To calculate the real count we need to use the actual fixed point
increment and can not use the floating point value increment wass based
on since it might round differently.
Includes auto-test by Gabriel de Dietrich.
Task-number: QTBUG-50153
Change-Id: Ia973088f361c90370fa20bac14a4b8f373b5d234
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The name, format and maxChange of a Section depend only on the
section, not on the details of the currently parsed text it matches;
so we don't need the parser object's list of all sections to work them
out. Move these methods to the SectionNode and act directly on that
instead of going via the section list.
Make the name take a Section enum instead of an int.
Likewise, make stateName take a State enum instead of an int.
Change-Id: Ie340d042ab95aec517013c4dcc30901d40305c78
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
The actual section members grew up to the internal value, leading to
interleaving of subsequently-added values. Change existing enum
values to make this go away (class is private, so no BC constraint
forbids this).
Change-Id: If266b557817eae19d375519bf38268f0f2a0d372
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
One #if...#endif started in one function's body and ended in
another's, which is worth remarking on in comments at both ends.
A later #if...#else... opened blocks in both halves, that were closed
just after their #endif, leading to simplistic brace-matching failure;
so move that closing brace to inside both halves, so each half is
brace-balanced and the function, as a whole, brace-balances simply.
Commented on each #endif that was distant from its #if.
Change-Id: I74d97b6dc4b291ec05053d299077a61cecf41ca1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Generate the qundo*.qm files for tst_QUndo*::commandTextFormat() in
the current directory (out of source, for a shadow build) rather than
alongside the qundo*.ts from which they're derived (in the source
tree); and remove them once loaded, if that succeeds. (On failure, we
might even want to look at them.)
Task-number: QTBUG-49081
Change-Id: I666985fa3ceb8c25c917b617d6d39141eddebb76
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
To do that, split out and export a QKeySequencePrivate::keyName() function
that returns the key text representation without the modifiers.
The implementation is compatible with libdbusmenu-qt.
Change-Id: Ibc3190a3949813a1610728cf89574027e5d2778d
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Rename TestWidget to PaintTestWidget, because this class tests only
whether paint event occurs.
Remove unused variables.
Remove reset() method, because there is no need to reset only one
variable in class method.
Change-Id: I8f442c73598e3431baf2b0433fefc157d3f10ea6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This warning was a good idea when the plugins were needed to give a hint
where to start debugging. Now the a11y plugins were merged into
qtwidgets/qtquick, so there is no more need for this warning which may
pop up on custom widgets e.g. inheriting QWindow.
Task-number: QTBUG-50215
Change-Id: Ic5efbb3dfbd07a7139884126a2604b54c99005e4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
This solves an instance where restoreState() was used when the
dockwidget was already floating and the saved state was also for
a floating dockwidget.
Change-Id: I1fe764ae2a6b0351ae26e33ffec682ad37c944d7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The QKeySequence test no longer uses private members (since commit
725bdc3fd2), so that is no longer needed.
Also, remove the unused include from the test.
Change-Id: I4d252bb3efd7282f74c44e48444c23ab51d48ea5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This reverts commit 4c71db7567.
It's too risky for 5.6, we should let it cook in dev for a while
and backport when ready.
Change-Id: I91e677e65d967f29c84a254cd3dffc8bb847b263
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
These are "special" XCB_NOTIFY_MODE_(UN)GRAB
Enter/Leave events and we do not have handlers for
them in Qt, so lets just ignore events with this mode.
Patch fixes Qt+ArchLinux+Awesome WM issues, where Qt
applications were receiving Enter/Leave events for
mouse clicks in the application window.
This patch does not affect "normal" XCB_NOTIFY_MODE_NORMAL
Enter/Leave event handling.
Task-number: QTBUG-45818
Change-Id: Ib70fdd9ed9200364a9753904f8e63d1ed9e2072f
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
The memory should be allocated only if we operates on a valid type,
It is a regression introduced by 3d575d4845
Change-Id: Ia31bccd5b41fe090c29df1aeaa69efb706cd25bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There is no reason why they should be disabled, and also the current behavior
breaks the D-Bus platform menu bar implementation.
Change-Id: I8a8b5b6a66e40f1f1a25394dc87ac2178c7907fa
Reviewed-by: Martin Klapetek <mklapetek@kde.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Changed setCurrentAction() function so that it reselects parent menu
action only if mouse is over a menu and parent menu is not already
selected.
Task-number: QTBUG-47987
Change-Id: Id077d6ce1de1335ba2709180c8480af5d1720de0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Michal Policht <michpolicht@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
qfeatures.txt says that it depends on PROPERTIES, so this condition will
never happen.
Change-Id: I42e7ef1a481840699a8dffff1409e2e63c6857fa
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Resetting focus_window and other internal QGuiApplication variables before
calling setVisible(false) and destroying the platform window means that the
platform window can't reason about whether or not it was the focus window
unless it can resolve that using native APIs. We should let the platform
window take care of resetting the focus window and related states, and
only execute our fallback logic if the plugin doesn't do the right
thing.
We also use QPA to update the state instead of modifying the internal
QGuiApplication variables directly, so that events and signals are
emitted as a result of the reset.
The QLineEdit test gets two added calls to processEvents(), since
assuming that activateWindow() is synchronous is not correct, and
would result in the QMenu resetting the focus window to 0 on destroy.
Task-number: QTBUG-46414
Change-Id: I562788393ed0ffd77d7a4be2279862322f721c1a
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Can be useful for e.g. testlib for handling native key events.
Change-Id: I6560c6e28799e25eb3bdcaa0f2ca3c17644c62db
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
A sequence of state changes fullscreen, maximized and back can leave the
window in a maximized state after setting the top level style. It needs to
be cleared before applying the normal geometry, otherwise, the window ends
up with a maximized button and normal geometry. Amends change
e3288f246b.
Task-number: QTBUG-49709
Change-Id: I0bb4ac1d60693e25d5ee74e763d293405636bb13
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
The feature is enabled by CONFIG += unsupported/objc_namespace,
but can be easily integrated into other build systems such as
CMake or native Xcode by modifying the LD and LDFLAGS equivalent
for each build system.
This is a less resource-intensive alternative to using multiple
Qt builds with different -qtnamespace settings.
Note: The feature is not supported in any way, and should be
used with care.
Change-Id: Ibb8ba1159db36efd7106c117cc2210c7e2e24784
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Introduce separate scale factors for hot spot and pixmap and
set the devicePixelRatio of the scaled pixmap to 1 matching that
of the target pixmap which will be converted to a Windows cursor.
Change-Id: I0b0f6c6a79589ec954b5a1a09a86b87c91b5147d
Task-number: QTBUG-46068
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Use QCursor::pos() to obtain the position in device independent pixels.
Change-Id: Ia54701c556188f40ba678341125114d113ffe8c7
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
qt_mac_set_dock_menu() needs a \relates command to show up properly.
"\since 5.2" produces "This function was introduced in Qt 5.2", which is
wrong; the function existed in Qt 4.
qt_set_sequence_auto_mnemonic() is referenced by the QShortcut class
ref, but the page that hosted it in qtdoc.git is being removed. Thus,
its description is now transferred here.
Change-Id: If009a45f1d04541787925cf230ed7b59c7db0b39
Reviewed-by: Alejandro Exojo Piqueras <suy@badopi.org>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
We have to make sure that the plugins to be tested are located inside
the virtual sandbox / relative to the application binary. Launching via
winrtrunner, a test can find those plugins then. It is not possible to
those via TESTDATA and extract them to temp, as LoadPackagedLibrary only
loads inside the sandbox.
Unfortunately this also implies that running those tests inside Visual
Studio will fail, as Visual Studio copies the virtual sandbox to another
location missing the plugins. For automated testing this should not
matter though.
Change-Id: I70f5ef2d56b3cf526b731fd885f12583c8f6e103
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Bump copyright year in tool output and user visible strings to 2016.
Task-number: QTBUG-50578
Change-Id: I2f4aa9089c6672726f554cba7e6009b425d27683
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Q_DEAD_CODE_FROM_QT4_WINCE was never defined anywhere and there are
no other engines that do similar trick; so remove the code at all.
Consider this "feature" lost in WinCE history ;)
Change-Id: I99183a07ccb45b6b970cd33414708288bd0d7efa
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Parse the requested family before we're looking/saving into the cache,
thus hitting the cached EngineData for:
* quoted family names (eg. QFont("'Arial'"))
* non-simplified family names (eg. QFont(" Arial "))
* substituted family names (\sa QFont::insertSubstitution())
* explicit fallback list, where possible (eg. QFont("Tahoma, Arial"))
This also improves the cache hitting for the font engines in some cases.
Change-Id: I18cdc3e8d669cccec961f84e9b27329402e2b7ed
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
QWindowsPipeWriter is not used in the Windows CE port.
Change-Id: I068dd2408bb21a7e2a86886e0692b1636016ff6a
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Setting it to FirstSection was obviously wrong and left LastSection
nowhere set ...
Change-Id: I26260182e9d986b41b5f3a5d6df94540a5fc116a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Setting conflicts to isSet & DaySection cleared it if we hadn't seen
the day stipulated, even if there had been a conflict (e.g. over year)
before we hit the day-of-week that didn't match the (unset, so
defaulting to) 1st of the month. Explicitly test for conflict and
only set conflicts (to true) if there is a conflict. Added regression
test.
Change-Id: I7363eb66a8bb808d341738d14969039834f50db8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Eliminates separate declaration line, makes unambiguous that all are
initialized.
Change-Id: Ib419a385b38f98070c06428da246d4580b0a0dbc
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
A parameter was called index; but an inner block re-used that name.
Rename the parameter.
Change-Id: I2fa18f32aa129c5b1d8de6c4b6571438eeefea14
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
... Just cache it.
Change-Id: Iae70e09233b237d904ab100f46f8dc7ab9ac8e04
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
All other colors are hard-coded in here, only the background followed the
palette.
Change-Id: If8033a72f85f953358ffeec4edd80a36b8494c7f
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
As of change a094af0017, X11 now joins
other platforms in having a fake screen if no physical screens are
attached, rather than ever allowing QGuiApplication::screens() to
return an empty list or QGuiApplication::primaryScreen() to return
null. This is more consistent across platforms and helps to prevent
bugs in applications which want to use QScreen in some context but
fail to check whether it exists.
[ChangeLog][X11] In case there are no physical screens attached,
QGuiApplication::screens() and QGuiApplication::primaryScreen() will
return a placeholder QScreen object.
Task-number: QTBUG-42985
Change-Id: I0f58afbfe2a034fb9e872a5d1dbdabad2c7dbf9e
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
- Introduce Qt 5 signal-slot connection syntax.
- Merge MainWindow::createMenus()/createActions()
into MainWindow::createMenus(), removing the need
to store the actions as member variables.
Use QMenu::addAction() for brevity.
- For actions in QActionGroups, carry the Valuator enum
in QAction::data so that the slot to handle the selection
does not need to compare the QAction pointer itself.
- Use a non-modal QColorDialog, so that the user
can change colors more easily while drawing.
- Choose saner shortcut keys: control-Q should not
override the default usage for quitting the application,
and using shortcuts for About dialogs is anyway dubious.
- Improve the example documentation.
Change-Id: I57aaf5f5b885c13a953482dbcc41275dd3d6bff4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Replace the large switch in QStandardPaths::writableLocation()
by a function mapping QStandardPaths::StandardLocation
to the int clsid required by SHGetSpecialFolderPath(). Warn if
SHGetSpecialFolderPath() fails for config location and append
prefixes (cache/application name/organization) only on success.
Change the logic in QStandardPaths::standardLocations() to append
the writable location first, avoiding the prepend().
Task-number: QTBUG-50570
Change-Id: I9d80e83d1ca7af3ea8d3ac2c720ee981b1b2c32a
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
... but they were only marked as bidirectional.
Fixed.
This change is slightly BiC, because if some class used tag
dispatching on this iterator type, a recompile might now
pick a different overload, and the old one may not be
available to a user anymore (no longer instantiated).
I do not think Qt uses that technique, yet, though. Not on
iterator categories, at least.
Change-Id: I75fb334af7e191f882d11575dec83c879a6b50ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We depend on the assumption QFontCache::findEngine(key) for key.multi=1
returns a font engine of type QFontEngine::Multi;
guarantee that by checking it in a single place.
Change-Id: I287da4fd62deb22fc5520cde5b0505bc44547609
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
For QLatin1String, operator== is overloaded, so comparing to a latin-1
(C) string literal is efficient, since strlen() is comparatively fast.
OTOH, QStringLiteral, when not using RVO, litters the code with
QString dtor calls, which are not inline. Worse, absent lambdas,
it even allocates memory.
So, just compare using QLatin1String instead.
Change-Id: I761b2b26ab5b416bc695f524a9ee607dacf0a7b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>