summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Fix build with -no-feature-whatsthisPaul Olav Tvete2017-01-251-0/+2
| | | | | Change-Id: I2f31357e91b01f826ef44710f477b80fde1f3fbf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build with -no-feature-treewidgetPaul Olav Tvete2017-01-251-2/+2
| | | | | | | Make sure the feature is defined before testing it. Change-Id: I4d4b555c9f2629c8a3ca58cf52efff279f6a78f5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Compile with -no-feature-tooltipPaul Olav Tvete2017-01-253-0/+6
| | | | | Change-Id: I6093559dd7b8df578ebd050655fb9bd07e5f6809 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build with -no-feature-toolbuttonPaul Olav Tvete2017-01-253-2/+12
| | | | | Change-Id: I16495548fa3ed24409883fadab08ddb8545efd0d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build with -no-feature-tabbarPaul Olav Tvete2017-01-254-5/+26
| | | | | Change-Id: I97c5345f2627743876aa05a94ffc03f2a6012b6c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build with -no-feature-tabwidgetPaul Olav Tvete2017-01-251-11/+9
| | | | | Change-Id: I0fbabdfec763f1647bf85582afe088a3e5b42e1f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build with -no-feature-sliderPaul Olav Tvete2017-01-252-1/+3
| | | | | Change-Id: I36e5c850068c2f9ac2ae078a3734ddb88d88c532 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build with -no-feature-texteditPaul Olav Tvete2017-01-252-1/+5
| | | | | Change-Id: I4a75c134803043180c57287ca352e26e3422204c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix styles compilation with features removed, round 2Paul Olav Tvete2017-01-254-11/+72
| | | | | Change-Id: I8f09a8844e5edc1ad3e3dfd39eca9f3b42c5c828 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build with -no-feature-rubberbandPaul Olav Tvete2017-01-251-1/+2
| | | | | Change-Id: Ida6698c4868507ccbf5b4c5e3eb1d2f5a7109f53 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build with -no-feature-menubarPaul Olav Tvete2017-01-251-2/+9
| | | | | Change-Id: I23b23fcaf6fcc655d38a06495127b108975f4a58 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build with -no-feature-menuPaul Olav Tvete2017-01-253-2/+10
| | | | | Change-Id: I8f9d5ef6b7f7102e56816677f1d3a5b5144b7083 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Compile with -no-feature-itemviewsPaul Olav Tvete2017-01-253-5/+11
| | | | | Change-Id: I23506f06df35f124f5eb9fcc8426c63b407a0872 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build with -no-feature-graphicsviewPaul Olav Tvete2017-01-251-0/+3
| | | | | Change-Id: I9ae724ddf90efc9e951d475e3332083e6f8207d6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build with -no-feature-dockwidgetPaul Olav Tvete2017-01-251-4/+20
| | | | | Change-Id: Id484b54fd7191715e61ba6708247357b83159f28 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix style compilation with -no-feature-...Paul Olav Tvete2017-01-255-6/+41
| | | | | Change-Id: Ic7fadf0622f98d339322a4a1d4d5c36908f4f7f6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove reimplementations of removed featuresPaul Olav Tvete2017-01-252-4/+4
| | | | | | | Avoid the "marked ‘override’, but does not override" compile error. Change-Id: I4b125f1951614045781f3059fbc5cb65dd26775c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make sure features are defined before testing themPaul Olav Tvete2017-01-253-9/+9
| | | | | | | | | Include the file defining the feature before testing whether the feature exists. Also use the new feature macro to make sure this bug doesn't happen again. Change-Id: I204836fee59b143a7ce7d256a7aed223c4d0ceb1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* model-view-programming.qdoc: Add missing list/endlistFriedemann Kleint2017-01-241-0/+2
| | | | | | | | | | | | | Fixes qdoc-warnings: qtbase/src/widgets/doc/src/model-view-programming.qdoc:2076: warning: Command '\li' outside of '\list' and '\table' qtbase/src/widgets/doc/src/model-view-programming.qdoc:2077: warning: Command '\li' outside of '\list' and '\table' qtbase/src/widgets/doc/src/model-view-programming.qdoc:2078: warning: Command '\li' outside of '\list' and '\table' qtbase/src/widgets/doc/src/model-view-programming.qdoc:2079: warning: Command '\li' outside of '\list' and '\table' Amends change 7adfe7494bb4a2c1d3a036fe9dfd946bc00c5d49. Change-Id: Ifa1121ba743c17d7223058e780ad03211565e3ff Reviewed-by: David Faure <david.faure@kdab.com>
* QMacNativeWidget: Remove Carbon reference from documentationGabriel de Dietrich2017-01-231-6/+2
| | | | | Change-Id: Ie1f1064a98f202194cad98aa3fa106e87eba7f39 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QMacCocoaViewContainer: Fix typos, wording in documentationGabriel de Dietrich2017-01-231-22/+17
| | | | | | | | Also removes reference to Carbon and the old dual backend. Change-Id: I01292caa7efcbe85526cd7602ec8ac678fd78eab Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc: Remove specific mention of 'Qt 4' from Model/View documentationTopi Reinio2017-01-231-1/+1
| | | | | Change-Id: If2101124d1bc772c9412c3d09d2d7753d9b51569 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* QQuickWidget: fix drag and dropOleg Yadrov2017-01-201-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | QQuickWidget did not receive mouse release events after drag and drop because the logic was so: 1) QWidgetWindow::handleMouseEvent() was called on press and qt_button_down was set to the corresponding QQuickWidget; 2) After drag started, qt_button_down was set to 0 in QApplicationPrivate::notifyDragStarted(); 3) On mouse release QWidgetWindow::handleMouseEvent() was called again, but because qt_button_down was 0 QApplicationPrivate::pickMouseReceiver() returned 0 and as a result QWidgetWindow ignored the event and did not propagate it to QQuickWidget for further processing. The step 2 is a widgets-specific fix for QTBUG-26145 that does not work for QQuickWidget (QtQuick has its own focus system). Note that because Widgets and QtQuick do not share the sources, there is no possibility to cast the pointer to check whether qt_button_down is a QQuickWidget or some other QWidget-derived class object, so we have to use QObject::inherits() method to check that. Task-number: QTBUG-56713 Change-Id: I599b843e903c64329e6178752e0dc49f674bb890 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QWidget::winId(): Remove documentation bit about macOSGabriel de Dietrich2017-01-191-4/+0
| | | | | | | | The Carbon port has been removed since 5.0, so there's only one framework against which we can build Qt. Change-Id: I38ce410f50cd4eda7abcc50ac4c4c7a23b3e1f45 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* docs: Mention that QWidget::ensurePolished() also affects childrenSergio Martins2017-01-191-2/+2
| | | | | | Change-Id: I083d1c503039010024c89db59003fb6fca050c26 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Martin Smith <martin.smith@qt.io>
* Make shortcuts work for platform menu barsDmitry Shachnev2017-01-192-5/+16
| | | | | | | | | | | | | | | | | | | | | When a platform menu bar is used, the QMenuBar is hidden, so shortcuts for QActions attached only to it do not work. Extend the macOS-specific code to treat such menubars as visible to other platforms, to make the shortcuts work. The exception is made for internal QMenuBar shortcuts, which are forwarded to the platform menu. A follow-up change will add support for this to QDBusPlatformMenu. The updateGeometries() method is called for platform menu bars too to make sure the internal shortcuts are registered even if the global menu is in use. Add two cases to the tst_QMenuBar::activatedCount() test to test both native and non-native menu bars when possible (it now passes with native menu bars too). Change-Id: I2d7128512719ac199cd3f8f7ba28333d04d84ed4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix access incorrect index in QListView with batch layoutAleksei Ilin2017-01-171-1/+1
| | | | | | | | | | | The size of flowPositions is larger by one than the number of rows in the model so the last correct row number is flowPositions.count()-2, not flowPositions.count()-1. Change-Id: Idf8bbd155151d553947d5d299dd01ffaff0c95fa Task-number: QTBUG-47694 Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: David Faure <david.faure@kdab.com>
* QKeySequenceEdit: If the next key is Key_unknown then it should be ignoredAndy Shaw2017-01-171-1/+2
| | | | | | | | | | | When triggering a combination of keys which is causing a dead key then it will send Key_unknown which is not a valid key to be used in a shortcut so it should just skip past it as if it were a modifier key. Task-number: QTBUG-57932 Change-Id: I16e004b84f3aa854f8f8f2bbdf86beb6d764de48 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QSystemTrayIcon: initialize all membersMarc Mutz2017-01-141-1/+4
| | | | | | | | | | | | | | | | The 'showArrow' member was not init'ed. Initialize it to true, which is the default value of the QBalloonTip::showBalloon() function's argument of the same purpose. Reported as new by Coverity, but dating back all the way to cc3875c2e463be5cf126a18637295a0c56358eda, so affects all current branches. Coverity-Id: 171482 Change-Id: Ica519ecda3a4ae413f606faab8c22f7072f412a8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Don't show bogus empty window when calling QMainWindow::restoreState()Sergio Martins2017-01-113-2/+20
| | | | | | | | | | | Qt doesn't create the actual QDockWidgets when restoring, the user must ensure they are created before restoring state. So lets not create an empty QDockWidgetGroupWindow which you can't close and with no tabs. Change-Id: If0a6aa7cf6f3932ff4274e03f787e27aef8fa53d Task-Id: QTBUG-57492 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Replace non-existent signals with the correct onesKavindra Palaraja2017-01-101-1/+1
| | | | | | | | activated() is actually triggered(), highlighted() is actually hovered() Task-number: QTBUG-50315 Change-Id: Ieefdc8376102d80d0885a6c7ca47a9380945afef Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Doc: corrected qdoc list syntaxNico Vertriest2017-01-091-0/+2
| | | | | | | qundostack.cpp: Command '\li' outside of '\list' and '\table' Change-Id: Ic162e246c754e125f6ae82a2a66312e925b231c2 Reviewed-by: Martin Smith <martin.smith@qt.io>
* QStylesheetStyle: don't lose precision when drawing a progress barMarc Mutz2017-01-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | When qreal is float, it cannot represent all values an int can take, so we may lose precision in the expression qreal(a) / b as opposed to the double result double(a) / b For lack of trying, I do not know of a value where this would change the resulting 'fillWidth' value, but better be safe than sorry, and use double instead of qreal arithmetic. Also, when calculating fillRatio, we were converting values back and forth between qreal and double. Using double everywhere avoids that. Found while reviewing integer arithmetic in QProgressBar as part of the fix for QTBUG-57857. Change-Id: I054cb11d35e3ecf5bf79b5c8ee39029bd23bcf49 Reviewed-by: David Faure <david.faure@kdab.com>
* QFusionStyle: don't lose precision when drawing a progress barMarc Mutz2017-01-071-6/+8
| | | | | | | | | | | | | | | | | | | | | When qreal is float, it cannot represent all values an int can take, so we may lose precision in the expression qreal(value) - minimum as opposed to the exact result qint64(value) - minimum' For lack of trying, I do not know of a value where this would change the resulting 'progressBarWidth' value, but better be safe than sorry, and use the 64-bit integer expression instead of floating-point. Found while reviewing integer arithmetic in QProgressBar as part of the fix for QTBUG-57857. Change-Id: I0240c143bb75af6986910489b34042ce9b3a8caa Reviewed-by: David Faure <david.faure@kdab.com>
* QPixmapStyle: do not assume minimum == 0 when painting progress barsMarc Mutz2017-01-071-4/+7
| | | | | | | | | | | | | | | | The arithmetic used to calculate the size of the progress bar fill in QPixmapStyle assumed minimum == 0, but that does not necessarily hold, since the minimum value is user-defined. So, fix the arithmetic to take the minimum into account, taking care, as done elsewhere, to avoid signed integer and qreal=float overflows, by using qint64 and double, respectively. [ChangeLog][QtWidgets][QPixmapStyle] Now handles progress bars with minimum != 0 correctly. Change-Id: I738ded56e8234716c36a5e9fde15bae691c43a35 Reviewed-by: David Faure <david.faure@kdab.com>
* QProgressBar: don't lose precision in text()Marc Mutz2017-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When qreal is float, it cannot represent all values an int can take, so we may lose precision in the expression qreal(d->value) - d->minimum as opposed to the exact result qint64(d->value) - d->minimum' For lack of trying, I do not know of a value where this would change the resulting 'progress' value, but better be safe than sorry, and use the 64-bit integer expression instead. Found while reviewing integer arithmetic in QProgressBar as part of the fix for QTBUG-57857. While touching the line, make the (intended) double → int truncation explicit, by using a static_cast. Change-Id: I03dbfce24c709310c3bbad9487a2bf0d1d78137a Reviewed-by: David Faure <david.faure@kdab.com>
* QProgressBar: remove unneeded ctor-style no-op castMarc Mutz2017-01-071-1/+1
| | | | | | | | | | The expression '100' already has type int, so the cast is not necessary, and confusing. Remove it. Change-Id: Id63f56645b1b13532f73e481547c2a606dfc9c9a Reviewed-by: David Faure <david.faure@kdab.com>
* QAndroidStyle: fix UB (signed integer overflow) in ↵Marc Mutz2017-01-061-5/+4
| | | | | | | | | | | | | | | AndroidProgressBarControl::drawControl() The expression 'maximum - minimum' has undefined behavior when 'qint64(maximum) - minimum > INT_MAX'. Use 64-bit arithmetic instead. Also fix calculation of the progress when minimum != 0. Rename QStyleOptionProgressBar* variable to avoid line wraps. Change-Id: I1d48a7930e7f6d69798c2e878bb0045d55c2f057 Reviewed-by: David Faure <david.faure@kdab.com>
* Fix UB (signed integer overflows) in QProgressBarMarc Mutz2017-01-061-6/+8
| | | | | | | | | | | | The expression 'minimum - 1' invokes UB when 'minimum == INT_MIN'. Likewise, the expression 'maximum - minimum' invokes UB when 'qint64(maximum) - minimum > INT_MAX'. Fix by restructuring the code or else by using 64-bit arithmetic. Change-Id: I352eafa72f28ae907f41c8f88abcf0a81705c718 Task-number: QTBUG-57857 Reviewed-by: David Faure <david.faure@kdab.com>
* Make filesystemmodel feature depend on itemmodelUlf Hermann2017-01-041-0/+1
| | | | | | | | QFileSystemModel inherits from QAbstractItemModel, so it has to be disabled if the latter is not available. Change-Id: Ifc56f7e311d84bd15e8b4ed95d67bf9ad9aba888 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QHeaderView: fix restoreState() on a model with more columnsDavid Faure2016-12-291-0/+14
| | | | | | | | | | | | | When saving state for a 3-columns headerview and then restoring that state onto a 5-column headerview, the headerview shouldn't suddenly think it has 3 columns. Rather than making restoreState() fail, we adjust for the additional columns, so that we can still apply the customizations from the user to all other columns (hiding, moving, etc.). Change-Id: I3f220aa322ea8b629d2fe345f8cde13e0ea615d6 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Fix warning from MinGW/GCC 6.2Andrew Knight2016-12-281-2/+1
| | | | | | | | | | | | src/widgets/styles/qwindowsvistastyle.cpp: In member function 'virtual QSize QWindowsVistaStyle::sizeFromContents(QStyle::ContentsType, const QStyleOption*, const QSize&, const QWidget*) const': src/widgets/styles/qwindowsvistastyle.cpp:1872:9: error: this 'if' clause does not guard... [-Werror=misleading-indentation] if (!sz.isEmpty()) ^~ src/widgets/styles/qwindowsvistastyle.cpp:1874:13: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' return sz; Change-Id: Ifd3faef8c93f12d5fadaf4edf875fbe0fc6fb785 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Silence maybe_uninitialized warning with gcc -OgAllan Sandfeld Jensen2016-12-211-2/+2
| | | | | | | | | | GCC produces false positives for maybe_uninitialized when compiling with -Og in these three places. Simply initialize the variables to silence it. This should be entirely cost-free for normal compilation. Change-Id: Iab778a6ba25993f78f190e928c1fcc2dbd8b2fcd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Updated code sample to match documentation of QCompleterSamuel Gaist2016-12-201-1/+1
| | | | | | | | | | The QCompleter documentation mentions QFileSystemModel while the code sample still uses QDirModel. This patch fixes this by updating the code sample. Change-Id: I99a0d2419efcf781af3e9530508df088d77fbbfa Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Update model-view documentation about layoutChangedStephen Kelly2016-12-181-3/+16
| | | | | | | | | | | This has always been true, but hasn't been documented well enough, so triagers are giving incorrect information in bug reports (eg QTBUG-47711 and QTBUG-53221). That incorrect information is being treated as truth by Qt users which take action based on incorrect information. That is a problem, so try to make the documentation clear. Change-Id: I4e44a9a0675cdd7d9289ec209ae32d5a92899fc9 Reviewed-by: David Faure <david.faure@kdab.com>
* QDockWidgetGroupWindow now honors custom title barSergio Martins2016-12-153-5/+53
| | | | | | | | | When you change tab it will loose or gain native window decos depending on if the current dock widget has them or not. Change-Id: I1171f43fa5ee897ce7d695fc447255dcb0d1d5a1 Task-Id: QTBUG-56866 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix for horizontal scrollbarsLambert Duijst2016-12-131-2/+2
| | | | | | | | Horizontal scrollbars scroll in the wrong direction when the app has a stylesheet and the LayoutDirection is RightToLeft. Change-Id: I860cb733709e8d59a7b844f2b6ed1ee63410956e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Doc: added spec about parameter enableNico Vertriest2016-12-121-2/+2
| | | | | | | | Err: Undocumented parameter 'enable' in QNetworkProxyFactory::setUseSystemConfiguration() Err: no such parameter 'editable' in QComboBox::setCompleter() Change-Id: Ib27b93cf74e97efd656eda1265003f33c6802005 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Accept ZWNJ, ZWJ and PUA characters in input widgetsEskil Abrahamsen Blomfeldt2016-12-124-26/+18
| | | | | | | | | | | | | | | | | | | | Private Use Area characters are quite valid input characters when used in combination with a custom font. Joiners also serve an important language purpose in semitic writing systems. Note that there is a hack where we disregard any character produced using CTRL or CTRL+SHIFT specifically because of German keyboards. I have chosen to keep the hack in this patch to limit the change (though I have made an exception for ZWJ and ZWNJ since both are produced using Ctrl+Shift on Windows), but it will probably have to be reverted. [ChangeLog][QtWidgets][Input] Accept characters in Private Use Area, as well as zero-width joiners and zero-width non-joiners in input in QLineEdit and QTextEdit. Task-number: QTBUG-42074 Task-number: QTBUG-57003 Change-Id: I73f3b7d587a8670de24e902dc52a51f7721dba5a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix crash when dragging a tab off QDockWidgetGroupWindowSergio Martins2016-12-061-1/+3
| | | | | | | Crashes later in QMainWindowLayout::hover() Change-Id: Ibf1085ebfa7b0edcbd1662b0300550788b7f9c33 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>