summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Speed up the removal of items from a QGraphicsSceneDimitar Asenov2014-06-162-7/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | When using a linear index, all items in a scene are stored in a QList. While adding new items is a constant operation, removal requires a traversal through the entire list. This is especially problematic when the scene contains millions of items and many of them are removed, which requires a linear search for each item, resulting in a very slow operation. Moreover, this behavior is actually inconsistent with the current documentation which states for the linear index: "Adding, moving and removing items, however, is done in constant time." Instead of removing items from the list in the index, this patch just marks the list as invalid. The next time the list is required it will be rebuilt from scratch by traversing all items from the scene. This new behavior more accurately matches the documentation. Testing this change in a scene with over 1 million objects, resulted in a massive speed up, effectively eliminating the overhead of item removal. [ChangeLog][QtWidgets][QGraphicsScene] Speed up the removal of items when using the linear index. Change-Id: I95c7b90b9f1fe426018695b6429138530e6d2f3e Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵J-P Nurmi2014-06-0711-18/+62
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devJ-P Nurmi2014-06-0511-18/+62
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt.prf src/plugins/platforms/xcb/qxcbwindow.h src/tools/qdoc/qdocindexfiles.cpp src/widgets/kernel/qwidget_qpa.cpp Change-Id: I214f57b03bc2ff86cf3b7dfe2966168af93a5a67
| | * QApp: Method to check for native style usage.Christoph Schleifenbaum2014-06-052-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds QApplicationPrivate::usesNativeStyle to check whether the QApplication is using the native platform style. This can be needed internally to decided whether to let the platform plugins do stuff or do it interally, style dependent. E.g. letting the platform plugin popup a QMenu vs. letting the style draw one. Change-Id: Ibb5e11a4d9d1d2824685ff146786a9354ceef43c Reviewed-by: BogDan Vatra <bogdan@kde.org>
| | * Do not clear default button in QMessageBox::setDetailedText().Friedemann Kleint2014-06-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Store the value of QMessageBoxPrivate::autoAddOkButton temporarily when automatically adding the "Show Details..." button. Task-number: QTBUG-39334 Change-Id: I173c83893548ee83b3d8ea2743f87686c32657e7 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| | * QDialogButtonBox does not need TabFocusJan Arve Saether2014-05-311-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It will now share the same behavior as QGroupBox, which has NoFocus if its not checkable. This doesn't lure AT clients to stop and read its content (this is the case for android accessibility) (designer seems to generate a tooltip for each QDialogButtonBox, which will be read as the name). Change-Id: I6cfacdd9c01299521222c773634df1e36971d982 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
| | * Move native subwidgets in QWidget::scroll().Friedemann Kleint2014-05-282-6/+6
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-38999 Change-Id: Ie22dcf61895bbfc575eaae4d1929516a8749de39 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| | * WinRT: Fix compile warningsMaurice Kalinowski2014-05-261-0/+3
| | | | | | | | | | | | | | | Change-Id: If223dd73b9558a0f5144be38f19a61316f8c807b Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
| | * Account for the sort indicator being placed above the text on VistaAndy Shaw2014-05-263-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In WindowsVista style and later the sort indicator is placed above the text as opposed to alongside it. Therefore the extra space given is moved to the common style allowing styles that have it placed differently to easily ensure it is not included. Task-number: QTBUG-19915 Change-Id: Ic21fcc1d95f4c3cc2eb9c465e1c8afb9b805389a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
| | * Fix loss of precision warningsFrederik Gladhorn2014-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Found by http://www.viva64.com/en/b/0251 Change-Id: I2a0c3dba74fef07c3119c9e57b343a8253ee7daa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | | Fix key navigation through cells with spans in QTableView.Mitch Curtis2014-06-061-1/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When navigating with the directional keys or tab/backtab, there are certain situations where the cell that is edited is incorrect. For example, consider the table below. '^' represents the starting cell and the direction of navigation. 'c' represents the index that is arrived at as the currentIndex prior to this patch as reported by view.selectionModel()->currentIndex(). 'x' is the cell that should be edited: +---+---+---+---+ | | | e | | +---+---+---+---+ | | x | | +---+ +---+ | | c | | +---+---+---+---+ | | | ^ | | +---+---+---+---+ Before this patch, the cell that will actually be edited is c, rather than x, so after editing the cell and pressing enter, the previous contents of the cell will still be shown. With this patch, currentIndex() will be changed after every call to cursorMove(). Navigation into and out of cells is not affected because the visualCursor member in the QTableViewPrivate tracks the keyboard navigation entry point. If after the up navigation into the span, the user presses up, the cell entered is 'e', not the cell above 'x'. Task-number: QTBUG-29239 [ChangeLog][QtWidgets][QTableView][QTableWidget] currentIndex() now reflects the top left cell when in a span. Change-Id: I3dc3db46ebba340102860fc4ad98fcaf91484983 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | Mac Style: Don't crash when rendering PE_IndicatorBranch without widgetGabriel de Dietrich2014-06-051-1/+2
| | | | | | | | | | Change-Id: I45784af3738807ab6753b67a5b103a65d4e28084 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* | Fix internationalization of "txt File" in QFileDialogLasse Liehu2014-06-031-2/+4
| | | | | | | | | | | | | | | | Some languages (for example Finnish) need to customize punctuation and capitalization in this case. Change-Id: I9720626263f061adc7972bff18bcb59f2f2b382f Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | Accessibility: Fix select state usageFrederik Gladhorn2014-05-312-3/+2
| | | | | | | | | | | | | | | | | | | | The selectable/selected states refer to items in a list and similar, do not interpret them as text selection states. Without this change NVDA for example announces text edits as selected which makes no sense and which it doesn't do for native text items. Change-Id: Ib1d109523bd4cc2b9b40ace8a8c3d7d3a7f9f25c Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* | Accessibility: Fix rect for QComboBox and QRadioButtonFrederik Gladhorn2014-05-304-0/+23
| | | | | | | | | | | | | | | | | | This is especially relevant on mobile devices where screen readers often send mouse clicks to the middle of the object. Task-number: QTBUG-39100 Change-Id: I5972f21dd12434601d86136215ab9b61248c9691 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* | Use accurate title/status bar gradient colors on OS X.Jake Petroules2014-05-261-11/+31
| | | | | | | | | | | | | | QMacStyle now uses proper system colors when drawing status bars. Change-Id: I618e485a2a68a484f7c8cb5635cd2bf529126c02 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-05-225-16/+12
|\| | | | | | | Change-Id: Ia36e93771066d8abcf8123dbe2362c5c9d9260fc
| * Trigger repaint of window when toggling unified toolbar on or off.Jake Petroules2014-05-221-0/+1
| | | | | | | | | | Change-Id: I5204e5c65ae3cf84459cc62f587ecccd855e02f8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Fix broken QPlainTextDocumentLayout after removing charsAxel Rasmussen2014-05-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | This fixes an issue where, if characters were removed from several blocks in a single edit, the document layout would end up being corrupted since the document layout manager wouldn't re-layout the proper number of text blocks. Task-number: QTBUG-30051 Change-Id: Idf3a6f567120e6a5dbebf1f65f685d374219328a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
| * QMacStyle: Always draw status bar in active state if the window is main.Jake Petroules2014-05-171-2/+2
| | | | | | | | | | | | | | | | On OS X, most controls are drawn active or inactive based on their window's main state, NOT its key ("active" in Qt) state. Change-Id: If447d0a537bc594978f7202e7888ceacb54ec8fa Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| * Accessibility: Update ComboBox text on arrow keysFrederik Gladhorn2014-05-161-6/+6
| | | | | | | | | | | | | | | | | | | | Use ValueChanged to notify of changes in the ComboBox. On Linux we need to update name and then send selection-changed for Orca. Task-number: QTBUG-36814 Change-Id: Icdd34adddeac532476a6dd910d1e8bd33bcd590b Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
| * Avoid setting unnecessary parameters in QOpenGLWidgetLaszlo Agocs2014-05-161-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QOpenGLFramebufferObject sets the texture parameters already, do not set them again. Especially not GL_REPEAT, which is wrong and breaks on devices that do not support REPEAT on NPOT textures. What QOpenGLFramebufferObject does is just fine (it sets NEAREST/ NEAREST and CLAMP_TO_EDGE). This is important for WebEngine where the QWidget-based web view is using QOpenGLWidget. Change-Id: I264d30118ce7adf50f68f2c7b9a5599a406b4362 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | Turn setUnifiedTitleAndToolBarOnMac into a slot.Jake Petroules2014-05-211-3/+4
| | | | | | | | | | Change-Id: Ieb28960bf3fb9e70a6bcc6d47ff723f0ed4e1b63 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | qpa: Rename qwidgetwindow_qpa_p.h to qwidgetwindow_p.hTor Arne Vestbø2014-05-207-9/+9
| | | | | | | | | | Change-Id: I24835b86194653e89c0bacefd22ddbff06b6e97b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | qpa: Merge qapplication_qpa.cpp into qapplication.cppTor Arne Vestbø2014-05-203-505/+419
| | | | | | | | | | | | | | The variable 'appFont' was removed as it was not used. Change-Id: I8dfa8382b3f30b72490fd22b4e0a27e991318a9c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | Remove friends of QEvent.Friedemann Kleint2014-05-182-2/+2
| | | | | | | | | | | | | | | | Introduce function to set the spontaneous flag to QCoreApplicationPrivate to solve a few cases. Change-Id: I7c1f1f3644defe00deea9cecb244ca258afd5b94 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove friend class QETWidget.Friedemann Kleint2014-05-163-3/+0
| | | | | | | | | | | | | | The class no longer exists in Qt 5. Change-Id: Icd98c151f8e06910a3240d0bec6fff333a8ef3e3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | qpa: Merge qwidget_qpa.cpp into qwidget.cppTor Arne Vestbø2014-05-154-1125/+1033
| | | | | | | | | | Change-Id: I8424ec7290b366f4c76999a956fce1428fc56626 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | qpa: Merge qdesktopwidget_qpa.cpp into qdesktopwidget.cppTor Arne Vestbø2014-05-155-198/+146
| | | | | | | | | | Change-Id: I39316744b87d1fd588a99ab71edbd711ee8fae47 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | Make QColorDialog build under QT_NO_REGULAREXPRESSIONGiuseppe D'Angelo2014-05-151-0/+8
| | | | | | | | | | | | | | | | Since we can't set a validator on the HTML-color lineedit, just make it readonly. Change-Id: Ibeaacbea00867cdb6ef33b6667f7ee3539b7f929 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-131-0/+1
|\| | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp Change-Id: Ibe75603dc8a51769db6550ea3f07bc8d19b0be85
| * Ensure the QMenu is polished before creating the native windowMartin Gräßlin2014-05-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call ::ensurePolished from QMenu::exec before the native window gets created. This ensures that the style handles the menu before its too late. E.g. a style which wants to create RGBA menus needs to add the appropriate flag before the native window gets created. Without this change the style cannot change to RGBA as the native window has already been created and changing the format used by QWindow is not possible after QWindow::create was called. Change-Id: Ic861037a438b4cb74c59a00be0ef2d633db538ed Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Removed unused variable macItemVMargin in qmacstyle_mac.mm.Ivan Komissarov2014-05-131-1/+0
| | | | | | | | | | Change-Id: Ib888781238f6cc9407732431219e570299a47198 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | QMenu: Use Qt::QueuedConnection when connecting to native menu.Ivan Komissarov2014-05-131-2/+2
| | | | | | | | | | | | | | | | | | | | This fix allows to catch exeptions thrown in slots connected to QAction::triggered() signal via QApplication::notify(). Task-number: QTBUG-15197 Change-Id: I6f3e51ec39139ffb0a5f3a31b79f839c18089b26 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2014-05-1311-30/+31
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-1311-30/+31
| |\| | | | | | | | | | | | | | | | | | | Manually changed enum to LibGL in src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: If34ee6cce3d1d51fb4bb1fdfa59c30389ea0d207
| | * Avoid drawing when the QOpenGLWidget isn't mappedJocelyn Turcotte2014-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do as QGLWidget::updateGL does and avoid calling paintGL in updateGL when we we don't have a valid QSurface to draw on. We currently end up calling makeCurrent on the context with a null QSurface in that case, which is the equivalend of doneCurrent, and causes QOpenGLContext::currentContext to return null later when paintGL is called on the subclass. Change-Id: I712ee59274855457b0e4de3757754f56b3528955 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
| | * Remove trailing whitespace.Jake Petroules2014-05-081-1/+1
| | | | | | | | | | | | | | | Change-Id: Id487c8951d7f258c57fa71fd35a60ddb8c5a3fb2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Fix visual index lookup in QTreeViewPrivate::adjustViewOptionsForIndex().Friedemann Kleint2014-05-061-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Determine the visual index by looking up the column of the QModelIndex in the logicalIndices array instead of looping. Task-number: QTBUG-37813 Change-Id: I5c3c73c67537877b03cdc2c36a52041d99f7f49d Reviewed-by: David Faure <david.faure@kdab.com>
| | * QFileDialog: Return empty QUrl from the static get..FileUrl() functions.Friedemann Kleint2014-05-061-3/+8
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-38672 Change-Id: Idf554cd93d1a79db7c82f3165bd128fb31ead3e5 Reviewed-by: David Faure <david.faure@kdab.com>
| | * Fix typo in QGraphicsView's interactive property doc.Mitch Curtis2014-05-061-1/+1
| | | | | | | | | | | | | | | Change-Id: Iccc58490b330657d5d23c333fc408cde33231d95 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| | * Prevent interaction with a disabled menu in the menubarAndy Shaw2014-05-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When moving the mouse over a disabled menu it could appear to be usable but it should not show any interaction at all. Task-number: QTBUG-31688 Task-number: QTBUG-37488 Change-Id: I9e6594b40e8b209146d8c3705750dfd75f1258c5 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
| | * Use QCoreApplication::postEvent() for replaying popup mouse events.Friedemann Kleint2014-05-061-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | When replaying the mouse events synchronously, nested calls of QEventLoop::exec() may happen in conjunction with menus. Task-number: QTBUG-38550 Change-Id: I2b1dafdac59d1a080775af5f165d1e594ea58804 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| | * QMdiArea: Ignore events of other instances in the event filter.Friedemann Kleint2014-05-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This caused for example the variable QMdiAreaPrivate::isSubWindowsTiled being cleared from another instance, which resulted in odd resizing behavior. Task-number: QTBUG-31448 Change-Id: I880f7e415d6654e52499df1bfaf99f2c55d86320 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
| | * Fix crash on startup when running screenreaderFrederik Gladhorn2014-05-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For exaple Qt Creator would crash when started and a screen reader (eg NVDA) is running. This is due to updateAccessibility being called during the ctor of the TextEdit and on Windows the AT can access properties in the same call resulting in accessing the text control before it's fully constructed. Also make sure to not send accessibility updates for non-widget type edits since we don't support any accessibility in Qt Quick 1. Task-number: QTBUG-38659 Change-Id: I1635fa3b2c4d3509f44daf760e4d7b4171d67e1d Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
| | * Fix typo in QListWidget documentation.Mitch Curtis2014-05-051-1/+1
| | | | | | | | | | | | | | | Change-Id: Ieefb664a49bb578efc70ea1ab1a09fb4c8507568 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| | * Fixed wrong condition in QMacStyle.Ivan Komissarov2014-05-031-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I003e59bd50754dbbda23de5c55096ca2d25b7a7a Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | | Fix widget margins on Mac with style sheetsJens Bache-Wiig2014-05-091-0/+19
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Previously we have rejected this issue as you can work around it by setting Qt::WA_LayoutUsesWidgetRect per widget. However there is no reason to apply the negative mac style layout margins on any custom style so I think we should completely bypass it unless the native border is used. Task-number: QTBUG-13050 Change-Id: I8923e07d868c51a13587993c9b2ce79c51beaeee Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2014-05-0819-56/+182
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-0619-56/+182
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/qgl.cpp src/opengl/qglpixelbuffer.cpp src/opengl/qglshaderprogram.cpp tests/auto/opengl/qglthreads/tst_qglthreads.cpp Change-Id: Iaba137884d3526a139000ca26fee02bb27b5cdb5