This was broken in f95181c7bb,
and has been broken in all released versions of Qt5.
Change-Id: Ia75ab602be4904cc6ab19471f909716538af8746
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Re-add the name of a QML type/QML basic type to the navigation
bar.
Change-Id: Ia0ced775099f1ed4071ae9a922d808b9114c10ea
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
GCC was bailing out when attempting to merge this into the dev
branch due to the use of "potentially uninitialized values".
Change-Id: Id2fc4a123a4b180b9ab439429a0d20245c7ee41b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Take PM_FocusFrameVMargin into account.
Task-number: QTBUG-35146
Change-Id: I1499790537ddf9fbb912ab764b7d049ee11af95d
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
FusionStyle and MacStyle have this already, the change just brings it to the others.
Task-number: QTBUG-40277
Change-Id: I08dc80771b9cd0ab47179e1994ab6510b022eade
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Say you have a document of two blocks of text.
When you select a block of text in the document and then replace this
with a new empty block (by pressing enter) and then subsequently
undo this action, the following three steps are performed as a
chain of undo commands:
1. Remove the empty block at the beginning of the document
2. Insert a new empty block at the beginning of the document
3. Insert the text back into the first block
Since a block is removed and inserted in the same go, both blocks
require a relayout, since the accumulated change spans both blocks.
However, in QPlainTextDocumentLayout we would only look at the max
of either removed chars or added chars. This would match the text
length of the first block at this point, so we would only relayout
that block. However, since we are also removing characters, the
actual accumulated change to the document is larger. We should
relayout any block touched by the sum of the added and removed
character counts.
Missing this, the paint event would later query
block.layout()->lineForTextPosition(0) which would give an invalid
line despite the fact that the block.length() > 0. This caused
a crash in the paint event when the full width selection was
turned on.
Note that the logic here was only recently updated to include the
removed characters at all in the logic, by the SHA1:
2983cb9531.
[ChangeLog][QPlainTextEdit] Fixed a crash when using full width
selections and issuing a complex undo command chain which removes
and inserts an empty block in one go.
Task-number: QTBUG-36415
Change-Id: Iafe8a69e455e0c713a48714f10f0cace69c84f51
Reviewed-by: Axel Rasmussen <axel.rasmussen1@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
If we leave out the default so that the compiler catches missing enum
values we should actually handle them all ...
Change-Id: Ieb4992dec84ce847e48ab3c4a94bd8825a148706
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
When the paint for the QOpenGLWidget was in invoked on the
fast path, where only that widget was dirty, the resetWidget
call after sending the paint event removed the widget from the
dirty list, making it impossible to schedule an update during the
event handling. The correct way is to clean the list and then send
the paint events.
Change-Id: Icdad5686ded7944fd1c8af56496f725e163a60e6
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
A fullscreen window can have maximized flags being set so first check
the NetWmStateFullScreen flag.
Change-Id: Ia802abf3cfa4c784baa2d55088e3f53310f0362e
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
"accessible/qaccessible.cpp:2154:43: error: 'type' may be used uninitialized in this function [-Werror=maybe-uninitialized]"
Compiler doesn't seem very smart, all enumerators are handled in the switch already.
Observed on android's gcc and gcc-4.7 on GNU/Linux
Change-Id: I30b4660c18992158457cada01b5916aa4feae4ff
Reviewed-by: BogDan Vatra <bogdan@kde.org>
On Windows, the detection changes only by inserting the use of the
environment variable before the existing tests and removing the check on
stderr.
This commit adds logic similar to Windows's: if the application has a
controlling TTY, we'll use stderr. Otherwise, we'll use the system log.
This is technically a change in behavior: previously, we would always
use the system log, unless the environment variable told us not to.
In practice, the behavior doesn't really change: Android and BlackBerry
and systemd-spawned applications are launched with no controlling TTY,
so logging will go to their logging systems.
[ChangeLog][Important behavior changes][Logging (including qDebug and
qWarning)] Log output will now go to the system log (if support for it
was compiled into Qt) if the application has no controlling terminal or
console window. Set QT_LOGGING_TO_CONSOLE to 1 to force logging to go to
stderr.
Task-number: QTCREATORBUG-12564
Change-Id: I043c5c4f47c15f26d4f4a5cf43df466ea38cdbc7
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This reverts commit 636d2e3402.
The issue was caused by a bug in ANGLE, not a lack of hardware support.
Change-Id: If2a66cd023dc7f2329dc2812169042487eecd428
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Upgrade to address issues discovered since the last upgrade.
Patch notes:
0000-General-fixes-for-ANGLE-2.1.patch
added removal of the unused third-party tracing functions
0003-Fix-compilation-with-MinGW-gcc-64-bit.patch
removed as it is no longer needed
0011-ANGLE-Fix-compilation-error-on-MinGW-caused-by-trace.patch
removed as it is no longer needed
0016-ANGLE-Fix-compilation-with-MinGW-D3D11.patch
now supports MinGW 64-bit
[ChangeLog][Third-party libraries] ANGLE updated to 2.1~f8602ad91e4f
Task-number: QTBUG-40649
Task-number: QTBUG-40658
Task-number: QTBUG-41031
Task-number: QTBUG-41081
Task-number: QTBUG-41308
Task-number: QTBUG-41563
Change-Id: I9f776c8d5cb94ddb12d608a8d5630bfc54437bea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Having two versions of popup, one that takes a point and one that
takes a target rect, causes problems for client code if they use
the 'target rect' version since not all platforms override that
function.
So this patch will change the remaining platform that override
QPlatformmenu into using the new 'target rect' version.
Calling the old version that takes a point will still work, since
the base version will then convert the point into a zero-sized rect, and
forward the call to the 'target rect' version instead.
Change-Id: Icc8531d79270a4f24ec08b8ed95b18ed3db1ad4d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
It breaks the compiler self-test:
tst_compiler.cpp:754: error: no matching function for call to ‘qCompare(tst_Compiler::cxx11_class_enum()::X&, tst_Compiler::cxx11_class_enum()::X, const char [2], const char [13], const char [17], int)’
We not should assume it is safe to use, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064 and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37946.
Change-Id: I72c9c56e3e4f62bdfdfa133b6b0a2e610b5331c8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
_NET_WM_STATE message can be received by a window in the minimized state.
Don't change the window state in this case.
Task-number: QTBUG-31117
Task-number: QTBUG-39376
Task-number: QTBUG-34430
Change-Id: Ic77a345e442891972b692803fab1e2f6aef30433
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
So far, we were restricted by the values of ThemeButtonKind, which
consist mostly of buttons. We want to generalize to other kind of
controls when the time arrives. Already, QPushButton with pull-
down menu is not possible to get from that enum, while its easy to
get from NSPopupButton.
Task-number: QTBUG-40833
Change-Id: I244c42c42ab595f4790050eb15ade70443e155b2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This allows the menu to tell its containing item the menu got
deleted. This removes the need to reset the COCOA_MENU_ANCESTOR
property value, which would crash since QCocoaMenuItem::m_menu
would be a dangling pointer.
Task-number: QTBUG-41587
Change-Id: Ia3408ef85cf823bfddbc2c41d6534e43bf14ed29
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
ToUnicode sometimes gives wrong results if it is used with a
keyboard buffer containing the ctrl modifier. Special cases
containing alt and control might trigger the third assignment
of a key, but if no alt modifier is used for the key event,
we temporarily disable the control modifier in order to obtain
the character with ToUnicode.
Task-number: QTBUG-35734
Change-Id: Ifd88c640541b42fa65ee1dc9b55af3386714b0b8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Function EnumFontFamiliesEx with parameters (lfCharSet = DEFAULT_CHARSET, lfFaceName = '\0') enumerates only first installed font from many with same family name.
This patch calls EnumFontFamiliesEx twice:
1. Without family name to enumerate families;
2. With family name to enumerate fonts with same family.
Task-number: QTBUG-40828
Change-Id: Ic36a24a9e70f735a7324c05fe4b70f7c7e5710d0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
On Unix, those functions are already #define'd to qt_safe_read and
qt_safe_write, which do the necessary EINTR handling. On Windows, EINTR
cannot happen.
Change-Id: I50c46472c04bd90a0bac51c725cc86311ae905c8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
IPv6 addresses can start with ":", for which QDir::isAbsolute() would
always return true (QResourceFileEngine::isRelativePath() returns
constant false) and would trip the calculation for local files.
Similarly, IPv6 addresses can start with strings that look like Windows
drives: "a:", "b:", "c:", "d:", "e:" and "f:" (though not today, as
those address blocks are unassigned). Since a valid IPv6 address will
definitely require at least one more colon and Windows file names cannot
contain ':', there's no ambiguity: a valid IPv6 address is never a valid
file on Windows.
This resolves the ambiguity in favor of IPv6 for Unix filenames (which
can contain a colon) and in case of an URL containing scheme, relative
path and no authority ("dead:beef::" for example could have been parsed
as scheme() == "dead" and path() == "beef::").
Task-number: QTBUG-41089
Change-Id: Id9119af1acf8a75a786519af3b48b4ca3dbf3719
Reviewed-by: David Faure <david.faure@kdab.com>
This change enables us to reorder the stacking order used by the
layout. This is necessary if we want to influence the drawing order.
Lowering or raising views are done separately for native views and
Qt surface views, that is, the two different view "types" are moved
relative to other views of the same type and Native views are always
placed on top.
Change-Id: I01cbb88f8efee08877b5972cf330fd25266a2aa9
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
The static QJNIEnvironmentPrivate::findClass() function exposes the
cache and the class finding code in qjni.
Change-Id: I42043dc993cf9cace042faf763f2a647ba79d97f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Adds:
- Improved geometry calculations (e.g, inside a parent)
- Change visibility
- proper stacking order. Native views now reserve the top of the stack
to ensure that they stay visible.
- React to application state changes.
Change-Id: I35de0396937fff37ffcd272c9a7d8e9873a91dfb
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
There are a couple of code paths in which we return from a function
without freeing the memory pointed by a local pointer.
For the sake of not over-modifying the code, I chose not to turn
"ui" into a scoped pointer.
Change-Id: I0b23944f7526d250c1ebeca0bae9bdc36dceceed
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This introduces a combined brush/dash pattern which can be used to
perform faster dashed straight-line drawing. The dash pattern is
prerendered to a tiled bitmap brush, resulting in a significant speedup
for lines with many elements.
As the result of non-rectilinear lines may lose quality compared to the
native dashed renderer, the slow/high quality codepath can be activated
by setting the QPainter::HighQualityAntialiasing render hint.
Task-number: QTBUG-40604
Change-Id: I771e9a81c042b4d8b6891dc9280932696e5a0694
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
When the composition mode changes to a mode which is not supported by
Direct2D's primitive blending, the rendering follows the emulated (slow)
code path using rasterFill(). This allows the direct2d paint engine to
handle all composition modes supported by QImage.
Task-number: QTBUG-40602
Change-Id: I0ac0b5c89aab2483cb2ef7768d6dec8e16913249
Done-with: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
The "Fixed CE build of sqlite3" patch is *updated* in this change.
Since sqlite 3.8.6, SQLITE_OS_WINCE isn't defined early enough so we
have to check _WIN32_WCE directly.
(ea70ec8711)
Change-Id: I63ee5163fb915274c9780c169e1f8673755bba47
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame.
Change-Id: Icff45cbd3a47db8618a7f7a80f7252651969237c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Changes some switches on QImage::Format that needed to be updated
whenever a new image format was added. Two were changed to matching
formats supported by BMP and PPM instead of what they don't support,
and two were changed to now use QPixelFormat values.
Change-Id: I5a14f1d7b7cc0451c68e4d6ab2361a5bd8dc8915
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
My previous fix for CPU load issues between HTTP thread
and user thread was fragile if the upload QIODevice
emitted readyRead() multiple times.
[ChangeLog][QtNetwork][QNetworkAccessManager] Fix behavior of upload QIODevice
that generate data on readyRead() for HTTP PUT/POST
Change-Id: Idb1c2d5a382a704d8cc08fe03c55c883bfc95aa7
Reviewed-by: Christian Kamm <kamm@incasoftware.de>
Reviewed-by: Richard J. Moore <rich@kde.org>
Put sections with similar content together:
- Put "A Small Example" next to "A Real Example".
- Put "Signals and Slots", "Signals", and "Slots" together. Altogether,
these 3 sections contain lots of repeated content and should be
consolidated in a future commit.
This patch only moves content around without adding, removing, or
modifying content.
Change-Id: Ic6bf6a8b51f4785a8bbe6d230c2934f2c952104d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
- This article is not the right place to describe the low-level
mechanisms of moc and qmake, or to discuss QMetaObject features that
are unrelated to signals and slots.
- Most users never need to run moc directly.
- The current content only mentions qmake for moc automation, but CMake,
QBS, and the Visual Studio Add-In can also do that.
In light of the above 3 points, let's simply link to the "Meta-Object
System" article for those who are interested in the behind-the-scenes
details.
Most of the content deleted by this patch are already discussed in
detail in the articles "The Meta-Object System" and "Using the Meta-
Object Compiler (moc)" (the former links to the latter). The exception
is Snippet 5 -- this is deleted without replacement because
qobject_cast() is a much safer alternative to QMetaObject::inherits()
with static_cast(), so we should encourage the former.
Change-Id: I638c888cedfcdfb818747edeb806213ebd54dfb6
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Since we assign a fromValue to the scroll animation directly, the
UIViewAnimationOptionBeginFromCurrentState flag does not have
any effect. So we need to set the fromValue based on the current
presentation state explicit.
The reason why we need to ensure that we scroll from the current
state is to avoid screen 'jumping' as a result of the scroll function
being called many times during the same event loop cycle during after a
focus change (focus object/window change, cursor rect change etc).
Change-Id: Id98f43d60ec5d028b113361dab953569accf9b3f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Since keyboard rect should be in window coordinates, it needs to
change when focus window changes.
Change-Id: I052aa5cadf182841d7c4eb114ebd1ea5317ff39c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
After changes to how we scroll the screen, we need to change
the implementation for calculating the keyboard rect as well.
Change-Id: I7f468d55f6e29604b9c276deccd9926e071552a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
There were several use cases that did not work with the old
implementation and it was not really readable.
Task-number: QTBUG-3472
Task-number: QTBUG-40067
Task-number: QTBUG-23892
Change-Id: I1e038792dc54cdc6f8d9bb59d80b11dd3c56fac6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
If the a message notification is created at the same time as the system
tray icon is embedded it may start at a wrong location, since the icon
location it bases its own location is not yet final.
This patch adds code to update the balloon tip location when the system
tray icon is moved or resized.
The bug and fix can be tested by the systray example by disabling the
icon and letting show message trigger both showing it and the message.
Change-Id: Ie1dc10489ad420e581e32afeb757c236fb5129ab
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
The moc preprocessor is not necessarily fully compatible with the native
compiler preprocessor, which can lead to annoying warnings.
This fixes a problem particularly with the boost headers that rely on
MSVC only preprocessor features (to work around other MSVC preprocessor
deficiencies).
Task-number: QTBUG-29331
Change-Id: If884452969b512a746c81e235d31636b39c45b27
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
It turns out that setting visibility means whether or not the
menu should appear visible in a parent menu, and not to
actually show or hide the popup. This means that the only way
to show a popup is to call showPopup, which also makes
it simpler since we then always get a parent window as
argument that we can activate and get a focus object from.
Change-Id: Ie3866b5664294f9aa4d694fa422e8116e9c75ced
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
There might be menu types later that should show them, but
for now we just hide them.
Change-Id: Iac31e3204d8dcfd5beb5a2d5a372478ca811776c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Fixes a regression against Qt 4, where Show/Hide events were received
when the minimized state changed.
It is restricted to QWidget so as not to introduce additional events
to QWindow (which already has signal visibilityChanged()) and cause
unexpected side effects in QQuickWindow.
Task-number: QTBUG-41312
Change-Id: Ib165a5daf7a7e5d8231ef8a94b70e8a2a3253057
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Radio button, checkbox and non-editable combobox, in normal,
small and mini sizes, and only in the inactive state.
This commit amends 982b9b7ec2.
Task-number: QTBUG-40833
Change-Id: If3f2bb215e9b8966cbf15f08fa252feb92483c7b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
dbmsType was previously kept as a private variable in QSqlDriverPrivate,
however it's particularly useful for QODBC users.
[ChangeLog][QtSql][QSqlDriver] Add support for determining DBMS type from SQL driver.
Change-Id: If1c221520da9ac4ccef85a02db078679d76eac92
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
On Windows, if a window was previously staying on top then it needs to be
explicitly told to have HWND_NOTOPMOST set when it is recreated. If it was
not staying on top before the flag has no effect so it is safe to always
set it in this case.
Task-number: QTBUG-30359
Change-Id: I8be546886d6ae61032113c241f5903bcce04c163
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
The rotation will already result in laying out of the root viewcontroller,
so we don't need to send explicit geometry changes for the statubar change.
The properties of the screen at that point are also not consistent, as the
screen is about to rotate.
Change-Id: I1b45bee1c1224ca56f9e37068d68c4ee1bfeb9b6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
We detect changes to the statusbar height, eg. when the in-call 40px tall
statusbar is active, and ensure that the root viewcontroller view is laid
out again with new screen properties applied. To make the layout match
the animation of the statusbar height we apply the layout inside a
animation block.
Change-Id: I751d9d1273e833ef052a3a4f3d2777e1dffec7dd
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Instead of doing manual translation of the local touch point to global
screen (QScreen) coordinates we take advantage of the fact that QWindow
already has a position that's adjusted for all of the view-controller
offsets in its parent hierarchy.
Change-Id: Ib34173db5ac053c20712dfff469c4a1286f2a324
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
As we now have a root viewcontroller that always has a geometry that matches
the containing UIWindow, we don't need to do any fancy calculations when
mapping between the two.
Change-Id: I08a7b9992be7b7238cbad2a2da20488bba1c0939
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
The logic of how to deal with top level windows in the presence of rotation
or status bar changes should be confined to our custom QIOSViewController
that acts as a desktop manager for regular Qt applications.
We no longer treat windows with full-screen or maximized geometry but without
the matching window state flag as being targeted for auto-resizing. In the
future we might detect this case and warn the user that windows should have
the appropriate flags to be able to auto-resize on orientation changes.
Change-Id: Ibab09de5cf37e77c356fbf51a54a2fcec4bb5c51
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Instead of custom logic to detect portrait/landscape and the height of
the status bar. The latter would fail when the statusbar/orientation was
set explicitly through [UIApplication setStatusBarOrientation], as the
statusbar would not follow the normal behavior of covering the top part
of the screen. The new code also handles upside-down portrait mode, as
well as iOS8's behavior of reporting screen bounds and application
frame in interface orientation instead of device orientation.
Change-Id: I54e3b99246a32e17aaba13960f456fa823768fd8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Instead of updating screen properties (and hence laying out top level
windows) in willAnimateRotationToInterfaceOrientation, we do it in
the more catch-all viewWillLayoutSubviews, which also handles changes
to the orientation while the application is in the background, as well
as changes to the statusbar frame/size, eg. while being in a call.
Change-Id: Ib4a08af2f3a56db426a10ff1ed819867895b5a5a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
We opt to use sublayerTransform instead of changing the root view's
bounds, so that we can keep the root view at the same position and
size regardless of statusbar height and visibility.
Change-Id: I3f04a4587f1108084208aefa990f91a130fb47b8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Easier to read/understand that the screen properties are initialized
from the platformScreen.
Change-Id: I3084c3ac30a08cb4e154536f949475459212d2de
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
QWindowsTheme::standardPixmap() takes a size parameter which is in user
space coordinates. This patch causes it to calculate the size in device
pixels, to get the image from the OS in the correct resolution and to
set the devicePixelratio of the returned pixmap accordingly.
Change-Id: Ifad5d0a26d5fd5945e37e432787d63ee79269295
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Not every length parameter unit is accepted by Qt Style sheets.
Task-number: QTBUG-31907
Change-Id: I953c56caf68c1397ba24369f433d21c6f4772d0d
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
This commit fixes a bug that causes QXmlSimpleReader to handle only
external reference files less than 1k. Instead of reading the
first 1k of the reference file, it reads all data from the file into
memory. The change is not optimal for memory management, but there does
not seem to be better solution without breaking the existing API.
A similar but incomplete patch was already applied to Qt 4.7 but never
made it into Qt 5. This patch is based on a Qt 4.7 patch and adds the
missing cases.
Task-number: QTBUG-26910
Change-Id: Ia4d055ded80a40ce76b79fc61ad585e8ebb719db
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Fix the position of the menu gutter.
Change-Id: Ia8e056f14315f314d1e7a8b95a1ac87f6843e466
Task-number: QTBUG-40277
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
The two mono formats are actually indexed and may have both color and
alpha values in the color-table, and Format_ARGB4444_Premultiplied and
Format_ARGB6666_Premultiplied both have the alpha value in the end.
Change-Id: I7f1efb2213710f5eb628d71356f9c8ed75b50f4d
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This helps to blacklist a test function on all platforms,
something that isn't easily possible currently. Adding
[testfunction]
*
to the BLACKLIST file will now blacklist the function
on all platforms.
Change-Id: I9e1a1daf94caa05408a6b3cd7ea7a3acdc962a43
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Since we already tell direct2d that we are using pixel sizes in the
QWindowsDirect2DDeviceContextPrivate constructor and thereby enable
scaling inside direct2d, there is no need to scale the font size again.
Change-Id: Id9c9ed4d2848bcd09f997e41fb87802a3fe2432b
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
The result of qstrtoull() was unconditionally truncated to an int,
resulting in wrong values being appended to the segments vector
when the numerical segment value was above INT_MAX.
Prevent this by first checking the return value of qstrtoull
as a qulonglong for values larger than INT_MAX and stopping
processing in that case. That means that segments that
numerically overflow an int are now considered part of the
suffix.
Also added tests for the case where a segment value is larger
than ULLONG_MAX. That was already working correctly.
Change-Id: Ia4b89021dcfe6bfae27c8d89bb678ec5e0e3b847
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame.
Change-Id: I55539305df28267d0671a54a5cb7fcc17d045b8b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame.
Change-Id: Ic165b524e8d86a0dd5355de338e87a33cd7429c7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
qwinrtscreen(1010): 'd': local variable is initialized but not referenced
Change-Id: Ic21a9bc087d8418ad9f01b263677438a4db8f493
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
When QCursor::setPos() is called and the platform plugin doesn't
implement QPlatformCursor::setPos, a warning is printed.
Additionally, we now emulate a mouse move to have a default
implementation that's actually useful.
QPlatformCursor::pos() now returns the position that was set by
QPlatformCursor::setPos(), or other facilities that generate mouse events,
for example the Tslib plugin.
Change-Id: Ifc539202765f311baad085f72347aeb732f7b2ba
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Fix compilation errors when trying to compile ANGLE with e.g. MSVC2013
targeting XP.
Change-Id: I3238c47e198662c39e2ca0cb0e53153e8f13d442
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
ICC doesn't like that you assign -1 to an unsigned variable. I could
have used ~0 to mean the same thing, but actually initialization isn't
necessary at all.
error #68: integer conversion resulted in a change of sign
Change-Id: I3e9116d7309f7a7ccd99b1adfa9bffaed1ff1c73
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
QtTest has its own logging environment, such as XML output, so we don't
want to have messages formatted differently than expected or sent to an
unexpected place.
Change-Id: If665c9d7121267269e5b2063f49468eb2b9b9d08
Reviewed-by: Jason McDonald <macadder1@gmail.com>
[ChangeLog][Important behavior changes][Logging (including qDebug and
qWarning)] Support for the deprecated environment variables
QT_NO_JOURNALD_LOG and QT_ANDROID_PLAIN_LOG has been removed. Instead,
set QT_LOGGING_TO_CONSOLE to 1 to force logging to the console (stderr).
Set that variable to 0 to force logging to the system-specific event log
(if any).
Change-Id: I4800fc061752421f67aba1bf4535d524607579d5
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On 64-bit platforms: 64 -> 56 bytes.
On 32-bit platforms it's still the same size (44 bytes).
Change-Id: I681b9385ee3bc7601c1e8036efd6544471d1e058
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove an useless check which spontaneously allow direct reads from the
socket engine.
Change-Id: Ia3d2a572d6f1563d613fe2f00d0d6849df259827
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The text was not drawn properly because when eliding the text a fixed
value '4' was substracted from the rect to compute the available width
instead of the actual value of the header margin.
Change-Id: I1e110f1a6490679730ddf5815d3ff7b679dc1a47
Task-number: QTBUG-24772
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
A tablet which can also do touch will show up as several XInput
devices. The touch device should be treated as a touch pad, not as
a tablet.
[ChangeLog][Platform Specific Changes][X11 / XCB] Wacom touch
devices are not mistaken for additional graphics tablets
Task-number: QTBUG-39572
Change-Id: I7a61a4c0d82925080edb0175b7d03870748f55ce
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Do not zoom 1pt on every single wheel-event, but instead scale
the zoom with the size of the angle delta.
Change-Id: Idbe17356c7845ebd0039f655d3e611e71c6f0dd6
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Quoting was not reset after consuming the quoted character.
This bug only manifests when a format contains two quoted
characters.
It's not possible to write an auto-test for this, since
the format is always read from the locale.
Change-Id: I39aff41f20f647c285c971b4d560f9e36d4b82fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This is in preparation of a change putting all these helper classes
into the unnamed namespace.
Change-Id: I553b1e23b6cdbe6daa492c2dc4c26406ac580de3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-[NSWindow setContentView:] doesn't make assupmtions about where that
view comes from, and just attaches it to the window. We need to make
sure we detach it from its previous window by calling -[NSView
removeFromSuperview], or the previous NSWindow may keep references to
the view. This can be an issue if the view is deleted right after.
Task-number: QTBUG-39628
Change-Id: I152dedcb64ac044d8ca290c9996b388809e2477b
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Only step the value in the spin box when we have accumulated one wheel
tick worth of wheel delta.
Also fixes the obsolete contructors of QWheelEvent so they set the non
obsolete properties.
Change-Id: Ic6ea4b37afa8eec85a6ca7bdc0d919bf8fb02608
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Recognize non-premultiplied images and draw them using the existing
NonPremultipliedImageSrc shader so we save premultiplying them on the
CPU.
Change-Id: I3dfc8f9385ff91502d64ccabf4bf54049cc28040
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This was done wrong when using the ini format.
Task-number: QTBUG-22461
Change-Id: Ib9390460bce6138659cceac7e3cd25339ba5e9bb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Starting/stopping timers from another thread may result in errors that
may not appear until hours, days or weeks after if a release build of
Qt is used with the GLib/UNIX event dispatchers. Such errors may
manifest as warnings such as "QObject::killTimer(): Error: timer id 7
is not valid for object 0x2a51b488 (), timer has not been killed" and
application crashes (e.g. crashes in malloc, realloc and
malloc_consolidate).
Initial-patch-by: Eike Ziller <eike.ziller@digia.com>
Task-number: QTBUG-40636
Change-Id: I2de50d50eb1fc7467fcebb9c73b74d2f85137933
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QT_CLOSE is #defined to be qt_safe_close which already performs
the EINTR loop. So there's no need of doing other loops
(either by hand or by the EINTR_LOOP macro).
Change-Id: Icca256124def5ab5d79c2ba101c6f889c85d19da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
C11 §7.21.3.4 [Files] says that
The value of a pointer to a FILE object is indeterminate
after the associated file is closed
POSIX.1-2013 reinforces by saying that
After the call to fclose(), any use of stream results
in undefined behavior.
This means we can't call fclose() again on a FILE *,
even if fclose() returned EOF and set errno to EINTR.
Change-Id: I282f4ff926e3c134729defa290c80d42431e97ce
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Coverity warns that we may access the gray array without initializing
it. The array is initialized if d (the source image depth) is 8.
However, when doing ordered dithering, we don't check that depth
any more and just use the array. There are instead checks in place
for the other dither modes; the one for ordered has been commented
out before public history.
So, for the love of kittens, put the check back.
Change-Id: I1cc5ced8edbb626777e54e9f4e58f152c6b28ddc
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Although never used, the d member triggers all sorts of warnings
when copying a QTransform around because it's technically
undefined behavior (reading from an uninitialized variable).
Change-Id: If06b6bea6f0ec0623c38ba330d46958b373cdc65
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
For some reason it seems to be supported to call moveToThread(0).
That call will allocate a new QThreadData for the object. However,
if we then detect that we're calling moveToThread from a thread
which is not the one the QObject has affinity with,
we error out leaking that QThreadData object.
Change-Id: I0fe6625a2a9887535e457f3897b514d2a03d1480
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
An early return in case of errors leaked memory tracked in a variable
in scope.
Change-Id: I68cd77890608caff54df7476d38850e5541ce76e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
The QClipboard::Mode returned from modeForAtom should be checked
everywhere because values greater than Selection (i.e. FindBuffer)
aren't supported on X and should mean error conditions.
The lack of such a check did an out-of-bounds array access, which
could lead to a crash.
Change-Id: I70f70b5f713ab2f892e258d4df2f7afeb434f0c1
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
An early return caused a leak of a new'd allocated object.
Change-Id: I9fbc37238dd49066d24363a2e8ee8bf35b155301
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
This bug can be reproduced (AFAIK) only on 10.9. To fix it I suggest we create
NSOpenPanel/NSSavePanel
_every_ time it must be displayed. Actually, that's what I've seen in all code samples
I was able to found - nobody tries to retain this panel and re-use it.
If we re-use it, "Media" section magically disappears.
I believe this bug is not Qt's bug, but something weird in Cocoa.
Task-number: QTBUG-40655
Change-Id: Ic0e76e0a9a5444a76f336d511c0ff93f9fd05797
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
When ordering a key window out Cocoa
tries to find a new KEY window. Looks like it prefers the current MAIN
window and since QNSPanel is never a main window, Cocoa is breaking
the stack order. To avoid this - try to change the key
window BEFORE ordering out a window.
The application has a stack of all open windows (visible and hidden),
we iterate through this stack starting from our current key window
and look for the nearest window below, that can become a new key window.
Most probably, it will be our transient parent :)
This code will change (potentially) the key window _only_
if there is a transient parent.
Task-number: QTBUG-39809
Change-Id: I96b630799341875fc7e38dabf1ff6416338e687b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
A regression was introduced by bdebec4e2e.
The intention of the change was to avoid using Qt's shortcut mechanism
to trigger menu items which were already triggered through the regular
menu API in Cocoa. However, Cocoa has trouble with key equivalents that
do not have any keyboard modifiers. Thus, we have to allow these
particular key sequences to go through the regular system. I've verified
that the original bug is still fixed with this change.
[ChangeLog][OS X] Fixed menu item shortcuts without keyboard
modifiers.
Task-number: QTBUG-41192
Change-Id: I8f5a9cbc7a448b3cb0519baed95be5cbb630205c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Deleting a QWindow automatically deletes its child windows because
they are in the QObject hierarchy. However, if the user sets both
WA_NativeWindow and WA_DontCreateNativeAncestors, we can't just
delete that widget's QWindow. First because the widget doesn't get
notified (and maybe it should be), and then because we may invalidate
any reference to the QWindow the user may have kept.
Our solution is to reparent the child QWindows into the new parent's
closest QWindow. We must, however, take the precaution of not keeping
any reference to the backing store in the platform window. Reparenting
operations can trigger repaints on the platform window, but the backing
store is not set and flushed until later.
Task-number: QTBUG-38377
Change-Id: I353f5528f227a227b6d10419367cbe1d5d07a94e
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
socket(2) is allowed to return 0, so 0 should not be included
when checking for errors.
Change-Id: I0454ea60347d90078d3ab3046969add8d5c37935
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
device is private, always null and class has no friends, so no need to have it at all
Change-Id: I320d47f1a712a3202c08b494563533e29d185501
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Connect to QScreen::availableGeometryChanged().
Task-number: QTBUG-32567
Change-Id: I2097d80faa83ae062f7e149122fba26d23432e95
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
1cdcf64ad5 recently introduced a rendering
bug whereby certain clips would be handled incorrectly.
Change-Id: I3f486819c66b1d665243c8dc1e9d077dd2f64f25
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
This only applies to QTreeView.
8eb3d724a9 introduced this error.
Change-Id: Ia8a2c387afbd19e4d98ea6f81e5ce6409d79bcd9
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
The symptoms were made apparent in the xmlpatterns command line
utility when trying to use the synchronous HTTP code path in
QXmlQuery for fetching schemas.
Change-Id: I93b283fdec4b501a5c1fc646f7ddc30d8407f5ae
Reviewed-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
We need to have a finer grained control over the tests
we skip in our CI system. This adds a blacklisting
mechanism that allows blacklisting individual test
functions (or even test data) using a set of predefined
matching keys for the operating system and some other
relevant variables.
QTestlib will search for a file called BLACKLIST in the test
directory and parse it if found. The file contains a simple
ini style list of functions to blacklist. For details see
qtestblacklist.cpp.
Change-Id: Id3fae4b264ca99970cbf9f45bfb85fa75c1fd823
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
When a platform menu is used then it would hard code the icon size to
16x16. Instead of using the hard coded value then PM_SmallIconSize should
be used instead.
Change-Id: I27540ebc4397501e8f57686a118c28cd7167c0a1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
The code calls QLibraryInfoPrivate::findConfiguration() to get a
new QSettings object but was not deleting it.
Change-Id: I207a7ff55f87aff91e2898a99e9cac06d57c5f7d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Instead of coupling the visibility of the virtual keyboard to
the first-responder status of the currently active QUIView, we
now treat first-responder as a separate state, tied directly
to QWindow activation. This fits better with the concept of
first-responders in iOS, as a UIView can become first-responder
without dealing with text input, eg when dealing with touch
events or menu actions.
The decision point on whether or not to show the virtual
keyboard is then handled by implementing the conformsToProtocol
method and selectively returning YES for the UIKeyInput protocol.
iOS internally calls _requiresKeyboardWhenFirstResponder on the
UIResponder to determine this, but since we can't override a
private method (like WKContentView in WebKit does) we have to
rely on the fact that the implementation of the method uses the
protocol conformance to make its decision.
Once the virtual keyboard is up, we then need to react to changes
to its configuration, such as keyboard type or the type of return
key. Normally this would be a simple call to [view reloadInputViews],
but iOS will not reload the built-in keyboards unless the UIResponder
returns YES for _requiresKeyboardResetOnReload. Since we again can't
override this private method (like WebKit does), we work around it
by taking advantage of the fact that iOS will treat any change to
the first-responder as a reason to do a keyboard reset. By using
a stand-alone UIResponder for text input we can init and destroy
these responders as needed, so that every call to reloadInputViews
will trigger a reset, as the responder has not been seen before.
We keep track of changes to the input-method-query, and detect
whether or not we need to bring up a new UIResponder for text
handling.
As part of this refactoring we now tie the visibility of the
virtual keyboard to the presence of a focus object that has
input-methods enabled. This means that we automatically will
track changes to input-elements through the focus changes,
and reconfigure or hide the keyboard as appropriate. As a
result the hide() method of QInputMethod becomes a no-op on
iOS.
Change-Id: I4c4834df490bc8b0bac32aeedbd819780bd5aaba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
In the list of default implementations, the raster ops added in
ae0ddb8c72 were all offset by one
composition mode because of a duplicate entry in the array. The
effect would be, e.g. that using the NotDestination operator would
resolve to the Set operator instead.
Most users will probably not have experienced this since any of
the asm-based functions will be preferred.
[ChangeLog][Painting] Fixed some very rare cases of mismatched
raster modes in QPainter.
Change-Id: Ia242b54c78acbe1c89d9b4ecd10936564ec134b2
Task-number: QTBUG-41413
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
The role may changed based on the checkable state of the button, eg, so
we need to resolve the role at runtime instead of hard-coding it in the
constructor.
Change-Id: I78faee08189c5510ca9964b07ad94bcf5d4fa11b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Synthesized mouse events should not cause mouse events which
look like they were obtained from the system.
So set the source of generated events from the original event.
Change-Id: I862829446ac6ef664e1b8e4a5b54ed11926a1d4b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Mouse events synthesized from touch events by Qt
should be marked as Qt::MouseEventSynthesizedByQt.
Change-Id: I73612621a0248440b3b773f1280395c05c55e4aa
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
A window width constraint coded in Qt4.8 was accidentally applied
to the height in Qt5. Upon further review, it does not seem that
this constraint is needed, in any case. Different versions of
Windows have different minimum window widths (8.1 had 124px
instead of 112), and setting a smaller value seems to cause no
harm.
Task-number: QTBUG-32820
Change-Id: I21ad6d406abf7344aff54d32b41974265aa9ea81
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
When a window's screen changes it may recreate the platform window.
In that case, update the winId in the widget to keep it in sync.
Task-number: QTBUG-40681
Change-Id: Iec815320214832bb63952de3a5bd1340a04dacd4
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Some IMEs will perform an insertNewLine when Return/Enter is pressed while
composing text as well as causing the edit to finish. By handling this it
will ensure that the extra enter/return event is sent when the IME
requests it.
Task-id: QTBUG-39125
Change-Id: Ice6eded68e6b1dc51703a38316f76f78099923da
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
If QRawFont and and drawGlyphRun is used on a QPaintBuffer it will lose
the QRawFont and end up painting with primary font at the time.
With this patch, QStaticTextItem can now indicate that they must be
drawn using the supplied font-engine and that the font information is
not enough.
Change-Id: Id6bd376d797d2bfb457e7de55c48bdcf9f20ae38
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Applications that do not override paintGL() (may happen in some test code)
will not perform any GL rendering, not even clearing. This is fine, but
to be safe we need to do a clear right after creating the FBO in order to
prevent showing garbage.
Task-number: QTBUG-38327
Change-Id: If062901bb18724f961e41856085470e37b49abbe
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
GetGlyphOutline Windows API returns wrong values when used with an
OpenType PS font and in GGO_NATIVE mode. It causes problem when
exporting to PDF. The fix changes the GetGlyphOutline call to use
GGO_METRICS instead.
Task-number: QTBUG-12799
Change-Id: I47d6d16b6e7819b51bc444420ada4a47d5f24f4e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
qatomic_sparc.h was removed previously as part of general cleanup of
old atomic code for Qt 5.3. Unfortunately SPARC include reference was
not removed resulting in build failure on that platform.
Task-number: QTBUG-41384
Change-Id: Ic6e31b32324b0e5dd3700a6a21515a8eea5668bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The fallbacks on the platform should ideally contain all fonts that
support the script passed in, but this would require populating the
font database and checking the unicode ranges for all fonts, so it
would cause a significant performance hit on Mac. What we do here
instead is just return a set of default fonts as the fallbacks
and disregard the requested script.
The consequence of this is that some special unicode codepoints were
not supported on Mac, because we weren't working with a full fallback
list.
To rectify this without breaking performance, we always add Arial
Unicode MS to the end of the fallback list as a final fallback.
This should always be present on the system and has a wide support
of different scripts.
[ChangeLog][OS X][Fonts] Fixed missing glyph box shown in place of some
uncommon Unicode code points.
Change-Id: I4fc8576bfddc8a73204aca2b16437d42c524bc79
Task-number: QTBUG-40986
Task-number: QTBUG-40549
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Otherwise it is impossible to set a swap interval different
than the one set by QSurfaceFormat::setDefaultFormat().
Both windows and xcb will pick up the updated interval from the
window on the next frame.
Change-Id: I55a59f83a62d3adcea687adf28639646b576ed58
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Its contents are already inside the "state" member.
Fixes a "TODO" for Qt 5 (bumping it to Qt 6, where we will be
able to break API).
[ChangeLog][QtWidgets][Styles] The usage of the
QStyleOptionProgressBar::orientation member has been deprecated.
Task-number: QTBUG-25121
Change-Id: Ie531bb2f2733b15a213e83c9706468e2bf829359
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The QPixmap(const char* const*) ctor featured prominently in the callgrind
trace of tst_qmdi*, with 23% of total time spent there in tst_qmdiarea
before the change.
Cache the results in the QPixmapCache. That's probably a good idea for all
standardPixmap()s, but none other feature prominently in any of the
widgets/widgets auto-tests, so there's no immediate need to do something
about it.
After the change, less than 3.5% of the total time is spent on parsing
XPMs.
Change-Id: Idfb6ffe0d0f7a4a1f71a7c26fc9ab0f42bdbd7a8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
The only way I was able to find information on this was through bug
reports.
Change-Id: Iac59a82fab9c216495860ad3b1efad1125130002
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The code to draw underlines on specific characters in widget menu could
not handle ligatures. Instead of using special code to handle this case
this patch changes the mnemonic underlines to use normal format-ranges
making the text engine deal with splitting ligatures as necessary.
Task-number: QTBUG-20960
Change-Id: I6159110eae7aa8c819af16ba4a393d758871e2e0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
In OS X, certain keyboard layouts (such as Japanese) do not produce
unicode character conversions for Escape and other keys. In these cases
the code uses a fallback scan code check to map the key. The scan code
mapping had the function keys, but there are several other important
keys it can map.
Task-number: QTBUG-41090
Change-Id: I624793c9bb28ae8c98b54539c277943905cac7e2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Extend the QImage format with two 8-bit grayscale and alpha formats.
These formats have the advantage over Indexed8 that they have simpler
conversion and can be rendered to by the raster engine.
[ChangeLog][QtGui][QImage] Added support grayscale and alpha 8-bit
formats which can also be rendered to.
Change-Id: I4343c80a92a3dda196aa38d0c3ea251b094fc274
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This is to align the behaviour with how QGtkStyles behavior is.
Change-Id: Ic85d96cf4a4ab30974b25936de6d5b98e65dd2f3
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Qt sets a QCocoaMenuDelegate on every menu it creates in order to emit
the (OSX specific) aboutToShow signal. However, there are a few cases
where OSX will copy a menu without copying the delegate. One of those
cases is the dock: the result of -[NSApplication applicationDockMenu:]
is used to create a new menu, to which a few more items are copied.
This copy is then send back to the dock.
This patch invokes the delegate's -menuWillOpen: method when
-[NSApplication applicationDockMenu:] is called. Note that sub-menus
won't receive the call-back, because the dock doesn't tell the
application what happens after returning from applicationDockMenu:.
Task-number: QTBUG-39604
Change-Id: I0e06df371a3d77342ae4b7148041214e5c4579d7
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
QToolButton::sizeHint() takes into account the presence of a menu.
However, setMenu() doesn't retrigger a size hint recalculation. Hence,
(un)setting a menu on an already sized tool button won't properly
reset the size hint. Since the calculated size hint is cached,
delete the cached value and call updateGeometry to cause a
recalculation.
Task-number: QTBUG-38949
Change-Id: I6e79e5e70e31afdfd129282b3668875eca86f51d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The code transformed the coordinates from the view to the window's
content view, and since that content view is flipped in the pure
Qt world (content view == QNSView), it manually flipped the
coordinates to transform from that to window coordinates.
Instead just directly transform the view coordinates to window
coordinates using standard Cocoa methods, which then works with
any kind of content view and NSWindow configuration.
Task-number: QTBUG-40958
Change-Id: Idddd327fe9cff3309606379d0e04ee8b4bd5eece
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
QSplitter::handleWidth() returns either a style dependent value if
d->handleWidth is negative or the value of d->handleWidth itself.
So to preserve this choice after calling saveState()/restoreState()
we should save and restore the value of d->handleWidth rather than a
result of handleWidth() which is non-negative.
Change-Id: Idc11f8063d34b6c4a5f9b0a0032868679766dfb9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
[ChangeLog][QtWidgets][Styles] Allow overriding standardIcon() in a proxy style
Change-Id: I3c7983a7e51a8b220a0ca8ead2b4d7b87a77d71b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The current behavior was that accessibility is enabled if the variable
is _not_ set, which causes accessibility to be enabled all the time even
if a screen reader isn't present.
Change-Id: I73286622fb5abe1cedce420e760306ab7f200e69
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Tomasz Olszak <olszak.tomasz@gmail.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
It used LCID without including qt_windows.h while QT_USE_ICU was
defined.
Change-Id: I3d4cf0e6bd0e299729d23d9a36c5a87adde774c9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Mouse events synthesized from touch events affect only the left mouse button.
So preserve the state of other buttons.
Change-Id: I628d41089db39f0c983aa95f311a842111b8c39c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This covers the case in the bug report, but not much more.
Task-number: QTBUG-21254
Change-Id: Ie191a39ceddd7e58a0d8baf7d01f2a08c70162e5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
And a comment to fix it when the tooling situation improves.
Change-Id: I79781da18a36d4e11cede8477f90f216e08bffe2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
And enable the style to control the behavior of the sloppy submenus
[ChangeLog][QtWidgets][QMenu] QMenu now pick up how "sloppy" submenus
behave from the style
Task-number: QTBUG-20094
Change-Id: Ib1a9770d9b63028033cc360ae236471449d00267
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
On 64-bit platforms: 56 -> 48 bytes.
On 32-bit platforms it's still the same size (44 bytes).
Change-Id: Ia4831753258ef12aa983757523bb76979e6fc4b0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
And not a normal pointer. The problem is that in certain scenarios,
if the TLW containing a QSizeGrip changes and the old TLW gets
immediately destroyed, then the mechanism which updates the tracked
TLW is run too late, and ends up accessing a dangling pointer.
Therefore, we need to protect that pointer via a smart pointer.
Task-number: QTBUG-22867
Change-Id: Icfb051132bacde604f660ac7a98bc0a9d1022c68
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
There is no point in recreating the QOpenGLWidget's
context when it shares with all top-levels'
shareContext().
Change-Id: I659a8ef6563de0cc1e833198af4dfb8c705e40d8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Forward dnd events to the QWindow, exactly like QQuickWidget would do.
This of course requires setting setAcceptDrops(true) on the container widget.
Task-number: QTBUG-39213
Change-Id: I8ea49e630b071dc0aacd53f798d9b46b03502365
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
QSet::contains needs to hash the string, which is unnecessary, since we
can just check if the size of the set changed.
Change-Id: I2c7a42bae6cdf351533d5a582a42079658fa7729
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Translation is an expensive thing, and probably quite uncommon - so don't
penalise any common cases by checking for it until we're quite sure they have
failed.
In addition, we avoid repeated string construction when translating (caching the
result) and avoid repeated case-insensitive comparison by toLowering the string
data.
This change either speeds up most runtime cases that were unfairly penalised
(such as "light") by 50-70% or doesn't impact the runtime speed at all (or,
results were within the margin-of-error).
Of course, calling with translated content will be a bit slower now, but the
slowness of the translations should more than dwarf the real change there.
Change-Id: If24685dfd553e4aed07fbf07678b2585e22b0a3a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
thread-local variables are known to be broken on Windows XP if the
library is loaded dynamically. This has been fixed since Windows Vista,
but to avoid any elaborate runtime checking of the OS version we're just
removing the logic alltogether for MSVC / Windows.
Task-number: QTBUG-41008
Change-Id: I64ee95270d142294c975a5890d6e1b62a833b6ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Added the notion that enter and return keys are not handled
if editor is of type QTextEdit or QPlainTextEdit.
Change-Id: I9d5cb529bf154c687fab1949fccf37e9da096c85
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
This data is clearly not (and will never be) utf8 data, so using fromLatin1
avoids the (slightly more expensive) utf8 mangling.
I didn't see any significant impact on benchmarks, but I also wasn't
specifically collecting data when making this change.
Change-Id: I45190d40b2caccf15b1f9a1ae5b7dcd08cbd541f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
By using QStringRef instead of QString, we avoid a data copy. This takes the
QDateTime::fromStringIso benchmark from 0.79ms to 0.53ms for me.
Change-Id: Ibb36067491ffc275ce3b667cb0e04941aa9457f0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Add a new PM_TreeViewIndentaion enum value to QStyle and get
the corresponding pixel metric in QTreeView.
[ChangeLog][QtWidgets][QTreeView] Indentation is now style-dependent by default.
[ChangeLog][QtWidgets][QTreeView] Added resetIndentation().
Change-Id: Ifad7987b8f3c6cd32987b89d95390f33043d8f19
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Adam Majer <adamm@zombino.com>
Improve code readability using by-pointer rather than
by reference out argument.
Change-Id: Icf2d609f1b63feac7b1674b357fe64473bfa8f3f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Change-Id: Ie91aa2731732e4a6a1abdc2fc7ae00876c5d76e2
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Currently QTextDocuement only provides find using QRegExp. This patch
aims to add support for QRegularExpression.
[ChangeLog][QtGui][QTextDocument] Support for searching with a
QRegularExpression in a document has been added.
Change-Id: I6dba10545b83995d093407038a821fe54db3d261
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
The API was using int, not qint64 leading to implicit
truncation of numbers in a few places
Task-number: QTBUG-40974
Change-Id: I13aedc84557a19b6f74fe6825764e7b5827f27b0
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Gestalt is deprecated so we can't use it long term. At the same time,
the new API is cross platform, so we'll no longer have to parse strings
in -[UIDevice systemVersion] either.
Change-Id: Ic81797174c1a3d50b47b9b209205a6a506cc75ef
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Heuristic with last-modified time in Qt has some problems.
1) Remove redundant expirationDate.isInvalid() check
expirationDate.isInvalid is already checked. So I removed.
2) Add dateHeader.isInvalid() check
The dateHeader is used in expiration calculation.
I add invalid check for the dateHeader.
*. The dateHeader is the origin server's Date
3) Change diff time calculation.
The expirationDate is calculated with time diff.
Previous calculation is
// The lastModified is earlier than the currentDateTime.
// The diff has negative value.
int diff = currentDateTime.secsTo(lastModified);
// The expirationDate is earlier than lastModified
// , currentDateTime and dateHeader.
expirationDate = lastModified.addSecs(diff / 10);
*. currentDateTime: current time
*. lastModified: last modified date in server
It means that files are not cached with the heuristic.
I changed diff calculation.
int diff = lastModified.secsTo(dateHeader);
freshness_lifetime = diff / 10; // RFC 2616 13.2.4
4) httpRequest.headerField setting
If current_age is larger than 1 day, the cache MUST attach Warning 113.
*. The current_age is value of age in header
or elapsed time from dateHeader in Qt source code.
Previous code does not check current_age is larger than 1 day correctly.
// dt = 1970-01-01T00:00:00 + current_age
dt.setTime_t(current_age);
// currentDateTime is much bigger than 1970-01-01T00:00:00
if (dt.daysTo(currentDateTime) > 1)
Task-number: QTBUG-40836
Change-Id: I4b00c3b287e6fafeea6b02681533fe75a198247e
Reviewed-by: Jung Dong-Heon <dongheon.jung@lge.com>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Qt supports changing the default lines a scroll wheel click scroll, but
wasn't trying to read the system settings. The patch adds support for
platform themes to set the default.
Change-Id: I53fdcec7984941d1d1285d927d70460356613f81
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
When the frame's vertical geometry changes because top/bottom
margins, border or padding changes we need to do a full relayout
of the frame to position it correctly.
Task-number: QTBUG-2975
Change-Id: Ia0f063cc2057b6d7a469977d258ec1608feff9bf
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Use C++11 move semantics, and the ctor-init-list.
Change-Id: I1a5faa83ef552e8d98ce994edf967770a73cab0e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: I1ac14bb3d262201071025a885633886934f2d74c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: I92805767b55adce478a4bf8eb1cbafaa544f96aa
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: I427aa5bf5b8d76aabdd5ce5950e9e6762f79b8d8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: Ib303f00ce45816677ffca0580cc6b91a14a0e5be
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
The documentation states that 120 is the value users of
the event should use to determine one full step of the
wheel. Provide that number as a symbolic constant.
Change-Id: I0da0cdd8328a476538080b7276d02863906ea53f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: I774ae9011b855f746b5e3fdf25995d81ec60b82a
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: Ie625d79352fa166e45939ef8f0a5e0cc32f8e801
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: I73d548ad4e25424fc41722961f527e63632a7b56
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: I211d6de32da06bf465c4f721f39d73289206745f
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: Idaad6ec1d92d9aa58d61e2d98e136f108be2bb4c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: Iaaba62396de2d70f611bfa2ba5badb070087fa24
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: I4c43809954ed720de95b3056c13bf520577e3280
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: I6d79852613228658f9093a272edf9b434e60286c
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: I64de0b2644c50469a35fdba9ecde167862975b79
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: I18c00da9504dd3744e6fbb23ea9b9fb7c6d669c9
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: Id50609c1f3511287d99e24b03e48c0a254893194
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: Ie41b95c09f2c6106a6683ba4637513c974555840
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
There's no need to use a macro here, since we can just store
the pointer value in a qulonglong and have the second shift
operation be done unconditionally. For 32-bit platforms, it
will yield 0, and xor'ing it into 'seed' will have no effect.
Change-Id: I3e63bd504e81c84d13935d5503c3707d40d74d6f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There's no need to check for nullptr before invoking delete.
Change-Id: Ied751f76f15f390bf86bbba53c14a3e450aa81e8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Instead of initializing debug_env to -1 (thus forcing the variable
into the data segment), and then overwriting the -1 with a read
from the env-var, dynamically initialize the variable from the
env-var directly, thus allowing the variable back into the bss
segment (which doesn't occupy storage in the executable).
There may have been a reason to do it this way when the old code
could fail due to the memory allocation involved, but now with
qEnvironmentVariableIntValue(), that is no longer a reason.
Change-Id: I9f21b0783ff348f50b574395fc07f2869a14102e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().
Change-Id: I8d440619edfbd90045564e1f92676f1e1f87e136
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A lot of code in Qt uses VAR=1 for enabling or disabling some feature
or other, ignoring qEnvironmentVariableIsSet(), which was added for
that purpose. Other code actually reads numerical values from
environment variables. For both use-cases, provide a non-throwing,
non-memory-allocating way to get the numerical (int) value of an
environment variable, complementing qEnvironmentVariableIs{Set,Empty}().
[ChangeLog][QtCore] Added qEnvironmentVariableIntValue().
Change-Id: I81c85287ea10d355c1bbf8d7807ec9a0e477bce0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is useful when writing a generic preview-icon-generator which
should work with different type of views, itemviews and QML views.
A way to be notified of a change of icon size was missing on the itemview side.
[ChangeLog][QtWidgets][QAbstractItemView] Added iconSizeChanged signal.
Change-Id: I19b3049961002ca27d71aefbb6980d1e6f225c79
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Avoids allocating a QString for every char being written out.
The benchmark went from 5.5 ms per iteration to 0.8 ms,
and from 40 million instructions to 6 million.
Found using Milian Wolff's heaptrack tool.
Change-Id: I1784c47b944454bc947a607a22c39d249372ed55
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Found this while debugging something else in Dr. Memory.
Change-Id: Id295ddf4e07088684ecf91e3c2e0a156bf6054cb
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
If the types doesn't match in QVariant::compare we do a comparison based
on QString, this may end up indicating a full match, though the we don't
match according to cmp. In this case it would be better if we preserved
the non-matching to avoid breaking ordering.
[ChangeLog][QtCore][QVariant] Fixed ordered comparison between QVariants
that do not match but produce identical toString output.
Task-number: QTBUG-40363
Change-Id: I84a8eca11e8875dba9948bde2906ae7c5aa35704
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
QClipboard sends QPlatformClipboard a zero pointer to
QMimeData when it's told to clear. So we need to check
for this to avoid a crash.
Change-Id: I570ed727029ca699673d7b2e989bdff44df8e161
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
-qtdoc repo uses "OS X" instead of "Mac OS X" and this caused
broken links.
-more comprehensive change still needs to be done but the new
name is used in the page to maintain consistency. At least within
the page or class.
Change-Id: I8a5650046fc0413cbb18359b743ecd30fd62e417
Task-number: QTBUG-40759
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
QIODevice makes readData() call only when its read buffer is empty.
Also data argument points to the user or reserved read buffer area.
So, no need in data transfer from read buffer at this point at all.
Change-Id: Ieb4afdf7eec37fdf288073e4a060e64424f22b9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QUnifiedTimer::elapsed() was implemented using
driverStartTime + time.elapsed() while the driver
was running, but time.elapsed already contains
driverStartTime so that was counted twice. This caused
repeating timers to fire immediately once they first
had fired, if the animation driver was started while
it was running.
Separate the two timers. Animation driver time restarts
from 0 every time it starts.
Change-Id: Icf5cd0381b121b2355d7c6ec3edd0997721cbcdf
Task-number: QTBUG-41198
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Right now, we use them for inactive non-editable combo box, check
box, and radio button only on Yosemite. We keep as much as possible
the previous behavior on older versions.
In addition, we add a way for QQuickStyleItem to specify the window
the item is on. This is currently without effect, since we don't
seem to take the inactive window state into account.
Task-number: QTBUG-40833
Change-Id: I2fb2a99e6adf1972f881195b79b07ce85a960273
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This reverts commit 20cf632ad5. The commit
produced to many problems during statics destruction. For example
causing QtCreator crash (QTBUG-40987).
Change-Id: Ib52f6a449c2d84deab2de792559a6a065ca45e8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
If the font engine for some reason fails to get font metrics
for the font, the application should still not crash.
[ChangeLog][Widgets][QPlainTextEdit] Fixed a possible divide
by zero crash when font metrics were missing for the font.
Task-number: QTBUG-40347
Change-Id: I571bc3eace07cdbee6f9ce9aa649df95412aed71
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
A "sharing violation" happens when trying to delete the lock file and another
thread/process is reading it at that very moment. Detect the error and try again,
up to 10000 times - to avoid an infinite loop if QFile::remove fails for another
reason such as a sudden change of permissions preventing us from deleting our
own lock file.
On Unix the deletion can't fail because of readers, but it doesn't hurt
to check the return value there too, to catch other reasons for failures
such as a sudden permission change.
Task-number: QTBUG-38853
Change-Id: Icf12a74faed4a4916e3427abc09d9c33aa141476
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Many of them are already marked. Do it for the rest (QGLWidget et al).
Change-Id: I506d72ad20f8ef39981dbeee0df49229bcf748a7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Refactor the code and move more things into the cross platform
code path.
Make sure the flags survive changing the locale of QCollator.
Use the correct locale on Windows, WinRT and OS X. We now
pass all QCollator autotests on these platforms.
Task-number: QTBUG-40778
Change-Id: Ic2d3334b5018c323a35a3ea8fc1d7ab5f99b4e62
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The old code was completely broken. It did dereference
val for user types, but val does in this case only contain
garbage. Instead use the pointer to the correct data.
Change-Id: I20ccf0bfa3dd3774c787d08c51cc8dd7b1ec9a1a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
A well formed JSON document is not allowed to contain
trailing garbage at the end. Don't accept this in the
parser.
Task-number: QTBUG-40062
Change-Id: I0a09dbd099a8c643f58023342546c4e67d026fec
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
The comparison operators between QJsonPrivate::String
and QJsonPrivate::Latin1String weren't all correct, leading
to wrong sorting of keys in QJsonObjects when the keys were
outside of the latin1 range and resulting lookup errors.
Task-number: QTBUG-41100
Change-Id: Idceff615f85d7ab874ad2a8e4a6c1ce8c2aa0f65
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
focusObjectInputMethodQuery() and sendInputMethodEvent() were not
thread safe. Remove them, and replace with thread safe versions
based on the same principle as queryFocusObjectThreadSafe().
Task-number: QTBUG-40995
Change-Id: Idb6f0c6d3963b7e8e73e029e83d0367088146ca8
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
It has no effect and inhibits move semantics.
After this change, two and five more copies are moves in QtGui
and QtWidgets, resp.
Keep the old form for compilers that mangle the return type.
Change-Id: I6257683144110230079fe9095303907ecc858c94
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Unlike ordinary widgets, the ones that have OpenGL framebuffers must know
about screen changes because the device pixel ratio may be different on
the new screen. Add an internal event, ScreenChangeInternal, as the
counterpart to WindowChangeInternal.
Change-Id: I5e55999838e4c0284e7d9832299f7cc6b541ee3f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Add QMAKE_CFLAGS_XCB to xcb-static,
needed for successfully building with -qt-xcb.
Add QMAKE_CFLAGS because some code gets built with the C compiler.
Also, this fixes a compile error
when xcb include is not in system include path.
Task-number: QTBUG-41129
Change-Id: I842ebe391a7a857e234becc451c33601fce9b07a
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
The language support detection in Cocoa does not report the correct
set of languages for all fonts. One consequence of this is that e.g.
Mkhedruli (Georgian) was not supported on Mac because the
'ka' language code was not reported for e.g. the Arial Unicode MS
font.
This was never detected in Qt 4, because the writing system support
we set for each font was never used for font matching, since we let
CoreText do the matching in Qt 4.
To remedy this, we also detect writing system support based on the OS/2
table in the font. We add this in addition to the current test in case
the language list has information about fonts with incomplete OS/2 tables,
to avoid regressing.
[ChangeLog][OS X] Fixed detection of writing system support in fonts for
some scripts such as Mkhedruli.
Change-Id: I26c2a42ef45112e17d6794d8798a57c8d8aaaafa
Task-number: QTBUG-41208
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Updating the geometry and available geometry in two steps means that
QScreen will be in an inconsistent state when emitting the geometry
change signal, as the available geometry has not been updated yet.
Piggy-backing changes to the availableGeometry based on the virtual
geometry changing does not make sense, so we now tie geometry and
availableGeometry (and their size variants) to their own separate
geometryChanged and availableGeometryChanged signals.
Change-Id: Iee0ced642cbb91c470cb54bc507d2c0512482c13
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
With the recent changes in QDoc, we can no longer assume that
pages listed in the TOC are of type DocNode. For example, all
Qt modules want to list C++/QML type index pages in the TOC,
and those are now of type CollectionNode.
This change fixes the issue by using a more generic search
function when generating the .qhp TOC, one that doesn't
restrict the results to any specific node type. As an
exception, the main index page for a project must still be a
DocNode, i.e. a page declared using the \page command.
However, we do want to restrict the search to the pages in
this documentation module only - for that purpose, a function
for setting a local search order is introduced.
Task-number: QTBUG-40241
Change-Id: Ibaa5af9c5de6436f34b7ae67e56733817fc090b9
Reviewed-by: Martin Smith <martin.smith@digia.com>
As fb_types.h says, Firebird requires (S)LONG to be 32 bit, and it defines
SLONG to int. This leads to sqllen being 4, so qsql_ibase.cpp allocates
4 bytes... and was writing 8 bytes into it.
Fixed by checking sqllen, the same way QIBaseResult::gotoNext does.
Change-Id: Ie8680d32f98c354dfc8430b8efbfe95450556956
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
If you configure QOpenGLWidget to use sampling, the 'resolvedFbo' isn't
updated during resizing. This leads to garbled views.
Change-Id: I9f9265520134bcf12436778773507df936c5fbb6
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
In some cases, e.g. when bad credentials are provided in an ftp URI,
QNetworkAccessAuthenticationManager::cacheCredentials is called with a
null authenticator. This authenticator should not be cached, because
it is useless, and leads to inconsistencies in the use of the cache
Task-number: QTBUG-40622
Change-Id: If2a0a422b915f268648f5eef1d68601446123371
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
According to the XDND standard (http://www.newplanetsoftware.com/xdnd/)
if the proxy window exists then it should be checked for the XdndAware
property rather than the target window directly.
c3f9de6296 introduced the mistake.
In the old code the proxy window was used.
Change-Id: I83b66d4b1f08a1f44d5c1451d0f1735c084bcf09
Spotted-by: Alexander Smirnov
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
In both cases theme.rect calculated right after the
"sub & SC_ScrollBarSlider" test.
Change-Id: I9fa0c4e1327e68b4184674a13e7a4bf362f8deff
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
QOpenGLWindow already has some notes regarding this. It must be
mentioned in QOpenGLWidget too.
Change-Id: I0af90c9410a1c44cb9dd9ce58aa0371a58c57f65
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Make it clear that the class is usable regardless of the OpenGL version
the app is targeting. It may just do nothing.
Change-Id: I50e68a46e36ef1f4694016311af93c6f8719ce4f
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Since 5.0 it is possible to use one call to bindValue to bind
values to multiple placeholders with the same name.
Task-number: QTBUG-23360
Change-Id: Ic838150d25dd07bca7bc9e5d91ab3362a73833d6
Reviewed-by: Matt Newell <newellm@blur.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
To convert coordinates to a parent's coordinate system one should
translate them by an offset of a child widget relative to it's
parent widget. QRect::moveCenter() doesn't translate, it sets
the coordinates of the touch point's center to this offset.
Change-Id: I9d823784803bd1448c0d665944090674d3ff518b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Otherwise the protos are not pulled in so the ANGLE-only build cannot
suceed (unless the flag is defined from somewhere else).
Task-number: QTBUG-41164
Change-Id: I959d154da88f7ccc8159ec7e810ffdba0e7f50ea
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
While GCC 4.4 has the required header, it is missing important
typedefs requiring use of pointers instead. This is acceptable if only
used in one or two places, but a quick search through the source code
lists quite a few usages of const_iterator typedef.
$ git grep -c initializer_list\<.\*\>::const_iterator
src/corelib/global/qflags.h:2
src/corelib/json/qjsonarray.h:1
src/corelib/json/qjsonobject.h:1
src/corelib/tools/qhash.h:2
src/corelib/tools/qmap.h:2
src/corelib/tools/qset.h:1
The lesser-evil is to bump Q_COMPILER_INITIALIZER_LISTS to version
GCC 4.5 and retain usage of required (by standard) initializer_list
typedefs.
Change-Id: I38d6fa0ef3dc7d958587b406d33e3e3a7378c026
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This statement was left from when toAscii was used, instead of toUtf8.
There is no loss of information when converting to UTF-8.
Change-Id: Iad92977af319b324cbf06f1a24712b31a7836622
Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We have no business defining types which come from another library.
These originally stem from the S60 port without further explanation
and Qt and its examples today compile without them, so remove them.
Change-Id: I683ea897c00ab3a1f7c809c45352fe590ae9a41f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Use the new dedicated field instead of just assuming that the evaluation
timespan is buildtime + 30 days.
Change-Id: Ibf4078f030ea609d823fe01889a106a5da345817
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
It was decided not to port the handling of the saved
screen size to Qt 4.8, so, bump the major version to
ensure Qt 4.8 bails out.
Task-number: QTBUG-38858
Change-Id: Ia870519553172cd383830d9a722b0fada180ee1b
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Windows does not automatically move WS_EX_TOOLWINDOW type windows.
Task-number: QTBUG-39320
Change-Id: If9804f32beb534a27ba649abf5eaceb686af8f50
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This makes non-OpenSSL backends able to handle to certificate
extensions.
This also converts the Q_OS_WINRT #ifdef's in the unit test to
QT_NO_OPENSSL as the behavior is the same for any non-OpenSSL
backend.
Change-Id: I6a8306dc5c97a659ec96063d5a59cee2ee9a63a9
Reviewed-by: Richard J. Moore <rich@kde.org>
This commit adds id tags with the anchor reference as the value
to html entities for documentation section titles and function
signatures, properties etc. for both C++ and QML documentation
pages.
Together with new CSS rules, we can dynamically highlight the
title that the user clicked on. This helps to locate the item
of interest on a crowded page or when the page cannot be
scrolled down enough to place the selected item on top.
Change-Id: I7d1db2ed4e12779e1a9e571996ee65c3befa4e7a
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Don't wait for the GUI thread when it's already waiting for us.
An application that uses the virtual keyboard may get an inputmethod
query just when it is being suspended. If the GUI thread is already
blocking on a semaphore at that point, waiting for the android thread,
we really do not want to wait for the GUI thread...
Task-number: QTBUG-40955
Change-Id: Iea2cf0dd058a41a897d596c4bcf16f0508adb20b
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
When we suspend the app, we destroy the surface to save resources.
We don't want to create it again just as we are shutting down.
Task-number: QTBUG-41072
Change-Id: I7a616249bee869b92716d0911201a80d73c2f8da
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Metrics obtained from the system must be scaled down
when device pixel ration scaling is in effect. Factor out
functions to return the device pixel values which might still
be used for drawing.
Task-number: QTBUG-38993
Task-number: QTBUG-38858
Change-Id: I6b90629e4979436bbb46f8c1fa1ee2253ada7ece
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Also, remove the -angle-d3d11 configure option, as it no longer is
necessary to select the renderer at build time.
The D3D11 renderer is the default renderer in upstream ANGLE, and has
been shown to be a more reliable solution for developers running over
remote desktop and inside virtual machines. It also provides more features
to the OpenGL ES implementation.
This configuration switch does not disable the D3D9 render; if the GPU
does not support D3D11, D3D9 is used instead.
[ChangeLog][QtGui][Windows] The ANGLE D3D11 renderer was enabled by
default. Systems which cannot use the new renderer will automatically fall
back to the D3D9 renderer at runtime.
Task-number: QTBUG-41031
Change-Id: If894309c07d9309c236b63c36f37679f74375133
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
The code says
bool QRect::isValid() const { return x1 <= x2 && y1 <= y2; }
so the documentation should say <= as well, rather than <.
Change-Id: If52005879d2a758b5d1d64b552e6cd96341fae76
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Widgets and layouts added or inserted to a layout are checked for:
- Not being NULL
- Not being the parent widget of a layout or the layout itself,
respectively
Without this commit, adding a widget to its own layout would result in a
CPU-hogging infinite loop. Now, a warning is written to stderr and the
add or insert function call is ignored.
The checks are implemented as public functions of QLayoutPrivate and
thus accessible in QLayout's descendants to be used in various
"addWidget", "insertWidget", etc functions.
Unlike 'classical' layouts like QGridLayout, QFormLayout does indeed
accept widgets that are NULL. To not break this behavior, any call for
the check functions first tests if the widget or layout, respectively,
to test is NULL or not and calls the check only in the latter case.
Automated tests for QBoxLayout, QGridLayout, and QFormLayout were added.
For an unpatched Qt 5.3, each of those automated tests will freeze as
explained in QTBUG-40609. For a fixed version, warning messages about
invalid parameters to addWidget/addLayout/... calls will be read by
QTest::ignoreMessage, resulting in a passed test.
Change-Id: I1522d5727e643da3f7c025755975aca9f482676d
Task-number: QTBUG-40609
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
No need to allocate dynamic memory for a fixed-size point array
when QPainter has a (QPoint*,int) overload.
This one is a bit more complicated, as the QPolygon was returned
from a helper function, so I wrapped the array in a minimal
std::array-like StaticPolygonF.
Together, these four QPolygon -> QPoint[] changes result in
ca. 4.5K text size reduction for libQtWidgets.
Change-Id: I082f199d5edb7a7782173fe3748220f373edac8a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
No need to allocate dynamic memory for a fixed-size point array
when QPainter has a (QPoint*,int) overload.
Change-Id: Ie1eecd376a52b73572998ba253a032deaa0daaf9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
No need to allocate dynamic memory for a fixed-size point array
when QPainter has a (QPoint*,int) overload.
Change-Id: Ifdf8224ddffe06ef7848562023e372e2c32b9ad6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
No need to allocate dynamic memory for a fixed-size point array
when QPainter has a (QPoint*,int) overload.
Change-Id: I50c69103bba47e9f6de4f5616e8f40fee522ddc2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
ATSFontNotify() allocates over 30MB for no apparent reason for
applications that don't register fonts.
Change-Id: I7bbc97f53b76be1e638de8ca0d1be3a08586cf00
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Both Q_LITTLE_ENDIAN and Q_BIG_ENDIAN macros are always defined
on all architectures. So, byte order detection results in
"little_endian" value for big endian systems. Test the system
endianness in a right way, according to Q_BYTE_ORDER macro
documentation.
Change-Id: I5523f90567e78d679a3ff2902a8f5377ed39ceb1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For iOS8 and up [UIScreen bounds] changes based on the interface orientation,
so we need to use [UIScreen nativeBounds] instead.
Change-Id: I3fc12cfa417df26ca94c803e970bc2dc18a94378
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This reverts commit f6c36917f1.
Depends on 203ce7c5ce
which can't go into 5.3 because it introduces new enum values.
Change-Id: I13040a7268fae4baeace244a3e75dc982d3a50b8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Provide workarounds for things GCC doesn't like, and define a number
of macros not found in the MinGW headers.
Change-Id: I254c208209c0071fae5efb6727f2b3cfd5542da6
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
When we strip the & we should also report the hotkey.
In addition only strip labels when they are buddys and try not to remove
ampersands from all kinds of random text.
This fixes https://bugs.kde.org/show_bug.cgi?id=338282
Change-Id: I401281cd9ff43b23a3923ad9909ca9c469b59506
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
These functions are supposed to make it easy for third parties (and
QLineEdit) to implement the textAt/Before/AfterOffset functions.
Before the functions were ignoring newlines completely and thus only somewhat
useful.
Change-Id: I7136b9502a7fa6f8ad9ad7236761a34c1a7fd4da
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
I was actually wondering if the test always succeeds (i.e. should
be turned into a Q_ASSERT), but I don't know the codebase enough to
justify such a change.
Change-Id: Id01b8de7244428e9b1c240dc365c66eeef0d6111
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Read and store softInputMode set at AndroidManifest.xml on QtActivityDelegate.
When showSoftwareKeyboard is requested setSoftInputMode for main window if
softInputMode is not defined fall back to old behavior.
Change-Id: I71cb27d4bdb4ae4e3c2a0706560173703a2f5a50
Task-number: QTBUG-34401
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Fix some memory leaks in uic. These break the Qt build with clangs
address sanitizer feature enabled as Clang will cause uic to fail when
it detects these leaks. This in turn will stop the Qt build.
Change-Id: I6794b29f5a36fc8a2d59cf36f6d7459f3f50d56d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
QMdiSubWindow::eventFilter() is supposed to close the sub window on a
double click on the menu icon. However, it did not receive the double
click event since it removed itself when the menu was hidden, which
happened before the double click was delivered.
Task-number: QTBUG-25179
Change-Id: I5e7fb02dda26ceab12e8b7554fc604066a0a3136
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This switches the font rendering to use gray scale antialiasing when in
translucent rendering mode. It does so by adding a flags argument to the
paint engine, allowing for future expansion in communicating render hints
from the device to the engine.
Task-number: QTBUG-41002
Change-Id: I0265154716a12060e851b603a109e9c693f5e843
Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This adds support for reading and writing ASN.1 boolean
values. It also adds an operator to test two ASN.1 elements
for equality.
Change-Id: I4a22cbf9808533d593fc59d27b63caaf650b1f57
Reviewed-by: Richard J. Moore <rich@kde.org>
This environment variable will paint an overlay on each paint command
that is using the accelerated blitter path for DirectFB. This is useful
when you want to assure that you are taking advantage of the DirectFB
blitter.
Change-Id: I6e374754825794daf9c1bf40bee2b963e752a8e9
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
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."
With this change, the list is sorted once an item needs to be removed.
The item to be removed is then found using binary search. To reduce
the overhead of sorting the list is not sorted from scratch. First the
newly inserted items are sorted and then the two parts of the list
are merged.
[ChangeLog][QtWidgets][QGraphicsScene] Speed up the removal of items
when using the linear index.
Change-Id: I28708622605d7fb0fac656df1f9b2f2fa3136759
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
During the introduction of context adoption support the config choosing got
broken for context creation, at least for hooks that return a customized
format in surfaceFormatFor(). The returned format is the one that needs
to be passed to chooseConfig(), not the original.
Change-Id: Iae203cbbf7b39c462386611dd3744f048116df13
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
This reverts commit bf2ec0183c.
That patch changed the way the linear index works in QGraphicsScene
in order to speed up item removal. That patch occasionally rebuilt
the index by recursively exploring all items in the scene, starting
with the top level. Further testing revealved that in some
circumstances, rebuilding the index in this way can be slow, thereby
significantly slowing down the index compared to the unpatched
version.
The original patch only exists in the qt 5.4 branch and has not been
released.
Change-Id: I081dbcdcc86196ef382466c3e800a33eab9a5b79
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Get rid of the rendezvous at shutdown: the android thread does not
need to wait for the GUI thread. Since the GUI thread frequently does
blocking calls to the android thread, this fixes several known and
potential deadlocks.
Task-number: QTBUG-41072
Change-Id: Ia6fa8da026b1727e7352b22f4df4d72b63b8c847
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
There are valid uses cases how to use Qt without installing
any fonts (e.g. by using an application font), so let's
make the warning non fatal.
Task-number: QTBUG-29192
Change-Id: I5684331b687bef4b8a54be1f68303c80aa8d4372
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Assignment of a value was two times successively for same variable while
the variable itself is not used between these assignments.
Change-Id: I3c457e3af0505d32a64f6c8576b458cd15a951e5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The practical uses of a POD QElapsedTimer are not really that clear, and the
number of misuses of this API are quite high. Default the state to invalid to
prevent against mistakes.
[ChangeLog][QtCore][QElapsedTimer] Is no longer a POD.
Change-Id: I267292acf2bfca7404e3e449dd04410441d7ce26
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
udpSocket() can only be called after the socket descriptor is set.
Change-Id: If651ff58507cd66c98de4b699a80149913d9ffcf
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Maintaining a black list of devices can't be reasonably done.
The workaround is now enabled by default. It can be disabled with the
QT_ANDROID_DISABLE_GLYPH_CACHE_WORKAROUND environment variable, in
which case the current list of blacklisted drivers will still be taken
into account.
Task-number: QTBUG-40483
Change-Id: I9b90ab45e86569e8e4679333ddb9b835189892c7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Previously, this failed because QEasingCurveFunction only had a linear
behavior.
The fix is to change that and let QEasingCurveFunction handle
any of the simple "non-parametric easing" functions.
Task-number: QTBUG-38686
Change-Id: I666d59e10ceb589dcc52956b16a6f0c259aebdad
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This adds the infrastructure for reading and writing encrypted private keys
when using non-OpenSSL backends. Each platform must provide its cryptographic
encrypt / decrypt functions.
As WinRT already uses the common parser, this commit includes an
implementation for that platform.
Done-with: Andrew Knight <andrew.knight@digia.com>
Task-number: QTBUG-40688
Change-Id: I0d153425ce63601ff03b784a111e13962061025f
Reviewed-by: Richard J. Moore <rich@kde.org>
Do not try to resize or destroy invalid surfaces.
This caused update problems with all GL apps after suspend,
since we would forget the dummy view that we always keep
around so we get proper transitions on shutdown.
Also make sure that we don't mess this up even if we try to destroy a
non-existing surface. This would have fixed the bug by itself, but
then we would still be stuck with the annoying warning message.
Task-number: QTBUG-41093
Change-Id: I83299e93eb9ac5357b98ca47014789b56c91b35a
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
The default behavior of ANGLE is to use D3D11 before falling back to D3D9.
This change improves flexibility the platform plugin to explicitly create
a D3D11, D3D9, or D3D11 software (WARP) context by setting the
QT_ANGLE_PLATFORM to "d3d11", "d3d9", or "warp", respectively.
Task-number: QTBUG-41031
Change-Id: Ie1d399c1cb0e360e5b3a6d9f2a4b28745d86cc71
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
The color table is passed by value (good for C++11), so when
the argument is assigned to the member variable, that's a good
spot for a move assignment.
However, the argument is also declared const.
The standard says that top-level const is ignored, but some
compilers (I know about SunCC) think differently, so we cannot
remove it.
Instead, we do a const_cast. It is well-defined: Even though
apparently the argument was declared as const, the standard
says the const is not there, and no sane compiler would put
the argument copy into read-only memory.
Add a reminder to remove the top-level const from the
signature come Qt 6.
Change-Id: Iac18846ba669de0a30da620685ad1438c267e193
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The code doesn't touch any member variables, so it doesn't need mutex
protection. Reducing the time spent under the mutex allows a higher
speedup (Amdahl's Law), so do it.
Also made the mutex locker const to indicate it is never unlock()ed
again.
Change-Id: Ic50b827c0e34d39cbddc7ec83675b568a9c33f6d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Use a template helper function and template specialization
to select which of the two versions (64bit / 32bit) to
use. This makes the compiler see both versions on all
platforms, enabling better syntax checking should either
of the two change. It also will fail to compile on platforms
where the word size is neither 4 nor eight bytes now...
And, of course, it's always satisfying to remove a use of
the preprocessor.
Change-Id: I4870411f99eb3b1a2c0c170fa53fa3c9b026da15
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
The implementation of hash(float) does not treat +0 and -0 the same,
thus violating the property required of hash functions that they
produce equal hash values for equal input.
Simply use the qHash() FP functions which recently became available
and which do not have that problem.
This was found by unrelated code review. I'm not aware of any user-
visible issue this fixes.
Change-Id: I458c384aaf112e29cea677022969b62a34263cfb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The old code repeatedly evaluated QImage::colorTable(), which returns
a vector by value.
Instead, factor the checks performed on the color table into
a helper function and pass the color table to it, reducing
the number of evaluations from three to one.
Also makes the code more readable, because the condition now
fits on a single line.
Change-Id: I82773c235047e76b87c8a9d630f7df9440430351
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Instead we can just use the QEasingCurve::Type enum.
This reduces code size and should simplify the code a bit.
Change-Id: I34eb62b7921634c91785c7b8c7c12741e6284fa1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We pull out the magic UIViewAnimationCurve of the keyboard animation
when the keyboard is about to show, but we need to defer the shifting
of the value 16 bits, as that turns it into a UIViewAnimationOptions,
which we can't store in a UIViewAnimationCurve member.
Change-Id: Id35dae1ec487951df749dfffb6118b572c28b103
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>