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>
When the window container already has a window handle, allow embedded
windows to use this handle as a parent. This change will allow proper
window stacking and clipping.
Task-number: QTBUG-50477
Change-Id: I8d656ecb99e0c42ae7a7ac461e5e5b5d801f5493
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
c7e5e1d9e0 assumed shortcut handling could be done at the QPA
level, but this fails on async platforms where there are e.g
activation events in the QPA queue and we then try to handle
the shortcut synchronously.
This commit restores the handling to QtGui for non-OS X platforms,
and we should fix OS X by adding callbacks through the IME for
the special case of OS X.
Task-number: QTBUG-50467
Change-Id: I7460184cc60d0319f07771eec487325a17d7e7e7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
- put it in a separate private header
- add a protected QFinalState constructor that takes a
QFinalStatePrivate
- when passing through, also export QStatePrivate, so the linker can
find the symbol
Change-Id: I8563da16739731d9d6142be438a8769fc29de148
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This test ensure that a connection made to either an invalid host or an
unreachable host fails properly.
Task-number: QTBUG-47452
Change-Id: If31d23d815e496fc21ef2e1e19c34c2723bd3504
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The QFontCache instance is stored in QThreadStorage and thus calling
QFontCache::instance() isn't really cheap; avoid calling it multiple
times where possible.
Change-Id: I1b7a83089698a06c49dac08b2a3a8e9c3c75a500
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Since the likelyhood that decoration_size is greater than 0 then we can
save time with explicitly ensuring that it does not call the functions.
Change-Id: Iaf991a6c77bbc4908c459307ca7e645cf3b3ca20
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The error message was not informative enough to troubleshoot.
Change-Id: Ib21fce238c80b31d21939d139fc173b48eb5ceb8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Makes it clear that the engine for font with no Latin WS support
won't be cached as "shared" engine and thus shouldn't be normally
expected in the cache, so don't even try to find it there.
Change-Id: I9e6275b4919607f4057a193b446825c98932bd23
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
by inlining and reordering the condition.
Change-Id: I68a91e75071975a4cc26333094db3433afbaeb72
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
The old code did the equivalent of strcpy(), thus stopping
at the first NUL byte, ignoring the QLatin1String's size().
That is not acceptable, for two reasons:
1. Appending QLatin1String to a QString uses the size(), too.
2. The QConcatenable claims an ExactSize = true, so
it cannot go and write less data than it's own
size() said it would. Even worse, it will happily
write _more_ data, too, if the QLatin1String is
not properly zero-terminated.
This change has low risk, because the equivalent change
to the QString branch has been applied between 5.2 and
5.3 (in fd0f1bc3), with no complaints from the user base.
It is also in a branch that is very unlikely to be taken:
Since QConcatenable<QLatin1String> is setting ConvertTo
to QString, any QStringBuilder expression containing it
will only implicitly convert to QString, not QByteArray.
In fact, I don't even know how to make it invoke the
changed code in normal operation...
Change-Id: I486a76352af7f318ba05da845d3afee7d826c92a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Set the NSImage size (which is in points/device
independent pixels) to inform Cocoa DnD about the
intended image visual size.
Change-Id: I6fadd77f4e0173e8e9773725fab3b35f70a055ff
Task-id: QTBUG-44179
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Uses a time derived via .toUTC() to ensure the .toLocalTime() comes
out at the time we expect.
Task-number: QTBUG-49008
Change-Id: I2005127929c7eab1b7a3cbaba8d21df8c9585d17
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>