diff --git a/QtQTreeWidgetEx/ExQTreeWidget.cpp b/QtQTreeWidgetEx/ExQTreeWidget.cpp new file mode 100644 index 0000000..abc3a27 --- /dev/null +++ b/QtQTreeWidgetEx/ExQTreeWidget.cpp @@ -0,0 +1,298 @@ +#include "ExQTreeWidget.h" +#include "ui_ExQTreeWidget.h" + +ExQTreeWidget::ExQTreeWidget(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::ExQTreeWidget) +{ + ui->setupUi(this); + setWindowTitle(QObject::tr("QTreeWidget和QDockWidget的讲解和使用")); + + setCentralWidget(ui->scrollArea); //设置scrollArea为中心控件 + initTree(); + + m_labFlie = new QLabel("当前文件的路径:", this); + ui->statusBar->addWidget(m_labFlie); +} + +ExQTreeWidget::~ExQTreeWidget() +{ + delete ui; +} + +//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +//初始化根节点(只能够有唯一) +void ExQTreeWidget::initTree() +{ + //准备工作 + ui->treeFiles->clear(); + QString dataStr = ""; + QIcon icon; + icon.addFile(":/image/Image001.jpg"); + + //创建唯一root的节点 + QTreeWidgetItem* root = new QTreeWidgetItem(treeItemType::itemRoot); + root->setIcon(treeColNum::colItem, icon); + root->setText(treeColNum::colItem, QString("相簿")); + root->setText(treeColNum::colItemType, QString("treeItemType")); + root->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsAutoTristate); + root->setCheckState(treeColNum::colItem, Qt::Unchecked); + root->setData(treeColNum::colItem, Qt::UserRole, QVariant(dataStr)); + + //添加顶层节点 + ui->treeFiles->addTopLevelItem(root); +} + +//添加目录节点 +void ExQTreeWidget::addFolderItem(QTreeWidgetItem *parItem, QString dirName) +{ + QIcon icon; + icon.addFile(":/image/Image006.jpg"); + + //添加一个新的节点 + QTreeWidgetItem* item = new QTreeWidgetItem(treeItemType::itemFile); + QString folderName = getFinalFolderName(dirName); + item->setIcon(treeColNum::colItem, icon); + item->setText(treeColNum::colItem, folderName); + item->setText(treeColNum::colItemType, QString("treeItemType")); + item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsAutoTristate); + item->setCheckState(treeColNum::colItem, Qt::Unchecked); + item->setData(treeColNum::colItem, Qt::UserRole, QVariant(dirName)); + + //添加子节点 + if (parItem->type() == treeItemType::itemFile) { //若是文件节点 + parItem->addChild(item); + } else if (parItem->type() == treeItemType::itemRoot) { //若是唯一root节点 + QTreeWidgetItem *root = ui->treeFiles->topLevelItem(0); + root->addChild(item); + } + +} + +//添加图片节点 +void ExQTreeWidget::addImageItem(QTreeWidgetItem *parItem, QString fileName) +{ + if (parItem == nullptr) + return; + + QIcon icon; + icon.addFile(":/image/Image014.jpg"); + + //添加一个新的节点 + QTreeWidgetItem* item = new QTreeWidgetItem(treeItemType::itemImage); + QString folderName = getFinalFolderName(fileName); + item->setIcon(treeColNum::colItem, icon); + item->setText(treeColNum::colItem, folderName); + item->setText(treeColNum::colItemType, QString("treeItemType")); + item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsAutoTristate); + item->setCheckState(treeColNum::colItem, Qt::Unchecked); + item->setData(treeColNum::colItem, Qt::UserRole, QVariant(fileName)); + + //添加子节点 + if (parItem->type() == treeItemType::itemFile) { //若是文件节点 + parItem->addChild(item); + } else if (parItem->type() == treeItemType::itemRoot) { //若是唯一root节点 + QTreeWidgetItem *root = ui->treeFiles->topLevelItem(0); + root->addChild(item); + } +} + +//从完整的路径里面,获取最后的文件夹名称 +QString ExQTreeWidget::getFinalFolderName(const QString &pathName) +{ + QString path = pathName; + int cnt = pathName.count(); + int i = pathName.lastIndexOf("/"); + QString str = pathName.right(cnt - i - 1); + return str; +} + +//遍历传进来的父节点下的所有子节点;每遍历过该节点,就在其节点的信息加一个# +void ExQTreeWidget::changeItemCaption(QTreeWidgetItem *parItem) +{ + QString str = "# " + parItem->text(treeColNum::colItem); + parItem->setText(treeColNum::colItem, str); + + if (parItem->childCount() < 0) + return; + + for (int i = 0; i < parItem->childCount(); i++) { + changeItemCaption(parItem->child(i)); //回调,调用自己 + } +} + +//显示当前item的图片(默认以适配高度) +void ExQTreeWidget::displayImage(QTreeWidgetItem *item) +{ + QString fileName = item->data(treeColNum::colItem, Qt::UserRole).toString(); + m_labFlie->setText(fileName); + m_curPixmap.load(fileName); //从文件载入图片 + on_actAdaptiveHeight_triggered(); //自动适应高度显示 + + ui->actAmplification->setEnabled(true); + ui->actShrink->setEnabled(true); + ui->actZoomRealSize->setEnabled(true); + ui->actAdaptiveHeight->setEnabled(true); + ui->actAdaptiveWidth->setEnabled(true); +} + +//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +//增加文件夹 +void ExQTreeWidget::on_actAddFolder_triggered() +{ + QString path = QFileDialog::getExistingDirectory(); //选择目录 + + if (! path.isEmpty()) { + QTreeWidgetItem* item = ui->treeFiles->currentItem(); //获取当前节点 + + if(item != nullptr) + addFolderItem(item, path); + } +} + +//添加图片 +void ExQTreeWidget::on_actAddFile_triggered() +{ + QStringList list = QFileDialog::getOpenFileNames(this, "选择多个将要加载的图片", "", "Images(*.jpg, *.png, *.*)"); //选择目录 + + if (! list.isEmpty()) { + QTreeWidgetItem* parItem = nullptr; + QTreeWidgetItem* item = ui->treeFiles->currentItem(); //获取当前节点 + + if (item == nullptr) + return; + + if (item->type() == treeItemType::itemImage) { //获得父节点 + parItem = item->parent(); + } else { + parItem = item; + } + + for (int i = 0; i < list.size(); i++) { + QString strName = list.at(i); //获得文件名称 + addImageItem(parItem, strName); //添加图片文件到文件节点 + } + } +} + +//删除节点 +void ExQTreeWidget::on_actDeleFile_triggered() +{ + QTreeWidgetItem* parItem = nullptr; + QTreeWidgetItem* currItem = ui->treeFiles->currentItem(); + + if (currItem->type() != treeItemType::itemRoot) + parItem = currItem->parent(); //只能够由其父节点删除 +// else +// ui->treeFiles->takeTopLevelItem(0); //删除顶层节点使用这个 + + if (currItem == nullptr || parItem == nullptr) + return; + + parItem->removeChild(currItem); //移除没有从内存中删除,所以delete删除 + delete currItem; +} + +//遍历所有的顶层节点(本处只有一个root顶层节点) +void ExQTreeWidget::on_actScanItems_triggered() +{ + for (int i = 0; i < ui->treeFiles->topLevelItemCount(); i++) { + QTreeWidgetItem* currItem = ui->treeFiles->topLevelItem(i); //顶层item + changeItemCaption(currItem); + } +} + +//图片自动适应高度 +void ExQTreeWidget::on_actAdaptiveHeight_triggered() +{ + int height = ui->scrollArea->height(); //得到scrollArea的高度 + int realHeight = m_curPixmap.height(); //原始图片的实际高度 + m_ratio = height * 1.0 / realHeight; //当前显示比例,必须转换为浮点数 + + QPixmap pixmap = m_curPixmap.scaledToHeight(height - 50); //图片缩放到指定高度 + ui->labDisplay->setPixmap(pixmap); //设置Label的PixMap +} + +//图片自动适应宽度 +void ExQTreeWidget::on_actAdaptiveWidth_triggered() +{ + int width = ui->scrollArea->width(); + int realWidth = m_curPixmap.width(); + m_ratio = width * 1.0 / realWidth; + + QPixmap pixmap = m_curPixmap.scaledToHeight(width - 50); + ui->labDisplay->setPixmap(pixmap); +} + +//当前节点变化的时候,自动加载当前图片 +void ExQTreeWidget::on_treeFiles_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous) +{ + if (current != nullptr && previous != nullptr) { + displayImage(current); + } +} + + +//放大 +void ExQTreeWidget::on_actAmplification_triggered() +{ + m_ratio *= 1.2; //在当前比例基础上乘以0.8 + int height = m_curPixmap.height() * m_ratio; // 显示宽度 + int widht = m_curPixmap.width() * m_ratio; // 显示宽度 + + QPixmap pix = m_curPixmap.scaled(widht, height); //图片缩放到指定高度和宽度,保持长宽比例 + ui->labDisplay->setPixmap(pix); + +} + +//缩小 +void ExQTreeWidget::on_actShrink_triggered() +{ + m_ratio *= 0.8; + int height = m_curPixmap.height() * m_ratio; + int widht = m_curPixmap.width() * m_ratio; + + QPixmap pix = m_curPixmap.scaled(widht, height); + ui->labDisplay->setPixmap(pix); +} + +//还原 +void ExQTreeWidget::on_actZoomRealSize_triggered() +{ + m_ratio = 1; + int height = m_curPixmap.height(); + int widht = m_curPixmap.width(); + + QPixmap pix = m_curPixmap.scaled(widht, height); + ui->labDisplay->setPixmap(pix); +} + +//设置Dock窗口是否浮动 +void ExQTreeWidget::on_actDockFloating_triggered(bool check) +{ + ui->dockWidget->setFloating(check); +} + +//设置Dock窗口是否隐藏不显示 +void ExQTreeWidget::on_actDockVisible_triggered(bool checked) +{ + ui->dockWidget->setVisible(!checked); +} + +//退出 +void ExQTreeWidget::on_actQiut_triggered() +{ + close(); +} + +//单击DockWidget组件的标题栏的关闭按钮时候,会隐藏在停靠区域,并且发射信号visibilityChanged; 停靠区域可见性变化 +void ExQTreeWidget::on_dockWidget_visibilityChanged(bool visible) +{ + ui->actDockVisible->setChecked(visible); +} + +//当拖动DockWidget组件,使其浮动或者停靠时候,会发射信号topLevelChanged; 更新其Action的状态 +void ExQTreeWidget::on_dockWidget_topLevelChanged(bool topLevel) +{ + ui->actDockFloating->setChecked(topLevel); +} diff --git a/QtQTreeWidgetEx/ExQTreeWidget.h b/QtQTreeWidgetEx/ExQTreeWidget.h new file mode 100644 index 0000000..c4400a6 --- /dev/null +++ b/QtQTreeWidgetEx/ExQTreeWidget.h @@ -0,0 +1,66 @@ +#ifndef EXQTREEWIDGET_H +#define EXQTREEWIDGET_H + +#include +#include +#include +#include + +namespace Ui { +class ExQTreeWidget; +} + +class ExQTreeWidget : public QMainWindow +{ + Q_OBJECT + +public: + + enum treeItemType { //枚举,节点类型 + itemRoot, + itemFile, + itemImage + }; + + enum treeColNum { //目录树列表的编号 + colItem = 0, + colItemType = 1 + }; + + explicit ExQTreeWidget(QWidget *parent = nullptr); + ~ExQTreeWidget(); + + void initTree(); //初始化根节点(唯一) + void addFolderItem(QTreeWidgetItem *parItem, QString dirName); //添加目录 + void addImageItem(QTreeWidgetItem *parItem, QString fileName); //添加图片文件 + QString getFinalFolderName(const QString &pathName); //从完整的路径里面,获取最后的文件夹名称 + void changeItemCaption(QTreeWidgetItem* parItem); //遍历item下面的所有节点 + void displayImage(QTreeWidgetItem* item); //显示当前item的图片(默认以适配高度) + +private slots: + void on_actAddFolder_triggered(); //增加文件夹 + void on_actAddFile_triggered(); //添加图片文件 + void on_actDeleFile_triggered(); //删除节点 + void on_actScanItems_triggered(); //遍历所有的顶层节点(本处只有一个root顶层节点) + void on_actAdaptiveHeight_triggered(); //图片自动适应高度 + void on_actAdaptiveWidth_triggered(); //图片自动适应宽度 + void on_actAmplification_triggered(); //放大 + void on_actShrink_triggered(); //缩小 + void on_actZoomRealSize_triggered(); //还原 + void on_actDockFloating_triggered(bool check); //设置Dock窗口是否浮动 + void on_actDockVisible_triggered(bool checked); //设置Dock窗口是否隐藏不显示 + void on_actQiut_triggered(); //退出 + void on_treeFiles_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous); //当前节点变化的时候,自动加载当前图片 + void on_dockWidget_visibilityChanged(bool visible); //单击DockWidget组件的标题栏的关闭按钮时候,会隐藏在停靠区域,并且发射信号visibilityChanged; 停靠区域可见性变化 + void on_dockWidget_topLevelChanged(bool topLevel); //当拖动DockWidget组件,使其浮动或者停靠时候,会发射信号topLevelChanged; 更新其Action的状态 + +private: + Ui::ExQTreeWidget *ui; + + QLabel *m_labFlie; //状态栏显示当前文件路径 + QPixmap m_curPixmap; //显示当前文件图片 + float m_ratio; //图片缩放比例 + +}; + +#endif // EXQTREEWIDGET_H diff --git a/QtQTreeWidgetEx/ExQTreeWidget.ui b/QtQTreeWidgetEx/ExQTreeWidget.ui new file mode 100644 index 0000000..bca496f --- /dev/null +++ b/QtQTreeWidgetEx/ExQTreeWidget.ui @@ -0,0 +1,305 @@ + + + ExQTreeWidget + + + + 0 + 0 + 851 + 564 + + + + ExQTreeWidget + + + + + + + true + + + + + 0 + 0 + 556 + 449 + + + + + + + + + + Qt::AlignCenter + + + + + + + + + + + + + 0 + 0 + 851 + 23 + + + + + 文件 + + + + + + + + + + 视图 + + + + + + + + + + + 工具 + + + + + + + + + + + + + true + + + Qt::ToolButtonTextUnderIcon + + + TopToolBarArea + + + false + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + 节点 + + + + + 节点类型 + + + + + + + + + + + :/image/Image016.jpg:/image/Image016.jpg + + + 添加文件夹 + + + 添加文件夹 + + + + + + :/image/Image007.jpg:/image/Image007.jpg + + + 添加文件 + + + 添加文件 + + + + + + :/image/Image005.jpg:/image/Image005.jpg + + + 删除文件 + + + 删除文件 + + + Del + + + + + + :/image/Image008.jpg:/image/Image008.jpg + + + 遍历节点 + + + 遍历节点 + + + + + + :/image/Image012.jpg:/image/Image012.jpg + + + 放大 + + + 放大图片 + + + + + + :/image/Image011.jpg:/image/Image011.jpg + + + 缩小 + + + 缩小图片 + + + + + + :/image/Image002.jpg:/image/Image002.jpg + + + 实际大小 + + + 还原成实际大小 + + + + + + :/image/Image009.jpg:/image/Image009.jpg + + + 最佳高度 + + + 缩放到最佳高度 + + + + + + :/image/Image010.jpg:/image/Image010.jpg + + + 最佳宽度 + + + 缩放至最佳宽度 + + + + + true + + + + :/image/Image015.jpg:/image/Image015.jpg + + + 窗口浮动 + + + 窗口浮动开关 + + + + + true + + + + :/image/Image003.jpg:/image/Image003.jpg + + + 隐藏 + + + 窗口隐藏 + + + + + + :/image/Image004.jpg:/image/Image004.jpg + + + 退出 + + + 退出本程序 + + + + + + + + + diff --git a/QtQTreeWidgetEx/QtQTreeWidgetEx.pro b/QtQTreeWidgetEx/QtQTreeWidgetEx.pro new file mode 100644 index 0000000..f965bc2 --- /dev/null +++ b/QtQTreeWidgetEx/QtQTreeWidgetEx.pro @@ -0,0 +1,45 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2019-09-04T00:32:28 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = QtQTreeWidgetEx +TEMPLATE = app + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which has been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +CONFIG += c++11 + +SOURCES += \ + main.cpp \ + ExQTreeWidget.cpp + +HEADERS += \ + ExQTreeWidget.h + +FORMS += \ + ExQTreeWidget.ui + +RC_ICONS += qt.ico + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +RESOURCES += \ + resources.qrc diff --git a/QtQTreeWidgetEx/image/Image001.jpg b/QtQTreeWidgetEx/image/Image001.jpg new file mode 100644 index 0000000..a9cf41d Binary files /dev/null and b/QtQTreeWidgetEx/image/Image001.jpg differ diff --git a/QtQTreeWidgetEx/image/Image002.jpg b/QtQTreeWidgetEx/image/Image002.jpg new file mode 100644 index 0000000..08aae9d Binary files /dev/null and b/QtQTreeWidgetEx/image/Image002.jpg differ diff --git a/QtQTreeWidgetEx/image/Image003.jpg b/QtQTreeWidgetEx/image/Image003.jpg new file mode 100644 index 0000000..334a52b Binary files /dev/null and b/QtQTreeWidgetEx/image/Image003.jpg differ diff --git a/QtQTreeWidgetEx/image/Image004.jpg b/QtQTreeWidgetEx/image/Image004.jpg new file mode 100644 index 0000000..db6317d Binary files /dev/null and b/QtQTreeWidgetEx/image/Image004.jpg differ diff --git a/QtQTreeWidgetEx/image/Image005.jpg b/QtQTreeWidgetEx/image/Image005.jpg new file mode 100644 index 0000000..a6b06e2 Binary files /dev/null and b/QtQTreeWidgetEx/image/Image005.jpg differ diff --git a/QtQTreeWidgetEx/image/Image006.jpg b/QtQTreeWidgetEx/image/Image006.jpg new file mode 100644 index 0000000..7c01f01 Binary files /dev/null and b/QtQTreeWidgetEx/image/Image006.jpg differ diff --git a/QtQTreeWidgetEx/image/Image007.jpg b/QtQTreeWidgetEx/image/Image007.jpg new file mode 100644 index 0000000..f963db2 Binary files /dev/null and b/QtQTreeWidgetEx/image/Image007.jpg differ diff --git a/QtQTreeWidgetEx/image/Image008.jpg b/QtQTreeWidgetEx/image/Image008.jpg new file mode 100644 index 0000000..fa81baf Binary files /dev/null and b/QtQTreeWidgetEx/image/Image008.jpg differ diff --git a/QtQTreeWidgetEx/image/Image009.jpg b/QtQTreeWidgetEx/image/Image009.jpg new file mode 100644 index 0000000..0d7a9f0 Binary files /dev/null and b/QtQTreeWidgetEx/image/Image009.jpg differ diff --git a/QtQTreeWidgetEx/image/Image010.jpg b/QtQTreeWidgetEx/image/Image010.jpg new file mode 100644 index 0000000..b117443 Binary files /dev/null and b/QtQTreeWidgetEx/image/Image010.jpg differ diff --git a/QtQTreeWidgetEx/image/Image011.jpg b/QtQTreeWidgetEx/image/Image011.jpg new file mode 100644 index 0000000..e16b590 Binary files /dev/null and b/QtQTreeWidgetEx/image/Image011.jpg differ diff --git a/QtQTreeWidgetEx/image/Image012.jpg b/QtQTreeWidgetEx/image/Image012.jpg new file mode 100644 index 0000000..3a1954e Binary files /dev/null and b/QtQTreeWidgetEx/image/Image012.jpg differ diff --git a/QtQTreeWidgetEx/image/Image013.ico b/QtQTreeWidgetEx/image/Image013.ico new file mode 100644 index 0000000..0ee0568 Binary files /dev/null and b/QtQTreeWidgetEx/image/Image013.ico differ diff --git a/QtQTreeWidgetEx/image/Image014.jpg b/QtQTreeWidgetEx/image/Image014.jpg new file mode 100644 index 0000000..a39dc89 Binary files /dev/null and b/QtQTreeWidgetEx/image/Image014.jpg differ diff --git a/QtQTreeWidgetEx/image/Image015.jpg b/QtQTreeWidgetEx/image/Image015.jpg new file mode 100644 index 0000000..f8ca4ab Binary files /dev/null and b/QtQTreeWidgetEx/image/Image015.jpg differ diff --git a/QtQTreeWidgetEx/image/Image016.jpg b/QtQTreeWidgetEx/image/Image016.jpg new file mode 100644 index 0000000..995f150 Binary files /dev/null and b/QtQTreeWidgetEx/image/Image016.jpg differ diff --git a/QtQTreeWidgetEx/main.cpp b/QtQTreeWidgetEx/main.cpp new file mode 100644 index 0000000..9ce5a7e --- /dev/null +++ b/QtQTreeWidgetEx/main.cpp @@ -0,0 +1,11 @@ +#include "ExQTreeWidget.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + ExQTreeWidget w; + w.show(); + + return a.exec(); +} diff --git a/QtQTreeWidgetEx/qt.ico b/QtQTreeWidgetEx/qt.ico new file mode 100644 index 0000000..0ee0568 Binary files /dev/null and b/QtQTreeWidgetEx/qt.ico differ diff --git a/QtQTreeWidgetEx/resources.qrc b/QtQTreeWidgetEx/resources.qrc new file mode 100644 index 0000000..8691263 --- /dev/null +++ b/QtQTreeWidgetEx/resources.qrc @@ -0,0 +1,20 @@ + + + image/Image001.jpg + image/Image002.jpg + image/Image003.jpg + image/Image004.jpg + image/Image005.jpg + image/Image006.jpg + image/Image007.jpg + image/Image008.jpg + image/Image009.jpg + image/Image010.jpg + image/Image011.jpg + image/Image012.jpg + image/Image013.ico + image/Image014.jpg + image/Image015.jpg + image/Image016.jpg + + diff --git a/QtQlistWidgetEx/QtQlistWidgetEx.pro b/QtQlistWidgetEx/QtQlistWidgetEx.pro index a72dbd6..72fe7ea 100644 --- a/QtQlistWidgetEx/QtQlistWidgetEx.pro +++ b/QtQlistWidgetEx/QtQlistWidgetEx.pro @@ -34,7 +34,7 @@ HEADERS += \ FORMS += \ ExQListWidget.ui -RC_ICONS += qt.ico +#RC_ICONS += qt.ico # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin diff --git a/README.md b/README.md index c1933a0..bb82cca 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,8 @@ - 自定义`QStyle`界面所有控件的风格,换肤效果的教程,自定义继承`QCommonStyle`的风格类【QtCustomStyleEx】 - 预备知识:`QStyle`、`QCommonStyle`d等讲解 - [更换`Qt`应用程序的界面`UI`,实现换肤,改用自带其他默认`QStyle`风格样式](https://mp.csdn.net/mdeditor/100148539#) +- [`QStyle`自定义重绘`QSlider`控件](https://blog.csdn.net/qq_33154343/article/details/100545769) +- [QStyle自定义重绘QRubberBand控件](https://blog.csdn.net/qq_33154343/article/details/100588428)