summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | Add qOverload to select overloaded functionsPeter Kümmel2016-02-155-0/+254
| | | | | | | | | | | | | | | | [ChangeLog][QtCore][Global] qOverload added to select overloaded functions. Change-Id: I7c9b1b054e6631eca0b5594db59e1202ef552c33 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Use QVector instead of QList for sizeof(T) > sizeof(void*)Sérgio Martins2016-02-143-3/+3
| | | | | | | | | | | | | | | | | | | | caught with static analyzer which only warns for trivial cases: - Container must be local - Container isn't passed to any function, assigned to another container or assigned to. Change-Id: I3f3aa73c128a56f067fa8745990977445a495ac4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Introduce QHash::equal_range()Sérgio Martins2016-02-143-0/+156
| | | | | | | | | | | | | | | | | | | | | | | | Similar to QMap::equal_range(). Will allow to easily fix inefficient code such as: foreach (auto value, hash.values(key)) { ... } [ChangeLog][QtCore][QHash] Added QHash::equal_range() Change-Id: I6e19e25de632e897ad83d3141d9d07f0313f7200 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QtWidgets: use new QRect::transposed()Marc Mutz2016-02-139-14/+11
| | | | | | | | | | | | Change-Id: Idfed0ae6b80e301fd32206b2e6d68054460b76de Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QRect(F): add transposed()Marc Mutz2016-02-133-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | I didn't add a transpose(), because r = r.transposed() is perfectly capable of filling that role, and just as efficient. Existing API mistakes are no excuse to create more of them. [ChangeLog][QtCore][QRect/QRectF] Added transposed(). Change-Id: Ic38721e9028496fc9b50f4d4cef2e7a60532eed8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QRegion: add move ctorMarc Mutz2016-02-133-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | After this change, this was the distribution of calls in QtGui and QtWidgets when the patch was developed for 5.4: QtGui QtWidgets move 23 63 copy 23 36 Change-Id: If3f536e52fc242c585e7fa0662049c0657efcc9c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Use QFlags::setFlag where prudent in qtbaseAndre Somers2016-02-1225-185/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFlags::setFlag is most useful to replace explicit constructs like if (condition) { someFlags |= TheConditionFlag; } else { someFlags &= ~TheConditionFlag; } with someFlags.setFlag(TheConditionFlag, condition); Change-Id: Ie4586681c83e0af812d5bbf14965aad51941a960 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Fix for deferredDelete() bug when calling the glib loop directlyPaolo Angelelli2016-02-127-19/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes sure that all events posted using Qt on top of the GLib event loop have the loopLevel counter incremented. This is done since Qt depends on the fact that all deleteLater() calls are issued within the scope of some signal handler (in other words, triggered by the chain sendEvent() -> notifyInternal2()). There is a side effect though: in the conditions affected by this patch, that is deleteLater()s issued within a glib event handler for example, manually calling processEvents() or sendPostedEvents() with or without the QEvent::DeferredDelete flag has the same effect, and deferred deleted events are always processed. While this is not a currently working feature which the patch breaks, this side effect seems to be difficult to avoid without separating sendPostedEvents() and processEvents() into a public and a private method, in order to detect when they are manually called. Such change could perhaps be done for Qt6. An autotest for QTBUG-36434 is also included. Autotesting for QTBUG-32859 seems to be more challenging in this respect, due to its dependency on GLib. Task-number: QTBUG-18434 Task-number: QTBUG-32859 Task-number: QTBUG-36434 Change-Id: Ib89175aa27c9e38bca68ae254d182b2cd21cf7e9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Generalize iOS simulator and device exclusive buildTor Arne Vestbø2016-02-129-79/+79
| | | | | | | | | | | | | | | | Preparation for Apple tvOS support, which shares a lot with the iOS platform. Change-Id: I543d936b9973a60139889da2a3d4948914e9c2b2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | QTextFrame::iterator: restore nothrow move special membersMarc Mutz2016-02-122-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The user-defined copy assignment and copy constructors inhibit the move special member functions. We cannot do something about it in Qt 5, because the class is exported (which it shouldn't be), and because making it trivially-copyable might change how it is passed to functions by value, so we need to supply all the missing member functions manually. Change-Id: Ic710b449f6abd386449fa6df71e8bc9bd0f98d2b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QXmlStream*: make nothrow move assignable and -constructibleMarc Mutz2016-02-121-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, we cannot rely on Q_DECL_EQ_DEFAULT, so I needed to code the special member functions by hand. The 'reserved' field is pretty useless, since the existing ctors didn't initialize it, but just in case someone finds a way how to store information in there, deal with the field in the usual way: set to nullptr in the move ctor and swap in the move assignment operator. Also schedule all this for removal again come Qt 6 (then without the reserved field). This amends a83be780aecd78bf8b2b76dab722097f74663d74, which only dealt with QXmlStreamAttribute. Change-Id: I6898e5d0423c9519f7c07d23e2c6d2700508151e Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QBitmap: restore nothrow move special membersMarc Mutz2016-02-122-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user-defined dtor inhibits the move special member functions. We cannot do something about it in Qt 5, because the class is exported (which it shouldn't be), and because it's polymorphic (which it also shouldn't be), so we need to supply all the missing member functions manually. Add a note to remove the inheritance from QPixmap in Qt 6. Change-Id: I86a1a3fe7b84247b3e604cb008aa17bb673c8468 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Cocoa integration - suppress excessive dragginUpdated messagesTimur Pocheptsov2016-02-121-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our abstract item views are using a timer before starting autoscroll. Constant dragginUpdated (re)starts this timer again and again and it actually never times out (== no autoscroll). It looks like a bug in Cocoa since 10.11, they test: respondsToSelector:@selector(wantsPeriodicDraggingUpdated:) with ':' at the end, though they need a method without parameters; as a result QTBUG-32761 was re-introduced. Let's make them happy and respond to this selector also (never gets called actually). Change-Id: I3b7bb0a455124f84c97fc350f69486bf0fc5d5fc Task-number: QTBUG-32761 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
* | QStringListModel: optimize container usage.Anton Kudryavtsev2016-02-121-4/+4
| | | | | | | | | | | | | | | | - don't call QList::removeAt() in loop. Just call erase() with two iterators. - don't re-evaluate QList::count() because of result is already cached. Change-Id: I4b3596df4a388f1d39b523c27decad612044cec6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Fix QFileSelectorPrivate::addStatics()J-P Nurmi2016-02-122-0/+12
|/ | | | | | | | | It must clear the previously cached sharedData->staticSelectors, or else QFileSelectorPrivate::updateSelectors() does nothing and the newly added static selectors end up being ignored. Change-Id: If6997664629199be9f00de64c5dd01de2bf0a044 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* QtGui: eradicate Q_FOREACH loops [const-& returns]Marc Mutz2016-02-113-5/+9
| | | | | | | | | | | ... by replacing them with C++11 range-for loops. The function QObject::children() returns by const-reference, so they can be passed to range-for without further changes. Change-Id: I8cd2921165c45020914dd3a23b1f18b519fe7900 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QtGui: eradicate Q_FOREACH loops [needing qAsConst()]Marc Mutz2016-02-119-20/+19
| | | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(). Change-Id: I90fd517ad542ef92034403c15ebb8300a56ac693 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QtGui: eradicate Q_FOREACH loops [already const]Marc Mutz2016-02-1116-26/+27
| | | | | | | | | (or trivially marked const) ... by replacing them with C++11 range-for loops. Change-Id: I3cce92b9d77a3ff96fad877d1d989145e530646f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Optimize string building in QImage::text()Marc Mutz2016-02-111-5/+4
| | | | | | | | | | | | | | - Don't iterate over QMap::keys(), but directly over the map, saving a temporary QList and double lookups. - Always append the item separator, and chop it off once at the end, which allows to fold the separator into the existing string builder expression. Change-Id: Ibd20ea292695098e0fc575025b1827a75aabfd1e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QMatrix, QTransform: restore nothrow move special membersMarc Mutz2016-02-114-10/+34
| | | | | | | | | | | | | | The user-defined copy assignment and (on QMatrix) copy constructors inhibit the move special member functions. We cannot do something about it in Qt 5, because these classes are exported (which they shouldn't be), and because making them trivially copyable might change how they are passed to functions by value, so we need to supply all the missing member functions manually. Change-Id: I59e480d7ba02cac7e3d654cb3345f541e0701f4c Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Suppress memory allocation due to temporary containerSérgio Martins2016-02-111-1/+1
| | | | | | Change-Id: I337c3f7ed63444ac0950a30298eb619f462b7a16 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QtGui: replace a Q_FOREACH loop with qDeleteAll()Marc Mutz2016-02-111-4/+2
| | | | | | | Change-Id: Ibb26338809ffccc3a736a7c53ac4f5877cac34a8 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QtGui: replace a Q_FOREACH loop with QList::op+=Marc Mutz2016-02-111-4/+2
| | | | | | | Change-Id: I071705d6fdb4cec5bc357bda034c249b400147a9 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QtGui: eradicate Q_FOREACH loops [rvalues]Marc Mutz2016-02-119-17/+32
| | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Change-Id: I457942159015ff153bdfc6d5f031a3f0a0f6e9ac Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QImage: split strings with splitRef() in convertWithPalette()Marc Mutz2016-02-111-4/+4
| | | | | | | | | | Optimize the string splitting by using splitRef(), avoiding the creation of lots of substrings. Twice. While touching the for loop, port to C++11 range-for. Change-Id: Ia666896bc5b96c4b6973498cc4a9eeb24cadba6d Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QtGui: eradicate Q_FOREACH loops [QVarLengthArray]Marc Mutz2016-02-112-4/+4
| | | | | | | | | | | | | Q_FOREACH over a QVarLengthArray is a partcularly bad idea. Use C++11 range-for (without qAsConst(), because QVLA isn't CoW). Change-Id: I5ee55557577f183151d3871e4518382c4adf0237 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QPainter: replace an inefficient QList with QVectorMarc Mutz2016-02-114-25/+22
| | | | | | | | | | | | | | QPainterClipInfo is larger than a void*, so holding it in QLists is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by marking it movable and holding it in a QVector instead. Port from op<< to append() to reap rvalue push_back(). Change-Id: I3af17eca2443d26a795381635510b8b9a5795e5f Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* uic: replace an inefficient QList with QVectorMarc Mutz2016-02-112-4/+6
| | | | | | | | | | | | | | | | | Buddy is larger than a void*, so holding it in QLists is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by marking it movable, and holding it in a QVector instead. Since QVector requires a default ctor, drop the pointless existing ctor and use aggregate initialization instead. Use QVector's rvalue append. Change-Id: I696ca4f03dbe362a5438be209debbcd966fe8130 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Move waylandfunctions from qtwayland to qtbaseLaszlo Agocs2016-02-113-0/+88
| | | | | | | | The only place such headers can live is qtbase. Exporting headers under QtPlatformHeaders from other modules would conflict. Change-Id: I13d78fe54b50c5eaccc29bb166efdaafba70e6e2 Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
* Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/devLiang Qi2016-02-11105-960/+875
|\
| * Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-02-11105-960/+875
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfilesystemwatcher_win.cpp src/corelib/plugin/plugin.pri src/plugins/platforms/cocoa/qcocoaaccessibility.mm tests/auto/corelib/tools/qlocale/tst_qlocale.cpp Change-Id: Id6824631252609a75eff8b68792e4d10095c8fc1
| | * QLocale: Use QVariant::toStringList() instead of template instantiationSérgio Martins2016-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Avoids (binary) code duplication. Change-Id: I57a23e2f6e151963163d8073b309b3562f8e8684 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Fix usage of QMutexLocker, destroy it only at end of scopeSérgio Martins2016-02-102-5/+5
| | | | | | | | | | | | | | | | | | Change-Id: I87f2c433c987b5f7b4680639cae51cdf6ce9ddc6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | * Windows accessibility: Add override declaration.Friedemann Kleint2016-02-101-1/+1
| | | | | | | | | | | | | | | Change-Id: I982c91a9316f10a5e6d88abd60c028664ed3e28e Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
| | * Windows accessibility: Remove some cruft.Friedemann Kleint2016-02-103-367/+0
| | | | | | | | | | | | | | | Change-Id: I5cb35bdd5441a8dd7a51193048b32a6feccba2b2 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
| | * QWindowsVistaStyle: Suppress animation when QLineEdit's base color is set.Friedemann Kleint2016-02-101-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce utility function to check using QWindowsXPStylePrivate::isLineEditBaseColorSet(). Task-number: QTBUG-40634 Change-Id: Iaa6962a17217352aa59d0c54421b764ad47d3bf8 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
| | * QWindowsXPStyle: Introduce utility function for QLineEdit's palette.Friedemann Kleint2016-02-103-39/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce QWindowsXPStylePrivate::isLineEditBaseColorSet() checking whether the base color has been set in the widget's palette taking into account the QSpinBox special case and simplify the code accordingly. Task-number: QTBUG-40634 Change-Id: I0e7527031b333d71727fbd30db6dd80aa715c9ab Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
| | * Provide QCss with the correct font for <pre> blocksAleix Pol2016-02-092-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Labels would use a statically defined font for <pre> blocks. Use the one defined by the QPlatformTheme instead, through QFontDatabase::systemFont(FixedFont) Task-number: QTBUG-50564 Change-Id: I5491bd0defce651bdf809bcbc6a529a900f4959b Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| | * Readability fix for MS isRelative, isAbsolute.Edward Welbourne2016-02-091-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The layout and phrasing of these two QFileSystemEntry methods was such as to obscure what they actually test. (Overlong lines, extraneous parentheses, spurious conditions and poor line-breaking.) Rewrote to make both clearer; and, in particular, to make it obvious that they are *not* mutually complementary. Behavior is not changed. Change-Id: If748e48d41fe3a76bab3a1f840c7b7ca62442f8f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * Cleanup testcase for platforms without QProcess support.Maurice Kalinowski2016-02-091-0/+2
| | | | | | | | | | | | | | | Change-Id: Ib56c90262605ad975772f6b26c6232020e308ca6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | * QWindow::setMask(): Apply High DPI scaling.Friedemann Kleint2016-02-092-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move code from QWidget::setMask() and reimplement QWidget::setMask() using QWindow::setMask(). Task-number: QTBUG-50938 Change-Id: I040688d6b18df91368fa6ab6392a3b4cd80f2683 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| | * Standarddialogs example: Remove horizontal spacer from fullscreen layout.Friedemann Kleint2016-02-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | It does not work as expected since the QLineEdits do not expand. Amends b880b7e1ac15f3458c009d63002c872e7521eeab. Change-Id: I0b3b3822cca7fc6442a7155eecd46bd3d134d069 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| | * Don't force antialiasing when it is turned offEskil Abrahamsen Blomfeldt2016-02-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the gray antialiasing code path for text on Windows, we check whether Cleartype is enabled in the system and, if it is, we forcibly enable gray antialiasing instead. But in this logic we did not consider the case where antialiasing is turned off entirely, i.e. when the style strategy is QFont::NoAntialias. We should never override no-antialias with antialias. [ChangeLog][Windows][Text] Made it possible to disable antialiasing for text when drawing into images. Task-number: QTBUG-47141 Change-Id: Ieb2beba8c2d02295abe6d9a98d2e63a2d39c9e6a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| | * dbustray: Support late registering of tray icon menuDmitry Shachnev2016-02-093-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | If a menu is added to the tray icon after the icon itself has been registered, we need to register the menu properly. Change-Id: I19a6d78848142d66c2cd882746d8d55c0b9a2818 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| | * dbustray: Do not change m_menu in QDBusTrayIcon::createMenu()Dmitry Shachnev2016-02-091-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This method can be called for a submenu after it's called for the top-level menu, and we should not replace it with a submenu. Change-Id: I8e180ee074287cfcdc76dfe77c6c7aa7d5891741 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| | * Fix clang 3.7 developer build [Werror, Winconsistent-missing-override]Sérgio Martins2016-02-081-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: Ia5c149c6e6886c38bb9a83cd8b36737a57876b41 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * dbusmenu: Refactor the code to allow dynamic updating of menusDmitry Shachnev2016-02-086-54/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Transfer propertiesUpdated and updated signals from submenus to parent menus. Without this, the adaptor only receives this signal from top-level menu items, and doesn't receive it from items of submenus. Connect to these signals when a menu item is added or synced, and disconnect when it is removed. * Make QDBusPlatformMenus use IDs of items containing them, not their own IDs (own IDs do not make any sense since they are not exported over D-Bus). * Store toplevel menus per-adaptor, to make it possible to export multiple menus (for example a menubar and a tray icon menu). * Adjust the QDBusMenuLayoutItem::populate methods to always get the menu via its containing item and to populate the menus recursively. * Map D-Bus menu AboutToShow method to platform menu aboutToShow method, and map hovered and closed events to hovered and aboutToHide signals. (QTBUG-46293) * Always set the visible property on item. Otherwise, when an item becomes visible, the D-Bus menu still thinks it's invisible because that property was not changed back to true. (QTBUG-48647) * Call emitUpdated from insertMenuItem and removeMenuItem methods, as they really update layout. Do not call it from syncMenuItem, it changes only properties but not the layout. * Start revision numbering with 1, because libdbusmenu-based hosts ignore updated signal with revision=1. Task-number: QTBUG-46293 Task-number: QTBUG-48647 Change-Id: Icf713405db0443e25462c1a19046df7689fe5e78 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
| | * Reduce allocations by using reserve()Sérgio Martins2016-02-0714-20/+44
| | | | | | | | | | | | | | | Change-Id: If34fa53402985f6b3c5e7217bce4a1177af835b6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * Make QWindowGeometrySpecification suitable to use as globalSérgio Martins2016-02-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | It's used as a global static but according to library policy it's required to have a trivial dtor and a trivial or constexpr ctor, otherwise it runs code at library load/unload. Change-Id: I1fcea3ce388b2a198e3851e6d0aeb91ae0a8e4b1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * xcb: Fix not delivering focusIn event on hide/showAlexander Bersenev2016-02-061-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider a window which was hidden and shown with hide() and show() methods and mouse pointer was in window when hide() was called. At first, window got focusOutEvent and then Qt library sends X server a message to unmap the window. Then X server will send client two messages: 1) FocusOut(10) detail=Nonlinear(0x03) 2) FocusIn(9) detail=Pointer(0x05) QXcbWindow has a logic for not seting active window to 0 if there is a FocusIn coming (see QXcbWindow::doFocusOut). So QGuiApplicationPrivate::focus_window still points to the current window. Then when show() is called, qt compares previous focus with new focus and, since they are equal, doesn't do anything. Event focusInEvent isn't delivered to the window. Here are two links why X server sends FocusIn just after FocusOut: http://lists.freedesktop.org/archives/xorg/2008-December/041684.html https://tronche.com/gui/x/xlib/events/input-focus/normal-and-grabbed.html Proposed fix ignores FocusIn events with detail==Pointer. The text of explaining comment is taken from the Chromium project: https://chromium.googlesource.com/chromium/src/+/master/ui/views/widget/desktop_aura/x11_desktop_handler.cc from X11DesktopHandler::ProcessXEvent function. [ChangeLog][module][Linux/XCB] Fix not delivering focusIn event on hide/show with XCB Task-number: QTBUG-49071 Change-Id: I433c8b638834c25f113cc134ee4185778c44f540 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>