summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* QAbstractItemView - allow deselect in single selection mode.Thorbjørn Lund Martsum2013-01-021-1/+19
| | | | | | | | | This patch allows single selection to be cleared with the normal control modifier. This affects e.g QTreeView and QListView. Task-number: QTBUG-8836 Change-Id: I7fd50b987acc3552b36657409568192763257536 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix typo in QWidget::setLayout() documentation.Mitch Curtis2012-12-211-1/+1
| | | | | Change-Id: I4882f01b980d7b89e54be2eeacc3a83fd014d0fe Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QMessageBox: Add property 'textInteractionFlags'.Friedemann Kleint2012-12-202-0/+28
| | | | | | Change-Id: Ia7a4801599f18a1202aa89f54e48066e3d271bfb Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Deactivating an inactive panel no longer causes unwanted deactivation.Andreas Aardal Hanssen2012-12-171-10/+14
| | | | | | | | | | | | | | | | | | | | | QGraphicsItem::setActive() is by design not guarded against calls that do not change the current activation state of the item (e.g., calling setActive(true) on an active item or calling setActive(false) on an inactive item). This is to ensure that it's possible to set explicit activation state on items, either before they are added to a scene, or while the scene itself is inactive. Before this fix, calling setActive(false) on a panel item that is not currently active would by accident clear activation from any other panel that might have focus. After this fix, activation is only cleared if the item setActive() was called on itself is the active panel, or is the panel that will regain activation once the scene is reactivated. Task-number: QTBUG-28544 Change-Id: Ic4752f1e4400f9a0660bc968834747610212bb52 Reviewed-by: Bjørn Erik Nilsen <post@bjoernen.com> Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Add new signal: QGraphicsScene::focusItemChanged().Andreas Aardal Hanssen2012-12-173-7/+47
| | | | | | | | | | | | | | This signal is emitted by QGraphicsScene whenever focus changes in the scene (i.e., when an item gains or loses input focus, or when focus passes from one item to another). You can connect to this signal if you need to keep track of when other items gain input focus. It is particularily useful for implementing virtual keyboards, input methods, and cursor items. Task-number: QTBUG-10570 Change-Id: I9cbbd9a2d15d6f568e1597c2c33ec049eb70f793 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Make sure panels always gain focus when activated or tab is pressed.Andreas Aardal Hanssen2012-12-171-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes behavior, but I would argue it's a good change. If you create a panel and activate it (e.g., by simply showing it or reparenting it onto an already-visible item), you expect the panel to gain focus / which is sort of the whole point of activating it. Prior to this change, you had to have explicitly called setFocus() on one of the panel's children, which would give that item subfocus, for that item to auto- gain focus when the panel was activated. This change makes it more automatic. If the panel itself or any of the widgets in its focus chain can gain focus, they will gain focus when the panel is activated. So the new logic is - if the panel already has a focus item, so if someone explicitly set subfocus on an item before the panel is shown, that item gets focus. Otherwise, if the panel itself can gain focus (e.g., someone makes a line edit / text edit panel), it gains focus when activated. Otherwise, we search the focus chain until we find the first item that can gain focus. This last case is the file dialog case, where the dialog itself can't gain focus but typically the first item in the focus chain is the primary focus widget, such as the search field or the directory list view. The change also fixes this for the first Tab. If you clear focus on a panel, the user expects to be able to press Tab to regain focus. Prior to this change that didn't happen. Now, the panel or the first in the focus chain that can get focus gets focus on first tab. Task-number: QTBUG-28194 Change-Id: Id7ec1741d0d5eb4ea845469909c8d684e14017f1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Remove some dead code from QLabel::paintEvent()Andy Shaw2012-12-111-14/+0
| | | | | | | | | | | | The code removed was in a if (d->control) block and therefore d->control was always going to be true thus rendering the nested if invalid. The case that this would account for is already handled in the else for the parent if so this code is in effect not needed. Change-Id: I799383e238560a8a8e3d7dc073d3b1ee74269f90 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Repair QGraphicsWidget focus chain when used with ItemIsPanel.Andreas Aardal Hanssen2012-12-073-78/+96
| | | | | | | | | | | | | | | | | Add handling of the focus chain to QGraphicsItem::setFlags(), so that the focus chain is repaired (panels pop out of the chain and non-panels merge back in) when the ItemIsPanel flag is toggled. Add handling focus chain to QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting for panels. Before this fix, you must enable the ItemIsPanel flag before adding the item as a child to a parent panel, and you lose focus when using the tab key to focus around a panel after it has been reparented into another panel. Task-number: QTBUG-28187 Change-Id: I1d0d81a90697eaf715a8a337c8bf6c2159329e68 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* [QTBUG-27420] Make Q{Box,Grid,Form}Layout::takeAt() unparent a nested layoutMarc Mutz2012-12-023-5/+23
| | | | | | | | | | | QStackedLayout doesn't have support for QLayout, only QWidget, so the issue doesn't arise there. Reported-by: Johannes Schaub Task-number: QTBUG-27420 Change-Id: I71f8d10a036918c16d8f8c9197a2ec61cd76cf01 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Move gestures overview from qtdoc to qtbase; mention Qt QuickShawn Rutledge2012-12-014-9/+225
| | | | | | | | | | | | On the one hand this doc reads like an overview, but didn't mention Qt Quick; on the other, the gestures framework is questionable, and in any case is solidly in the widgets module, not reusable for Qt Quick. So, just added some comments at the end to make it clear that Qt Quick takes a different approach. Also changed the relevant links because the title has changed. Change-Id: I66a0c0c106f496de26fb8947e90826ef39ccfddd Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Basic high-dpi "retina" support for Qt 5.Morten Johan Sørvig2012-12-018-70/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | Bring Qt 5 on par with Qt 4, prepare for more comprehensive support later on. Introduce device independent pixels (dips), device pixels, and devicePixelRatio. Add high-dpi support to QPainter, QGLWidget, the cocoa platform plugin, mac and fusion styles. Dips are similar to CSS pixels, Apple points and Android density-independent pixels. Device pixels are pixels in the backing store/physical pixels on screen. devicePixelRatio is the ratio between them, which is 1.0 on standard displays and 2.0 on "retina" displays. New API: QImage::devicePixelRatio() and setDevicePixelRatio() QPixmap::devicePixelRatio() and setDevicePixelRatio() QWindow::devicePixelRatio() QScreen::devicePixelRatio() QGuiApplicaiton::devicePixelRatio() Change-Id: If98c3ca9bfdf0e1bdbcf7574cd5b912c9ff63856 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QWidget windows have fullscreen button by default; manual test for itShawn Rutledge2012-12-012-2/+3
| | | | | | | | | | It's again possible for QWindows and widget windows to go into fullscreen mode on the Mac. Change-Id: I7b304a135838394ef0392f89be4f225f2949fad3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Renamed the keyboard-focus doc to make clear it's about WidgetsShawn Rutledge2012-12-014-4/+5
| | | | | | | Also link from the widgets index page. Change-Id: I49cd415b09d7458d89d75931ecfaafe29c226c6f Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Mac: Fix small button metrics, menu indicator alignmentGabriel de Dietrich2012-12-011-2/+6
| | | | | | Task-number: QTBUG-28275 Change-Id: I08de3cc7fee3af725c66ed081072277b2ca32601 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* WINCE: Fix renameing of resource filesAndreas Holzammer2012-12-011-2/+2
| | | | | | | | The standard resource files where renamed, so fix the include for qmenu in Windows CE. Change-Id: Id29dd8e1028cf438f4d483126a74994fc1e310d7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QGraphicsView - fix rubberband to stay right on scrollThorbjørn Lund Martsum2012-12-011-1/+1
| | | | | | | | | | | | | | We should consider the scene-position when we are expanding moving a rubberband. If the user does some auto-scroll (Qt should support that itself, but that is another matter) then the rubberband should not keep the (old) local position to calculate the rubberband extension, but instead use the scene-position that was actually clicked. Change-Id: I04a2df6a1edae8b3587e1ac2104c7fe4ccfb7762 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix compile with -DQT_NO_WIZARDMontel Laurent2012-12-012-2/+4
| | | | | Change-Id: I6f7be895b8c4a1a65de43ee35d1fab25a30a25c6 Reviewed-by: David Faure <david.faure@kdab.com>
* Fix example documentation for OpenGL module and (widget) Tools.Gunnar Sletta2012-11-301-10/+4
| | | | | Change-Id: Id9dc39752bcae915f618e1a5696115a5e6923251 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Mention the QT_STYLE_OVERRIDE env variable.Shawn Rutledge2012-11-301-1/+3
| | | | | | | | IMO we need to have a list of all the environment variables somewhere, but this one is especially useful and wasn't documented at all. Change-Id: I2de09194c5904a9a27066604840ec4be66574fb7 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fix broken links in the QtWidgets examples.Gunnar Sletta2012-11-302-1/+2
| | | | | | | | I remove the widgets examples from the gui docs as they will introduce broken duplicates (under doc/qtgui/...). Change-Id: I54255ceaf4187477da3e82f6809be41fb98378a2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix linking in painting, richtext and desktop examplesGunnar Sletta2012-11-304-1/+56
| | | | | Change-Id: If08b2c3366610f74201ab6736f216f1a7d29b3c7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* QGV: set QStyleOption::styleObject for graphics items & widgetsJ-P Nurmi2012-11-303-0/+14
| | | | | | | | | | | Certain QStyle code paths expect the style object to be set. This will avoid problems when QGraphicsItems/Widgets utilize QStyle for drawing. Even if things will not necessarily animate properly, such legacy code won't cause a crash at least. Change-Id: Ic77cb4ee9820d6c4ec92c7278fd87cb866f5a780 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Docs: clarify availability & platform theme usage in widget galleriesJ-P Nurmi2012-11-304-7/+20
| | | | | Change-Id: Id3c1e278d6a6ce6c67b7f73c3a9490cf83eb0466 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Made QWindowsStyle internalJ-P Nurmi2012-11-3014-114/+115
| | | | | | | | | | | | | | | We will take this opportunity to remove various QStyle specializations from the public API in Qt5. This gives us much more freedom, for example changing the inheritance hierarchy, pluginizing etc. without worrying about BC. => Use QStyleFactory and/or QProxyStyle instead of creating an instance or inheriting QWindowsStyle directly. Change-Id: Ic17c7e425535bc5bb3a08620e9059bb0aea5185e Reviewed-by: Andras Becsi <andras.becsi@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
* QPA: update backingstore also when moving QWindowsRichard Moe Gustavsen2012-11-301-1/+3
| | | | | | | | | | | | | When moving QMdiSubWindows that contains native widgets (e.g QGLWidget) inside a QMdiArea, garbage is drawn to the screen. The reason is that since we use native QWindow backed widgets, QPA will assume that it does not need to update/scroll the backingstore. But since the backingstore can be shared among several windows, we need to do this to ensure that exposed areas behind the moved QWindow will be updated. Change-Id: I35f4d4069a73ab6cd6d610e25c176c752789a927 Task-number: QTBUG-26162 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Revise QMacStyle scrollbar animation handlingJ-P Nurmi2012-11-301-65/+51
| | | | | | | | Skip animations whether styleObject is not set. Task-number: QTBUG-27895 Change-Id: I1d2e4655b735627b672bc85f773605adcd375418 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Add a nice description of Qt Widgets moduleJan Arve Saether2012-11-301-0/+4
| | | | | | | | Since Qt Widgets was moved from Addons to Essensials, take the old description for the Qt Widgets addon and put it in the module. Change-Id: If955747999d48fe09fff00a9c78e38ccbcf9a493 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* doc: Remove references to Qt 4 in QMainWindow introductionEskil Abrahamsen Blomfeldt2012-11-291-6/+5
| | | | | | | Also make it read less as a porting guide from Qt 3. Change-Id: I78f93c643d236e13ba4ef76eeea1a98be4573def Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Make Mac style not crash on null styleObject.Morten Johan Sørvig2012-11-291-0/+14
| | | | | | | | | | | | We generally expect styleObject to be set during style draw calls but this isn't always done, especially legacy code outside Qt (for example in Qt creator). Create a temporary stand-in QObject. This will disable scroll bar animations. Change-Id: I781967fe28f68f5952b368cd56be980b9e270ecd Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Mention that the Qt book only covers widgetsGunnar Sletta2012-11-281-0/+1
| | | | | Change-Id: Ieb20f410570496286d670cab48e80f7bf7772338 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QtWidgets docs: use Fusion screenshotsJ-P Nurmi2012-11-2872-55/+55
| | | | | | | | The Plastique style no longer exists in QtBase. All the references have been updated to Fusion, and the obsolete screenshots have been removed. Change-Id: I771a9ecf23b82965c7b3c41a40945cf051cb5f3a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove Qt 3 references from model/view documentation.Paul Olav Tvete2012-11-281-16/+7
| | | | | | | Also, don't pretend that Qt 4 is new. Change-Id: Ib8f719310059093b31181e3c98cf5c028c3018dc Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Move session management code from QApplication to QGuiApplication.David Faure2012-11-283-259/+1
| | | | | | | | | | | | | | QSessionManager was already in QtGui, but not usable since the only API to get to it was still in QtWidgets. Session management isn't related to widgets, it also applies to QML apps on the desktop. The virtual commitData and saveState methods have been removed, given the two signals which exist since 4.2, and an additional isSessionSaving() method was added instead. Change-Id: I8099e70df133303e74456706827da21f013fcc6a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Docs: cleaned up remaining cleanlooks references and screenshotsJ-P Nurmi2012-11-2830-10/+5
| | | | | Change-Id: I671cec2a84eabe14bef788499dbfa7d7e9c27670 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Docs: add Fusion Style Widget GalleryJ-P Nurmi2012-11-2829-3/+141
| | | | | | Change-Id: I1eb6548a8842fc141b1506d6070f6b74bda5c893 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Choose better screenshots for "The Widget Classes" docsJ-P Nurmi2012-11-281-5/+5
| | | | | | | | | Remove references to the obsolete CDE and Plastique styles, choose screenshots from more modern styles, and revise the table so that screenshots in the same column are from the same style. Change-Id: I20d5944ab62d8a6965fb49339dede90624c520b3 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Style docs & snippets: remove references to QWindowsStyleJ-P Nurmi2012-11-286-65/+75
| | | | | | | | | QWindowsStyle is being made internal. Use either QProxyStyle for customizing existing styles or QCommonStyle to implement full custom styles. Change-Id: Ic81696abc61a3c012a3775efc0b4fba2e1dab4bb Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Remove invalid assert from QGraphicsSceneRafael Roquetto2012-11-281-1/+0
| | | | | | | | | | | This assert has become invalid since commit 40fef403. After that commit, the 'origin' mentioned by the assert is not necessarily the first item of cachedItemsUnderMouse, since it origin can be reassigned at line 5735. Change-Id: Ibc0739b9fe31be3cc74110225940e9e173f585e0 Reviewed-by: Bernd Weimer <bweimer@rim.com> Reviewed-by: Denis Dzyubenko <denis@ddenis.info> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
* Docs: removed Motif widget galleryJ-P Nurmi2012-11-2829-138/+0
| | | | | | | The Motif style no longer lives in QtBase. Change-Id: I7a0d31603a3898c1e5ab558b6e14aac4ec1315bc Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Docs: removed CDE widget galleryJ-P Nurmi2012-11-2828-133/+0
| | | | | | | The CDE style no longer lives in QtBase. Change-Id: Idfb35e8333b30939a4929418ecf2ce6ccfc437cd Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Always use QAIM to get the default flags.Stephen Kelly2012-11-281-1/+1
| | | | | Change-Id: I801f5c8023e3e3672fde28139a7f34f640e650f5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make "API Reference" section \section1Jan Arve Saether2012-11-281-1/+2
| | | | | | | This is consistent with QtCore and QtSql landing pages. Change-Id: Ibea45678a6952b39d24483bad1ee44f562699d1f Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Ensure subfocus is not reset to 0 when hiding a panel.Andreas Aardal Hanssen2012-11-262-14/+27
| | | | | | | | | | | | | | | | | | | When hiding any widget that is not a panel, it is correct to clear subfocus. In case clearFocus() has been called, the result is that focusItem() / focusWidget() points to 0, which is correct. Upon reactivation, nothing gains input focus. When changing focus, the following setSubFocus() call will ensure subfocus points to the new widget. When hiding a panel, however, it's essential that subfocus within that panel is not cleared, otherwise, when re-showing the panel, nothing will have focus, whereas the expected behavior is that focus is restored to the last item that had focus, i.e., the focusItem() a.k.a. subfocus widget. Task-number: QTBUG-22256 Change-Id: I84d849a505764e074e1369fef923cef1ad5c0b1e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QMacStyle: cleanup unused includesJ-P Nurmi2012-11-261-7/+0
| | | | | Change-Id: I8fbc33f86fac5abed4553d35fac2973f47a445e9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fix example paths in example manifests that are used by Qt Creator.Eike Ziller2012-11-261-0/+2
| | | | | | Task-number: QTBUG-27801 Change-Id: I345c009fc0e4e1c1eabb43ad142e3b474e7a6fee Reviewed-by: hjk <qthjk@ovi.com>
* Mac: Reworking flat QGroupBox lookGabriel de Dietrich2012-11-261-15/+25
| | | | | | | | The line has been removed, giving a globally cleaner appearance. Also, the label font size has been increased to normal size. Change-Id: I3ef9d59ca54755c6fa158e943e4a6ce94eb05065 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Moving code for PE_IndicatorArrow* from windows to common styleThomas Hartmann2012-11-262-74/+74
| | | | | | | | If QCommonStyle is taking the place of a common base style, it should support PE_IndicatorArrow*. Change-Id: Iec08a37bf3a501bcca61751b11e907999f538e34 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* docs: mark QMacStyle internalJ-P Nurmi2012-11-261-0/+1
| | | | | | | | QMacStyle was made internal in 27aa41, but was accidentally left public in the docs. Change-Id: Id7841718af3a21bbbda3102858d1a11bccb8179b Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
* Fix keyboard grab in QWidgetWindow.Friedemann Kleint2012-11-261-0/+2
| | | | | | | Task-number: QTBUG-28070 Change-Id: I6f55a2dd906ee896071137a5d47fb97c9a571b5f Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
* Fix color issue with sliders on Fusion styleJens Bache-Wiig2012-11-251-1/+1
| | | | | | | | We should not directly use the palette as it looks weird on mac. Change-Id: I2062bd43a8b28875330d9f8cc0eaa4069f3a43f6 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>