改进代码
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
IconHelper *IconHelper::iconFontAliBaBa = 0;
|
IconHelper *IconHelper::iconFontAliBaBa = 0;
|
||||||
IconHelper *IconHelper::iconFontAwesome = 0;
|
IconHelper *IconHelper::iconFontAwesome = 0;
|
||||||
|
IconHelper *IconHelper::iconFontWeather = 0;
|
||||||
|
int IconHelper::iconFontIndex = -1;
|
||||||
|
|
||||||
void IconHelper::initFont()
|
void IconHelper::initFont()
|
||||||
{
|
{
|
||||||
static bool isInit = false;
|
static bool isInit = false;
|
||||||
@@ -13,103 +16,101 @@ void IconHelper::initFont()
|
|||||||
if (iconFontAwesome == 0) {
|
if (iconFontAwesome == 0) {
|
||||||
iconFontAwesome = new IconHelper(":/image/fontawesome-webfont.ttf", "FontAwesome");
|
iconFontAwesome = new IconHelper(":/image/fontawesome-webfont.ttf", "FontAwesome");
|
||||||
}
|
}
|
||||||
|
if (iconFontWeather == 0) {
|
||||||
|
iconFontWeather = new IconHelper(":/image/pe-icon-set-weather.ttf", "pe-icon-set-weather");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QFont IconHelper::getIconFontAliBaBa()
|
||||||
|
{
|
||||||
|
initFont();
|
||||||
|
return iconFontAliBaBa->getIconFont();
|
||||||
|
}
|
||||||
|
|
||||||
|
QFont IconHelper::getIconFontAwesome()
|
||||||
|
{
|
||||||
|
initFont();
|
||||||
|
return iconFontAwesome->getIconFont();
|
||||||
|
}
|
||||||
|
|
||||||
|
QFont IconHelper::getIconFontWeather()
|
||||||
|
{
|
||||||
|
initFont();
|
||||||
|
return iconFontWeather->getIconFont();
|
||||||
|
}
|
||||||
|
|
||||||
|
IconHelper *IconHelper::getIconHelper(int icon)
|
||||||
|
{
|
||||||
|
initFont();
|
||||||
|
|
||||||
|
//指定了字体索引则取对应索引的字体类
|
||||||
|
//没指定则自动根据不同的字体的值选择对应的类
|
||||||
|
//由于部分值范围冲突所以可以指定索引来取
|
||||||
|
//fontawesome 0xf000-0xf2e0
|
||||||
|
//iconfont 0xe501-0xe793 0xe8d5-0xea5d
|
||||||
|
//weather 0xe900-0xe9cf
|
||||||
|
|
||||||
|
IconHelper *iconHelper = iconFontAwesome;
|
||||||
|
if (iconFontIndex < 0) {
|
||||||
|
if ((icon > 0xe501 && icon < 0xe793) || (icon > 0xe8d5 && icon < 0xea5d)) {
|
||||||
|
iconHelper = iconFontAliBaBa;
|
||||||
|
}
|
||||||
|
} else if (iconFontIndex == 0) {
|
||||||
|
iconHelper = iconFontAliBaBa;
|
||||||
|
} else if (iconFontIndex == 1) {
|
||||||
|
iconHelper = iconFontAwesome;
|
||||||
|
} else if (iconFontIndex == 2) {
|
||||||
|
iconHelper = iconFontWeather;
|
||||||
|
}
|
||||||
|
|
||||||
|
return iconHelper;
|
||||||
|
}
|
||||||
|
|
||||||
void IconHelper::setIcon(QLabel *lab, int icon, quint32 size)
|
void IconHelper::setIcon(QLabel *lab, int icon, quint32 size)
|
||||||
{
|
{
|
||||||
initFont();
|
getIconHelper(icon)->setIcon1(lab, icon, size);
|
||||||
|
|
||||||
//自动根据不同的字体的值选择对应的类,fontawesome 0xf开头 iconfont 0xe开头
|
|
||||||
if (icon > 0xe000 && icon < 0xf000) {
|
|
||||||
iconFontAliBaBa->setIcon1(lab, icon, size);
|
|
||||||
} else if (icon > 0xf000) {
|
|
||||||
iconFontAwesome->setIcon1(lab, icon, size);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IconHelper::setIcon(QAbstractButton *btn, int icon, quint32 size)
|
void IconHelper::setIcon(QAbstractButton *btn, int icon, quint32 size)
|
||||||
{
|
{
|
||||||
initFont();
|
getIconHelper(icon)->setIcon1(btn, icon, size);
|
||||||
|
|
||||||
//自动根据不同的字体的值选择对应的类,fontawesome 0xf开头 iconfont 0xe开头
|
|
||||||
if (icon > 0xe000 && icon < 0xf000) {
|
|
||||||
iconFontAliBaBa->setIcon1(btn, icon, size);
|
|
||||||
} else if (icon > 0xf000) {
|
|
||||||
iconFontAwesome->setIcon1(btn, icon, size);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IconHelper::setPixmap(QAbstractButton *btn, const QColor &color, int icon, quint32 size,
|
void IconHelper::setPixmap(QAbstractButton *btn, const QColor &color, int icon, quint32 size,
|
||||||
quint32 width, quint32 height, int flags)
|
quint32 width, quint32 height, int flags)
|
||||||
{
|
{
|
||||||
initFont();
|
getIconHelper(icon)->setPixmap1(btn, color, icon, size, width, height, flags);
|
||||||
|
|
||||||
//自动根据不同的字体的值选择对应的类,fontawesome 0xf开头 iconfont 0xe开头
|
|
||||||
if (icon > 0xe000 && icon < 0xf000) {
|
|
||||||
iconFontAliBaBa->setPixmap1(btn, color, icon, size, width, height, flags);
|
|
||||||
} else if (icon > 0xf000) {
|
|
||||||
iconFontAwesome->setPixmap1(btn, color, icon, size, width, height, flags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap IconHelper::getPixmap(const QColor &color, int icon, quint32 size,
|
QPixmap IconHelper::getPixmap(const QColor &color, int icon, quint32 size,
|
||||||
quint32 width, quint32 height, int flags)
|
quint32 width, quint32 height, int flags)
|
||||||
{
|
{
|
||||||
initFont();
|
return getIconHelper(icon)->getPixmap1(color, icon, size, width, height, flags);
|
||||||
|
|
||||||
//自动根据不同的字体的值选择对应的类,fontawesome 0xf开头 iconfont 0xe开头
|
|
||||||
QPixmap pix;
|
|
||||||
if (icon > 0xe000 && icon < 0xf000) {
|
|
||||||
pix = iconFontAliBaBa->getPixmap1(color, icon, size, width, height, flags);
|
|
||||||
} else if (icon > 0xf000) {
|
|
||||||
pix = iconFontAwesome->getPixmap1(color, icon, size, width, height, flags);
|
|
||||||
}
|
|
||||||
return pix;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IconHelper::setStyle(QWidget *widget, QList<QPushButton *> btns,
|
void IconHelper::setStyle(QWidget *widget, QList<QPushButton *> btns,
|
||||||
QList<int> icons, const IconHelper::StyleColor &styleColor)
|
QList<int> icons, const IconHelper::StyleColor &styleColor)
|
||||||
{
|
{
|
||||||
initFont();
|
|
||||||
|
|
||||||
//自动根据不同的字体的值选择对应的类,fontawesome 0xf开头 iconfont 0xe开头
|
|
||||||
int icon = icons.first();
|
int icon = icons.first();
|
||||||
if (icon > 0xe000 && icon < 0xf000) {
|
getIconHelper(icon)->setStyle1(widget, btns, icons, styleColor);
|
||||||
iconFontAliBaBa->setStyle1(widget, btns, icons, styleColor);
|
|
||||||
} else if (icon > 0xf000) {
|
|
||||||
iconFontAwesome->setStyle1(widget, btns, icons, styleColor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IconHelper::setStyle(QWidget *widget, QList<QToolButton *> btns,
|
void IconHelper::setStyle(QWidget *widget, QList<QToolButton *> btns,
|
||||||
QList<int> icons, const IconHelper::StyleColor &styleColor)
|
QList<int> icons, const IconHelper::StyleColor &styleColor)
|
||||||
{
|
{
|
||||||
initFont();
|
|
||||||
|
|
||||||
//自动根据不同的字体的值选择对应的类,fontawesome 0xf开头 iconfont 0xe开头
|
|
||||||
int icon = icons.first();
|
int icon = icons.first();
|
||||||
if (icon > 0xe000 && icon < 0xf000) {
|
getIconHelper(icon)->setStyle1(widget, btns, icons, styleColor);
|
||||||
iconFontAliBaBa->setStyle1(widget, btns, icons, styleColor);
|
|
||||||
} else if (icon > 0xf000) {
|
|
||||||
iconFontAwesome->setStyle1(widget, btns, icons, styleColor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IconHelper::setStyle(QWidget *widget, QList<QAbstractButton *> btns,
|
void IconHelper::setStyle(QWidget *widget, QList<QAbstractButton *> btns,
|
||||||
QList<int> icons, const IconHelper::StyleColor &styleColor)
|
QList<int> icons, const IconHelper::StyleColor &styleColor)
|
||||||
{
|
{
|
||||||
initFont();
|
|
||||||
|
|
||||||
//自动根据不同的字体的值选择对应的类,fontawesome 0xf开头 iconfont 0xe开头
|
|
||||||
int icon = icons.first();
|
int icon = icons.first();
|
||||||
if (icon > 0xe000 && icon < 0xf000) {
|
getIconHelper(icon)->setStyle1(widget, btns, icons, styleColor);
|
||||||
iconFontAliBaBa->setStyle1(widget, btns, icons, styleColor);
|
|
||||||
} else if (icon > 0xf000) {
|
|
||||||
iconFontAwesome->setStyle1(widget, btns, icons, styleColor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IconHelper::IconHelper(const QString &fontFile, const QString &fontName, QObject *parent) : QObject(parent)
|
IconHelper::IconHelper(const QString &fontFile, const QString &fontName, QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
//判断图形字体是否存在,不存在则加入
|
//判断图形字体是否存在,不存在则加入
|
||||||
@@ -122,6 +123,7 @@ IconHelper::IconHelper(const QString &fontFile, const QString &fontName, QObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//再次判断是否包含字体名称防止加载失败
|
||||||
if (fontDb.families().contains(fontName)) {
|
if (fontDb.families().contains(fontName)) {
|
||||||
iconFont = QFont(fontName);
|
iconFont = QFont(fontName);
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(4,8,0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(4,8,0))
|
||||||
@@ -179,6 +181,11 @@ void IconHelper::toggled(bool checked)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QFont IconHelper::getIconFont()
|
||||||
|
{
|
||||||
|
return this->iconFont;
|
||||||
|
}
|
||||||
|
|
||||||
void IconHelper::setIcon1(QLabel *lab, int icon, quint32 size)
|
void IconHelper::setIcon1(QLabel *lab, int icon, quint32 size)
|
||||||
{
|
{
|
||||||
iconFont.setPixelSize(size);
|
iconFont.setPixelSize(size);
|
||||||
@@ -269,8 +276,9 @@ void IconHelper::setStyle1(QWidget *widget, QList<QAbstractButton *> btns, QList
|
|||||||
}
|
}
|
||||||
|
|
||||||
//如果图标是左侧显示则需要让没有选中的按钮左侧也有加深的边框,颜色为背景颜色
|
//如果图标是左侧显示则需要让没有选中的按钮左侧也有加深的边框,颜色为背景颜色
|
||||||
|
//如果图标在文字上面而设置的边框是 top bottom 也需要启用加深边框
|
||||||
QStringList qss;
|
QStringList qss;
|
||||||
if (styleColor.textBesideIcon) {
|
if (styleColor.defaultBorder) {
|
||||||
qss << QString("QWidget[flag=\"%1\"] QAbstractButton{border-style:solid;border-radius:0px;%2border-color:%3;color:%4;background:%5;}")
|
qss << QString("QWidget[flag=\"%1\"] QAbstractButton{border-style:solid;border-radius:0px;%2border-color:%3;color:%4;background:%5;}")
|
||||||
.arg(position).arg(strBorder).arg(styleColor.normalBgColor).arg(styleColor.normalTextColor).arg(styleColor.normalBgColor);
|
.arg(position).arg(strBorder).arg(styleColor.normalBgColor).arg(styleColor.normalTextColor).arg(styleColor.normalBgColor);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public:
|
|||||||
//样式颜色结构体
|
//样式颜色结构体
|
||||||
struct StyleColor {
|
struct StyleColor {
|
||||||
QString position; //位置 left right top bottom
|
QString position; //位置 left right top bottom
|
||||||
bool textBesideIcon; //文字在图标左侧
|
bool defaultBorder; //默认有边框
|
||||||
|
|
||||||
quint32 iconSize; //图标字体尺寸
|
quint32 iconSize; //图标字体尺寸
|
||||||
quint32 iconWidth; //图标图片宽度
|
quint32 iconWidth; //图标图片宽度
|
||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
|
|
||||||
StyleColor() {
|
StyleColor() {
|
||||||
position = "left";
|
position = "left";
|
||||||
textBesideIcon = false;
|
defaultBorder = false;
|
||||||
|
|
||||||
iconSize = 12;
|
iconSize = 12;
|
||||||
iconWidth = 15;
|
iconWidth = 15;
|
||||||
@@ -87,20 +87,38 @@ public:
|
|||||||
static IconHelper *iconFontAliBaBa;
|
static IconHelper *iconFontAliBaBa;
|
||||||
//FontAwesome图形字体类
|
//FontAwesome图形字体类
|
||||||
static IconHelper *iconFontAwesome;
|
static IconHelper *iconFontAwesome;
|
||||||
|
//天气图形字体类
|
||||||
|
static IconHelper *iconFontWeather;
|
||||||
|
//图形字体索引
|
||||||
|
static int iconFontIndex;
|
||||||
|
|
||||||
//初始化图形字体
|
//初始化图形字体
|
||||||
static void initFont();
|
static void initFont();
|
||||||
|
|
||||||
|
//获取图形字体
|
||||||
|
static QFont getIconFontAliBaBa();
|
||||||
|
static QFont getIconFontAwesome();
|
||||||
|
static QFont getIconFontWeather();
|
||||||
|
|
||||||
|
//根据值获取图形字体类
|
||||||
|
static IconHelper *getIconHelper(int icon);
|
||||||
|
|
||||||
|
//设置图形字体到标签
|
||||||
static void setIcon(QLabel *lab, int icon, quint32 size = 12);
|
static void setIcon(QLabel *lab, int icon, quint32 size = 12);
|
||||||
|
//设置图形字体到按钮
|
||||||
static void setIcon(QAbstractButton *btn, int icon, quint32 size = 12);
|
static void setIcon(QAbstractButton *btn, int icon, quint32 size = 12);
|
||||||
|
|
||||||
|
//设置图形字体到图标
|
||||||
static void setPixmap(QAbstractButton *btn, const QColor &color,
|
static void setPixmap(QAbstractButton *btn, const QColor &color,
|
||||||
int icon, quint32 size = 12,
|
int icon, quint32 size = 12,
|
||||||
quint32 width = 15, quint32 height = 15,
|
quint32 width = 15, quint32 height = 15,
|
||||||
int flags = Qt::AlignCenter);
|
int flags = Qt::AlignCenter);
|
||||||
|
//获取指定图形字体,可以指定文字大小,图片宽高,文字对齐
|
||||||
static QPixmap getPixmap(const QColor &color, int icon, quint32 size = 12,
|
static QPixmap getPixmap(const QColor &color, int icon, quint32 size = 12,
|
||||||
quint32 width = 15, quint32 height = 15,
|
quint32 width = 15, quint32 height = 15,
|
||||||
int flags = Qt::AlignCenter);
|
int flags = Qt::AlignCenter);
|
||||||
|
|
||||||
|
//指定导航面板样式,带图标和效果切换+悬停颜色+按下颜色+选中颜色
|
||||||
static void setStyle(QWidget *widget, QList<QPushButton *> btns, QList<int> icons, const StyleColor &styleColor);
|
static void setStyle(QWidget *widget, QList<QPushButton *> btns, QList<int> icons, const StyleColor &styleColor);
|
||||||
static void setStyle(QWidget *widget, QList<QToolButton *> btns, QList<int> icons, const StyleColor &styleColor);
|
static void setStyle(QWidget *widget, QList<QToolButton *> btns, QList<int> icons, const StyleColor &styleColor);
|
||||||
static void setStyle(QWidget *widget, QList<QAbstractButton *> btns, QList<int> icons, const StyleColor &styleColor);
|
static void setStyle(QWidget *widget, QList<QAbstractButton *> btns, QList<int> icons, const StyleColor &styleColor);
|
||||||
@@ -124,6 +142,9 @@ private slots:
|
|||||||
void toggled(bool checked);
|
void toggled(bool checked);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
//获取图形字体
|
||||||
|
QFont getIconFont();
|
||||||
|
|
||||||
//设置图形字体到标签
|
//设置图形字体到标签
|
||||||
void setIcon1(QLabel *lab, int icon, quint32 size = 12);
|
void setIcon1(QLabel *lab, int icon, quint32 size = 12);
|
||||||
//设置图形字体到按钮
|
//设置图形字体到按钮
|
||||||
|
|||||||
@@ -3,7 +3,12 @@
|
|||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
#ifdef quc
|
||||||
|
class Q_DECL_EXPORT FramelessDialog : public QDialog
|
||||||
|
#else
|
||||||
class FramelessDialog : public QDialog
|
class FramelessDialog : public QDialog
|
||||||
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -3,7 +3,12 @@
|
|||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
|
||||||
|
#ifdef quc
|
||||||
|
class Q_DECL_EXPORT FramelessMainWindow : public QMainWindow
|
||||||
|
#else
|
||||||
class FramelessMainWindow : public QMainWindow
|
class FramelessMainWindow : public QMainWindow
|
||||||
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -3,7 +3,12 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
#ifdef quc
|
||||||
|
class Q_DECL_EXPORT FramelessWidget : public QWidget
|
||||||
|
#else
|
||||||
class FramelessWidget : public QWidget
|
class FramelessWidget : public QWidget
|
||||||
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
#include "qpushbutton.h"
|
#include "qpushbutton.h"
|
||||||
#include "qcheckbox.h"
|
#include "qcheckbox.h"
|
||||||
#include "framelesswidget2.h"
|
#include "framelesswidget2.h"
|
||||||
|
#include "framelessform/dialog.h"
|
||||||
|
#include "framelessform/widget.h"
|
||||||
|
#include "framelessform/mainwindow.h"
|
||||||
|
|
||||||
frmFramelessWidget::frmFramelessWidget(QWidget *parent) : QWidget(parent), ui(new Ui::frmFramelessWidget)
|
frmFramelessWidget::frmFramelessWidget(QWidget *parent) : QWidget(parent), ui(new Ui::frmFramelessWidget)
|
||||||
{
|
{
|
||||||
@@ -80,3 +83,24 @@ void frmFramelessWidget::stateChanged2(int arg1)
|
|||||||
frameless->setResizeEnable(arg1 != 0);
|
frameless->setResizeEnable(arg1 != 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void frmFramelessWidget::on_btnDialog_clicked()
|
||||||
|
{
|
||||||
|
Dialog dialog;
|
||||||
|
dialog.resize(800, 600);
|
||||||
|
dialog.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
void frmFramelessWidget::on_btnWidget_clicked()
|
||||||
|
{
|
||||||
|
Widget *widget = new Widget;
|
||||||
|
widget->resize(800, 600);
|
||||||
|
widget->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void frmFramelessWidget::on_btnMainWindow_clicked()
|
||||||
|
{
|
||||||
|
MainWindow *window = new MainWindow;
|
||||||
|
window->resize(800, 600);
|
||||||
|
window->show();
|
||||||
|
}
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ private slots:
|
|||||||
void on_pushButton_clicked();
|
void on_pushButton_clicked();
|
||||||
void stateChanged1(int arg1);
|
void stateChanged1(int arg1);
|
||||||
void stateChanged2(int arg1);
|
void stateChanged2(int arg1);
|
||||||
|
|
||||||
|
void on_btnDialog_clicked();
|
||||||
|
void on_btnWidget_clicked();
|
||||||
|
void on_btnMainWindow_clicked();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FRMFRAMELESSWIDGET_H
|
#endif // FRMFRAMELESSWIDGET_H
|
||||||
|
|||||||
@@ -13,18 +13,45 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QPushButton" name="pushButton">
|
<widget class="QWidget" name="">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>10</y>
|
<y>10</y>
|
||||||
<width>92</width>
|
<width>491</width>
|
||||||
<height>28</height>
|
<height>30</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<string>弹出</string>
|
<item>
|
||||||
</property>
|
<widget class="QPushButton" name="pushButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>弹出</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnDialog">
|
||||||
|
<property name="text">
|
||||||
|
<string>Dialog</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnWidget">
|
||||||
|
<property name="text">
|
||||||
|
<string>Widget</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnMainWindow">
|
||||||
|
<property name="text">
|
||||||
|
<string>MainWindow</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
#pragma execution_character_set("utf-8")
|
#pragma execution_character_set("utf-8")
|
||||||
|
|
||||||
#include "frmframelesswidget.h"
|
#include "frmframelesswidget.h"
|
||||||
#include "dialog.h"
|
|
||||||
#include "widget.h"
|
|
||||||
#include "mainwindow.h"
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
|
|
||||||
@@ -29,11 +26,8 @@ int main(int argc, char *argv[])
|
|||||||
QTextCodec::setCodecForLocale(codec);
|
QTextCodec::setCodecForLocale(codec);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
frmFramelessWidget w;
|
frmFramelessWidget w;
|
||||||
//Dialog w;
|
w.setWindowTitle("无边框窗体");
|
||||||
//Widget w;
|
|
||||||
//MainWindow w;
|
|
||||||
w.setWindowTitle("无边框窗体类");
|
|
||||||
w.resize(800, 600);
|
w.resize(800, 600);
|
||||||
w.show();
|
w.show();
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
#pragma execution_character_set("utf-8")
|
#include "frmmain.h"
|
||||||
#include "frmmain.h"
|
|
||||||
#include "ui_frmmain.h"
|
#include "ui_frmmain.h"
|
||||||
#include "qfile.h"
|
#include "head.h"
|
||||||
#include "qtextstream.h"
|
|
||||||
#include "qtranslator.h"
|
|
||||||
#include "qdebug.h"
|
|
||||||
|
|
||||||
frmMain::frmMain(QWidget *parent) : QMainWindow(parent), ui(new Ui::frmMain)
|
frmMain::frmMain(QWidget *parent) : QMainWindow(parent), ui(new Ui::frmMain)
|
||||||
{
|
{
|
||||||
@@ -31,6 +27,10 @@ void frmMain::initForm()
|
|||||||
this->initOther();
|
this->initOther();
|
||||||
this->initStyle();
|
this->initStyle();
|
||||||
this->initTranslator();
|
this->initTranslator();
|
||||||
|
|
||||||
|
ui->rbtn1->setChecked(true);
|
||||||
|
ui->ck2->setChecked(true);
|
||||||
|
ui->ck3->setCheckState(Qt::PartiallyChecked);
|
||||||
ui->tabWidget->setCurrentIndex(0);
|
ui->tabWidget->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,11 +133,7 @@ void frmMain::initListWidget()
|
|||||||
|
|
||||||
void frmMain::initOther()
|
void frmMain::initOther()
|
||||||
{
|
{
|
||||||
ui->rbtn1->setChecked(true);
|
|
||||||
ui->ck2->setChecked(true);
|
|
||||||
ui->ck3->setCheckState(Qt::PartiallyChecked);
|
|
||||||
ui->horizontalSlider->setValue(88);
|
ui->horizontalSlider->setValue(88);
|
||||||
|
|
||||||
ui->tab9->setStyleSheet("QPushButton{font:20pt;}");
|
ui->tab9->setStyleSheet("QPushButton{font:20pt;}");
|
||||||
ui->widgetVideo->setStyleSheet("QLabel{font:20pt;}");
|
ui->widgetVideo->setStyleSheet("QLabel{font:20pt;}");
|
||||||
|
|
||||||
@@ -156,9 +152,9 @@ void frmMain::initStyle()
|
|||||||
{
|
{
|
||||||
//加载样式表
|
//加载样式表
|
||||||
QString qss;
|
QString qss;
|
||||||
//QFile file(":/qss/psblack.css");
|
QFile file(":/qss/psblack.css");
|
||||||
//QFile file(":/qss/flatwhite.css");
|
//QFile file(":/qss/flatwhite.css");
|
||||||
QFile file(":/qss/lightblue.css");
|
//QFile file(":/qss/lightblue.css");
|
||||||
if (file.open(QFile::ReadOnly)) {
|
if (file.open(QFile::ReadOnly)) {
|
||||||
#if 1
|
#if 1
|
||||||
//用QTextStream读取样式文件不用区分文件编码 带bom也行
|
//用QTextStream读取样式文件不用区分文件编码 带bom也行
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui {
|
||||||
{
|
|
||||||
class frmMain;
|
class frmMain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,15 @@
|
|||||||
#pragma execution_character_set("utf-8")
|
#include "frmmain.h"
|
||||||
#include "frmmain.h"
|
#include "head.h"
|
||||||
#include <QApplication>
|
|
||||||
#include <QTextCodec>
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
|
||||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Floor);
|
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Floor);
|
||||||
#endif
|
#endif
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
a.setFont(QFont("Microsoft Yahei", 9));
|
a.setFont(QFont("Microsoft Yahei", 9));
|
||||||
|
|
||||||
#if (QT_VERSION <= QT_VERSION_CHECK(5,0,0))
|
#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
|
||||||
#if _MSC_VER
|
#if _MSC_VER
|
||||||
QTextCodec *codec = QTextCodec::codecForName("gbk");
|
QTextCodec *codec = QTextCodec::codecForName("gbk");
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ QWidget[nav="top"] QAbstractButton:hover,QWidget[nav="top"] QAbstractButton:pres
|
|||||||
border-style:solid;
|
border-style:solid;
|
||||||
border-width:0px 0px 2px 0px;
|
border-width:0px 0px 2px 0px;
|
||||||
padding:4px 4px 2px 4px;
|
padding:4px 4px 2px 4px;
|
||||||
border-color:#00BB9E;
|
border-color:#575959;
|
||||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F6F6F6,stop:1 #F6F6F6);
|
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F6F6F6,stop:1 #F6F6F6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ border-style:none;
|
|||||||
|
|
||||||
QWidget[nav="left"] QAbstractButton:hover{
|
QWidget[nav="left"] QAbstractButton:hover{
|
||||||
color:#FFFFFF;
|
color:#FFFFFF;
|
||||||
background-color:#00BB9E;
|
background-color:#575959;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget[nav="left"] QAbstractButton:checked,QWidget[nav="left"] QAbstractButton:pressed{
|
QWidget[nav="left"] QAbstractButton:checked,QWidget[nav="left"] QAbstractButton:pressed{
|
||||||
@@ -53,7 +53,7 @@ color:#57595B;
|
|||||||
border-style:solid;
|
border-style:solid;
|
||||||
border-width:0px 0px 0px 2px;
|
border-width:0px 0px 0px 2px;
|
||||||
padding:4px 4px 4px 2px;
|
padding:4px 4px 4px 2px;
|
||||||
border-color:#00BB9E;
|
border-color:#575959;
|
||||||
background-color:#FFFFFF;
|
background-color:#FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E4E4E4,stop:1
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWidget[video="true"] QLabel:focus{
|
QWidget[video="true"] QLabel:focus{
|
||||||
border:1px solid #00BB9E;
|
border:1px solid #575959;
|
||||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F6F6F6,stop:1 #F6F6F6);
|
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F6F6F6,stop:1 #F6F6F6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ border:1px solid #B6B6B6;
|
|||||||
border-radius:3px;
|
border-radius:3px;
|
||||||
padding:2px;
|
padding:2px;
|
||||||
background:none;
|
background:none;
|
||||||
selection-background-color:#00BB9E;
|
selection-background-color:#575959;
|
||||||
selection-color:#FFFFFF;
|
selection-color:#FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,11 +356,11 @@ border-radius:6px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:horizontal:hover{
|
QScrollBar::handle:horizontal:hover{
|
||||||
background:#00BB9E;
|
background:#575959;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:horizontal:pressed{
|
QScrollBar::handle:horizontal:pressed{
|
||||||
background:#00BB9E;
|
background:#575959;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::add-page:horizontal{
|
QScrollBar::add-page:horizontal{
|
||||||
@@ -393,11 +393,11 @@ border-radius:6px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:vertical:hover{
|
QScrollBar::handle:vertical:hover{
|
||||||
background:#00BB9E;
|
background:#575959;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:vertical:pressed{
|
QScrollBar::handle:vertical:pressed{
|
||||||
background:#00BB9E;
|
background:#575959;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::add-page:vertical{
|
QScrollBar::add-page:vertical{
|
||||||
@@ -478,7 +478,7 @@ background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F6F6F6,stop:1
|
|||||||
|
|
||||||
QTabBar::tab:selected,QTabBar::tab:hover{
|
QTabBar::tab:selected,QTabBar::tab:hover{
|
||||||
border-style:solid;
|
border-style:solid;
|
||||||
border-color:#00BB9E;
|
border-color:#575959;
|
||||||
background:#FFFFFF;
|
background:#FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,7 +632,16 @@ QTabWidget::pane:bottom{bottom:-1px;}
|
|||||||
QTabWidget::pane:left{right:-1px;}
|
QTabWidget::pane:left{right:-1px;}
|
||||||
QTabWidget::pane:right{left:-1px;}
|
QTabWidget::pane:right{left:-1px;}
|
||||||
|
|
||||||
*:disabled{
|
QDialog {
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
color:#57595B;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDialogButtonBox > QPushButton {
|
||||||
|
min-width:50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
*:disabled,QMenu::item:disabled{
|
||||||
background:#FFFFFF;
|
background:#FFFFFF;
|
||||||
border-color:#E4E4E4;
|
border-color:#E4E4E4;
|
||||||
color:#B6B6B6;
|
color:#B6B6B6;
|
||||||
@@ -645,4 +654,4 @@ color:#B6B6B6;
|
|||||||
/*NormalColorEnd:#E4E4E4*/
|
/*NormalColorEnd:#E4E4E4*/
|
||||||
/*DarkColorStart:#F6F6F6*/
|
/*DarkColorStart:#F6F6F6*/
|
||||||
/*DarkColorEnd:#F6F6F6*/
|
/*DarkColorEnd:#F6F6F6*/
|
||||||
/*HighColor:#00BB9E*/
|
/*HighColor:#575959*/
|
||||||
@@ -32,7 +32,7 @@ QWidget[nav="top"] QAbstractButton:hover,QWidget[nav="top"] QAbstractButton:pres
|
|||||||
border-style:solid;
|
border-style:solid;
|
||||||
border-width:0px 0px 2px 0px;
|
border-width:0px 0px 2px 0px;
|
||||||
padding:4px 4px 2px 4px;
|
padding:4px 4px 2px 4px;
|
||||||
border-color:#00BB9E;
|
border-color:#386488;
|
||||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF);
|
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ border-style:none;
|
|||||||
|
|
||||||
QWidget[nav="left"] QAbstractButton:hover{
|
QWidget[nav="left"] QAbstractButton:hover{
|
||||||
color:#FFFFFF;
|
color:#FFFFFF;
|
||||||
background-color:#00BB9E;
|
background-color:#386488;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget[nav="left"] QAbstractButton:checked,QWidget[nav="left"] QAbstractButton:pressed{
|
QWidget[nav="left"] QAbstractButton:checked,QWidget[nav="left"] QAbstractButton:pressed{
|
||||||
@@ -53,7 +53,7 @@ color:#386487;
|
|||||||
border-style:solid;
|
border-style:solid;
|
||||||
border-width:0px 0px 0px 2px;
|
border-width:0px 0px 0px 2px;
|
||||||
padding:4px 4px 4px 2px;
|
padding:4px 4px 4px 2px;
|
||||||
border-color:#00BB9E;
|
border-color:#386488;
|
||||||
background-color:#EAF7FF;
|
background-color:#EAF7FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWidget[video="true"] QLabel:focus{
|
QWidget[video="true"] QLabel:focus{
|
||||||
border:1px solid #00BB9E;
|
border:1px solid #386488;
|
||||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF);
|
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ border:1px solid #C0DCF2;
|
|||||||
border-radius:3px;
|
border-radius:3px;
|
||||||
padding:2px;
|
padding:2px;
|
||||||
background:none;
|
background:none;
|
||||||
selection-background-color:#00BB9E;
|
selection-background-color:#386488;
|
||||||
selection-color:#FFFFFF;
|
selection-color:#FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,11 +356,11 @@ border-radius:6px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:horizontal:hover{
|
QScrollBar::handle:horizontal:hover{
|
||||||
background:#00BB9E;
|
background:#386488;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:horizontal:pressed{
|
QScrollBar::handle:horizontal:pressed{
|
||||||
background:#00BB9E;
|
background:#386488;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::add-page:horizontal{
|
QScrollBar::add-page:horizontal{
|
||||||
@@ -393,11 +393,11 @@ border-radius:6px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:vertical:hover{
|
QScrollBar::handle:vertical:hover{
|
||||||
background:#00BB9E;
|
background:#386488;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:vertical:pressed{
|
QScrollBar::handle:vertical:pressed{
|
||||||
background:#00BB9E;
|
background:#386488;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::add-page:vertical{
|
QScrollBar::add-page:vertical{
|
||||||
@@ -478,7 +478,7 @@ background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1
|
|||||||
|
|
||||||
QTabBar::tab:selected,QTabBar::tab:hover{
|
QTabBar::tab:selected,QTabBar::tab:hover{
|
||||||
border-style:solid;
|
border-style:solid;
|
||||||
border-color:#00BB9E;
|
border-color:#386488;
|
||||||
background:#EAF7FF;
|
background:#EAF7FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,7 +632,16 @@ QTabWidget::pane:bottom{bottom:-1px;}
|
|||||||
QTabWidget::pane:left{right:-1px;}
|
QTabWidget::pane:left{right:-1px;}
|
||||||
QTabWidget::pane:right{left:-1px;}
|
QTabWidget::pane:right{left:-1px;}
|
||||||
|
|
||||||
*:disabled{
|
QDialog {
|
||||||
|
background-color:#EAF7FF;
|
||||||
|
color:#386487;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDialogButtonBox > QPushButton {
|
||||||
|
min-width:50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
*:disabled,QMenu::item:disabled{
|
||||||
background:#EAF7FF;
|
background:#EAF7FF;
|
||||||
border-color:#DEF0FE;
|
border-color:#DEF0FE;
|
||||||
color:#C0DCF2;
|
color:#C0DCF2;
|
||||||
@@ -645,4 +654,4 @@ color:#C0DCF2;
|
|||||||
/*NormalColorEnd:#C0DEF6*/
|
/*NormalColorEnd:#C0DEF6*/
|
||||||
/*DarkColorStart:#F2F9FF*/
|
/*DarkColorStart:#F2F9FF*/
|
||||||
/*DarkColorEnd:#DAEFFF*/
|
/*DarkColorEnd:#DAEFFF*/
|
||||||
/*HighColor:#00BB9E*/
|
/*HighColor:#386488*/
|
||||||
@@ -32,7 +32,7 @@ QWidget[nav="top"] QAbstractButton:hover,QWidget[nav="top"] QAbstractButton:pres
|
|||||||
border-style:solid;
|
border-style:solid;
|
||||||
border-width:0px 0px 2px 0px;
|
border-width:0px 0px 2px 0px;
|
||||||
padding:4px 4px 2px 4px;
|
padding:4px 4px 2px 4px;
|
||||||
border-color:#00BB9E;
|
border-color:#AAAAAA;
|
||||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252);
|
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ border-style:none;
|
|||||||
|
|
||||||
QWidget[nav="left"] QAbstractButton:hover{
|
QWidget[nav="left"] QAbstractButton:hover{
|
||||||
color:#FFFFFF;
|
color:#FFFFFF;
|
||||||
background-color:#00BB9E;
|
background-color:#AAAAAA;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget[nav="left"] QAbstractButton:checked,QWidget[nav="left"] QAbstractButton:pressed{
|
QWidget[nav="left"] QAbstractButton:checked,QWidget[nav="left"] QAbstractButton:pressed{
|
||||||
@@ -53,7 +53,7 @@ color:#DCDCDC;
|
|||||||
border-style:solid;
|
border-style:solid;
|
||||||
border-width:0px 0px 0px 2px;
|
border-width:0px 0px 0px 2px;
|
||||||
padding:4px 4px 4px 2px;
|
padding:4px 4px 4px 2px;
|
||||||
border-color:#00BB9E;
|
border-color:#AAAAAA;
|
||||||
background-color:#444444;
|
background-color:#444444;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #484848,stop:1
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWidget[video="true"] QLabel:focus{
|
QWidget[video="true"] QLabel:focus{
|
||||||
border:1px solid #00BB9E;
|
border:1px solid #AAAAAA;
|
||||||
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252);
|
background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,8 +73,8 @@ border:1px solid #242424;
|
|||||||
border-radius:3px;
|
border-radius:3px;
|
||||||
padding:2px;
|
padding:2px;
|
||||||
background:none;
|
background:none;
|
||||||
selection-background-color:#484848;
|
selection-background-color:#AAAAAA;
|
||||||
selection-color:#DCDCDC;
|
selection-color:#FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
QLineEdit:focus,QTextEdit:focus,QPlainTextEdit:focus,QSpinBox:focus,QDoubleSpinBox:focus,QComboBox:focus,QDateEdit:focus,QTimeEdit:focus,QDateTimeEdit:focus,QLineEdit:hover,QTextEdit:hover,QPlainTextEdit:hover,QSpinBox:hover,QDoubleSpinBox:hover,QComboBox:hover,QDateEdit:hover,QTimeEdit:hover,QDateTimeEdit:hover{
|
QLineEdit:focus,QTextEdit:focus,QPlainTextEdit:focus,QSpinBox:focus,QDoubleSpinBox:focus,QComboBox:focus,QDateEdit:focus,QTimeEdit:focus,QDateTimeEdit:focus,QLineEdit:hover,QTextEdit:hover,QPlainTextEdit:hover,QSpinBox:hover,QDoubleSpinBox:hover,QComboBox:hover,QDateEdit:hover,QTimeEdit:hover,QDateTimeEdit:hover{
|
||||||
@@ -356,11 +356,11 @@ border-radius:6px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:horizontal:hover{
|
QScrollBar::handle:horizontal:hover{
|
||||||
background:#00BB9E;
|
background:#AAAAAA;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:horizontal:pressed{
|
QScrollBar::handle:horizontal:pressed{
|
||||||
background:#00BB9E;
|
background:#AAAAAA;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::add-page:horizontal{
|
QScrollBar::add-page:horizontal{
|
||||||
@@ -393,11 +393,11 @@ border-radius:6px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:vertical:hover{
|
QScrollBar::handle:vertical:hover{
|
||||||
background:#00BB9E;
|
background:#AAAAAA;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::handle:vertical:pressed{
|
QScrollBar::handle:vertical:pressed{
|
||||||
background:#00BB9E;
|
background:#AAAAAA;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScrollBar::add-page:vertical{
|
QScrollBar::add-page:vertical{
|
||||||
@@ -478,7 +478,7 @@ background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1
|
|||||||
|
|
||||||
QTabBar::tab:selected,QTabBar::tab:hover{
|
QTabBar::tab:selected,QTabBar::tab:hover{
|
||||||
border-style:solid;
|
border-style:solid;
|
||||||
border-color:#00BB9E;
|
border-color:#AAAAAA;
|
||||||
background:#444444;
|
background:#444444;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,7 +632,16 @@ QTabWidget::pane:bottom{bottom:-1px;}
|
|||||||
QTabWidget::pane:left{right:-1px;}
|
QTabWidget::pane:left{right:-1px;}
|
||||||
QTabWidget::pane:right{left:-1px;}
|
QTabWidget::pane:right{left:-1px;}
|
||||||
|
|
||||||
*:disabled{
|
QDialog {
|
||||||
|
background-color:#444444;
|
||||||
|
color:#DCDCDC;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDialogButtonBox > QPushButton {
|
||||||
|
min-width:50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
*:disabled,QMenu::item:disabled{
|
||||||
background:#444444;
|
background:#444444;
|
||||||
border-color:#484848;
|
border-color:#484848;
|
||||||
color:#242424;
|
color:#242424;
|
||||||
@@ -645,4 +654,4 @@ color:#242424;
|
|||||||
/*NormalColorEnd:#383838*/
|
/*NormalColorEnd:#383838*/
|
||||||
/*DarkColorStart:#646464*/
|
/*DarkColorStart:#646464*/
|
||||||
/*DarkColorEnd:#525252*/
|
/*DarkColorEnd:#525252*/
|
||||||
/*HighColor:#00BB9E*/
|
/*HighColor:#AAAAAA*/
|
||||||
@@ -4,13 +4,8 @@ greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat
|
|||||||
|
|
||||||
TARGET = styledemo
|
TARGET = styledemo
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
MOC_DIR = temp/moc
|
|
||||||
RCC_DIR = temp/rcc
|
|
||||||
UI_DIR = temp/ui
|
|
||||||
OBJECTS_DIR = temp/obj
|
|
||||||
DESTDIR = $$PWD/../bin
|
DESTDIR = $$PWD/../bin
|
||||||
|
|
||||||
CONFIG += warn_off
|
|
||||||
SOURCES += main.cpp
|
SOURCES += main.cpp
|
||||||
HEADERS += head.h
|
HEADERS += head.h
|
||||||
HEADERS += frmmain.h
|
HEADERS += frmmain.h
|
||||||
|
|||||||
Reference in New Issue
Block a user