summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Brush up the Windows stylesFriedemann Kleint2019-09-161-80/+78
| | | | | | | | | | | | | | - use range-based for loops where possible - use nullptr - use member initialization - remove a lot of C-style casts - use override - fix some signedness warnings - add some missing break statements Task-number: QTBUG-76493 Change-Id: Ica6ed65ec29e958406e54d816b8a679ed81bd177 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Widget style: Use per-screen DPI in QStyleHelper::dpiScaled()Friedemann Kleint2019-08-231-13/+19
| | | | | | | | | | | | | | | | | Pass the style option to dpiScaled() in order to get the correct screen DPI. The style option contains the font, which again contains the current DPI value. Add QFontMetrics::fontDpi() accessors to get the DPI from the QFont. This DPI will/should be updated on screen change. Replace hardcoded Q_OS_MAC DPI with hardcoded base DPI. This makes per-screen DPI testable on macOS, too. Task-number: QTBUG-45055 Change-Id: I75f8b37d45eb50c3334b46b8469a546d29712f1b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QStyle/QWidget: Avoid repetitive invocation of QStyleHelper::dpiScaled()Friedemann Kleint2019-04-081-6/+11
| | | | | | | | | Store the result of QStyleHelper::dpiScaled() or functions dependent on it in a variable, preparing the addition of a DPI parameter. Task-number: QTBUG-45055 Change-Id: Ic70d65b590793c29a4b1f7a7a5312dd169517fc5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Windows style, themes: Fix deprecation warningsFriedemann Kleint2019-02-061-2/+3
| | | | | | | | | | | | | | Fix: qwindowstheme.cpp:287:77: warning: 'const QBrush& QPalette::background() const' is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations] qwindowstheme.cpp:336:37: warning: 'const QBrush& QPalette::foreground() const' is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations] qwindowstheme.cpp:861:102: warning: 'static bool QPixmapCache::find(const QString&, QPixmap&)' is deprecated: Use bool find(const QString &, QPixmap *) instead [-Wdeprecated-declarations] qwindowsvistastyle.cpp:635:56: warning: 'const QBrush& QPalette::background() const' is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations] qwindowsvistastyle.cpp:707:60: warning: 'static bool QPixmapCache::find(const QString&, QPixmap&)' is deprecated: Use bool find(const QString &, QPixmap *) instead [-Wdeprecated-declarations] qwindowsxpstyle.cpp:743:58: warning: 'const QMatrix& QPainter::deviceMatrix() const' is deprecated: Use deviceTransform() instead [-Wdeprecated-declarations] qwindowsinputcontext.cpp:448:49: warning: 'const QBrush& QPalette::background() const' is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations] Change-Id: I00a52a27b066caeb135ad4124f71ef3e09beafbf Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* qwindowsxpstyle: Add std::nothrow to newIvan Komissarov2018-12-101-2/+2
| | | | | | | | | | | There is no sense in testing the 'buf' pointer against null, as the memory was allocated using the throwing 'new' operator. However, since this function already can fail in other cases, the 'buf' pointer can be checked for nullptr after the nothrow new. Task-number: QTBUG-71156 Change-Id: Ibca5d672544d3980dd8890474e3e2fbf7443e05d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-07-021-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_dragging.mm src/plugins/platforms/ios/qiosinputcontext.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/tools/androiddeployqt/main.cpp Was moved from qttools into qtbase in 5.11. So re-apply 32398e4d here. tests/auto/corelib/global/qlogging/test/test.pro tests/auto/corelib/global/qlogging/tst_qlogging.cpp tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp tests/auto/corelib/thread/qthreadstorage/test/test.pro tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp tests/auto/widgets/kernel/qapplication/test/test.pro Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Done-with: Oliver Wolff <oliver.wolff@qt.io> Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
| * QWindowsFontDatabase/QWindowsXPStyle: Fix compilation with g++ 8.1/MinGWFriedemann Kleint2018-06-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Silence warnings about copying/clearing memory types which g++ considers non-trivial, for example: windows\qwindowsfontdatabase.cpp:1003:75: error: 'void* memcpy(void*, const void*, size_t)' copying an object of non-trivial type 'class QChar' from an array of 'const ushort' {aka 'const short unsigned int'} [-Werror=class-memaccess] memcpy(faceNamePtr, faceName.utf16(), sizeof(wchar_t) * nameLength); qwindowsxpstyle.cpp:946:46: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct ThemeMapData'; use assignment or value-initialization instead [-Werror=class-memaccess] memset(&data, 0, sizeof(data)); ^ qwindowsxpstyle.cpp:1053:38: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct ThemeMapData'; use assignment or value-initialization instead [-Werror=class-memaccess] memset(&data, 0, sizeof(data)); by introducing a cast. Task-number: QTBUG-68742 Task-number: QTQAINFRA-2095 Change-Id: I160eb5fc7b64a2bc404e1fa61d306af2662d1252 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-021-2/+4
|\| | | | | | | Change-Id: Ia082e20e2eb4b76afd4c1a1584ff4e5514655d7a
| * Convert features.toolbar to QT_[REQUIRE_]CONFIGStephan Binner2018-05-021-2/+4
| | | | | | | | | | | | | | | | Move declaration of pick/perp helpers up the dependency chain Change-Id: I7084ed829a057a0c45d60445c416fb07f2cb5624 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Windows: Fix MDI child window titles in High-DPI displaysAndre de la Rocha2018-04-191-6/+10
|/ | | | | | | | | | | This change improves the appearance of MDI child windows in a High-DPI display for applications using the WindowsVista style, with the Qt::AA_EnableHighDpiScaling attribute set. Task-number: QTBUG-64708 Change-Id: I5e9fbd23809b440ffd33e4948c83d115cc6e1910 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* offscreen: Check that native interface is valid before using itAndy Shaw2018-03-211-1/+2
| | | | | | | | | If the offscreen platform plugin is used on Windows then it can end up crashing since there is no native interface. This prevents a crash from occurring when these functions are called. Change-Id: I526fc0703771fa5f85b26d182ad3b15ef1a3ada5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix HiDPI rendering issues in the WindowsVista styleAndre de la Rocha2018-02-021-10/+13
| | | | | | | | | | | | | | | Fixing miscellaneous rendering issues to make the WindowsVista style look good on High DPI displays: - Fixed size/resolution of combo box arrows, and changed to native look. - Fixed vanishing horizontal line in the frame of line edit widgets. - Fixed gaps in combo box popup. - Fixed size/resolution of arrow in push button menu. Task-number: QTBUG-49374 Task-number: QTBUG-65237 Task-number: QTBUG-65238 Change-Id: If68c2fae7472def3c19636483af741ca8ed2c490 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* QWindowsXPStyle: Speed up level window loop in helper winId()Friedemann Kleint2018-01-091-5/+4
| | | | | | | | | | | Rewrite the loop using QGuiApplication::allWindows() to avoid the creation of temporary containers by QApplication::topLevelWidgets() and expensive checks. Task-number: QTBUG-64072 Change-Id: I56ef29b12f7bcbe274f3e00a6007d75d33f22b10 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QWindowsXPStyle: Remove unused codeFriedemann Kleint2018-01-051-38/+0
| | | | | | | | Fixes a deprecation warning about QDesktopWidget::screenGeometry(). Change-Id: Ib56b2d3f62ddca60d84b4f626571b5e444304804 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-021-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| * Fix -Wclazy-connect-not-normalized in Windows codeFriedemann Kleint2017-11-301-2/+2
| | | | | | | | | | | | | | | | qwindowsxpstyle.cpp(289,35): warning: Signature is not normalized. Use void* instead of void * [-Wclazy-connect-not-normalized] qwindowsxpstyle.cpp(292,35): warning: Signature is not normalized. Use void* instead of void * [-Wclazy-connect-not-normalized] Change-Id: I773530452c0837c5066f9174c25ae37e57086e76 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* | styles: port away from QRegion::rects()Marc Mutz2017-12-061-3/+1
| | | | | | | | | | | | | | | | | | | | | | Use begin()/end() instead. Drop the special handling of rectCount() == 1, since with begin()/end(), we no longer take the hit of creating a QVector just to be able to return it from rects(). Change-Id: I19ebc38267951c80bc71aa9d2b5df7403d710064 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | QWindowsXPStyle: Add debug operators for the theme dataFriedemann Kleint2017-10-191-0/+34
|/ | | | | | | | This helps to debug style issues. Change-Id: If2c236d6666512bf1658d951f9b304ce4d129357 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-201-13/+15
| | | | | | | | | | Conflicts: src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/util/qcompleter.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmdisubwindow.cpp Change-Id: If0e96981af07ce36ac68f2e69211bc2120f93973
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-061-1/+3
| | | | | | | | | | Conflicts: examples/opengl/qopenglwidget/main.cpp src/3rdparty/pcre2/src/pcre2_printint.c src/plugins/platforms/cocoa/qnsview.mm src/widgets/widgets/qcombobox.cpp Change-Id: I37ced9da1e8056f95851568bcc52cd5dc34f56af
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-151-4/+8
| | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoamenu.h src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/widgets/styles/qstylehelper_p.h Change-Id: I54247c98dd79d2b3826fc062b8b11048c9c7d9bb
* Merge remote-tracking branch 'origin/5.9' into devOswald Buddenhagen2017-08-021-8/+14
| | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/widgets/qdockarealayout.cpp src/widgets/widgets/qmainwindow.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmainwindowlayout_p.h tests/auto/corelib/tools/qlocale/tst_qlocale.cpp tests/auto/other/macnativeevents/BLACKLIST tests/auto/widgets/widgets/qmenu/BLACKLIST Change-Id: Ic8e724b80a65e7b1af25511b0e674d209265e567
* Merge remote-tracking branch 'origin/5.9' into devGabriel de Dietrich2017-07-131-6/+6
| | | | | | | Conflicts: src/widgets/widgets/qmainwindowlayout.cpp Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-041-5/+4
| | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
* QWindowsXPStyle: Do not draw some opaque theme parts directlyFriedemann Kleint2017-06-021-0/+8
| | | | | | | | | | Drawing directly using GDI32 can produce colors that are invalid in the premultiplied alpha format which is used for the backing store. Exclude part ids which are known to be opaque. Task-number: QTBUG-60571 Change-Id: I0863d030acf79f317f5e82a5ee954c9cb507c449 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Pluginize the platform stylesJake Petroules2017-04-141-0/+4223
This enforces decoupling and in the case of QMacStyle, isolates QtWidgets and therefore end user applications, from Carbon/HITheme. Windows and Fusion are platform independent, so they remain built-in (but mostly because the Windows style is tightly coupled to other styles like QStylesheetStyle). Task-number: QTBUG-59428 Change-Id: Id6519fe0c5269c1bce5b5921f9db06257032a1c9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>