summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Add shared implementation of a NSAutoreleasePool wrapper to qglobalTor Arne Vestbø2015-05-273-20/+7
| | | | | | | | | | | We have at least 5 different (but equal) implementations of a wrapper in Qt, and some code uses explicit NSAutoreleasePools. Having a shared implementation lets us clean up things a bit and makes it easier to reason about which pools are actually needed. Change-Id: I2fd8eefc3ae7308595ef9899b7820206268362a5 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Allow horizontal scrolling with a mouse wheel for QListViewAlexander Volkov2015-05-262-0/+34
| | | | | | | | | | | | | | | | | | Convert vertical wheel events to horizontal for two cases of the items layout when vertical scrolling is impossible: 1) TopToBottom flow with wrapping 2) LeftToRight flow without wrapping Do it only for pure vertical events to avoid a mess for such devices as touchpads or Apple Mouse. [ChangeLog][QtWidgets][Important Behavior Changes] Allow horizontal scrolling with a vertical mouse wheel for QListView. Task-number: QTBUG-37007 Change-Id: Ie2525153fa7b443d27ca08cc5f5d4d7ecdb8c183 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QWidgetWindow: Avoid using global static non-trivial type.Sérgio Martins2015-05-251-1/+1
| | | | | | | | Don't initialize it before main, instead, do it whenever QWidgetWindow::handleTabletEvent() is called, which is seldomly. Change-Id: I16935e223d4f9879257e7be026fee0215b9dde22 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Respecting correct text interaction flags when setting text cursor.David Schulz2015-05-181-2/+3
| | | | | | | | | | Currently the text cursor is hidden when a cursor was set using setTextCursor on a widget with a widget text control and the interaction flag TextSelectableByKeyboard. The documentation indicates that this is incorrect behavior. Change-Id: I624a470617f15d09f5772213016e552a5149424c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* QMouseEvent: add constructor which takes the source as a parameterAlexander Volkov2015-05-126-23/+16
| | | | | | | | | Simplify the code by passing the source of a mouse event directly to the constructor instead of setting it by QGuiApplicationPrivate::setMouseEventSource(). Change-Id: I1774cf39a211d36d3adf0ff30f3bd2fb7c5fb429 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Add QMainWindow::GroupedDragging DockOptionOlivier Goffart2015-05-128-90/+705
| | | | | | | | | | | | | | | | | If this setting is enabled, the entire group of docked tabs will be draggable by the title bar of the group and and individual dock can be dragged by dragging the tab. When tabs are detached, the docks that are contained are reparented to a QDockWidgetGroupWindow. [ChangeLog][QtWidgets][QMainWindow] Added GroupedDragging as a DockOption which allow users to drag all the tabs together when dragging the title of a QDockWidget which is tabbed with others. Change-Id: I5285685b129770498eb3e4fd5f4556e41225a595 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Deprecate ItemIsTristate in favor of ItemIsAutoTristate.David Faure2015-05-071-4/+4
| | | | | | | | | | | This makes the behavior much more clear. You can get a tristate checkbox just by setting the CheckStateRole to PartiallyChecked, no tristate flag needed. The flag, on the other hand, enables the automatic-tristate behavior in QTreeViews (and only there), hence the new name for it. Change-Id: I18d292a8b8294c863eab806f3874d15dfb72556c Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into HEADSimon Hausmann2015-05-045-6/+6
|\ | | | | | | Change-Id: I487a4b7c05687a10c498ac219c31367d4db6fbc0
| * QFileDialog: Stabilize tests.Friedemann Kleint2015-05-012-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The init()/cleanup() code in tst_qfiledialog and tst_qfiledialog2 currently differs and fails to clean up the settings file since it only removes the legacy settings under the Qt group and instantiates a new QFileDialog while the QSettings class is still in scope. Also, it has no means of clearing the setLastVisitedDirectory(), which causes the tst_QFiledialog::completer() and tst_QFiledialog::history() tests to interfere, leaving the settings in an invalid state. tst_qfiledialog2 does not use QStandardPaths::setTestModeEnabled((). - Ensure the last visited URL is always clean by making QFileDialogPrivate::setLastVisitedDirectory() static and calling it from init(). - Introduce a cleanupSettingsFile() function to the tests that cleans both groups and call it from initTestCase() and cleanup() to ensure a clean state. - Add QStandardPaths::setTestModeEnabled() to tst_qfiledialog2. Fixes sporadic test fails when executing tst_QFiledialog::completer() and tst_QFiledialog::history() in a sequence. Task-number: QTBUG-45764 Change-Id: I24de3caabf77be067b385d64ff11b7a07fe12b72 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * Minor optimization to QWidgetPrivate::setFont_helper()Konstantin Ritt2015-05-011-1/+1
| | | | | | | | | | | | | | There is no sense in comparing fonts with different resolve_mask-s. Change-Id: Icfdaf494fce8a59b7138d96fdf7354cc0514ca6a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * Fix QTreeView ending up in wrong state when dragKatja Marttila2015-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | Changed state in MouseRelease so that QTreeView does not end up in wrong state if drag is started but not completed. Task-number: QTBUG-44773 Change-Id: I0b665d2944f2b696bc4b7e79689d110aefa3f194 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| * QSystemTrayIcon: Fix the placement of title and message in a balloonAlexander Volkov2015-04-271-1/+1
| | | | | | | | | | | | | | | | | | Swap title and message parameters in the QBalloonTip::showBalloon() call. It was wrong in f277c074675389eba0b27f2ccadddd98869fdfbb on xcb platform. Task-number: QTBUG-43428 Change-Id: I18e354703d9fa9c196b2789e6df263debdb7ce06 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Fix crashes when accessing environment variables concurrentlySimon Hausmann2015-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We've seen crashes with QThreadPrivate::start using qgetenv during the creation of the event dispatcher, while another thread (for example the gui thread) called qputenv. This is inherently thread-unsafe and there are many places where we make the assumption that using the environment is safe. However access to the environment is inherently unsafe in the C runtime and the best that we can do is add a mutex around the Qt environment access functions, to at least protect ourselves and our users. Change-Id: Ie9a718d9f7ce63c423c645f0be3e3f4933e1cb08 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-272-3/+12
|\| | | | | | | | | | | | | | | Conflicts: src/tools/qdoc/tree.cpp tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: Iaa78f601a63191fa643aabf853520f913f2f0fdc
| * QMainWindow::restoreDockWidget(): Fix positioning of floating docks with ↵Friedemann Kleint2015-04-261-2/+8
| | | | | | | | | | | | | | | | | | | | | | native decoration. Use QWidget::move() to position floating dock widgets. Add a test for QMainWindow::restoreDockWidget(). Task-number: QTBUG-45780 Change-Id: I945917728a663916e8c225b9d3d2a75fa508d68f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Fix FPE in QApplicationPrivate::dispatchEnterLeave() due to invalid cursor ↵Friedemann Kleint2015-04-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | position. QGuiApplicationPrivate::lastCursorPosition is initialized to qInf(), qIn(). Under some circumstances, this is passed to dispatchEnterLeave() which causes an FPE in QPointF::toPoint(). Move the invocation of QPointF::toPoint() to the if-branch handling the enter list, which already fixes the FPE. To be extra sure, clamp to QWIDGETSIZE_MAX. Task-number: QTBUG-45501 Change-Id: I2d1407415e6360196730d23ee319d1ee6981d1f5 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/devFrederik Gladhorn2015-04-228-41/+128
|\ \
| * | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-228-41/+128
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/gui/painting/qdrawhelper.cpp src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/plugins/platforms/xcb/qxcbwindow.h src/testlib/qtestblacklist.cpp src/tools/qdoc/node.cpp src/tools/qdoc/node.h tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684
| | * QFileDialog: save settings to FileDialog group instead of serializedShawn Rutledge2015-04-202-35/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | The byte array serialization needed versioning, whereas a collection of separate settings is more robust and accessible. Task-number: QTBUG-36888 Change-Id: I790b1d7574707261923a7a33ccd8bcc596a69de5 Reviewed-by: David Faure <david.faure@kdab.com>
| | * Enable checking for whether the system palette was explicitly setHarald Hvaal2015-04-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to obey a palette set globally on QApplication, an application attribute for checking if it's set at all is added. Task-number: QTBUG-39800 Change-Id: I26b965e6e18e0e1ca4df03cf343b3527df3636b2 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | * Avoid warnings with clang 6Laszlo Agocs2015-04-161-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | warning: 'this' pointer cannot be null in well-defined C++ code The code tries to be smart but compilers warn about this unfortunately. Change-Id: Ifb8deafe8834d580beef829a3079ae9222acfa8f Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| | * Fix compilation error (OS X 10.8, warnings as errors)Timur Pocheptsov2015-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | Failed to compile on my OS X 10.8 (unused variable warning treated as error) Change-Id: I7ee881d4b905539361a10e93cff76b44ec08afbf Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
| | * QToolButton: Fix popup menu geometry in case of QGraphicsProxyWidget.Friedemann Kleint2015-04-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDesktopWidget::availableGeometry(const QWidget *) returns the scene geometry when the widget is embedded into a QGraphicsProxyWidget. Work around by using the overload taking a point. Task-number: QTBUG-38559 Change-Id: Ie630bda57e14648255015587a04e29b0de96bab7 Reviewed-by: Arnaud Bienner <arnaud.bienner@gmail.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| | * Guard QWidget::setStyleSheet() against invocation from destructor.Friedemann Kleint2015-04-091-0/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-45178 Change-Id: I3670d9cd9645155318b595d1324a3b3caf2352f6 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| | * Avoid leaking the QPlatformTextureListLaszlo Agocs2015-04-081-0/+1
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-45395 Change-Id: I8fbdc5136d7d15b9c131d6b91186a1bf2645e4d4 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | | QWindowsStyle: Do not rely on the widget to draw the dock titleOlivier Goffart2015-04-221-1/+1
|/ / | | | | | | | | | | | | | | | | There is no need to query widget->isWindow when this information is present in the QStyleOption state (it is even set using isWindow in QStyleOption::init) Change-Id: I4f3bbdd9c70d6253e9301bc168d61c7ecdbfdc06 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Remove <qhash.h> where it's not usedMarc Mutz2015-04-207-6/+2
| | | | | | | | | | | | | | | | To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5) in public headers. Change-Id: I6117e8a6b11200d2f1a0a94a0e87d5c27538218e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Allow for rearranging tabified QDockWidgetsOlivier Goffart2015-04-114-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow to drag and drop tabs [ChangeLog][QtWidgets][Important Behavior Changes] The tabs for the tabified docks can be moved by the user. Task-number: QTBUG-1049 Task-number: QTBUG-2295 Task-number: QTBUG-4532 Task-number: QTBUG-18883 Task-number: QTBUG-35148 Change-Id: I7ef9d4987db081654bd5d648e14370b3d381a720 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-081-0/+2
|\| | | | | | | Change-Id: I04f9f2749f68c0cb5a427b8d84e43b44bb143e4d
| * Add Q_UNUSED for parameter (OS X)Timur Pocheptsov2015-04-071-0/+2
| | | | | | | | | | | | | | | | Ifdefs exclude the code on OS X, but there is still unused parameter and annoying compiler (either warning or error, depending on ...). Change-Id: I913c25b4f96ebe275a6b1d15873bccf4aebe9e7a Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* | Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/devLiang Qi2015-04-0810-49/+97
|\ \
| * | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-0610-49/+97
| |\| | | | | | | | | | Change-Id: If9fd98525b6b4ca07e5e006fc98bf372a73b8a21
| | * QComboBox: also adjust size on model reset, with AdjustToContentsDavid Faure2015-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the size adjust policy is QComboBox::AdjustToContents, the combobox sizeHint was recalculated on dataChanged, rowsInserted, rowsRemoved, and setModel, but not when the model was reset. This led to truncated items in the combobox when models are filled asynchronously. Task-number: QTBUG-5413 Change-Id: I3456c327d680dfffa58d6dcb26c79456c67b2a32 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * QComboBox: open popup on touch release if QStyleHints has ↵Richard Moe Gustavsen2015-04-042-16/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setFocusOnTouchRelease() If we give focus to the combobox on touch release, we need to await opening the popup until touch release as well. Otherwise we might end up showing a popup for an unfocused combobox. Especially on iOS, there is a strong coupling between focus object and popup menus, which means that we effectively require the combobox to gain focus before it can show the popup. Change-Id: Ifb7ba091bb39b77f325cdbf61e00ab3e8ff2e522 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| | * Fix debug stream operators.Friedemann Kleint2015-04-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use QDebugStateSaver to restore space setting in stream operators instead of returning dbg.space() which breaks formatting on streams that already have nospace() set. - Fix some single character string constants. Change-Id: I0fe86bb1adbdd4a76ab6d2f8c19e063b45ddcf3b Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
| | * Improve debug operator for QGraphicsItem/QGraphicsObject.Friedemann Kleint2015-04-011-13/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce QDebugStateSaver, use new formatting helpers and output parent, flags and z only when necessary. Output the widget contained in QGraphicsProxyWidget. For example, QGraphicsProxyWidget (this = 0x1877550 , parent = 0x0 , pos = QPointF(870,491) , z = 1e+30 , flags = ( ItemIsFocusable | ItemUsesExtendedStyleOpton | ItemSendsGeometryChanges | ItemIsPanel ) ) becomes: QGraphicsProxyWidget(0x1877550, widget=ItemDialog(0x1e29dc0), pos=870,491, z=1e+30, flags=(ItemIsFocusable|ItemUsesExtendedStyleOption|ItemSendsGeometryChanges|ItemIsPanel)) Change-Id: Ia554dc3e2eb6f16d9d9220d1067194a4424b7cf5 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
| | * Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5Liang Qi2015-04-017-19/+22
| | |\
| | | * Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-317-19/+22
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
| | | | * Fix use of the window geometry specificationAlexander Volkov2015-03-271-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now we applied the geometry in QWidget::setVisible() by calling QWidget::move() and QWidget::resize(). But these methods are unreliable when the window is created but not visible yet. For example, specifying the window position by "-geometry +0+0" will take no effect. Apply the geometry directly to QWindow in QWindow::setVisible(). QWidget will update its geometry after the response of the window system. Besides it allows to specify the geometry for QML applications. Task-number: QTBUG-44713 Change-Id: I9a0e110e81e569c81da802729707fec104fef887 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| | | | * Doc: warn about resize event bugPaul Olav Tvete2015-03-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The resize event for QMdiSubWindow may occasionally have an invalid oldSize(). This has been the case since 2007. Fixing this looks like a high risk, low reward endeavour. Task-number: QTBUG-32446 Change-Id: I80ce43987c7b6e346cd44f7ac4cef01b01e5472b Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
| | | | * QComboBox: Update completer on setCurrentIndex()Andre Hartmann2015-03-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the ComboBox currentText() was changed by key LineUp or LineDown or mouse click, the completer still contained the last inserted characters. If now all text was selected (by Ctrl+A or selectAll()), the old item and index was restored on next Enter press. Task-number: QTBUG-41288 Change-Id: I6916fd31c8b8fbacfb12e1a62c3e46823cf918b4 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
| | | | * Do not colorizing images to invalid premultiplied colorsAllan Sandfeld Jensen2015-03-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some combinations the fusion style colorizeImage method would generate invalid colors causing odd colors in the end result. Task-number: QTBUG-41515 Change-Id: Ib16049be1f3e93ae4976524df2827076eac7d94f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com>
| | | | * Workaround for programs depending on previous layout bugPaul Olav Tvete2015-03-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 2bfee10f made QDockAreaLayout respect the maximum size of the central widget. This broke some existing programs which would set sizePolicy to Fixed on a central widget without a sizeHint. This patch restores the old behaviour for the special case where there are no dock areas. It is highly unlikely that the intention in this case is to have a very small central widget with huge blank areas on either side. Task-number: QTBUG-43797 Change-Id: I1e1fb17204f72166da3b0b054a7777e8183604a7 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
| | | | * [Android]: Ensure clicking on the arrow shows the popupAndy Shaw2015-03-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a problem with editable comboboxes specifically as there is an edit field area which is separate to the arrow. Giving a valid rectangle for the arrow allows QComboBox to know that it was clicked on. Task-number: QTBUG-44931 Change-Id: Ie1d06a6631d6c7f5e813419a5e76f67ec9dcd7e8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| | | | * Adjust wiki links to the new redirectSergio Ahumada2015-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it looks nicer this way Change-Id: I872976bdef5f581187a758aa92b02e2f5f32b130 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | | | QErrorMessage: sort statements in ctorMarc Mutz2015-04-071-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has no influence on text size, but by executing similar functions temporally close to each other, we should make better use of the i-cache. It's also more readable. Change-Id: Ia211e562d798d4f16f3fd17f87f1e2cad2e0359d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | | | QErrorMessage: streamline conditionals in done()Marc Mutz2015-04-071-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...to avoid checking the same conditions a second time. Saves 32B in text size on my machine, too. Change-Id: I0368408b9f5feb02e811dc15ade79d9796031896 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | | | QErrorMessage: avoid some code duplicationMarc Mutz2015-04-071-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...by using the predicate from nextPending() in the two showMessage() functions, too, which thus become identical, when substituting type -> QString(). Also saves around 250B in text size. Change-Id: Ibf5d081dbec3438b7b1be4e240879e26d0455d6b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | | | QErrorMessage: add some strategic qMove()sMarc Mutz2015-04-071-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Saves 56 bytes in text size on my machine. Change-Id: Ic92943356e0e27620346854e02c129cdfa00f894 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | | | QErrorMessage: replace inefficient QQueue with std::queueMarc Mutz2015-04-071-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQueue is-a QList, so it inherits the trait that types larger than a void* cause a heap-allocation when inserted, which is horribly inefficient. Use a std::queue instead, which, by default, is backed by std::deque. Requires rewriting the API calls, since QQueue uses non-standard function names. Text and data size increase negligibly (23 and 8 bytes, respectively), even though we're instantiating a completely new type (std::deque) instead of QList<QPair<QString, QString>>, which is probably still used, despite the inefficiency. Change-Id: I9bb04a2ec32bb1b9fa2eb83780f0aaa26e872d49 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>