summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* QMacStyle: fix transient scrollbar fade out animationJ-P Nurmi2013-05-091-1/+5
| | | | | | | | | | If a transient scrollbar was hidden during the fade out animation, it got stuck visible after being shown again. A regression introduced by f52177829a20b55624168870498947b28b82d220. Task-number: QTBUG-31060 Change-Id: I1cda16c6afa4370cce4702d3b4fdaee9f44f9ab9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Utilize the new Q_OS_MACX define.Jake Petroules2013-05-093-3/+3
| | | | | | | | | | All occurrences of `#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)` have been replaced with `#if defined(Q_OS_MACX)`. Change-Id: I5055d9bd1845136beb8ed1c79a8f0f2c0897751a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove references to inexisting enums in Q_ENUMSOlivier Goffart2013-05-082-2/+1
| | | | | | | | | moc currently silently ignores them, but I have a version which display a warning. Change-Id: I9a239cb7e99d40a57a013fb66357c4a6426d6e8b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix typos and style in QInputDialog's docsDavid Gil2013-05-081-11/+11
| | | | | | Change-Id: I1285938efd252346c4016c8f059c7e4f78ca12a9 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Menu item shortcuts reaching Qt's event loop are disabledGabriel de Dietrich2013-05-081-0/+10
| | | | | | | | | See comment in code and Cocoa event dispatching overview at https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/EventArchitecture.html Task-number: QTBUG-30657 Change-Id: I88907aeeefa4962e1121495cd51af17a8e71b7de Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fix tabFocusFirst when that item is removed from QGraphicsSceneMiikka Heikkinen2013-05-081-0/+9
| | | | | | | | | | If tabFocusFirst is not cleared or set to another valid item, there will be crash later if the removed item is deleted after removal. Task-number: QTBUG-30923 Change-Id: Iba9a6ce9334c52f8e552b0accda95ebb5fcfcdb1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* QWidgetWindow: don't accept touch events while in popup modeRichard Moe Gustavsen2013-05-071-0/+4
| | | | | | | | | | | | | | | | | | | | QWidgetWindow will always redirect mouse events to the active popup (if any). The same logic is not implemented for touch events, which means that touch events are always delivered to the widget under the finger. It is therefore possible to interact with widgets that are modally shaddowed by the popup. It is also not possible to close popups without touching them directly. This patch will ignore touch events when a popup is active, and as such, force a synthesised mouse event to be sent instead. Implementing proper touch support also for popups is out of scope for widgets. Change-Id: I023c09c3e1fd4e5495df990c11419c69ecafb8f9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* doc: QWidget::setEnabled cannot enable children of a disabled widgetJan Kundrát2013-05-071-1/+2
| | | | | | | | | | The current documentation is not terribly clear on this topic, and there's a couple of posts on various forums where people want to do this. In fact, the old wording suggested (at least to me) that it is OK to explicitly override a disabled state, which is apparently not true. Change-Id: I10c54e0089e9ba5d16958aea62df27feafdf7b3d Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Prevent crash due to giving QWidget::update() a large region.Samuel Rødal2013-05-071-4/+9
| | | | | | | | | | | Similar to what change a298216bb4383dbe96 does for update(QRect) we clip the update region against the widget's rect and return if it's empty. Otherwise we risk ending up with update rects that are larger than INT_MAX due to multiple update rects being merged. Task-number: QTBUG-30876 Change-Id: Idf695b1fdca50449a1e5ddf37500653de290590c Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fixed applying invalid data from QLineEdit to modelIvan Komissarov2013-05-072-20/+68
| | | | | | | | | Task-number: QTBUG-2216 Change-Id: I5d1c18aadb380667dedc2bb9f9b7e3dd8178a24c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Enable non-client-area mouse events by default for widgets.Friedemann Kleint2013-05-072-14/+3
| | | | | | | | Task-number: QTBUG-30530 Task-number: QTBUG-29012 Change-Id: Iaddbb89bbb198e2b04419407e0871951650552ce Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Set geometry set by QPlatformWindow::initialGeometry() on widget.Friedemann Kleint2013-05-071-0/+7
| | | | | | | Task-number: QTBUG-30855 Change-Id: I15f3dfa0b493874671711cce2190d0710b368796 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* remove dead declaration from QColorMapJoerg Bornemann2013-05-071-4/+0
| | | | | Change-Id: Idf50084c4688c8bb6b7a2e754cad28266e09271f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QApplication: fix touch to mouse bug when setting buttons()Richard Moe Gustavsen2013-05-071-1/+2
| | | | | | | | | | | | | | | | | | | QApplicationPrivate::translateTouchToMouse always sets buttons() to Qt::LeftButton for synthesised events. This is wrong for a mouse release, since 'button' should in that case be Qt::LeftButton, and 'buttons' should be Qt::NoButton (since no buttons are actually being pressed). This caused problems for QGraphicsView, which refuses to release any mouse grab set on a QGraphicsItem if at least one button is being pressed (which was always true). This resulted in broken drag behavior on touch platforms. Change-Id: Iefe63cd753f9f8bb04278fd04a4d728e3deda25e Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* QGraphicsView: ignore unhandeled touch eventsRichard Moe Gustavsen2013-05-071-0/+2
| | | | | | | | | | | | | | | | | | | | When QGraphicsView has sceneInteractionAllowed == false (e.g when dragMode == QGraphicsView::ScrollHandDrag), all touch events are accepted. This is wrong, and will stop mouse synthesising from happening on touch platforms. This in turn will make ScrollHandDrag not work (since no mouse events will come through). This patch will call QEvent::ignore() if the touch event isn't send to the scene, which will cause a mouse event to be synthesised. Note that according to http://doc.qt.digia.com/qq/qq11-events.html the correct approach would probably be to just return 'false', rather than calling QEvent::ignore(). But this logic is not followed consistently elsewhere (e.g in QApplication::notify), so I choose to follow what the code actually expects for this bugfix. Change-Id: Ida777647134c41661bab156d7b164ebd882a6bb1 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Enable bundling Qt in Android package in build systemEskil Abrahamsen Blomfeldt2013-05-011-0/+3
| | | | | | | | | | | | | | | | | | | | | For bundling Qt, we need two things: 1. We need to build a regular .jar file out of the Java files, so that they can be built into the app package. Dexing the classes first (i.e. compiling the JVM bytecode to Dalvik bytecode) is required for loading the .jar file at run-time, but cannot be used for building it into the app, so we need two different paths. 2. We need to specify which extra files have to be bundled for each module (this is primarily for plugins and imports). This is because there is no static dependency on these files, so it cannot be detected during deployment. Task-number: QTBUG-30751 Change-Id: I733603ee5d1c64bd7c5b9357eb5d993b9d0298f7 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Mac style: Fix text offset within 'small' comboboxGabriel de Dietrich2013-04-301-0/+2
| | | | | Change-Id: I2bde1c71e0e79a6d8ef2897acc053357b12dc00c Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Mac style: Update appearance of 'button with menu'Gabriel de Dietrich2013-04-301-19/+69
| | | | | | | | | | Most of the logic was still following the 10.6 UI guidelines, and had not yet been upgraded to the 10.7 new button look. We tried to keep 10.6 compatibility were possible, and improve 'small' and 'mini' Aqua sizes support. Change-Id: I64139f24cccd095e9349b27a987395210b55c586 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* QPlainTextEdit: add missing feature zoom on Ctrl+WheelCaroline Chao2013-04-302-0/+49
| | | | | | | | | | | When the control is read only. This is documented but not implemented. Add functions to zoomIn and zoomOut. Task-number: QTBUG-30845 Change-Id: I692b5f8cc5791498d34d35ea3dafa18b6e5d3e65 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Doc: Zooming inside QTextEditCaroline Chao2013-04-301-0/+2
| | | | | | | | | | | | | One can zoom in/out text inside a QTextEdit when the widget is read-only or when using the zoomIn/zoomOut functions. Zooming inside a HTML document only works if the font-style is not set to a fixed size inside the document though. Adding this information to the documentation. Change-Id: I66a62da53827e1ce3241ba16b91e86926b97c297 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Prevent crash due to giving QWidget::update() a large rect.Samuel Rødal2013-04-291-4/+9
| | | | | | | | | | | We can simply clip the update rect against the widget's rect and return if it's empty. Otherwise we risk ending up with update rects that are larger than INT_MAX due to multiple update rects being merged. Task-number: QTBUG-30876 Change-Id: I23bd0149fbe8d1a007a60b228e6bddb45dc4fc32 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Don't do any transitions if the widget is disabledAndy Shaw2013-04-251-1/+1
| | | | | | | | | | | | On Windows 8 it would end up changing the look of the QLineEdit when the mouse hovered over it even though it was not enabled. None of the Windows platforms show the lineedit changing when hovered over if it is disabled so we can skip the whole thing. Task-number: QTBUG-29224 Change-Id: Ib9495bf395477f114e91b744e1b1209c9e11f336 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Cocoa: Reflect menu hierarchy in QCocoaMenu* objectsGabriel de Dietrich2013-04-252-6/+7
| | | | | | | | | | | | | | QCocoaMenu is child of either a QCocoaMenuBar, a QCocoaMenuItem as a submenu, or nothing as a standalone menu. QCocoaMenuItem is child of its containing QCocoaMenu. The parent is set during insertion and cleared during removal. QMenu needs to be updated to avoid double deletion and leaking its own platform menu. Change-Id: Iadf60d8062d7466fa616f84f3761fe322fc9aa2e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Respond to the _NET_WM_CONTEXT_HELP WM_PROTOCOLS messageJan Kundrát2013-04-241-0/+8
| | | | | | | | | | | | | | | | This change restores a proper function of the "(?)" button in the window decorations which is used as a clue for the user to check what a particular widget is supposed to do. The change is only implemented for QtWidgets because the underlying QWhatsThis is inherently widget-specific -- which is why it sends an event to QGuiApplication, but only processes it in the QtWidget-specific QApplication. Thanks to Alberto Mardegan and Gunnar Sletta for their feedback on this patch. Change-Id: Ibb912e3960f1e9aec54c5ed77ade1c6744d6ca23 Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fixed documentation of QWidget::mouseDoubleClickEvent.Samuel Rødal2013-04-241-2/+0
| | | | | | | | Since change 3bb902495291c5 the documentation is invalid. Task-number: QTBUG-29680 Change-Id: I7d5fcb6bc490aa5cba83439d33f798459640c42d Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Cocoa: Add setAlertState(), isAlertState(), beep() functionsGabriel de Dietrich2013-04-231-1/+1
| | | | | | | | Also, fix operator precedence error in QApplication::alert(). Change-Id: I140ccfba29638d24bc1c97f5f9a9611f66eb6b8f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fixed QLayout::addChildLayout(QLayout *l) when l had a parentJan Arve Saether2013-04-235-5/+19
| | | | | | | | | | | Previously if l had a parent, addChildLayout would warn and skip the reparenting, but it would still add the sub layout to the layout. This caused some inconsistencies in the hierarchy which in worst case could cause crashes. Task-number: QTBUG-30758 Change-Id: I618ec3341636b97bd71e421201b22c746dcf43e1 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix typo in docsStephen Kelly2013-04-231-1/+1
| | | | | Change-Id: I3ee3e3d061fc87c0c2ea05197b37a952c8d63dd2 Reviewed-by: hjk <hjk121@nokiamail.com>
* Fix build with QT_NO_CLIPBOARDStephen Kelly2013-04-231-0/+4
| | | | | | Change-Id: I138a29e1099e691770b9e3e094a108fc8c52f8cb Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix crash when deleting a QMenu on exitGabriel de Dietrich2013-04-231-1/+1
| | | | | | | | | If the application object is an ancestor of QMenu, dereferencing qApp in its destructor will cause a crash. Task-number: QTBUG-30756 Change-Id: I31a33db0fd783bb210a420618911ea8b412e9a0f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Enforce focus policy in item delegate's editorGabriel de Dietrich2013-04-231-1/+4
| | | | | | | | | | | | Focus policy can be wider in this case given the limited scope of the editor widget. This helps workaround platform specific focus policies, like on Mac, were focus can be restricted depending on the widget type. Task-number: QTBUG-30715 Change-Id: I69acf8ebff4ba16d473964c91680a1cb0235e3cf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Don't set WA_AcceptTouchEvents on Mac OS X.Morten Johan Sørvig2013-04-231-2/+2
| | | | | | | | | | | Setting this flag causes scroll event lag, so we want to keep it off for all widgets that do not need touch events. QPanGestureRecognizer is installed on all QAbstractScrollAreas. Prevent it from setting the flag. Change-Id: Idd4fcc545ff26377607b56f75db75c2865a5fc82 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fix QTableView::doItemsLayout()J-P Nurmi2013-04-221-3/+8
| | | | | | | | | | | Keep the content aligned to the bottom when the view has been scrolled to the bottom and the content is relayouted (for example due to sorting). Task-number: QTBUG-30653 Change-Id: I9513e295e276d25ff2068036cd80dbf91314fe84 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Ensure the QLineEdit::returnPressed() signal is still emittedAndy Shaw2013-04-211-0/+1
| | | | | | | | | The signal needs to be emitted directly as the event is not passed to the QLineEdit if the QSpinBox gets the Key_Return. Since this signal may be relied upon then we ensure it is emitted directly. Change-Id: I17cdec62c9f995bacfd7d3cc66d6324f26c84c67 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Implement QApplication::beep().Friedemann Kleint2013-04-191-0/+1
| | | | | | | | | | Invoke slot "beep" on QPlatformNativeInterface. Implement for Windows and X11. Task-number: QTBUG-30416 Change-Id: I2be651165b899e5147818a012001d354827bb090 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Implement alertion state for windows.Friedemann Kleint2013-04-191-1/+11
| | | | | | | | | | | | | | Add QWindow::alert() and QPlatformWindow::setAlertState(). Add logic to clear alertion state when the window becomes active. The platform plugins then only need to implement a setter and a cheap getter and need not handle activation. Prototypically implement X11 and Windows. Task-number: QTBUG-30416 Change-Id: Ia70c4722d812462a21f4034b7d52735c9f2bc49c Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QMessageBox/Win: Include detailed text using Ctrl+C to copyJonathan Liu2013-04-191-1/+4
| | | | | | | Task-number: QTBUG-21150 Change-Id: I14c214e9f96892f0da4369e7253e363b7313c252 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make password mask characters themeable.Mitch Curtis2013-04-194-36/+11
| | | | | | | | Task-number: QTBUG-29871 Change-Id: I3cf739a321d7917f8f8431992e29bba0871b1934 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Allow using Ctrl+C to copy selected text from DetailedText in QMessageBoxKai Koehne2013-04-191-2/+38
| | | | | | | Task-number: QTBUG-21895 Change-Id: Ib28f064295493595263945bc72907bf95d2cb909 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Mac: Fix warnings about non-existing native Windows on startup.Friedemann Kleint2013-04-181-5/+5
| | | | | | | Shown for example by Qt Designer. Change-Id: Ia866a93a781a027aa3703f44314954888d75d436 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Mac: Fix various memory leaksGabriel de Dietrich2013-04-181-0/+1
| | | | | Change-Id: Id554be11ffcf9a506c217b0dc5b96cb37c4dd57c Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Cocoa Menu: Remove unnecessary retain, release/retain in the right orderGabriel de Dietrich2013-04-181-0/+1
| | | | | | | Also, make sure platform menu item is deleted on ActionRemoved event. Change-Id: Ic07a81cb77833bdffd1464abf1c81ebdee4d16e9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Convert the new filename to native separators before checking itAndy Shaw2013-04-181-1/+1
| | | | | | | | | | If a native separator was put in the new name when renaming a file name via the file dialog then it would correctly fail. But if a non-native one was used on Windows then it would cause the file to be moved instead if the directory existed. Change-Id: If01760b8c54a69b600c9a44c7509017be70d33e3 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Android: Don't crash when displaying multiple top-levelsEskil Abrahamsen Blomfeldt2013-04-181-1/+12
| | | | | | | | | | | | | | | | | | | | | | While the raster platform plugin supports multiple top level windows, this is not supported on the GL plugin, so if you use GL or QtQuick2 in your app and use several top levels, the app would crash with an error message. A problem is that the top-level SurfaceView is a special overlay View and does not support being stacked in a layout. So instead, we let all windows share the same GL surface and draw on top of each other. This works fine for simple use cases. We implement a new platform capability to make sure no top level windows (even combobox popups and dialogs) get non-fullscreen geometries. That has never worked properly with the eglfs plugin. Task-number: QTBUG-30473 Change-Id: Ia1438019638fc739cc93ffe79b46b81631254df2 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix GroupBox painting on Windows when not using widgetsJens Bache-Wiig2013-04-182-48/+3
| | | | | | | | | | | | | | This is simply removing some slow and rather ugly hacks that tried to reconstruct broken data from the windows xp theme. After testing without these hacks on both XP and Windows 7, I believe we can conclude that these workarounds are no longer required and even breaks our look and feel in several places. Task-number: QTBUG-29888 Change-Id: Ifaffd660e8d9ed6dfd43657745c3fa1606d33a7c Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fusion & GTK styles need to check direction from style option not qappShawn Rutledge2013-04-182-3/+3
| | | | | | | | | | An RTL menu containing a menu item which opens a submenu was showing the wrong arrow if the application's direction was not also RTL. So now the test for QTBUG-30595 can be simplified: no need to set the application direction, and therefore less chance of failure. Change-Id: Id140656206c6fefea3649289477dc54c77e2dd5e Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* An RTL submenu should be right-alignedShawn Rutledge2013-04-181-2/+2
| | | | | | Task-number: QTBUG-30595 Change-Id: Iac54cae70b5a2ac6be5a750279fb390bb158776a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Move Fusion styles palette into QtGuiJørgen Lind2013-04-171-39/+3
| | | | | | | | So that it can be used as the standard palette for QtGui applications instead of the absolutely useless black palette. Change-Id: Ie001439fcd8840a66275009c9f42cbf8bab4864a Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Prevent recursions when triggering menus in QToolButtonFrederik Gladhorn2013-04-161-0/+4
| | | | | | | | | | With a global shortcut set it would be possible to let the button re-open the menu again and again, each time spinning an event loop. Task-number: QTBUG-30399 Change-Id: If7eddc115c77fef3df3e751fd72e7414cedaf272 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* QGtkStyle: Remove widget dependency from GroupBoxJens Bache-Wiig2013-04-161-18/+20
| | | | | | | | | | This patch makes it possible to draw a checkable groupbox without passing a widget pointer. Task-number: QTBUG-29867 Change-Id: I9b74bcffa0401c88f9dcbcd9816081b7f03a5173 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>