📄 qplastiquestyle.cpp
字号:
/******************************************************************************** Copyright (C) 1992-2007 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://trolltech.com/products/qt/licenses/licensing/opensource/**** If you are unsure which license is appropriate for your use, please** review the following information:** http://trolltech.com/products/qt/licenses/licensing/licensingoverview** or contact the sales department at sales@trolltech.com.**** In addition, as a special exception, Trolltech gives you certain** additional rights. These rights are described in the Trolltech GPL** Exception version 1.0, which can be found at** http://www.trolltech.com/products/qt/gplexception/ and in the file** GPL_EXCEPTION.txt in this package.**** In addition, as a special exception, Trolltech, as the sole copyright** holder for Qt Designer, grants users of the Qt/Eclipse Integration** plug-in the right for the Qt/Eclipse Integration to link to** functionality provided by Qt Designer and its related libraries.**** Trolltech reserves all rights not expressly granted herein.**** 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 bool UsePixmapCache = true;static const bool AnimateBusyProgressBar = true;static const bool AnimateProgressBar = false;// #define QPlastique_MaskButtonsstatic const int ProgressBarFps = 25;static const int blueFrameWidth = 2; // with of line edit focus frame#include "qwindowsstyle_p.h"#include <qapplication.h>#include <qbitmap.h>#include <qabstractitemview.h>#include <qcheckbox.h>#include <qcombobox.h>#include <qdatetime.h>#include <qdebug.h>#include <qdialogbuttonbox.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 <qprocess.h>#include <qfileinfo.h>#include <qsettings.h>#include <qdir.h>#include <qvarlengtharray.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 windowsstatic 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", " *", " **", " ***", "****", " ***", " **", " *"};static const char * const qt_scrollbar_button_arrow_right[] = { "4 7 2 1", " c None", "* c #BFBFBF", "* ", "** ", "*** ", "****", "*** ", "** ", "* "};static const char * const qt_scrollbar_button_arrow_up[] = { "7 4 2 1", " c None", "* c #BFBFBF", " * ", " *** ", " ***** ", "*******"};static const char * const qt_scrollbar_button_arrow_down[] = { "7 4 2 1", " c None", "* c #BFBFBF", "*******", " ***** ", " *** ", " * "};static const char * const qt_scrollbar_button_left[] = { "16 16 6 1", " c None", ". c #BFBFBF", "+ c #979797", "# c #FAFAFA", "< c #FAFAFA", "* c #FAFAFA", " .+++++++++++++.", ".+#############+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", ".+<<<<<<<<<<<<<+", " .+++++++++++++."};static const char * const qt_scrollbar_button_right[] = { "16 16 6 1", " c None", ". c #BFBFBF", "+ c #979797", "# c #FAFAFA", "< c #FAFAFA", "* c #FAFAFA", ".+++++++++++++. ", "+#############+.", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+<<<<<<<<<<<<<+.", ".+++++++++++++. "};static const char * const qt_scrollbar_button_up[] = { "16 16 6 1", " c None", ". c #BFBFBF", "+ c #979797", "# c #FAFAFA", "< c #FAFAFA", "* c #FAFAFA", " .++++++++++++. ", ".+############+.", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+<<<<<<<<<<<<<<+", ".++++++++++++++."};static const char * const qt_scrollbar_button_down[] = { "16 16 6 1", " c None", ". c #BFBFBF", "+ c #979797", "# c #FAFAFA", "< c #FAFAFA", "* c #FAFAFA", "++++++++++++++++", "+##############+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", "+# <+", ".+<<<<<<<<<<<<+.", " .++++++++++++. "};static const char * const qt_scrollbar_slider_pattern_vertical[] = { "10 18 3 1", " c None", ". c #BFBFBF", "+ c #979797", ".. .. ..", ".+ .+ .+", " ", " ", ".. .. ..", ".+ .+ .+", " ", " ",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -