📄 qplastiquestyle.cpp
字号:
/******************************************************************************** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.**** This file is part of the QtGui module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file. Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://www.trolltech.com/products/qt/opensource.html**** If you are unsure which license is appropriate for your use, please** review the following information:** http://www.trolltech.com/products/qt/licensing.html or contact the** sales department at sales@trolltech.com.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#include "qplastiquestyle.h"#if !defined(QT_NO_STYLE_PLASTIQUE) || defined(QT_PLUGIN)static const bool UsePixmapCache = true;static const bool AnimateBusyProgressBar = true;static const bool AnimateProgressBar = false;// #define QPlastique_MaskButtonsstatic const int ProgressBarFps = 25;#include <qapplication.h>#include <qbitmap.h>#include <qabstractitemview.h>#include <qcheckbox.h>#include <qcombobox.h>#include <qdatetime.h>#include <qdebug.h>#include <qgroupbox.h>#include <qimage.h>#include <qlineedit.h>#include <qmainwindow.h>#include <qmenu.h>#include <qmenubar.h>#include <qpainter.h>#include <qpaintengine.h>#include <qpainterpath.h>#include <qpalette.h>#include <qpen.h>#include <qpixmap.h>#include <qpixmapcache.h>#include <qprogressbar.h>#include <qpushbutton.h>#include <qradiobutton.h>#include <qscrollbar.h>#include <qspinbox.h>#include <qsplitter.h>#include <qstyleoption.h>#include <qtextedit.h>#include <qtoolbar.h>#include <qtoolbox.h>#include <qtoolbutton.h>#include <qworkspace.h>#include <limits.h>// from windows stylestatic const int windowsItemFrame = 2; // menu item frame widthstatic const int windowsSepHeight = 2; // separator item heightstatic const int windowsItemHMargin = 3; // menu item hor text marginstatic const int windowsItemVMargin = 2; // menu item ver text marginstatic const int windowsArrowHMargin = 6; // arrow horizontal marginstatic const int windowsTabSpacing = 12; // space between text and tabstatic const int windowsCheckMarkHMargin = 2; // horiz. margins of check markstatic const int windowsRightBorder = 15; // right border on windowsstatic const int windowsCheckMarkWidth = 12; // checkmarks width on windows// checkbox, onstatic const char * const qt_plastique_check[] = { "9 9 3 1", "X c #323232", "o c #979797", ". c None", "oXo...oXo", "XXXo.oXXX", "oXXXoXXXo", ".oXXXXXo.", "..oXXXo..", ".oXXXXXo.", "oXXXoXXXo", "XXXo.oXXX", "oXo...oXo"};// checkbox, on and sunkenstatic const char * const qt_plastique_check_sunken[] = { "9 9 4 1", "X c #828282", "o c #bfbfbf", "* c #929292", ". c None", "oXo...oXo", "X*Xo.oX*X", "oX*XoX*Xo", ".oX*X*Xo.", "..oX*Xo..", ".oX*X*Xo.", "oX*XoX*Xo", "X*Xo.oX*X", "oXo...oXo"};static const char * const qt_plastique_radio[] = { "13 13 5 1", "X c #828282", "o c None", "- c None", "* c None", ". c None", "...*XXXXX*...", "..XXo---oXX..", ".Xo-------oX.", "*X---------X*", "Xo---------oX", "X-----------X", "X-----------X", "X-----------X", "Xo---------oX", "*X---------X*", ".Xo-------oX.", "..XXo---oXX..", "...*XXXXX*..."};static const char * const qt_plastique_radioborder[] = { "13 13 2 1", "X c #000000", ". c None", "....XXXXX....", "..XX.....XX..", ".X.........X.", ".X.........X.", "X...........X", "X...........X", "X...........X", "X...........X", "X...........X", ".X.........X.", ".X.........X.", "..XX.....XX..", "....XXXXX...."};static const char * const qt_plastique_radio_outeralpha[] = { "13 13 2 1", "o c #000000", ". c None", "...o.....o...", ".............", ".............", "o...........o", ".............", ".............", ".............", ".............", ".............", "o...........o", ".............", ".............", "...o.....o..."};static const char * const qt_plastique_radio_inneralpha[] = { "13 13 2 1", "o c #000000", ". c None", ".............", "....o...o....", "..o.......o..", ".............", ".o.........o.", ".............", ".............", ".............", ".o.........o.", ".............", "..o.......o..", "....o...o....", "............."};static const char * const qt_plastique_radio_innerhover[] = { "11 11 4 1", " c None", ". c #567CB6", "+ c #7AA1DB", "@ c #ABC3E8", " .+++. ", " .++@@@++. ", " +@@ @@+ ", ".+@ @+.", "+@ @+", "+@ @+", "+@ @+", ".+@ @+.", " +@@ @@+ ", " .++@@@++. ", " .+++. "};static const char * const qt_plastique_radio_check[] = { "13 13 3 1", ". c None", "g c #aa00aa", "* c #bb00bb", ".............", ".............", ".............", "....g***g....", "...g*****g...", "...*******...", "...*******...", "...*******...", "...g*****g...", "....g***g....", ".............", ".............", "............."};static const char * const qt_plastique_slider_verticalhandle[] = { "15 11 4 1", " c None", "+ c #979797", "@ c #C9C9C9", "$ c #C1C1C1", " $++++++++$ ", "$+ +$ ", "+ $$ +$ ", "+ $@ +$ ", "+ +$", "+ +", "+ +$", "+ $$ +$ ", "+ $@ +$ ", "$+ +$ ", " $++++++++$ "};static const char * const qt_plastique_slider_verticalhandle_left[] = { "15 11 4 1", " c None", "+ c #979797", "@ c #C9C9C9", "$ c #C1C1C1", " $++++++++$ ", " $+ +$", " $+ $$ +", " $+ $@ +", "$+ +", "+ +", "$+ +", " $+ $$ +", " $+ $@ +", " $+ +$", " $++++++++$ "};static const char * const qt_plastique_slider_horizontalhandle[] = { "11 15 4 1", " c None", "+ c #979797", "@ c #C9C9C9", "$ c #C1C1C1", " $+++++++$ ", "$+ +$", "+ +", "+ $$ $$ +", "+ $@ $@ +", "+ +", "+ +", "+ +", "+ +", "+ +", "$+ +$", " $+ +$ ", " $+ +$ ", " $+ +$ ", " $+$ "};static const char * const qt_plastique_slider_horizontalhandle_up[] = { "11 15 4 1", " c None", "+ c #979797", "@ c #C9C9C9", "$ c #C1C1C1", " $+$ ", " $+ +$ ", " $+ +$ ", " $+ +$ ", "$+ +$", "+ +", "+ +", "+ +", "+ +", "+ +", "+ $$ $$ +", "+ $@ $@ +", "+ +", "$+ +$", " $+++++++$ "};static const char * const qt_scrollbar_button_arrow_left[] = { "4 7 2 1", " c None", "* c #BFBFBF", " *", " **", " ***", "****", " ***", " **", " *"};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -