summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
Commit message (Collapse)AuthorAgeFilesLines
* Use QHash<K,V> instead of QMap<K,V> when K is a pointer typeGiuseppe D'Angelo2012-03-022-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes various internal usages of QMap when the key is a pointer type. Being ordered by the pointer value itself, it makes very little sense to use QMap<K*, V> (esp. in cases where the key is actually allocated on the heap). The usages have been found with the following script: #!/usr/bin/perl use strict; use warnings; use Regexp::Common; use File::Find; use feature ':5.10'; my $container = qr/(?:QMap)/; sub process { return unless (-f and -r and /(\.c|\.cpp|\.h|\.txt)$/); open my $fh, "<", $_ or die "Cannot open $_: $!"; while (my $line = <$fh>) { chomp $line; while ($line =~ /($container\s*$RE{balanced}{-parens=>"<>"})/g) { my $tmp = $1; $tmp =~ s/\s+//g; say "$_:$.: $line" if $tmp =~ /^$container\s*<[^,]+\*,/; } } close $fh; } find( { no_chdir => 1, wanted => \&process }, @ARGV ); Change-Id: Idd9819c3f4c48f98ef92831d5e8e5ac0fa42283c Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-023-178/+178
| | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix QPixmap::grabWidget() on Windows.Friedemann Kleint2012-03-021-2/+5
| | | | | | | | | | | | | | | Do not draw on the backingstore DC when drawing to a pixmap. Access the paintdevice for checking via the QPaintEngine since QPainter returns the clipdevice, which is a widget. Fix warning about accessing handle of 0-window in the test. Task-number: QTBUG-24183 Change-Id: Ie91ea6ab9d09528c7ec1d35633f9a0ee667719b1 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix icon loading in style sheets.Friedemann Kleint2012-02-271-3/+16
| | | | | | | | | QIcon was moved to QtWidgets, while the parser is still in QtGui. Introduce a QCss::IconValue struct that contains the icon data and convert to QIcon in widgets. Change-Id: I09ac8a12a4b02bdca91ee2e8fcc28c86b5a001e7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Add further theme hints to QPlatformTheme.Friedemann Kleint2012-02-221-15/+4
| | | | | | | | | | | | | | | | - Add hints for QDialog/QDialogButtonBox. - Add hint for available popup-menu area. - Add keyboard scheme hint replacing QGuiApplicationPrivate::currentKeyPlatform() Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Task-number: QTBUG-24204 Task-number: QTBUG-24315 Change-Id: I6653786b0dcb49a6fc264d3b9891dbfee502bd3e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove qMacVersion()Bradley T. Hughes2012-02-211-1/+1
| | | | | | | | Add QSysInfo::macVersion() instead, to match the windowsVersion() function. Change-Id: I783e59583ca21653d25586156cbb0cb1f301868b Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* No need to stat with QFile::exists before QFile::open, for reading.David Faure2012-02-171-1/+1
| | | | | | Change-Id: I14ca7f8a377bca39004defc96d69d62c151181f5 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Jeremy Katz <jeremy.katz@nokia.com>
* Add palette() and further hints to QtGui/QPlatformTheme.Friedemann Kleint2012-02-171-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | - Move palette() from deprecated QtWidgets/QGuiPlatformPlugin to QtGui/QPlatformTheme, Make it return a const * since QPalette does not have isNull(). - Initialize QGuiApplication::palette() and QApplication::systemPalette() from it. - Do not initialize QPalette from QGuiApplication::palette() unless app_pal is non-null (default to Qt::black if it is 0). This avoids initialization order crashes/recursions in the QPA plugin. Streamline initialization function. - Remove styleName(), systemIconThemeName() and iconSearchPaths() from QGuiPlatformPlugin and re-add them as QPlatformTheme::themeHint(). - Remove styleHint() from QGuiPlatformPlugin, add it to QPlatformTheme::themeHint(). - Add UNIX themes with factory function (Generic, KDE, Gnome), taking it from Qt 4.8 code (stripping the KDE 3 code). - Implement Windows palettes. Task-number: QTBUG-24204 Change-Id: Ie27ec035df4f84c42deaffc4816b2e53ce705462 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* QDial: Fix crash when singleStep-property is 0.Friedemann Kleint2012-02-161-1/+3
| | | | | | | | | Task-number: QTBUG-23072 Change-Id: I296b46af23420b24fa5460b9660e33bf203ea29f Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com> (cherry picked from commit 6d370a19e367d0ccec59db5c34cbe2e3f7cfc586) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Clean up qguifunctions_wince includes.Andreas Holzammer2012-02-101-1/+0
| | | | | | | | | There are leftovers from Qt 4.8 in regards of the qguifunctions_wince. The parts which where needed in widgets have been taken over into qwidgetsfunctions_wince. Change-Id: I737684a7f56ba356df89c1be77ab776bca034ae9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Compile fix QWindowsMobileStyleAndreas Holzammer2012-02-101-1/+0
| | | | | | Change-Id: Idb3f8b3cb19b0ed1f49245fa7e43f26f6faa174d Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add missing include of qdrawutil.hAndreas Holzammer2012-02-081-0/+1
| | | | | | Change-Id: Ifda1e3a0fbe1ee3431374722878d5cde86ef3916 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Use Q_OS_WINCE instead of Q_WS_WINCEAndreas Holzammer2012-02-072-35/+35
| | | | | | | | | Window system defines have been deprecated, so use Q_OS_WINCE instead. Change-Id: I52059d0f854fe783ac20610ab248800c3e1e827c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Windows XP style: Fix warnings wrt retrieving HANDLE from 0-window.Friedemann Kleint2012-02-061-4/+5
| | | | | | | | Exclude invisible top level dialogs for whom a native dialog is being shown from top-level search. Change-Id: Ia94599905457d81d342c14d09ad0b0fc89ec4ab1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove QInputContextPekka Vuorela2012-02-031-1/+1
| | | | | | | | | | This has only been around as compatibility interface for Qt4 but is now replaced by QPlatformInputContext. Change-Id: I677dbbea46311bf39f6c5ca9dc3fb5009abe924a Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Merge QStyleOption*V{2,3,4} classes togetherGiuseppe D'Angelo2012-02-022-1578/+289
| | | | | | | | | | | | | | | | | | | | | | | In order to keep binary compatibility, Qt 4 introduced V{2,3,4} classes for QStyleOption subclasses. They're simple, low level containers for various members with public access (no accessors required). In Qt 5.0 we can break BC, so this patch moves the members from the derived classes into the ``base'' ones. The ``base'' ones get a version bump matching the highest version available, and the V{2,3,4} classes become typedefs. This change can cause problems in code that used QStyleOption directly, especially QStyleOptionViewItem, because the old V4 fields get default initialization but the QStyle subclasses detect that the option is a V4 option and expect all fields to be properly initialized. The fix in such places is to properly initialize all fields. Task-number: QTBUG-23522 Change-Id: I2f782da09ca5cc8c4cbafc07448fb0d33153a251 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Mac: Fix compilation with -qtnamespace setKai Koehne2012-01-311-2/+2
| | | | | | Change-Id: Id3b9f4e3edf2caeac32c8a44278cdf05a1fc70fb Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Remove Symbian and Maemo 5 code from QtWidgets.Xizhi Zhu2012-01-312-14/+1
| | | | | Change-Id: I715c0ec70cbad05a6ba9737e49be9da7cbd65bf9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Prettify the plastique style's slider thumb.Pierre Rossi2012-01-301-2/+1
| | | | | | | | the bottom corners shouldn't be filled. Change-Id: I8be1c7a712225fe101b775ea04a8c2fc29e4e9da Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Jens Bache-Wiig
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-3061-61/+61
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* WindowsXP-Style: Draw on DC of backing store for widgets only.Friedemann Kleint2012-01-273-30/+35
| | | | | | | | | - Check the device type pof the painter passed in. - Introduce convenience functions for retrieving the DC for widgets that default to the top level. Change-Id: I18a8db02c8ffd7a249310a5ffaf3a530f0a3df40 Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
* Cleanup of QWindowsVistaStyle.Friedemann Kleint2012-01-262-28/+25
| | | | | | | | | | - Remove the limbowidget, try to obtain HWND from a toplevel or the desktop instead. - Clean up handling of the theme map, avoid operator[] and repeated invocation of of map.end() Change-Id: Ic5ea6186508f37aaff782ca304ce577899f7b41c Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
* Windows Vista Style: Fix drawing of buttons in message boxes.Friedemann Kleint2012-01-253-6/+5
| | | | | | | | | Do not use the HDC of the backing store when drawing to an image (as opposed to 4.8, where the HDC of the paint engine was used). This causes 'ghost buttons' to appear in the dialog box at 0,0. Change-Id: I301b66abf4447a65ee144f09655b68efaf18700d Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-2519-19/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove dead code.Richard Moore2012-01-231-19/+0
| | | | | | | | Task-number: QTBUG-23524 Change-Id: I6a80af450b599022e9242cccec945887b871f2b0 Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Update contact information in license headers.Jason McDonald2012-01-2361-61/+61
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Rename all our interfaces from com.trolltech to org.qt-projectLars Knoll2012-01-191-1/+1
| | | | | | Change-Id: I6db7211fcf6b24bd75e360645bbb2fdf1ef8a8bc Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Delete src/widgets/platforms/macMorten Johan Sorvig2012-01-171-0/+2
| | | | | | | | This looks like the mac port but isn't any more, remove it to prevent confusion. Change-Id: I498f536d77d1a3c53e687f696ca6992539a1a90b Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* QStyleHelper: Base DPI-calculation on QScreen.Friedemann Kleint2012-01-111-20/+3
| | | | | | | | | | | | | | | - Use qt_defaultDpiX() to obtain the resolution, which obtains it from QScreen. This implies that for X11, which previously used a hardcoded default of 96 DPI, the real resolution will be used (typically 75). - Since many tests (layouts, graphicsview) contain test data for 96 DPI, add an attribute to QCoreApplication making it possible to set the resolution to 96 DPI for testing. Change-Id: I77c8233a96b0d75de07406f58d48886a89c3de06 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Introduce a QVariant themeHint() to QPlatformTheme.Friedemann Kleint2012-01-112-19/+7
| | | | | | | Start on removing platform-specific code from QtWidgets. Change-Id: Ic2163a0ce6f2db2151cdf7ca93766b2d861eeb55 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-0561-61/+61
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Enable Mac style on Mac OS X.Morten Johan Sorvig2011-12-225-61/+404
| | | | | | | | | | | | | Add styles/qmacstyle_mac back to the build, modify qstylefactory to load it on Q_OS_MAC. Move helper functions from platforms/mac to qmacstyle_mac.mm. QMacStyle should now be self- contained and not rely on anything from platforms/mac. Change-Id: I68fe40bb7f88c01269968bffd9579b7f3b932d4c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* QtGui: Bring back HBITMAP/HICON conversion functions.Friedemann Kleint2011-11-281-21/+23
| | | | | | | | | | - Move the conversion functions from the Lighthouse plugin to QtGui as qt_pixmap/From/To/HBITMAP/HICON(). - Re-enable them in Widgets (QFileIconProvider, QWindowsStyle). - Use them in QtPrintSupport. Change-Id: I1436bc604160d94c78ef270ad2b31bf3b20b5c90 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* qtbase: Warnings fixes.Friedemann Kleint2011-11-182-9/+0
| | | | | Change-Id: Ie97e36bc168b3de3cae2d0eb615e777884529a06 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix sliders style issues.Pierre Rossi2011-11-172-28/+33
| | | | | | | | Due to their widget heritage,some styles' logic for drawing sliders incorrectly assumed a rect with a top left point at (0,0). Change-Id: I02d9c32d925650ccb36e2b917dd890e5d2bbf925 Reviewed-by: Jens Bache-Wiig
* Fix QDockWidget titlebar button positioning on Mac OS XPasi Matilainen2011-11-151-0/+101
| | | | | | | | | | | Move the QDockWidget close and float buttons from the right end of the dock widget title bar to the left end to avoid Mac App Store rejection. Task-number: QTBUG-19493 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> (cherry picked from commit 3b2bd144b7873daf2e7119248dbac7c0f0253993) Change-Id: I3b2bd144b7873daf2e7119248dbac7c0f0253993
* Fixed memory leak in Windows Vista style widgetsTero Ahola2011-11-151-0/+1
| | | | | | | | | | | | | The animations are now deleted in destruction of the Vista style. With the previous implementation the animations were not deleted for instance if you move mouse cursor off from a widget with hover animation (like QPushButton). Task-number: QTBUG-21532 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> (cherry picked from commit 261bbb12003dab0e45b5814f85dd74aa64bcfb79) Change-Id: I261bbb12003dab0e45b5814f85dd74aa64bcfb79
* Disable qmacstyle test on Mac OS XBradley T. Hughes2011-11-141-1/+1
| | | | | | | | | | | The QMacStyle is not built as part of QtWidgets at the moment (see the TODO in src/widgets/styles/styles.pri), so disable the test for now. I've included a comment in styles.pri to re-enable the test once the style is done. Change-Id: Ia6ea130135586f107ba257bf2c6c2c7187a830b6 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Mac: Fix the color of check marks in menus with stylesheetTero Ahola2011-11-141-3/+7
| | | | | | | | | | Task-number: QTBUG-16989 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Morten Johan Sorvig <morten.sorvig@nokia.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com> (cherry picked from commit 22c7a2f69e833789e9b5613f809ea43561624482) Change-Id: I22c7a2f69e833789e9b5613f809ea43561624482
* Fix QProgressBar causing timer event spamTero Ahola2011-11-112-23/+37
| | | | | | | | | | | | | | | On Windows you will get a lot of timer events if you use QProgressBar widget. This is because QWindowsStyle uses a timer to animate a progress bar with unknown state (min and max values both zero). The issue was fixed by starting the timer only if needed. Task-number: QTBUG-10501 (cherry picked from commit 72e61b127470b044e370af7017fa8a5b0538244f) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Change-Id: If9ff2ab99929d9b85a7ffa8f6fd47b045b982f67 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove unnecessary variable self-assignmentBradley T. Hughes2011-11-091-2/+0
| | | | | | | | | | | | | | | | | Assigning an int variable to itself is unnecessary and pointless, remove them. styles/qplastiquestyle.cpp:932:23: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign] width = width; ~~~~~ ^ ~~~~~ styles/qplastiquestyle.cpp:939:23: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign] width = width; ~~~~~ ^ ~~~~~ Change-Id: I0118874028bf43992bcce07f87b46b48868436cc Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Revert "Fix use of qMax() with floating point constants"Sergio Ahumada2011-11-011-1/+1
| | | | | | | This reverts commit 4e1b8720c1498edbb7a5bd37f622fdd3feb07850 Change-Id: I5e52a86119b522888b69fa261ebfa9168f885864 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Fix use of qMax() with floating point constantsSergio Ahumada2011-10-301-1/+1
| | | | | | | | When passing floating point constants make sure to cast them as qreal's. Change-Id: I17e7ee407ac4f92ce947f6a384aa4d64edb8e983 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove Windows and X11 from src/widgets/platforms.Robin Burchell2011-10-283-23/+5
| | | | | | | | | | This is dead code, unused with QPA in place, so remove it to avoid confusion caused through grepping for class names existing in both old and new places. Mac code is left in place for now, as some of it is still in use. Change-Id: Ia82cd5bbabe71285ca997f79d8fd9c0504e32c28 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fixed resource leak when setting QProgressBar style sheetTero Ahola2011-10-271-1/+2
| | | | | | | | | | | Task-number: QTBUG-19110 Merge-request: 2687 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> (cherry picked from commit ecd78168271cfe71715e074a50752712f4aa3229) Change-Id: I49fdf0f74b903313089eb8cd778c80a19d34b461 Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* Widgets: Remove Q_WS_QPA and qpa-sections from .pro files.Friedemann Kleint2011-10-211-1/+2
| | | | | | | | | | | | Enable compilation without -qpa. - Remove conditionals from Q_WS_QPA sections. - Rename precompiled header. - Remove gui-related Q_OS_SYMBIAN-#ifdef sections. - Leave other Q_WS code in for reference. Change-Id: I16326b631fff483aec8edd2f7a2e7a1822eab814 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Widgets: Remove Symbian-specific code.Friedemann Kleint2011-10-1910-6724/+0
| | | | | | | Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Change-Id: Ieee43d6650f5b1968fc7d77e618096701ffef941 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Clean-up a macro for CocoaMorten Sorvig2011-10-101-6/+0
| | | | | | | | | Remove the usage of Q_MAC_USE_COCOA and Carbon code paths. Change-Id: Ib569ad8c6d9ffe258f454b3c3b06e95294a10112 Reviewed-on: http://codereview.qt-project.org/5100 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Sanity-Review: Morten Johan Sørvig <morten.sorvig@nokia.com>
* qwindowsstyle: Remove duplicate flag in maskKent Hansen2011-10-071-1/+1
| | | | | | | | | | Adding State_Sunken once should be enough for everyone. Task-number: QTBUG-20482 Change-Id: Ic5c1bf47283d9c344eda41c766749d4106a8da67 Reviewed-on: http://codereview.qt-project.org/6051 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Move the documentation for the classes to their modules.Casper van Donderen2011-10-0318-2/+91
| | | | | | | | | | | All documented classes under src/widgets should now be under the QtWidgets module in the documentation. The QtPrintSupport classes should now be under the QtPrintSupport module in the documentation. Change-Id: I236b15443b8b93a61578a1d10f52b64dba938f29 Reviewed-on: http://codereview.qt-project.org/5520 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>