diff --git a/battery/frmbattery.h b/battery/frmbattery.h index 4138c66..9a1e4ce 100644 --- a/battery/frmbattery.h +++ b/battery/frmbattery.h @@ -3,21 +3,20 @@ #include -namespace Ui -{ +namespace Ui { class frmBattery; } class frmBattery : public QWidget { - Q_OBJECT + Q_OBJECT public: - explicit frmBattery(QWidget *parent = 0); - ~frmBattery(); + explicit frmBattery(QWidget *parent = 0); + ~frmBattery(); private: - Ui::frmBattery *ui; + Ui::frmBattery *ui; private slots: void initForm(); diff --git a/battery/frmbattery.ui b/battery/frmbattery.ui index 59270b5..dc7048b 100644 --- a/battery/frmbattery.ui +++ b/battery/frmbattery.ui @@ -6,8 +6,8 @@ 0 0 - 500 - 300 + 800 + 600 diff --git a/battery/main.cpp b/battery/main.cpp index 8f88677..df6eea8 100644 --- a/battery/main.cpp +++ b/battery/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); 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 QTextCodec *codec = QTextCodec::codecForName("gbk"); #else diff --git a/comtool/comtool.pro b/comtool/comtool.pro index 330e74f..2f3eded 100644 --- a/comtool/comtool.pro +++ b/comtool/comtool.pro @@ -5,11 +5,11 @@ greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat TARGET = comtool TEMPLATE = app DESTDIR = $$PWD/../bin -RC_FILE = other/main.rc +RC_FILE = qrc/main.rc SOURCES += main.cpp HEADERS += head.h -RESOURCES += other/main.qrc +RESOURCES += qrc/main.qrc INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD/api diff --git a/comtool/other/main.ico b/comtool/qrc/main.ico similarity index 100% rename from comtool/other/main.ico rename to comtool/qrc/main.ico diff --git a/comtool/other/main.qrc b/comtool/qrc/main.qrc similarity index 100% rename from comtool/other/main.qrc rename to comtool/qrc/main.qrc diff --git a/comtool/other/main.rc b/comtool/qrc/main.rc similarity index 100% rename from comtool/other/main.rc rename to comtool/qrc/main.rc diff --git a/core_qui/core_qui.pri b/core_qui/core_qui.pri index e8980ee..ca7e635 100644 --- a/core_qui/core_qui.pri +++ b/core_qui/core_qui.pri @@ -43,5 +43,5 @@ SOURCES += \ $$PWD/quitipbox.cpp \ $$PWD/quiwidget.cpp -RESOURCES += $$PWD/resource/qm.qrc -RESOURCES += $$PWD/resource/ttf.qrc +RESOURCES += $$PWD/qrc/qm.qrc +RESOURCES += $$PWD/qrc/font.qrc diff --git a/core_qui/iconhelper.cpp b/core_qui/iconhelper.cpp index 2043d36..26c85e2 100644 --- a/core_qui/iconhelper.cpp +++ b/core_qui/iconhelper.cpp @@ -11,13 +11,13 @@ void IconHelper::initFont() if (!isInit) { isInit = true; if (iconFontAliBaBa == 0) { - iconFontAliBaBa = new IconHelper(":/image/iconfont.ttf", "iconfont"); + iconFontAliBaBa = new IconHelper(":/font/iconfont.ttf", "iconfont"); } if (iconFontAwesome == 0) { - iconFontAwesome = new IconHelper(":/image/fontawesome-webfont.ttf", "FontAwesome"); + iconFontAwesome = new IconHelper(":/font/fontawesome-webfont.ttf", "FontAwesome"); } if (iconFontWeather == 0) { - iconFontWeather = new IconHelper(":/image/pe-icon-set-weather.ttf", "pe-icon-set-weather"); + iconFontWeather = new IconHelper(":/font/pe-icon-set-weather.ttf", "pe-icon-set-weather"); } } } diff --git a/core_qui/qrc/font.qrc b/core_qui/qrc/font.qrc new file mode 100644 index 0000000..9f303b2 --- /dev/null +++ b/core_qui/qrc/font.qrc @@ -0,0 +1,7 @@ + + + font/fontawesome-webfont.ttf + font/iconfont.ttf + font/pe-icon-set-weather.ttf + + diff --git a/core_qui/resource/image/fontawesome-webfont.ttf b/core_qui/qrc/font/fontawesome-webfont.ttf similarity index 100% rename from core_qui/resource/image/fontawesome-webfont.ttf rename to core_qui/qrc/font/fontawesome-webfont.ttf diff --git a/core_qui/resource/image/iconfont.ttf b/core_qui/qrc/font/iconfont.ttf similarity index 100% rename from core_qui/resource/image/iconfont.ttf rename to core_qui/qrc/font/iconfont.ttf diff --git a/core_qui/resource/image/pe-icon-set-weather.ttf b/core_qui/qrc/font/pe-icon-set-weather.ttf similarity index 100% rename from core_qui/resource/image/pe-icon-set-weather.ttf rename to core_qui/qrc/font/pe-icon-set-weather.ttf diff --git a/core_qui/qrc/qm.qrc b/core_qui/qrc/qm.qrc new file mode 100644 index 0000000..d14db1a --- /dev/null +++ b/core_qui/qrc/qm.qrc @@ -0,0 +1,6 @@ + + + qm/qt_zh_CN.qm + qm/widgets.qm + + diff --git a/core_qui/resource/image/qt_zh_CN.qm b/core_qui/qrc/qm/qt_zh_CN.qm similarity index 100% rename from core_qui/resource/image/qt_zh_CN.qm rename to core_qui/qrc/qm/qt_zh_CN.qm diff --git a/core_qui/resource/image/widgets.qm b/core_qui/qrc/qm/widgets.qm similarity index 100% rename from core_qui/resource/image/widgets.qm rename to core_qui/qrc/qm/widgets.qm diff --git a/core_qui/quidateselect.cpp b/core_qui/quidateselect.cpp index cb77fda..33c32f5 100644 --- a/core_qui/quidateselect.cpp +++ b/core_qui/quidateselect.cpp @@ -68,7 +68,7 @@ void QUIDateSelect::initControl() verticalLayout->setContentsMargins(1, 1, 1, 1); widgetTitle = new QWidget(this); - widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); + widgetTitle->setObjectName(QString::fromUtf8("QUIWidgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -81,7 +81,7 @@ void QUIDateSelect::initControl() horizontalLayout1->setContentsMargins(0, 0, 0, 0); labIco = new QLabel(widgetTitle); - labIco->setObjectName(QString::fromUtf8("labIco")); + labIco->setObjectName(QString::fromUtf8("QUILabIco")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Preferred); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -91,7 +91,7 @@ void QUIDateSelect::initControl() horizontalLayout1->addWidget(labIco); labTitle = new QLabel(widgetTitle); - labTitle->setObjectName(QString::fromUtf8("labTitle")); + labTitle->setObjectName(QString::fromUtf8("QUILabTitle")); QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); @@ -101,7 +101,7 @@ void QUIDateSelect::initControl() horizontalLayout1->addWidget(labTitle); widgetMenu = new QWidget(widgetTitle); - widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); + widgetMenu->setObjectName(QString::fromUtf8("QUIWidgetMenu")); sizePolicy1.setHeightForWidth(widgetMenu->sizePolicy().hasHeightForWidth()); widgetMenu->setSizePolicy(sizePolicy1); @@ -126,7 +126,7 @@ void QUIDateSelect::initControl() verticalLayout->addWidget(widgetTitle); widgetMain = new QWidget(this); - widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); + widgetMain->setObjectName(QString::fromUtf8("QUIWidgetMain")); verticalLayout1 = new QVBoxLayout(widgetMain); verticalLayout1->setSpacing(6); @@ -134,19 +134,19 @@ void QUIDateSelect::initControl() verticalLayout1->setContentsMargins(6, 6, 6, 6); frame = new QFrame(widgetMain); - frame->setObjectName(QString::fromUtf8("frame")); + frame->setObjectName(QString::fromUtf8("QUIFrame")); frame->setFrameShape(QFrame::Box); frame->setFrameShadow(QFrame::Sunken); gridLayout = new QGridLayout(frame); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); labStart = new QLabel(frame); - labStart->setObjectName(QString::fromUtf8("labStart")); + labStart->setObjectName(QString::fromUtf8("QUILabStart")); labStart->setFocusPolicy(Qt::TabFocus); gridLayout->addWidget(labStart, 0, 0, 1, 1); btnOk = new QPushButton(frame); - btnOk->setObjectName(QString::fromUtf8("btnOk")); + btnOk->setObjectName(QString::fromUtf8("QUIBtnOk")); btnOk->setMinimumSize(QSize(85, 0)); btnOk->setCursor(QCursor(Qt::PointingHandCursor)); btnOk->setFocusPolicy(Qt::StrongFocus); @@ -154,19 +154,19 @@ void QUIDateSelect::initControl() btnOk->setDefault(true); labEnd = new QLabel(frame); - labEnd->setObjectName(QString::fromUtf8("labEnd")); + labEnd->setObjectName(QString::fromUtf8("QUILabEnd")); labEnd->setFocusPolicy(Qt::TabFocus); gridLayout->addWidget(labEnd, 1, 0, 1, 1); btnClose = new QPushButton(frame); - btnClose->setObjectName(QString::fromUtf8("btnClose")); + btnClose->setObjectName(QString::fromUtf8("QUIBtnClose")); btnClose->setMinimumSize(QSize(85, 0)); btnClose->setCursor(QCursor(Qt::PointingHandCursor)); btnClose->setFocusPolicy(Qt::StrongFocus); gridLayout->addWidget(btnClose, 1, 2, 1, 1); dateStart = new QDateTimeEdit(frame); - dateStart->setObjectName(QString::fromUtf8("dateStart")); + dateStart->setObjectName(QString::fromUtf8("QUIDateStart")); QSizePolicy sizePolicy4(QSizePolicy::Expanding, QSizePolicy::Fixed); sizePolicy4.setHorizontalStretch(0); sizePolicy4.setVerticalStretch(0); @@ -176,7 +176,7 @@ void QUIDateSelect::initControl() gridLayout->addWidget(dateStart, 0, 1, 1, 1); dateEnd = new QDateTimeEdit(frame); - dateEnd->setObjectName(QString::fromUtf8("dateEnd")); + dateEnd->setObjectName(QString::fromUtf8("QUIDateEnd")); sizePolicy4.setHeightForWidth(dateEnd->sizePolicy().hasHeightForWidth()); dateEnd->setSizePolicy(sizePolicy4); dateEnd->setCalendarPopup(true); @@ -213,10 +213,14 @@ void QUIDateSelect::initControl() void QUIDateSelect::initForm() { + //设置阴影 + QUIHelper::setFormShadow(this, verticalLayout); + //设置无边框 QUIHelper::setFramelessForm(this, widgetTitle, labIco, btnMenu_Close); this->setWindowTitle(this->labTitle->text()); this->setFixedSize(QUIDialogMinWidth + 50, QUIDialogMinHeight); + //按钮设置最小尺寸和图标大小 QList btns = this->frame->findChildren(); foreach (QPushButton *btn, btns) { btn->setMinimumWidth(QUIBtnMinWidth); diff --git a/core_qui/quihelper.cpp b/core_qui/quihelper.cpp index 0323784..a029928 100644 --- a/core_qui/quihelper.cpp +++ b/core_qui/quihelper.cpp @@ -296,6 +296,64 @@ void QUIHelper::writeError(const QString &info, bool needWrite, const QString &f file.close(); } +//在部分linux系统设置了背景透明是黑色的所以限定只在win +#ifdef Q_OS_WIN +int QUIHelper::shadowMargin = 5; +#else +int QUIHelper::shadowMargin = 0; +#endif +int QUIHelper::shadowRadius = 15; +QString QUIHelper::shadowColor = "#333333"; +void QUIHelper::setFormShadow(QWidget *widget, QLayout *layout, const QString &color, int margin, int radius) +{ + if (margin <= 0 || radius <= 0) { + return; + } + + //采用系统自带的函数设置阴影 + QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect(widget); + shadowEffect->setOffset(0, 0); + shadowEffect->setColor(color); + shadowEffect->setBlurRadius(radius); + widget->setGraphicsEffect(shadowEffect); + + //必须设置背景透明 + widget->setAttribute(Qt::WA_TranslucentBackground, true); + //设置布局边距留出空间给边框阴影 + layout->setContentsMargins(margin, margin, margin, margin); +} + +void QUIHelper::setFormShadow(const QString &color) +{ + //重新应用边框阴影颜色等 + QUIHelper::shadowColor = color; + QGraphicsDropShadowEffect *shadowEffect = 0; + + //消息框 + shadowEffect = (QGraphicsDropShadowEffect *) QUIMessageBox::Instance()->graphicsEffect(); + if (shadowEffect != 0) { + shadowEffect->setColor(color); + } + + //输入框 + shadowEffect = (QGraphicsDropShadowEffect *) QUIInputBox::Instance()->graphicsEffect(); + if (shadowEffect != 0) { + shadowEffect->setColor(color); + } + + //右下角提示框 + shadowEffect = (QGraphicsDropShadowEffect *) QUITipBox::Instance()->graphicsEffect(); + if (shadowEffect != 0) { + shadowEffect->setColor(color); + } + + //日期选择框 + shadowEffect = (QGraphicsDropShadowEffect *) QUIDateSelect::Instance()->graphicsEffect(); + if (shadowEffect != 0) { + shadowEffect->setColor(color); + } +} + void QUIHelper::setFramelessForm(QWidget *widgetMain, bool tool, bool top, bool menu) { widgetMain->setProperty("form", true); @@ -314,7 +372,10 @@ void QUIHelper::setFramelessForm(QWidget *widgetMain, bool tool, bool top, bool widgetMain->setWindowFlags(widgetMain->windowFlags() | Qt::WindowStaysOnTopHint); } if (menu) { + //如果是其他系统比如neokylin会产生系统边框 +#ifdef Q_OS_WIN widgetMain->setWindowFlags(widgetMain->windowFlags() | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint); +#endif } } @@ -1255,7 +1316,7 @@ int QUIHelper::showMessageBoxQuestion(const QString &info) { if (isCustomUI) { QUIMessageBox msg; - msg.setMessage(info, 1); + msg.setMessage(info, 1);msg.update(); return msg.exec(); } else { QMessageBox box(QMessageBox::Question, "询问", info); diff --git a/core_qui/quihelper.h b/core_qui/quihelper.h index cf8365f..9da8e90 100644 --- a/core_qui/quihelper.h +++ b/core_qui/quihelper.h @@ -32,10 +32,10 @@ public: //设置编码 static void setCode(bool utf8 = true); //设置字体 - static void setFont(const QString &ttfFile = ":/image/DroidSansFallback.ttf", + static void setFont(const QString &ttfFile = ":/font/DroidSansFallback.ttf", const QString &fontName = "Microsoft Yahei", int fontSize = 12); //设置翻译文件 - static void setTranslator(const QString &qmFile = ":/image/qt_zh_CN.qm"); + static void setTranslator(const QString &qmFile = ":/qm/qt_zh_CN.qm"); //初始化数据库 static void initDb(const QString &dbName); @@ -52,6 +52,17 @@ public: static void writeInfo(const QString &info, bool needWrite = false, const QString &filePath = "log"); static void writeError(const QString &info, bool needWrite = false, const QString &filePath = "log"); + //设置边框阴影 + static int shadowMargin; + static int shadowRadius; + static QString shadowColor; + static void setFormShadow(QWidget *widget, QLayout *layout, + const QString &color = shadowColor, + int margin = shadowMargin, + int radius = shadowRadius); + //立即更新所有阴影边框颜色比如换肤的时候需要用到 + static void setFormShadow(const QString &color); + //设置无边框窗体 static void setFramelessForm(QWidget *widgetMain, bool tool = false, bool top = false, bool menu = true); diff --git a/core_qui/quiinputbox.cpp b/core_qui/quiinputbox.cpp index a52f127..fb52803 100644 --- a/core_qui/quiinputbox.cpp +++ b/core_qui/quiinputbox.cpp @@ -44,7 +44,7 @@ void QUIInputBox::initControl() verticalLayout1->setContentsMargins(1, 1, 1, 1); widgetTitle = new QWidget(this); - widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); + widgetTitle->setObjectName(QString::fromUtf8("QUIWidgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -57,7 +57,7 @@ void QUIInputBox::initControl() horizontalLayout1->setContentsMargins(0, 0, 0, 0); labIco = new QLabel(widgetTitle); - labIco->setObjectName(QString::fromUtf8("labIco")); + labIco->setObjectName(QString::fromUtf8("QUILabIco")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Preferred); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -67,12 +67,12 @@ void QUIInputBox::initControl() horizontalLayout1->addWidget(labIco); labTitle = new QLabel(widgetTitle); - labTitle->setObjectName(QString::fromUtf8("labTitle")); + labTitle->setObjectName(QString::fromUtf8("QUILabTitle")); labTitle->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); horizontalLayout1->addWidget(labTitle); labCountDown = new QLabel(widgetTitle); - labCountDown->setObjectName(QString::fromUtf8("labCountDown")); + labCountDown->setObjectName(QString::fromUtf8("QUILabCountDown")); QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); @@ -82,7 +82,7 @@ void QUIInputBox::initControl() horizontalLayout1->addWidget(labCountDown); widgetMenu = new QWidget(widgetTitle); - widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); + widgetMenu->setObjectName(QString::fromUtf8("QUIWidgetMenu")); sizePolicy1.setHeightForWidth(widgetMenu->sizePolicy().hasHeightForWidth()); widgetMenu->setSizePolicy(sizePolicy1); @@ -107,7 +107,7 @@ void QUIInputBox::initControl() verticalLayout1->addWidget(widgetTitle); widgetMain = new QWidget(this); - widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); + widgetMain->setObjectName(QString::fromUtf8("QUIWidgetMain")); verticalLayout2 = new QVBoxLayout(widgetMain); verticalLayout2->setSpacing(5); @@ -115,12 +115,12 @@ void QUIInputBox::initControl() verticalLayout2->setContentsMargins(5, 5, 5, 5); frame = new QFrame(widgetMain); - frame->setObjectName(QString::fromUtf8("frame")); + frame->setObjectName(QString::fromUtf8("QUIFrame")); frame->setFrameShape(QFrame::Box); frame->setFrameShadow(QFrame::Sunken); labInfo = new QLabel(frame); - labInfo->setObjectName(QString::fromUtf8("labInfo")); + labInfo->setObjectName(QString::fromUtf8("QUILabInfo")); labInfo->setScaledContents(false); labInfo->setWordWrap(true); @@ -129,11 +129,11 @@ void QUIInputBox::initControl() verticalLayout3->addWidget(labInfo); txtValue = new QLineEdit(frame); - txtValue->setObjectName(QString::fromUtf8("txtValue")); + txtValue->setObjectName(QString::fromUtf8("QUITxtValue")); verticalLayout3->addWidget(txtValue); cboxValue = new QComboBox(frame); - cboxValue->setObjectName(QString::fromUtf8("cboxValue")); + cboxValue->setObjectName(QString::fromUtf8("QUICboxValue")); verticalLayout3->addWidget(cboxValue); lay = new QHBoxLayout(); @@ -142,13 +142,13 @@ void QUIInputBox::initControl() lay->addItem(horizontalSpacer); btnOk = new QPushButton(frame); - btnOk->setObjectName(QString::fromUtf8("btnOk")); + btnOk->setObjectName(QString::fromUtf8("QUIBtnOk")); btnOk->setMinimumSize(QSize(85, 0)); lay->addWidget(btnOk); btnOk->setDefault(true); btnCancel = new QPushButton(frame); - btnCancel->setObjectName(QString::fromUtf8("btnCancel")); + btnCancel->setObjectName(QString::fromUtf8("QUIBtnCancel")); btnCancel->setMinimumSize(QSize(85, 0)); lay->addWidget(btnCancel); @@ -170,10 +170,14 @@ void QUIInputBox::initControl() void QUIInputBox::initForm() { + //设置阴影 + QUIHelper::setFormShadow(this, verticalLayout1); + //设置无边框 QUIHelper::setFramelessForm(this, widgetTitle, labIco, btnMenu_Close); this->setWindowTitle(this->labTitle->text()); this->setFixedSize(QUIDialogMinWidth, QUIDialogMinHeight + 10); + //按钮设置最小尺寸和图标大小 QList btns = this->frame->findChildren(); foreach (QPushButton *btn, btns) { btn->setMinimumWidth(QUIBtnMinWidth); diff --git a/core_qui/quimessagebox.cpp b/core_qui/quimessagebox.cpp index 4f4931b..04212f1 100644 --- a/core_qui/quimessagebox.cpp +++ b/core_qui/quimessagebox.cpp @@ -74,7 +74,7 @@ void QUIMessageBox::initControl() verticalLayout1->setContentsMargins(1, 1, 1, 1); widgetTitle = new QWidget(this); - widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); + widgetTitle->setObjectName(QString::fromUtf8("QUIWidgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -87,7 +87,7 @@ void QUIMessageBox::initControl() horizontalLayout3->setContentsMargins(0, 0, 0, 0); labIco = new QLabel(widgetTitle); - labIco->setObjectName(QString::fromUtf8("labIco")); + labIco->setObjectName(QString::fromUtf8("QUILabIco")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Preferred); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -97,12 +97,12 @@ void QUIMessageBox::initControl() horizontalLayout3->addWidget(labIco); labTitle = new QLabel(widgetTitle); - labTitle->setObjectName(QString::fromUtf8("labTitle")); + labTitle->setObjectName(QString::fromUtf8("QUILabTitle")); labTitle->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); horizontalLayout3->addWidget(labTitle); labCountDown = new QLabel(widgetTitle); - labCountDown->setObjectName(QString::fromUtf8("labCountDown")); + labCountDown->setObjectName(QString::fromUtf8("QUILabCountDown")); QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); @@ -112,7 +112,7 @@ void QUIMessageBox::initControl() horizontalLayout3->addWidget(labCountDown); widgetMenu = new QWidget(widgetTitle); - widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); + widgetMenu->setObjectName(QString::fromUtf8("QUIWidgetMenu")); sizePolicy1.setHeightForWidth(widgetMenu->sizePolicy().hasHeightForWidth()); widgetMenu->setSizePolicy(sizePolicy1); @@ -137,7 +137,7 @@ void QUIMessageBox::initControl() verticalLayout1->addWidget(widgetTitle); widgetMain = new QWidget(this); - widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); + widgetMain->setObjectName(QString::fromUtf8("QUIWidgetMain")); verticalLayout2 = new QVBoxLayout(widgetMain); verticalLayout2->setSpacing(5); @@ -145,12 +145,12 @@ void QUIMessageBox::initControl() verticalLayout2->setContentsMargins(5, 5, 5, 5); frame = new QFrame(widgetMain); - frame->setObjectName(QString::fromUtf8("frame")); + frame->setObjectName(QString::fromUtf8("QUIFrame")); frame->setFrameShape(QFrame::Box); frame->setFrameShadow(QFrame::Sunken); labIcoMain = new QLabel(frame); - labIcoMain->setObjectName(QString::fromUtf8("labIcoMain")); + labIcoMain->setObjectName(QString::fromUtf8("QUILabIcoMain")); labIcoMain->setAlignment(Qt::AlignCenter); verticalLayout4 = new QVBoxLayout(frame); @@ -164,7 +164,7 @@ void QUIMessageBox::initControl() horizontalLayout1->addItem(horizontalSpacer1); labInfo = new QLabel(frame); - labInfo->setObjectName(QString::fromUtf8("labInfo")); + labInfo->setObjectName(QString::fromUtf8("QUILabInfo")); QSizePolicy sizePolicy4(QSizePolicy::Expanding, QSizePolicy::Expanding); sizePolicy4.setHorizontalStretch(0); sizePolicy4.setVerticalStretch(0); @@ -182,14 +182,14 @@ void QUIMessageBox::initControl() horizontalLayout2->addItem(horizontalSpacer2); btnOk = new QPushButton(frame); - btnOk->setObjectName(QString::fromUtf8("btnOk")); + btnOk->setObjectName(QString::fromUtf8("QUIBtnOk")); btnOk->setMinimumSize(QSize(85, 0)); btnOk->setFocusPolicy(Qt::StrongFocus); horizontalLayout2->addWidget(btnOk); btnOk->setDefault(true); btnCancel = new QPushButton(frame); - btnCancel->setObjectName(QString::fromUtf8("btnCancel")); + btnCancel->setObjectName(QString::fromUtf8("QUIBtnCancel")); btnCancel->setMinimumSize(QSize(85, 0)); btnCancel->setFocusPolicy(Qt::StrongFocus); horizontalLayout2->addWidget(btnCancel); @@ -212,11 +212,15 @@ void QUIMessageBox::initControl() void QUIMessageBox::initForm() { + //设置阴影 + QUIHelper::setFormShadow(this, verticalLayout1); + //设置无边框 QUIHelper::setFramelessForm(this, widgetTitle, labIco, btnMenu_Close); this->setWindowTitle(this->labTitle->text()); this->setFixedSize(QUIDialogMinWidth, QUIDialogMinHeight); labIcoMain->setFixedSize(QUITitleMinSize, QUITitleMinSize); + //按钮设置最小尺寸和图标大小 QList btns = this->frame->findChildren(); foreach (QPushButton *btn, btns) { btn->setMinimumWidth(QUIBtnMinWidth); @@ -226,6 +230,7 @@ void QUIMessageBox::initForm() closeSec = 0; currentSec = 0; + //倒计时定时器关闭窗体 QTimer *timer = new QTimer(this); timer->setInterval(1000); connect(timer, SIGNAL(timeout()), this, SLOT(checkSec())); @@ -300,11 +305,27 @@ void QUIMessageBox::setMessage(const QString &msg, int type, int closeSec) this->labInfo->setText(msg); this->setWindowTitle(this->labTitle->text()); + + //长度符合要求比如就两行只需要默认尺寸 + bool normal = (msg.length() < 30); + //计算有多少个换行符 + int count = 0; + foreach (QString s, msg) { + if (s == "\n") { + count++; + } + } + //如果包含换行超过1个则表示超过2行需要特殊布局尺寸 + if (count > 1) { + normal = false; + } + //设置对话框的大小总以最合适的大小显示 - if (msg.length() < 70) { + if (normal) { this->layout()->setSizeConstraint(QLayout::SetMinimumSize); this->setFixedSize(QUIDialogMinWidth, QUIDialogMinHeight); } else { this->layout()->setSizeConstraint(QLayout::SetFixedSize); + //this->setFixedSize(labInfo->sizeHint() + QSize(100, 120)); } } diff --git a/core_qui/quistyle.cpp b/core_qui/quistyle.cpp index 5acddba..ffaefbe 100644 --- a/core_qui/quistyle.cpp +++ b/core_qui/quistyle.cpp @@ -1,5 +1,33 @@ #include "quistyle.h" +bool QUIStyle::isDark1(const QString &styleName) +{ + QStringList listDark; + listDark << "blackvideo" << "blackblue" << "darkblack" << "darkblue" << "flatblack" << "flatblue" << "purple"; + bool dark = false; + foreach (QString list, listDark) { + if (styleName.contains(list)) { + dark = true; + break; + } + } + return dark; +} + +bool QUIStyle::isDark2(const QString &styleName) +{ + QStringList listDark; + listDark << "blackvideo" << "blackblue" << "darkblack" << "darkblue" << "purple"; + bool dark = false; + foreach (QString list, listDark) { + if (styleName.contains(list)) { + dark = true; + break; + } + } + return dark; +} + void QUIStyle::getStyle(QStringList &styleNames, QStringList &styleFiles) { static QStringList names; @@ -40,7 +68,13 @@ void QUIStyle::setStyle(const QString &qss) list << "QTabBar::tab:right:selected,QTabBar::tab:right:hover{border-width:0px 2px 0px 0px;}"; #endif + //增加文本框只读背景颜色 + list << QString("QLineEdit:read-only{background-color:#88%1;}").arg(QUIConfig::NormalColorStart.right(6)); + QUIHelper::isCustomUI = true; + //阴影边框和配色方案自动变化 + QUIHelper::setFormShadow(QUIConfig::HighColor); + QString paletteColor = qss.mid(20, 7); qApp->setPalette(QPalette(paletteColor)); qApp->setStyleSheet(list.join("")); @@ -125,6 +159,13 @@ void QUIStyle::getQssColor(const QString &qss, QString &textColor, QUIHelper::isCustomUI = true; QUIConfig::TextColor = textColor; + QUIConfig::PanelColor = panelColor; + QUIConfig::BorderColor = borderColor; + QUIConfig::NormalColorStart = normalColorStart; + QUIConfig::NormalColorEnd = normalColorEnd; + QUIConfig::DarkColorStart = darkColorStart; + QUIConfig::DarkColorEnd = darkColorEnd; + QUIConfig::HighColor = highColor; } void QUIStyle::setLabStyle(QLabel *lab, quint8 type, const QString &bgColor, const QString &textColor) diff --git a/core_qui/quistyle.h b/core_qui/quistyle.h index 5ca5180..c8bd147 100644 --- a/core_qui/quistyle.h +++ b/core_qui/quistyle.h @@ -27,6 +27,10 @@ public: Style_BlackVideo = 16 //视频监控黑色样式 }; + //获取是否是加深样式 + static bool isDark1(const QString &styleName); + static bool isDark2(const QString &styleName); + //获取皮肤样式中文名称和对应的样式表文件 static void getStyle(QStringList &styleNames, QStringList &styleFiles); //设置全局样式 diff --git a/core_qui/quitipbox.cpp b/core_qui/quitipbox.cpp index cde7e5f..24480fa 100644 --- a/core_qui/quitipbox.cpp +++ b/core_qui/quitipbox.cpp @@ -71,7 +71,7 @@ void QUITipBox::initControl() verticalLayout->setContentsMargins(1, 1, 1, 1); widgetTitle = new QWidget(this); - widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); + widgetTitle->setObjectName(QString::fromUtf8("QUIWidgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -84,17 +84,17 @@ void QUITipBox::initControl() horizontalLayout2->setContentsMargins(0, 0, 0, 0); labIco = new QLabel(widgetTitle); - labIco->setObjectName(QString::fromUtf8("labIco")); + labIco->setObjectName(QString::fromUtf8("QUILabIco")); labIco->setAlignment(Qt::AlignCenter); horizontalLayout2->addWidget(labIco); labTitle = new QLabel(widgetTitle); - labTitle->setObjectName(QString::fromUtf8("labTitle")); + labTitle->setObjectName(QString::fromUtf8("QUILabTitle")); labTitle->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); horizontalLayout2->addWidget(labTitle); labCountDown = new QLabel(widgetTitle); - labCountDown->setObjectName(QString::fromUtf8("labCountDown")); + labCountDown->setObjectName(QString::fromUtf8("QUILabCountDown")); QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -104,7 +104,7 @@ void QUITipBox::initControl() horizontalLayout2->addWidget(labCountDown); widgetMenu = new QWidget(widgetTitle); - widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); + widgetMenu->setObjectName(QString::fromUtf8("QUIWidgetMenu")); QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Preferred); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); @@ -132,11 +132,11 @@ void QUITipBox::initControl() verticalLayout->addWidget(widgetTitle); widgetMain = new QWidget(this); - widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); + widgetMain->setObjectName(QString::fromUtf8("QUIWidgetMain")); widgetMain->setAutoFillBackground(true); labInfo = new QLabel(widgetMain); - labInfo->setObjectName(QString::fromUtf8("labInfo")); + labInfo->setObjectName(QString::fromUtf8("QUILabInfo")); labInfo->setScaledContents(true); labInfo->setWordWrap(true); @@ -150,6 +150,9 @@ void QUITipBox::initControl() void QUITipBox::initForm() { + //设置阴影 + QUIHelper::setFormShadow(this, verticalLayout); + //设置无边框 QUIHelper::setFramelessForm(this, widgetTitle, labIco, btnMenu_Close); this->setWindowTitle(this->labTitle->text()); this->setFixedSize(QUIDialogMinWidth, QUIDialogMinHeight); @@ -157,6 +160,7 @@ void QUITipBox::initForm() closeSec = 0; currentSec = 0; + //关闭倒计时定时器 QTimer *timer = new QTimer(this); timer->setInterval(1000); connect(timer, SIGNAL(timeout()), this, SLOT(checkSec())); @@ -216,6 +220,7 @@ void QUITipBox::setTip(const QString &title, const QString &tip, bool fullScreen this->labInfo->setAlignment(center ? Qt::AlignCenter : Qt::AlignLeft); this->setWindowTitle(this->labTitle->text()); + //计算屏幕尺寸 QRect rect = QUIHelper::getScreenRect(!fullScreen); int width = rect.width(); int height = rect.height(); diff --git a/core_qui/quiwidget.cpp b/core_qui/quiwidget.cpp index 928667d..20908e6 100644 --- a/core_qui/quiwidget.cpp +++ b/core_qui/quiwidget.cpp @@ -110,14 +110,14 @@ void QUIWidget::initControl() verticalLayout1->setObjectName(QString::fromUtf8("verticalLayout1")); verticalLayout1->setContentsMargins(1, 1, 1, 1); widgetMain = new QWidget(this); - widgetMain->setObjectName(QString::fromUtf8("widgetMainQUI")); + widgetMain->setObjectName(QString::fromUtf8("QUIWidgetMain")); verticalLayout2 = new QVBoxLayout(widgetMain); verticalLayout2->setSpacing(0); verticalLayout2->setContentsMargins(11, 11, 11, 11); verticalLayout2->setObjectName(QString::fromUtf8("verticalLayout2")); verticalLayout2->setContentsMargins(0, 0, 0, 0); widgetTitle = new QWidget(widgetMain); - widgetTitle->setObjectName(QString::fromUtf8("widgetTitle")); + widgetTitle->setObjectName(QString::fromUtf8("QUIWidgetTitle")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -131,7 +131,7 @@ void QUIWidget::initControl() horizontalLayout4->setContentsMargins(0, 0, 0, 0); labIco = new QLabel(widgetTitle); - labIco->setObjectName(QString::fromUtf8("labIco")); + labIco->setObjectName(QString::fromUtf8("QUILabIco")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Preferred); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -142,7 +142,7 @@ void QUIWidget::initControl() horizontalLayout4->addWidget(labIco); labTitle = new QLabel(widgetTitle); - labTitle->setObjectName(QString::fromUtf8("labTitle")); + labTitle->setObjectName(QString::fromUtf8("QUILabTitle")); QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); @@ -152,7 +152,7 @@ void QUIWidget::initControl() horizontalLayout4->addWidget(labTitle); widgetMenu = new QWidget(widgetTitle); - widgetMenu->setObjectName(QString::fromUtf8("widgetMenu")); + widgetMenu->setObjectName(QString::fromUtf8("QUIWidgetMenu")); sizePolicy1.setHeightForWidth(widgetMenu->sizePolicy().hasHeightForWidth()); widgetMenu->setSizePolicy(sizePolicy1); horizontalLayout = new QHBoxLayout(widgetMenu); @@ -233,8 +233,11 @@ void QUIWidget::initForm() setIcon(QUIWidget::BtnMenu_Normal, QUIConfig::IconNormal); setIcon(QUIWidget::BtnMenu_Close, QUIConfig::IconClose); + //设置阴影 + //QUIHelper::setFormShadow(this, verticalLayout1); + //设置无边框 + QUIHelper::setFramelessForm(this); this->widgetTitle->setProperty("form", "title"); - QUIHelper::setFramelessForm(this, false, false, false); //设置标题及对齐方式 title = "QUI Demo"; diff --git a/core_qui/resource/qm.qrc b/core_qui/resource/qm.qrc deleted file mode 100644 index c5b158d..0000000 --- a/core_qui/resource/qm.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - image/qt_zh_CN.qm - image/widgets.qm - - diff --git a/core_qui/resource/ttf.qrc b/core_qui/resource/ttf.qrc deleted file mode 100644 index 2598e38..0000000 --- a/core_qui/resource/ttf.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - image/fontawesome-webfont.ttf - image/iconfont.ttf - image/pe-icon-set-weather.ttf - - diff --git a/devicebutton/frmdevicebutton.ui b/devicebutton/frmdevicebutton.ui index bce6188..a9306e9 100644 --- a/devicebutton/frmdevicebutton.ui +++ b/devicebutton/frmdevicebutton.ui @@ -7,7 +7,7 @@ 0 0 800 - 500 + 600 diff --git a/devicesizetable/devicesizetable.cpp b/devicesizetable/devicesizetable.cpp index 925a513..b25413b 100644 --- a/devicesizetable/devicesizetable.cpp +++ b/devicesizetable/devicesizetable.cpp @@ -7,6 +7,7 @@ #include "qfileinfo.h" #include "qdir.h" #include "qprogressbar.h" +#include "qtimer.h" #include "qdebug.h" #ifdef Q_OS_WIN @@ -52,7 +53,8 @@ DeviceSizeTable::DeviceSizeTable(QWidget *parent) : QTableWidget(parent) this->setSelectionMode(QAbstractItemView::SingleSelection); this->verticalHeader()->setVisible(true); this->horizontalHeader()->setStretchLastSection(true); - QMetaObject::invokeMethod(this, "load"); + //QMetaObject::invokeMethod(this, "load"); + QTimer::singleShot(10, this, SLOT(load())); } QColor DeviceSizeTable::getBgColor() const diff --git a/devicesizetable/frmdevicesizetable.cpp b/devicesizetable/frmdevicesizetable.cpp index 823bb31..58b9140 100644 --- a/devicesizetable/frmdevicesizetable.cpp +++ b/devicesizetable/frmdevicesizetable.cpp @@ -5,10 +5,11 @@ frmDeviceSizeTable::frmDeviceSizeTable(QWidget *parent) : QWidget(parent), ui(new Ui::frmDeviceSizeTable) { - ui->setupUi(this); + ui->setupUi(this); + ui->tableWidget->verticalHeader()->setDefaultSectionSize(25); } frmDeviceSizeTable::~frmDeviceSizeTable() { - delete ui; + delete ui; } diff --git a/devicesizetable/frmdevicesizetable.h b/devicesizetable/frmdevicesizetable.h index f5e1076..af26c51 100644 --- a/devicesizetable/frmdevicesizetable.h +++ b/devicesizetable/frmdevicesizetable.h @@ -3,21 +3,20 @@ #include -namespace Ui -{ +namespace Ui { class frmDeviceSizeTable; } class frmDeviceSizeTable : public QWidget { - Q_OBJECT + Q_OBJECT public: - explicit frmDeviceSizeTable(QWidget *parent = 0); - ~frmDeviceSizeTable(); + explicit frmDeviceSizeTable(QWidget *parent = 0); + ~frmDeviceSizeTable(); private: - Ui::frmDeviceSizeTable *ui; + Ui::frmDeviceSizeTable *ui; }; #endif // FRMDEVICESIZETABLE_H diff --git a/devicesizetable/frmdevicesizetable.ui b/devicesizetable/frmdevicesizetable.ui index ab1fbf8..22352f4 100644 --- a/devicesizetable/frmdevicesizetable.ui +++ b/devicesizetable/frmdevicesizetable.ui @@ -6,8 +6,8 @@ 0 0 - 500 - 300 + 800 + 600 diff --git a/devicesizetable/main.cpp b/devicesizetable/main.cpp index 6edda79..401f586 100644 --- a/devicesizetable/main.cpp +++ b/devicesizetable/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); 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 QTextCodec *codec = QTextCodec::codecForName("gbk"); #else @@ -24,7 +24,7 @@ int main(int argc, char *argv[]) #endif frmDeviceSizeTable w; - w.setWindowTitle("本地存储空间大小控件"); + w.setWindowTitle("磁盘容量"); w.show(); return a.exec(); diff --git a/ffmpegdemo/ffmpeg/ffmpeg.cpp b/ffmpegdemo/ffmpeg/ffmpeg.cpp index a6c9974..8499b1d 100644 --- a/ffmpegdemo/ffmpeg/ffmpeg.cpp +++ b/ffmpegdemo/ffmpeg/ffmpeg.cpp @@ -68,17 +68,17 @@ void FFmpegThread::initlib() bool FFmpegThread::init() { - //在打开码流前指定各种参数比如:探测时间/超时时间/最大延时等 - //设置缓存大小,1080p可将值调大 - av_dict_set(&options, "buffer_size", "8192000", 0); - //以tcp方式打开,如果以udp方式打开将tcp替换为udp - av_dict_set(&options, "rtsp_transport", "tcp", 0); - //设置超时断开连接时间,单位微秒,3000000表示3秒 - av_dict_set(&options, "stimeout", "3000000", 0); - //设置最大时延,单位微秒,1000000表示1秒 - av_dict_set(&options, "max_delay", "1000000", 0); - //自动开启线程数 - av_dict_set(&options, "threads", "auto", 0); +// //在打开码流前指定各种参数比如:探测时间/超时时间/最大延时等 +// //设置缓存大小,1080p可将值调大 +// av_dict_set(&options, "buffer_size", "8192000", 0); +// //以tcp方式打开,如果以udp方式打开将tcp替换为udp +// av_dict_set(&options, "rtsp_transport", "tcp", 0); +// //设置超时断开连接时间,单位微秒,3000000表示3秒 +// av_dict_set(&options, "stimeout", "3000000", 0); +// //设置最大时延,单位微秒,1000000表示1秒 +// av_dict_set(&options, "max_delay", "1000000", 0); +// //自动开启线程数 +// av_dict_set(&options, "threads", "auto", 0); //打开视频流 avFormatContext = avformat_alloc_context(); @@ -239,7 +239,9 @@ void FFmpegThread::run() continue; } - if (av_read_frame(avFormatContext, avPacket) >= 0) { + frameFinish = av_read_frame(avFormatContext, avPacket); + qDebug() << TIMEMS << frameFinish; + if (frameFinish >= 0) { //判断当前包是视频还是音频 int index = avPacket->stream_index; if (index == videoStreamIndex) { @@ -252,7 +254,7 @@ void FFmpegThread::run() continue; } - frameFinish = avcodec_receive_frame(videoCodec, avFrame2); + frameFinish = avcodec_receive_frame(videoCodec, avFrame2); if (frameFinish < 0) { continue; } diff --git a/ffmpegdemo/widget.cpp b/ffmpegdemo/widget.cpp index de3dd74..b75255f 100644 --- a/ffmpegdemo/widget.cpp +++ b/ffmpegdemo/widget.cpp @@ -8,14 +8,14 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) QStringList urls; urls << "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov"; - urls << "rtsp://admin:Admin123456@192.168.1.64:554/Streaming/Channels/102?transportmode=unicast&profile=Profile_2"; + urls << "rtsp://admin:Admin123456@192.168.0.64:554/Streaming/Channels/102?transportmode=unicast&profile=Profile_2"; urls << "rtsp://192.168.1.108:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif"; urls << "rtsp://192.168.1.15:554/media/video1"; urls << "rtsp://192.168.1.15:554/media/video2"; urls << "rtsp://192.168.1.247:554/av0_0"; urls << "rtsp://192.168.1.247:554/av0_1"; ui->cboxUrl->addItems(urls); - ui->cboxUrl->setCurrentIndex(5); + ui->cboxUrl->setCurrentIndex(1); } Widget::~Widget() diff --git a/imageswitch/frmimageswitch.cpp b/imageswitch/frmimageswitch.cpp index 7444d7a..b0548cd 100644 --- a/imageswitch/frmimageswitch.cpp +++ b/imageswitch/frmimageswitch.cpp @@ -19,9 +19,9 @@ void frmImageSwitch::initForm() ui->imageSwitch1->setChecked(true); ui->imageSwitch2->setChecked(true); ui->imageSwitch3->setChecked(true); - ui->imageSwitch1->setFixedSize(87, 28); - ui->imageSwitch2->setFixedSize(87, 28); - ui->imageSwitch3->setFixedSize(87, 28); + ui->imageSwitch1->setFixedSize(87, 30); + ui->imageSwitch2->setFixedSize(87, 30); + ui->imageSwitch3->setFixedSize(87, 30); ui->imageSwitch1->setButtonStyle(ImageSwitch::ButtonStyle_1); ui->imageSwitch2->setButtonStyle(ImageSwitch::ButtonStyle_2); ui->imageSwitch3->setButtonStyle(ImageSwitch::ButtonStyle_3); diff --git a/imageswitch/frmimageswitch.ui b/imageswitch/frmimageswitch.ui index 6e1a376..b0d052b 100644 --- a/imageswitch/frmimageswitch.ui +++ b/imageswitch/frmimageswitch.ui @@ -6,8 +6,8 @@ 0 0 - 500 - 300 + 800 + 600 diff --git a/imageswitch/main.cpp b/imageswitch/main.cpp index 247fe10..389461c 100644 --- a/imageswitch/main.cpp +++ b/imageswitch/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); 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 QTextCodec *codec = QTextCodec::codecForName("gbk"); #else diff --git a/lightbutton/frmlightbutton.h b/lightbutton/frmlightbutton.h index 989832a..29bf9f5 100644 --- a/lightbutton/frmlightbutton.h +++ b/lightbutton/frmlightbutton.h @@ -3,26 +3,25 @@ #include -namespace Ui -{ +namespace Ui { class frmLightButton; } class frmLightButton : public QWidget { - Q_OBJECT + Q_OBJECT public: - explicit frmLightButton(QWidget *parent = 0); - ~frmLightButton(); + explicit frmLightButton(QWidget *parent = 0); + ~frmLightButton(); private: - Ui::frmLightButton *ui; - int type; + Ui::frmLightButton *ui; + int type; private slots: - void initForm(); - void updateValue(); + void initForm(); + void updateValue(); }; #endif // FRMLIGHTBUTTON_H diff --git a/lightbutton/frmlightbutton.ui b/lightbutton/frmlightbutton.ui index 899d405..5d92613 100644 --- a/lightbutton/frmlightbutton.ui +++ b/lightbutton/frmlightbutton.ui @@ -6,8 +6,8 @@ 0 0 - 500 - 300 + 800 + 600 diff --git a/lightbutton/main.cpp b/lightbutton/main.cpp index dadad0b..85f0cf8 100644 --- a/lightbutton/main.cpp +++ b/lightbutton/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); 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 QTextCodec *codec = QTextCodec::codecForName("gbk"); #else diff --git a/lunarcalendarwidget/image/fontawesome-webfont.ttf b/lunarcalendarwidget/font/fontawesome-webfont.ttf similarity index 100% rename from lunarcalendarwidget/image/fontawesome-webfont.ttf rename to lunarcalendarwidget/font/fontawesome-webfont.ttf diff --git a/lunarcalendarwidget/frmlunarcalendarwidget.ui b/lunarcalendarwidget/frmlunarcalendarwidget.ui index 2097f87..c184d9d 100644 --- a/lunarcalendarwidget/frmlunarcalendarwidget.ui +++ b/lunarcalendarwidget/frmlunarcalendarwidget.ui @@ -6,8 +6,8 @@ 0 0 - 600 - 500 + 800 + 600 diff --git a/lunarcalendarwidget/lunarcalendarwidget.cpp b/lunarcalendarwidget/lunarcalendarwidget.cpp index 7d38de2..51c0110 100644 --- a/lunarcalendarwidget/lunarcalendarwidget.cpp +++ b/lunarcalendarwidget/lunarcalendarwidget.cpp @@ -15,7 +15,7 @@ LunarCalendarWidget::LunarCalendarWidget(QWidget *parent) : QWidget(parent) //判断图形字体是否存在,不存在则加入 QFontDatabase fontDb; if (!fontDb.families().contains("FontAwesome")) { - int fontId = fontDb.addApplicationFont(":/image/fontawesome-webfont.ttf"); + int fontId = fontDb.addApplicationFont(":/font/fontawesome-webfont.ttf"); QStringList fontName = fontDb.applicationFontFamilies(fontId); if (fontName.count() == 0) { qDebug() << "load fontawesome-webfont.ttf error"; diff --git a/lunarcalendarwidget/main.cpp b/lunarcalendarwidget/main.cpp index 080284e..1101f5e 100644 --- a/lunarcalendarwidget/main.cpp +++ b/lunarcalendarwidget/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); 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 QTextCodec *codec = QTextCodec::codecForName("gbk"); #else @@ -24,7 +24,7 @@ int main(int argc, char *argv[]) #endif frmLunarCalendarWidget w; - w.setWindowTitle("自定义农历控件"); + w.setWindowTitle("农历控件"); w.show(); return a.exec(); diff --git a/lunarcalendarwidget/main.qrc b/lunarcalendarwidget/main.qrc index ba3f349..afb23ea 100644 --- a/lunarcalendarwidget/main.qrc +++ b/lunarcalendarwidget/main.qrc @@ -1,6 +1,6 @@ image/bg_calendar.png - image/fontawesome-webfont.ttf + font/fontawesome-webfont.ttf diff --git a/navbutton/image/fontawesome-webfont.ttf b/navbutton/font/fontawesome-webfont.ttf similarity index 100% rename from navbutton/image/fontawesome-webfont.ttf rename to navbutton/font/fontawesome-webfont.ttf diff --git a/navbutton/frmnavbutton.cpp b/navbutton/frmnavbutton.cpp index 3dba9a6..47fad9c 100644 --- a/navbutton/frmnavbutton.cpp +++ b/navbutton/frmnavbutton.cpp @@ -181,14 +181,14 @@ void frmNavButton::initBtn4() NavButton *btn = btns4.at(i); btn->setLineSpace(10); btn->setLineWidth(10); - btn->setPaddingRight(25); + btn->setPaddingRight(35); btn->setShowTriangle(true); btn->setTextAlign(NavButton::TextAlign_Right); btn->setTrianglePosition(NavButton::TrianglePosition_Left); btn->setLinePosition(NavButton::LinePosition_Right); btn->setShowIcon(true); - btn->setIconSpace(10); + btn->setIconSpace(20); btn->setIconSize(QSize(15, 15)); btn->setIconNormal(iconNormal); btn->setIconHover(iconHover); diff --git a/navbutton/frmnavbutton.ui b/navbutton/frmnavbutton.ui index 569c593..4d683ff 100644 --- a/navbutton/frmnavbutton.ui +++ b/navbutton/frmnavbutton.ui @@ -18,7 +18,7 @@ 11 245 - 611 + 511 40 diff --git a/navbutton/iconhelper.cpp b/navbutton/iconhelper.cpp index 2043d36..26c85e2 100644 --- a/navbutton/iconhelper.cpp +++ b/navbutton/iconhelper.cpp @@ -11,13 +11,13 @@ void IconHelper::initFont() if (!isInit) { isInit = true; if (iconFontAliBaBa == 0) { - iconFontAliBaBa = new IconHelper(":/image/iconfont.ttf", "iconfont"); + iconFontAliBaBa = new IconHelper(":/font/iconfont.ttf", "iconfont"); } if (iconFontAwesome == 0) { - iconFontAwesome = new IconHelper(":/image/fontawesome-webfont.ttf", "FontAwesome"); + iconFontAwesome = new IconHelper(":/font/fontawesome-webfont.ttf", "FontAwesome"); } if (iconFontWeather == 0) { - iconFontWeather = new IconHelper(":/image/pe-icon-set-weather.ttf", "pe-icon-set-weather"); + iconFontWeather = new IconHelper(":/font/pe-icon-set-weather.ttf", "pe-icon-set-weather"); } } } diff --git a/navbutton/main.qrc b/navbutton/main.qrc index 827aaf3..de5ece3 100644 --- a/navbutton/main.qrc +++ b/navbutton/main.qrc @@ -1,5 +1,5 @@ - image/fontawesome-webfont.ttf + font/fontawesome-webfont.ttf diff --git a/netserver/form/frmmain.ui b/netserver/form/frmmain.ui index 123d652..83504ed 100644 --- a/netserver/form/frmmain.ui +++ b/netserver/form/frmmain.ui @@ -29,7 +29,7 @@ - 0 + 1 @@ -63,7 +63,7 @@ 16777215 - + 0 @@ -76,27 +76,35 @@ 0 - - + + + + + + 监听端口 + + + + + + + - - - - - - - 清空 - - - - + 监听 - + + + + 清空 + + + + @@ -118,6 +126,9 @@ + + + @@ -155,7 +166,7 @@ 16777215 - + 0 @@ -168,27 +179,35 @@ 0 - + + + + + + 监听端口 + + + + + + + + + 监听 - - - - + 清空 - - - - + @@ -210,6 +229,9 @@ + + + diff --git a/netserver/netserver.pro b/netserver/netserver.pro index 2004c64..31aec32 100644 --- a/netserver/netserver.pro +++ b/netserver/netserver.pro @@ -5,11 +5,11 @@ greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat TARGET = netserver TEMPLATE = app DESTDIR = $$PWD/../bin -RC_FILE = other/main.rc +RC_FILE = qrc/main.rc SOURCES += main.cpp HEADERS += head.h -RESOURCES += other/main.qrc +RESOURCES += qrc/main.qrc INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD/api diff --git a/netserver/other/main.ico b/netserver/qrc/main.ico similarity index 100% rename from netserver/other/main.ico rename to netserver/qrc/main.ico diff --git a/netserver/other/main.qrc b/netserver/qrc/main.qrc similarity index 100% rename from netserver/other/main.qrc rename to netserver/qrc/main.qrc diff --git a/netserver/other/main.rc b/netserver/qrc/main.rc similarity index 100% rename from netserver/other/main.rc rename to netserver/qrc/main.rc diff --git a/nettool/nettool.pro b/nettool/nettool.pro index ee81df6..6713e7a 100644 --- a/nettool/nettool.pro +++ b/nettool/nettool.pro @@ -11,17 +11,17 @@ greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat TARGET = nettool TEMPLATE = app -RC_FILE = other/main.rc +RC_FILE = qrc/main.rc wasm { DEFINES += emsdk -RESOURCES += other/font.qrc +RESOURCES += qrc/font.qrc } else { DESTDIR = $$PWD/../bin } SOURCES += main.cpp HEADERS += head.h -RESOURCES += other/main.qrc +RESOURCES += qrc/main.qrc INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD/api diff --git a/nettool/other/DroidSansFallback.ttf b/nettool/qrc/DroidSansFallback.ttf similarity index 100% rename from nettool/other/DroidSansFallback.ttf rename to nettool/qrc/DroidSansFallback.ttf diff --git a/nettool/other/font.qrc b/nettool/qrc/font.qrc similarity index 100% rename from nettool/other/font.qrc rename to nettool/qrc/font.qrc diff --git a/nettool/other/main.ico b/nettool/qrc/main.ico similarity index 100% rename from nettool/other/main.ico rename to nettool/qrc/main.ico diff --git a/nettool/other/main.qrc b/nettool/qrc/main.qrc similarity index 100% rename from nettool/other/main.qrc rename to nettool/qrc/main.qrc diff --git a/nettool/other/main.rc b/nettool/qrc/main.rc similarity index 100% rename from nettool/other/main.rc rename to nettool/qrc/main.rc diff --git a/styledemo/frmmain.cpp b/styledemo/frmmain.cpp index b6511b1..7d6a2d4 100644 --- a/styledemo/frmmain.cpp +++ b/styledemo/frmmain.cpp @@ -183,11 +183,11 @@ void frmMain::initTranslator() { //加载鼠标右键菜单翻译文件 QTranslator *translator1 = new QTranslator(qApp); - translator1->load(":/image/qt_zh_CN.qm"); + translator1->load(":/qm/qt_zh_CN.qm"); qApp->installTranslator(translator1); //加载富文本框鼠标右键菜单翻译文件 QTranslator *translator2 = new QTranslator(qApp); - translator2->load(":/image/widgets.qm"); + translator2->load(":/qm/widgets.qm"); qApp->installTranslator(translator2); } diff --git a/styledemo/qrc/font.qrc b/styledemo/qrc/font.qrc new file mode 100644 index 0000000..de5ece3 --- /dev/null +++ b/styledemo/qrc/font.qrc @@ -0,0 +1,5 @@ + + + font/fontawesome-webfont.ttf + + diff --git a/styledemo/other/image/Font Awesome Cheatsheet.png b/styledemo/qrc/font/Font Awesome Cheatsheet.png similarity index 100% rename from styledemo/other/image/Font Awesome Cheatsheet.png rename to styledemo/qrc/font/Font Awesome Cheatsheet.png diff --git a/styledemo/other/image/fontawesome-webfont.ttf b/styledemo/qrc/font/fontawesome-webfont.ttf similarity index 100% rename from styledemo/other/image/fontawesome-webfont.ttf rename to styledemo/qrc/font/fontawesome-webfont.ttf diff --git a/styledemo/other/image/btn_close.png b/styledemo/qrc/image/btn_close.png similarity index 100% rename from styledemo/other/image/btn_close.png rename to styledemo/qrc/image/btn_close.png diff --git a/styledemo/other/image/btn_ok.png b/styledemo/qrc/image/btn_ok.png similarity index 100% rename from styledemo/other/image/btn_ok.png rename to styledemo/qrc/image/btn_ok.png diff --git a/styledemo/other/image/msg_error.png b/styledemo/qrc/image/msg_error.png similarity index 100% rename from styledemo/other/image/msg_error.png rename to styledemo/qrc/image/msg_error.png diff --git a/styledemo/other/image/msg_info.png b/styledemo/qrc/image/msg_info.png similarity index 100% rename from styledemo/other/image/msg_info.png rename to styledemo/qrc/image/msg_info.png diff --git a/styledemo/other/image/msg_question.png b/styledemo/qrc/image/msg_question.png similarity index 100% rename from styledemo/other/image/msg_question.png rename to styledemo/qrc/image/msg_question.png diff --git a/styledemo/other/main.qrc b/styledemo/qrc/main.qrc similarity index 67% rename from styledemo/other/main.qrc rename to styledemo/qrc/main.qrc index 979bdfa..1451ee0 100644 --- a/styledemo/other/main.qrc +++ b/styledemo/qrc/main.qrc @@ -2,11 +2,8 @@ image/btn_close.png image/btn_ok.png - image/fontawesome-webfont.ttf image/msg_error.png image/msg_info.png image/msg_question.png - image/qt_zh_CN.qm - image/widgets.qm diff --git a/styledemo/qrc/qm.qrc b/styledemo/qrc/qm.qrc new file mode 100644 index 0000000..d14db1a --- /dev/null +++ b/styledemo/qrc/qm.qrc @@ -0,0 +1,6 @@ + + + qm/qt_zh_CN.qm + qm/widgets.qm + + diff --git a/styledemo/other/image/qt_zh_CN.qm b/styledemo/qrc/qm/qt_zh_CN.qm similarity index 100% rename from styledemo/other/image/qt_zh_CN.qm rename to styledemo/qrc/qm/qt_zh_CN.qm diff --git a/styledemo/other/image/widgets.qm b/styledemo/qrc/qm/widgets.qm similarity index 100% rename from styledemo/other/image/widgets.qm rename to styledemo/qrc/qm/widgets.qm diff --git a/styledemo/other/qss.qrc b/styledemo/qrc/qss.qrc similarity index 100% rename from styledemo/other/qss.qrc rename to styledemo/qrc/qss.qrc diff --git a/styledemo/other/qss/flatwhite.css b/styledemo/qrc/qss/flatwhite.css similarity index 98% rename from styledemo/other/qss/flatwhite.css rename to styledemo/qrc/qss/flatwhite.css index 77e0bb7..f164d06 100644 --- a/styledemo/other/qss/flatwhite.css +++ b/styledemo/qrc/qss/flatwhite.css @@ -68,6 +68,10 @@ border:1px solid #575959; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F6F6F6,stop:1 #F6F6F6); } +QLineEdit:read-only{ +background-color:#E4E4E4; +} + QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{ border:1px solid #B6B6B6; border-radius:3px; @@ -643,7 +647,7 @@ QTabWidget::pane:bottom{bottom:-1px;} QTabWidget::pane:left{right:-1px;} QTabWidget::pane:right{left:-1px;} -QDialog,QDial{ +QDialog,QDial,#QUIWidgetMain{ background-color:#FFFFFF; color:#57595B; } @@ -660,7 +664,7 @@ QToolBar>*,QStatusBar>*{ margin:2px; } -*:disabled,QMenu::item:disabled{ +*:disabled,QMenu::item:disabled,QTabBar:tab:disabled,QHeaderView::section:disabled{ background:#FFFFFF; border-color:#E4E4E4; color:#B6B6B6; diff --git a/styledemo/other/qss/flatwhite/add_bottom.png b/styledemo/qrc/qss/flatwhite/add_bottom.png similarity index 100% rename from styledemo/other/qss/flatwhite/add_bottom.png rename to styledemo/qrc/qss/flatwhite/add_bottom.png diff --git a/styledemo/other/qss/flatwhite/add_left.png b/styledemo/qrc/qss/flatwhite/add_left.png similarity index 100% rename from styledemo/other/qss/flatwhite/add_left.png rename to styledemo/qrc/qss/flatwhite/add_left.png diff --git a/styledemo/other/qss/flatwhite/add_right.png b/styledemo/qrc/qss/flatwhite/add_right.png similarity index 100% rename from styledemo/other/qss/flatwhite/add_right.png rename to styledemo/qrc/qss/flatwhite/add_right.png diff --git a/styledemo/other/qss/flatwhite/add_top.png b/styledemo/qrc/qss/flatwhite/add_top.png similarity index 100% rename from styledemo/other/qss/flatwhite/add_top.png rename to styledemo/qrc/qss/flatwhite/add_top.png diff --git a/styledemo/other/qss/flatwhite/arrow_bottom.png b/styledemo/qrc/qss/flatwhite/arrow_bottom.png similarity index 100% rename from styledemo/other/qss/flatwhite/arrow_bottom.png rename to styledemo/qrc/qss/flatwhite/arrow_bottom.png diff --git a/styledemo/other/qss/flatwhite/arrow_left.png b/styledemo/qrc/qss/flatwhite/arrow_left.png similarity index 100% rename from styledemo/other/qss/flatwhite/arrow_left.png rename to styledemo/qrc/qss/flatwhite/arrow_left.png diff --git a/styledemo/other/qss/flatwhite/arrow_right.png b/styledemo/qrc/qss/flatwhite/arrow_right.png similarity index 100% rename from styledemo/other/qss/flatwhite/arrow_right.png rename to styledemo/qrc/qss/flatwhite/arrow_right.png diff --git a/styledemo/other/qss/flatwhite/arrow_top.png b/styledemo/qrc/qss/flatwhite/arrow_top.png similarity index 100% rename from styledemo/other/qss/flatwhite/arrow_top.png rename to styledemo/qrc/qss/flatwhite/arrow_top.png diff --git a/styledemo/other/qss/flatwhite/branch_close.png b/styledemo/qrc/qss/flatwhite/branch_close.png similarity index 100% rename from styledemo/other/qss/flatwhite/branch_close.png rename to styledemo/qrc/qss/flatwhite/branch_close.png diff --git a/styledemo/other/qss/flatwhite/branch_open.png b/styledemo/qrc/qss/flatwhite/branch_open.png similarity index 100% rename from styledemo/other/qss/flatwhite/branch_open.png rename to styledemo/qrc/qss/flatwhite/branch_open.png diff --git a/styledemo/other/qss/flatwhite/calendar_nextmonth.png b/styledemo/qrc/qss/flatwhite/calendar_nextmonth.png similarity index 100% rename from styledemo/other/qss/flatwhite/calendar_nextmonth.png rename to styledemo/qrc/qss/flatwhite/calendar_nextmonth.png diff --git a/styledemo/other/qss/flatwhite/calendar_prevmonth.png b/styledemo/qrc/qss/flatwhite/calendar_prevmonth.png similarity index 100% rename from styledemo/other/qss/flatwhite/calendar_prevmonth.png rename to styledemo/qrc/qss/flatwhite/calendar_prevmonth.png diff --git a/styledemo/other/qss/flatwhite/checkbox_checked.png b/styledemo/qrc/qss/flatwhite/checkbox_checked.png similarity index 100% rename from styledemo/other/qss/flatwhite/checkbox_checked.png rename to styledemo/qrc/qss/flatwhite/checkbox_checked.png diff --git a/styledemo/other/qss/flatwhite/checkbox_checked_disable.png b/styledemo/qrc/qss/flatwhite/checkbox_checked_disable.png similarity index 100% rename from styledemo/other/qss/flatwhite/checkbox_checked_disable.png rename to styledemo/qrc/qss/flatwhite/checkbox_checked_disable.png diff --git a/styledemo/other/qss/flatwhite/checkbox_parcial.png b/styledemo/qrc/qss/flatwhite/checkbox_parcial.png similarity index 100% rename from styledemo/other/qss/flatwhite/checkbox_parcial.png rename to styledemo/qrc/qss/flatwhite/checkbox_parcial.png diff --git a/styledemo/other/qss/flatwhite/checkbox_parcial_disable.png b/styledemo/qrc/qss/flatwhite/checkbox_parcial_disable.png similarity index 100% rename from styledemo/other/qss/flatwhite/checkbox_parcial_disable.png rename to styledemo/qrc/qss/flatwhite/checkbox_parcial_disable.png diff --git a/styledemo/other/qss/flatwhite/checkbox_unchecked.png b/styledemo/qrc/qss/flatwhite/checkbox_unchecked.png similarity index 100% rename from styledemo/other/qss/flatwhite/checkbox_unchecked.png rename to styledemo/qrc/qss/flatwhite/checkbox_unchecked.png diff --git a/styledemo/other/qss/flatwhite/checkbox_unchecked_disable.png b/styledemo/qrc/qss/flatwhite/checkbox_unchecked_disable.png similarity index 100% rename from styledemo/other/qss/flatwhite/checkbox_unchecked_disable.png rename to styledemo/qrc/qss/flatwhite/checkbox_unchecked_disable.png diff --git a/styledemo/other/qss/flatwhite/menu_checked.png b/styledemo/qrc/qss/flatwhite/menu_checked.png similarity index 100% rename from styledemo/other/qss/flatwhite/menu_checked.png rename to styledemo/qrc/qss/flatwhite/menu_checked.png diff --git a/styledemo/other/qss/flatwhite/radiobutton_checked.png b/styledemo/qrc/qss/flatwhite/radiobutton_checked.png similarity index 100% rename from styledemo/other/qss/flatwhite/radiobutton_checked.png rename to styledemo/qrc/qss/flatwhite/radiobutton_checked.png diff --git a/styledemo/other/qss/flatwhite/radiobutton_checked_disable.png b/styledemo/qrc/qss/flatwhite/radiobutton_checked_disable.png similarity index 100% rename from styledemo/other/qss/flatwhite/radiobutton_checked_disable.png rename to styledemo/qrc/qss/flatwhite/radiobutton_checked_disable.png diff --git a/styledemo/other/qss/flatwhite/radiobutton_unchecked.png b/styledemo/qrc/qss/flatwhite/radiobutton_unchecked.png similarity index 100% rename from styledemo/other/qss/flatwhite/radiobutton_unchecked.png rename to styledemo/qrc/qss/flatwhite/radiobutton_unchecked.png diff --git a/styledemo/other/qss/flatwhite/radiobutton_unchecked_disable.png b/styledemo/qrc/qss/flatwhite/radiobutton_unchecked_disable.png similarity index 100% rename from styledemo/other/qss/flatwhite/radiobutton_unchecked_disable.png rename to styledemo/qrc/qss/flatwhite/radiobutton_unchecked_disable.png diff --git a/styledemo/other/qss/lightblue.css b/styledemo/qrc/qss/lightblue.css similarity index 98% rename from styledemo/other/qss/lightblue.css rename to styledemo/qrc/qss/lightblue.css index 277a1b9..e41b749 100644 --- a/styledemo/other/qss/lightblue.css +++ b/styledemo/qrc/qss/lightblue.css @@ -68,6 +68,10 @@ border:1px solid #386488; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); } +QLineEdit:read-only{ +background-color:#DEF0FE; +} + QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{ border:1px solid #C0DCF2; border-radius:3px; @@ -643,7 +647,7 @@ QTabWidget::pane:bottom{bottom:-1px;} QTabWidget::pane:left{right:-1px;} QTabWidget::pane:right{left:-1px;} -QDialog,QDial{ +QDialog,QDial,#QUIWidgetMain{ background-color:#EAF7FF; color:#386487; } @@ -660,7 +664,7 @@ QToolBar>*,QStatusBar>*{ margin:2px; } -*:disabled,QMenu::item:disabled{ +*:disabled,QMenu::item:disabled,QTabBar:tab:disabled,QHeaderView::section:disabled{ background:#EAF7FF; border-color:#DEF0FE; color:#C0DCF2; diff --git a/styledemo/other/qss/lightblue/add_bottom.png b/styledemo/qrc/qss/lightblue/add_bottom.png similarity index 100% rename from styledemo/other/qss/lightblue/add_bottom.png rename to styledemo/qrc/qss/lightblue/add_bottom.png diff --git a/styledemo/other/qss/lightblue/add_left.png b/styledemo/qrc/qss/lightblue/add_left.png similarity index 100% rename from styledemo/other/qss/lightblue/add_left.png rename to styledemo/qrc/qss/lightblue/add_left.png diff --git a/styledemo/other/qss/lightblue/add_right.png b/styledemo/qrc/qss/lightblue/add_right.png similarity index 100% rename from styledemo/other/qss/lightblue/add_right.png rename to styledemo/qrc/qss/lightblue/add_right.png diff --git a/styledemo/other/qss/lightblue/add_top.png b/styledemo/qrc/qss/lightblue/add_top.png similarity index 100% rename from styledemo/other/qss/lightblue/add_top.png rename to styledemo/qrc/qss/lightblue/add_top.png diff --git a/styledemo/other/qss/lightblue/arrow_bottom.png b/styledemo/qrc/qss/lightblue/arrow_bottom.png similarity index 100% rename from styledemo/other/qss/lightblue/arrow_bottom.png rename to styledemo/qrc/qss/lightblue/arrow_bottom.png diff --git a/styledemo/other/qss/lightblue/arrow_left.png b/styledemo/qrc/qss/lightblue/arrow_left.png similarity index 100% rename from styledemo/other/qss/lightblue/arrow_left.png rename to styledemo/qrc/qss/lightblue/arrow_left.png diff --git a/styledemo/other/qss/lightblue/arrow_right.png b/styledemo/qrc/qss/lightblue/arrow_right.png similarity index 100% rename from styledemo/other/qss/lightblue/arrow_right.png rename to styledemo/qrc/qss/lightblue/arrow_right.png diff --git a/styledemo/other/qss/lightblue/arrow_top.png b/styledemo/qrc/qss/lightblue/arrow_top.png similarity index 100% rename from styledemo/other/qss/lightblue/arrow_top.png rename to styledemo/qrc/qss/lightblue/arrow_top.png diff --git a/styledemo/other/qss/lightblue/branch_close.png b/styledemo/qrc/qss/lightblue/branch_close.png similarity index 100% rename from styledemo/other/qss/lightblue/branch_close.png rename to styledemo/qrc/qss/lightblue/branch_close.png diff --git a/styledemo/other/qss/lightblue/branch_open.png b/styledemo/qrc/qss/lightblue/branch_open.png similarity index 100% rename from styledemo/other/qss/lightblue/branch_open.png rename to styledemo/qrc/qss/lightblue/branch_open.png diff --git a/styledemo/other/qss/lightblue/calendar_nextmonth.png b/styledemo/qrc/qss/lightblue/calendar_nextmonth.png similarity index 100% rename from styledemo/other/qss/lightblue/calendar_nextmonth.png rename to styledemo/qrc/qss/lightblue/calendar_nextmonth.png diff --git a/styledemo/other/qss/lightblue/calendar_prevmonth.png b/styledemo/qrc/qss/lightblue/calendar_prevmonth.png similarity index 100% rename from styledemo/other/qss/lightblue/calendar_prevmonth.png rename to styledemo/qrc/qss/lightblue/calendar_prevmonth.png diff --git a/styledemo/other/qss/lightblue/checkbox_checked.png b/styledemo/qrc/qss/lightblue/checkbox_checked.png similarity index 100% rename from styledemo/other/qss/lightblue/checkbox_checked.png rename to styledemo/qrc/qss/lightblue/checkbox_checked.png diff --git a/styledemo/other/qss/lightblue/checkbox_checked_disable.png b/styledemo/qrc/qss/lightblue/checkbox_checked_disable.png similarity index 100% rename from styledemo/other/qss/lightblue/checkbox_checked_disable.png rename to styledemo/qrc/qss/lightblue/checkbox_checked_disable.png diff --git a/styledemo/other/qss/lightblue/checkbox_parcial.png b/styledemo/qrc/qss/lightblue/checkbox_parcial.png similarity index 100% rename from styledemo/other/qss/lightblue/checkbox_parcial.png rename to styledemo/qrc/qss/lightblue/checkbox_parcial.png diff --git a/styledemo/other/qss/lightblue/checkbox_parcial_disable.png b/styledemo/qrc/qss/lightblue/checkbox_parcial_disable.png similarity index 100% rename from styledemo/other/qss/lightblue/checkbox_parcial_disable.png rename to styledemo/qrc/qss/lightblue/checkbox_parcial_disable.png diff --git a/styledemo/other/qss/lightblue/checkbox_unchecked.png b/styledemo/qrc/qss/lightblue/checkbox_unchecked.png similarity index 100% rename from styledemo/other/qss/lightblue/checkbox_unchecked.png rename to styledemo/qrc/qss/lightblue/checkbox_unchecked.png diff --git a/styledemo/other/qss/lightblue/checkbox_unchecked_disable.png b/styledemo/qrc/qss/lightblue/checkbox_unchecked_disable.png similarity index 100% rename from styledemo/other/qss/lightblue/checkbox_unchecked_disable.png rename to styledemo/qrc/qss/lightblue/checkbox_unchecked_disable.png diff --git a/styledemo/other/qss/lightblue/menu_checked.png b/styledemo/qrc/qss/lightblue/menu_checked.png similarity index 100% rename from styledemo/other/qss/lightblue/menu_checked.png rename to styledemo/qrc/qss/lightblue/menu_checked.png diff --git a/styledemo/other/qss/lightblue/radiobutton_checked.png b/styledemo/qrc/qss/lightblue/radiobutton_checked.png similarity index 100% rename from styledemo/other/qss/lightblue/radiobutton_checked.png rename to styledemo/qrc/qss/lightblue/radiobutton_checked.png diff --git a/styledemo/other/qss/lightblue/radiobutton_checked_disable.png b/styledemo/qrc/qss/lightblue/radiobutton_checked_disable.png similarity index 100% rename from styledemo/other/qss/lightblue/radiobutton_checked_disable.png rename to styledemo/qrc/qss/lightblue/radiobutton_checked_disable.png diff --git a/styledemo/other/qss/lightblue/radiobutton_unchecked.png b/styledemo/qrc/qss/lightblue/radiobutton_unchecked.png similarity index 100% rename from styledemo/other/qss/lightblue/radiobutton_unchecked.png rename to styledemo/qrc/qss/lightblue/radiobutton_unchecked.png diff --git a/styledemo/other/qss/lightblue/radiobutton_unchecked_disable.png b/styledemo/qrc/qss/lightblue/radiobutton_unchecked_disable.png similarity index 100% rename from styledemo/other/qss/lightblue/radiobutton_unchecked_disable.png rename to styledemo/qrc/qss/lightblue/radiobutton_unchecked_disable.png diff --git a/styledemo/other/qss/psblack.css b/styledemo/qrc/qss/psblack.css similarity index 98% rename from styledemo/other/qss/psblack.css rename to styledemo/qrc/qss/psblack.css index ab00050..4de967a 100644 --- a/styledemo/other/qss/psblack.css +++ b/styledemo/qrc/qss/psblack.css @@ -68,6 +68,10 @@ border:1px solid #AAAAAA; background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252); } +QLineEdit:read-only{ +background-color:#484848; +} + QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit{ border:1px solid #242424; border-radius:3px; @@ -643,7 +647,7 @@ QTabWidget::pane:bottom{bottom:-1px;} QTabWidget::pane:left{right:-1px;} QTabWidget::pane:right{left:-1px;} -QDialog,QDial{ +QDialog,QDial,#QUIWidgetMain{ background-color:#444444; color:#DCDCDC; } @@ -660,7 +664,7 @@ QToolBar>*,QStatusBar>*{ margin:2px; } -*:disabled,QMenu::item:disabled{ +*:disabled,QMenu::item:disabled,QTabBar:tab:disabled,QHeaderView::section:disabled{ background:#444444; border-color:#484848; color:#242424; diff --git a/styledemo/other/qss/psblack/add_bottom.png b/styledemo/qrc/qss/psblack/add_bottom.png similarity index 100% rename from styledemo/other/qss/psblack/add_bottom.png rename to styledemo/qrc/qss/psblack/add_bottom.png diff --git a/styledemo/other/qss/psblack/add_left.png b/styledemo/qrc/qss/psblack/add_left.png similarity index 100% rename from styledemo/other/qss/psblack/add_left.png rename to styledemo/qrc/qss/psblack/add_left.png diff --git a/styledemo/other/qss/psblack/add_right.png b/styledemo/qrc/qss/psblack/add_right.png similarity index 100% rename from styledemo/other/qss/psblack/add_right.png rename to styledemo/qrc/qss/psblack/add_right.png diff --git a/styledemo/other/qss/psblack/add_top.png b/styledemo/qrc/qss/psblack/add_top.png similarity index 100% rename from styledemo/other/qss/psblack/add_top.png rename to styledemo/qrc/qss/psblack/add_top.png diff --git a/styledemo/other/qss/psblack/arrow_bottom.png b/styledemo/qrc/qss/psblack/arrow_bottom.png similarity index 100% rename from styledemo/other/qss/psblack/arrow_bottom.png rename to styledemo/qrc/qss/psblack/arrow_bottom.png diff --git a/styledemo/other/qss/psblack/arrow_left.png b/styledemo/qrc/qss/psblack/arrow_left.png similarity index 100% rename from styledemo/other/qss/psblack/arrow_left.png rename to styledemo/qrc/qss/psblack/arrow_left.png diff --git a/styledemo/other/qss/psblack/arrow_right.png b/styledemo/qrc/qss/psblack/arrow_right.png similarity index 100% rename from styledemo/other/qss/psblack/arrow_right.png rename to styledemo/qrc/qss/psblack/arrow_right.png diff --git a/styledemo/other/qss/psblack/arrow_top.png b/styledemo/qrc/qss/psblack/arrow_top.png similarity index 100% rename from styledemo/other/qss/psblack/arrow_top.png rename to styledemo/qrc/qss/psblack/arrow_top.png diff --git a/styledemo/other/qss/psblack/branch_close.png b/styledemo/qrc/qss/psblack/branch_close.png similarity index 100% rename from styledemo/other/qss/psblack/branch_close.png rename to styledemo/qrc/qss/psblack/branch_close.png diff --git a/styledemo/other/qss/psblack/branch_open.png b/styledemo/qrc/qss/psblack/branch_open.png similarity index 100% rename from styledemo/other/qss/psblack/branch_open.png rename to styledemo/qrc/qss/psblack/branch_open.png diff --git a/styledemo/other/qss/psblack/calendar_nextmonth.png b/styledemo/qrc/qss/psblack/calendar_nextmonth.png similarity index 100% rename from styledemo/other/qss/psblack/calendar_nextmonth.png rename to styledemo/qrc/qss/psblack/calendar_nextmonth.png diff --git a/styledemo/other/qss/psblack/calendar_prevmonth.png b/styledemo/qrc/qss/psblack/calendar_prevmonth.png similarity index 100% rename from styledemo/other/qss/psblack/calendar_prevmonth.png rename to styledemo/qrc/qss/psblack/calendar_prevmonth.png diff --git a/styledemo/other/qss/psblack/checkbox_checked.png b/styledemo/qrc/qss/psblack/checkbox_checked.png similarity index 100% rename from styledemo/other/qss/psblack/checkbox_checked.png rename to styledemo/qrc/qss/psblack/checkbox_checked.png diff --git a/styledemo/other/qss/psblack/checkbox_checked_disable.png b/styledemo/qrc/qss/psblack/checkbox_checked_disable.png similarity index 100% rename from styledemo/other/qss/psblack/checkbox_checked_disable.png rename to styledemo/qrc/qss/psblack/checkbox_checked_disable.png diff --git a/styledemo/other/qss/psblack/checkbox_parcial.png b/styledemo/qrc/qss/psblack/checkbox_parcial.png similarity index 100% rename from styledemo/other/qss/psblack/checkbox_parcial.png rename to styledemo/qrc/qss/psblack/checkbox_parcial.png diff --git a/styledemo/other/qss/psblack/checkbox_parcial_disable.png b/styledemo/qrc/qss/psblack/checkbox_parcial_disable.png similarity index 100% rename from styledemo/other/qss/psblack/checkbox_parcial_disable.png rename to styledemo/qrc/qss/psblack/checkbox_parcial_disable.png diff --git a/styledemo/other/qss/psblack/checkbox_unchecked.png b/styledemo/qrc/qss/psblack/checkbox_unchecked.png similarity index 100% rename from styledemo/other/qss/psblack/checkbox_unchecked.png rename to styledemo/qrc/qss/psblack/checkbox_unchecked.png diff --git a/styledemo/other/qss/psblack/checkbox_unchecked_disable.png b/styledemo/qrc/qss/psblack/checkbox_unchecked_disable.png similarity index 100% rename from styledemo/other/qss/psblack/checkbox_unchecked_disable.png rename to styledemo/qrc/qss/psblack/checkbox_unchecked_disable.png diff --git a/styledemo/other/qss/psblack/menu_checked.png b/styledemo/qrc/qss/psblack/menu_checked.png similarity index 100% rename from styledemo/other/qss/psblack/menu_checked.png rename to styledemo/qrc/qss/psblack/menu_checked.png diff --git a/styledemo/other/qss/psblack/radiobutton_checked.png b/styledemo/qrc/qss/psblack/radiobutton_checked.png similarity index 100% rename from styledemo/other/qss/psblack/radiobutton_checked.png rename to styledemo/qrc/qss/psblack/radiobutton_checked.png diff --git a/styledemo/other/qss/psblack/radiobutton_checked_disable.png b/styledemo/qrc/qss/psblack/radiobutton_checked_disable.png similarity index 100% rename from styledemo/other/qss/psblack/radiobutton_checked_disable.png rename to styledemo/qrc/qss/psblack/radiobutton_checked_disable.png diff --git a/styledemo/other/qss/psblack/radiobutton_unchecked.png b/styledemo/qrc/qss/psblack/radiobutton_unchecked.png similarity index 100% rename from styledemo/other/qss/psblack/radiobutton_unchecked.png rename to styledemo/qrc/qss/psblack/radiobutton_unchecked.png diff --git a/styledemo/other/qss/psblack/radiobutton_unchecked_disable.png b/styledemo/qrc/qss/psblack/radiobutton_unchecked_disable.png similarity index 100% rename from styledemo/other/qss/psblack/radiobutton_unchecked_disable.png rename to styledemo/qrc/qss/psblack/radiobutton_unchecked_disable.png diff --git a/styledemo/styledemo.pro b/styledemo/styledemo.pro index 37421d6..54d2dee 100644 --- a/styledemo/styledemo.pro +++ b/styledemo/styledemo.pro @@ -11,7 +11,10 @@ HEADERS += head.h HEADERS += frmmain.h SOURCES += frmmain.cpp FORMS += frmmain.ui -RESOURCES += other/qss.qrc -RESOURCES += other/main.qrc + +RESOURCES += qrc/qss.qrc +RESOURCES += qrc/qm.qrc +RESOURCES += qrc/font.qrc +RESOURCES += qrc/main.qrc INCLUDEPATH += $$PWD diff --git a/videowidget/videowidget.cpp b/videowidget/videowidget.cpp index 283c694..b0642ac 100644 --- a/videowidget/videowidget.cpp +++ b/videowidget/videowidget.cpp @@ -107,7 +107,7 @@ void VideoWidget::initFlowPanel() QFont iconFont; QFontDatabase fontDb; if (!fontDb.families().contains("iconfont")) { - int fontId = fontDb.addApplicationFont(":/image/iconfont.ttf"); + int fontId = fontDb.addApplicationFont(":/font/iconfont.ttf"); QStringList fontName = fontDb.applicationFontFamilies(fontId); if (fontName.count() == 0) { qDebug() << "load iconfont.ttf error";