From 054148433ab5654deb210052ffa3acce4c224e53 Mon Sep 17 00:00:00 2001 From: touwoyimuli Date: Mon, 26 Aug 2019 21:23:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A3=8E=E6=A0=BC=E7=9A=84=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit class:ExCustomStyle的类,但是里面是空白的,为后面更新的控件风格作为一个基准 --- QtCustomStyleEx/ExCustomStyle.cpp | 6 + QtCustomStyleEx/ExCustomStyle.h | 14 +++ QtCustomStyleEx/Examples.ui | 172 ++++++++++++++++++++++++++-- QtCustomStyleEx/QtCustomStyleEx.pro | 6 +- QtCustomStyleEx/main.cpp | 13 +++ 5 files changed, 202 insertions(+), 9 deletions(-) create mode 100644 QtCustomStyleEx/ExCustomStyle.cpp create mode 100644 QtCustomStyleEx/ExCustomStyle.h diff --git a/QtCustomStyleEx/ExCustomStyle.cpp b/QtCustomStyleEx/ExCustomStyle.cpp new file mode 100644 index 0000000..fe3ea79 --- /dev/null +++ b/QtCustomStyleEx/ExCustomStyle.cpp @@ -0,0 +1,6 @@ +#include "ExCustomStyle.h" + +ExCustomStyle::ExCustomStyle() +{ + +} diff --git a/QtCustomStyleEx/ExCustomStyle.h b/QtCustomStyleEx/ExCustomStyle.h new file mode 100644 index 0000000..a26377e --- /dev/null +++ b/QtCustomStyleEx/ExCustomStyle.h @@ -0,0 +1,14 @@ +#ifndef EXCUSTOMSTYLE_H +#define EXCUSTOMSTYLE_H + +#include + +class ExCustomStyle : public QCommonStyle +{ + Q_OBJECT + +public: + ExCustomStyle(); +}; + +#endif // EXCUSTOMSTYLE_H diff --git a/QtCustomStyleEx/Examples.ui b/QtCustomStyleEx/Examples.ui index b6774ff..5063ebe 100644 --- a/QtCustomStyleEx/Examples.ui +++ b/QtCustomStyleEx/Examples.ui @@ -1,20 +1,178 @@ + Examples - - + + 0 0 - 400 - 300 + 1235 + 695 - + Examples + + + + + QTabWidget::South + + + 0 + + + + 滚动条 + + + + + 30 + 280 + 531 + 31 + + + + Qt::Horizontal + + + + + + 540 + 40 + 31 + 191 + + + + Qt::Vertical + + + + + + 40 + 60 + 431 + 161 + + + + + a + + + + + b + + + + + c + + + + + d + + + + + e + + + + + f + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + + + 650 + 40 + 131 + 22 + + + + + Windows + + + + + New Item + + + + + WindowsXP + + + + + WindowsVista + + + + + Fusion + + + + + ExCustomStyle + + + + + + + Tab 2 + + + + + - - + diff --git a/QtCustomStyleEx/QtCustomStyleEx.pro b/QtCustomStyleEx/QtCustomStyleEx.pro index 57e11d7..e46ec7f 100644 --- a/QtCustomStyleEx/QtCustomStyleEx.pro +++ b/QtCustomStyleEx/QtCustomStyleEx.pro @@ -26,10 +26,12 @@ CONFIG += c++11 SOURCES += \ main.cpp \ - Examples.cpp + Examples.cpp \ + ExCustomStyle.cpp HEADERS += \ - Examples.h + Examples.h \ + ExCustomStyle.h FORMS += \ Examples.ui diff --git a/QtCustomStyleEx/main.cpp b/QtCustomStyleEx/main.cpp index 5c200aa..ca64a72 100644 --- a/QtCustomStyleEx/main.cpp +++ b/QtCustomStyleEx/main.cpp @@ -1,9 +1,22 @@ #include "Examples.h" #include +#include +#include +#include "ExCustomStyle.h" + int main(int argc, char *argv[]) { QApplication a(argc, argv); + + //使用系统或者自定义的风格 +// QStringList listStyle = QStyleFactory::keys(); +// foreach(QString val, listStyle) +// qDebug()<setStyle(customStyle); + Examples w; w.show();