People use this, so make sure there's a test for it.
I don't expect this test to fail, but static and
dynamic checkers should be presented with this
use-case, so they have a chance of warning, because
certain implementation strategies of QPointer may
make this code undefined.
Change-Id: I334bd73204ba4e186c4098fc6b7188917407e020
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Removing blacklistings from tests that are now passing.
Change-Id: I00aa1ce286d3e7715fb4bee4a36d0d77049a29ae
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
While extremely unlikely, there is a theoretical possibility that
the '0' glyph of a given font will have a width or height of 1 pixel,
in which case the (x + 1) / 2 way of getting the center would give us
an out of bounds pixel. We just default to true in this case, since
we cannot make any assumption based on the 0 glyph if it doesn't make
any sense. If the image is invalid, we default to false.
Change-Id: I36cea0b80c9d55aa10eb65db44d1b7ec8a40fc8c
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Some strings were drawn with a different size or scaling than what the
string itself said, causing confusion.
Change-Id: I4b187cba6d467cfa0900576bdf451052baa806e6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
If moc is invoked with the @ argument and no options file is specified
or the options file cannot be read, do not try to parse the empty
arguments list. Otherwise QCommandLineParser will print an additional
error message that is of no value for the user.
Task-number: QTBUG-51847
Change-Id: I9aa1eb20a44097b553123be8bc6fded87473a03a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QImage::pixel() assumed that the color table was valid
for the values in the bitmap. This was always wrong
for indexed images with explicit no color table set and
was wrong for mono images that were constructed from
preexisting data.
For mono images, we default to a black/white color table,
like we do when constructing with uninitialized data.
For indexed image, we always default to no color table,
but instead of crashing in pixel(), we warn and return
an undefined value.
[ChangeLog][QtGui][Image] Fixed possible crash in QImage::pixel()
for mono or indexed images.
Change-Id: Ieaf19c03984badddfd06e1855a7e287b862adc70
Task-number: QTBUG-50745
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Fixes the position of the input method window when High DPI scaling
is active.
Task-number: QTBUG-51923
Change-Id: I35ee4bcf320f8c2b7d5cc7fb8484348b18e1d833
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Extend the blacklist with Mali-T760 and Mali-T720 as found on Meizu
Pro 5 and Bq Aquaris M10 Ubuntu Editions. Reading from FBO like
taking screenshots does not produce correct result otherwise.
Initially reported at: https://launchpad.net/bugs/1557915 and
https://launchpad.net/bugs/1559906
Change-Id: Ic875bd083277bf933863a3a50f8e874dd6e04365
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Scaled hinted glyphs looks ugly, see QTBUG-24846. It was fixed
in 6da6845f07 by disabling hinting
for them. But at the same time that commit also disabled hinting
for glyphs with the most common transformation - rotating without
scaling.
Detect this type of transformation and don't disable hinting for it.
Change-Id: I0e69a2b60e7e4bc24e9efc4fdedb984df07ad15c
Task-number: QTBUG-50574
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This change disables tests which require QtGui.
Change-Id: Ib647afd086f54536054cb4c0cde5696d762ee8c4
Reviewed-by: Stephen Kelly <steveire@gmail.com>
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Replace if / else if chain by switch() and return the value
instead of reassigning it.
Change-Id: Ib87c54bbf9911a58d3ae764b71f19f33d59590ce
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The old code converted QRectF into QRect when applying the offset. Change
the offset point to QPointF and change the conversions accordingly. Add an
autotest similar to that of QPlainTextEdit.
This minimizes rounding errors and prevents conversions since
the input method logic mostly uses qreal.
Task-number: QTBUG-51923
Change-Id: I0c2f80ccae028d8bbbb97ec603f8782f69959c76
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Both QFont::handle() and QFont::freetypeFace() used to
be available in Qt 4 but were removed in Qt 5. There's
currently no API to get access to the native font handle,
which the font engine holds in a way or another.
Similar to the way it was in Qt 4, the actual handle type
depends on the font engine currently in use. The types map
as follows:
Font Engine Native Handle
------------------------------------
DirectWrite IDWriteFontFace *
Freetype FT_Face
Mac CTFontRef
Win HFONT
All other font engines return a null handle.
Change-Id: I3bea8259ac1378fd24079723aa6603bf9e74834c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
QMacStyle doesn't know how to accurately compute SE_ProgressBarGroove
But, since we only need the progress bar's main dimension, its rect
is good enough for QProgressBarPrivate::repaintRequired().
Change-Id: I81e936003b847cc9cc0ddf4fbfc05ddc1c9f6625
Task-number: QTBUG-51120
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Qt crashes when opening a native file dialog. Disable this feature to
fix this issue.
Change-Id: I1ee17d858238c2531964a63ddbe3e11c5a85483c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Determine offset point to similar to QTextEdit::inputMethodQuery()
and add an autotest.
Task-number: QTBUG-51923
Change-Id: I8232eb348063e2cd95d0632fe74a6eb30c897eda
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Subjects each *.png file that matched grep -law "sRGB" to:
pngcrush -ow -brute -rem allb -reduce
(Two needed -force but did get smaller.)
Change-Id: Ia030f0bc1d3617ba716bcc26677ff919ef58423c
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Moving tabs of a QTabBar goes through a temporary QWidget that
captures a "screenshot" of the tab, and then gets moved around.
Unfortunately, that screenshot was not using the devicePixelRatio,
resulting in blurry text and icons. For some reason, setting
the DPR on the pixmap isn't enough -- that causes it to be
drawn twice as big (bug somewhere in Qt styles?).
Work around that by not using the palette, but a simple widget
which draws the pixmap (which also leads to somehow clean code).
Change-Id: Id12f9251625693d108031488ddfab86277128705
Task-number: QTBUG-50898
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Its currently not possible to style the arrows with QCommonStyle because
drawPrimitive from QCommonStyle is called instead from the proxy.
Change-Id: I910b13df110601cb18578bc16edfa5ddaa17bbd2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The previous implementation overwrote multiple 'time' parts in the
qSetMessagePattern with the last setting in the pattern line.
%{time}%{time process}%{time boot} ended up to be output as if
%{time boot}%{time boot}%{time boot} was set.
This fix keeps the arguments of each individual 'time' part.
The same holds for multiple 'backtrace' parts. The previouse
implementation overwrote multiple 'backtrace' arguments with the
arguments of the last occurrence.
This fix keeps the individual arguments for the 'process' parts.
The individual arguments are applied in qFormatLogMessage.
A new test to verify the individual 'time' arguments application
is added, too.
Task-number: QTBUG-51944
Change-Id: Ib757614a482c5f31ed0a61b550daa2eea4b907b4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Match correct number of digits and entire string, amending
change 4347e81161.
Task-number: QTBUG-33962
Task-number: QTBUG-51373
Change-Id: I56de00bd5ffb3a3a700efbb20970154faf86f923
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
QWindowsPipeWriter doesn't write in a separate thread
anymore.
Change-Id: Id978bfdfa2531be91cce94476ab9b0dff237bd61
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Show and Hide events were not propagated before this change.
Add Timer, DynamicPropertyChange, ChildAdded, and ChildRemoved,
because they are supposed to be delivered to one QObject.
Also don't propagate these events if WA_DontShowOnScreen is set.
Change-Id: I134bf3909d46141e4d3e39f41983f493a4f35478
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Drop addSub() test. It executes exactly the union of fetchAndAdd()
and fetchAndSub(), which have already had their UBs fixed.
No need to do fixes in duplicated code.
Change-Id: Ib72caab0310fce3ff9a40c261d8a38518f91ecaf
Reviewed-by: David Faure <david.faure@kdab.com>
Commit 0307c008 removed the buffering of data-to-be-written from
QWindowsPipeWriter, because it was assumed that users of this class
(QProcess and QLocalSocket) already buffer data internally.
This assumption was wrong for QLocalSocket. The following sequence
localSocket->write(someData);
localSocket->write(someMoreData);
would not write anything on the second write.
Add a write buffer to the Windows implementation of QLocalSocket.
Task-number: QTBUG-52073
Change-Id: I6d0f03a722ec48138cbde3e2f69aae7dafe790d3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This makes minimal a bit more useful for apps needing to access
QFonts from non-UI environments.
Change-Id: Idc5ca13f0c385ab9b4258e11fea7ec886515eea4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
The most visible problem is that changing selection model didn't update()
the view, resulting in the old selection/current item still being drawn.
In general trigger the handlers for when the selection/current item
changes.
Change-Id: Ib3b2ad70412e6a21a182d4c173e617710bcc630d
Task-number: QTBUG-50535
Reviewed-by: Stephen Kelly <ske@ableton.com>
Found by UBSan:
src/gui/text/qrawfont.cpp:647:55: runtime error: load of misaligned address 0x000001eeed26 for type 'quint32', which requires 4 byte alignment
src/gui/text/qrawfont.cpp:648:50: runtime error: load of misaligned address 0x000001eeed02 for type 'quint32', which requires 4 byte alignment
Fix by using the qFromBigEndian() overload that can read from
unaligned memory.
While touching the code, also disentangle the two loops so that
operations are now performed in memory order instead of inter-
leaved, use less magic numbers, and avoid a QByteArray detach.
Change-Id: I26fa39726f6fa2e957b60863fa160280cf1dc9ac
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
While the implementation of the QByteArray::operatorX(const QString &s2)
for X \in { ==, !=, <, <=, >, >=} was already inavailable when
QT_RESTRICTED_CAST_FROM_ASCII was defined, the declaration was
still visible, leading effectively to a linking error.
This change hides the declaration, too, creating a compiler error as
intended, and as present with the QString::operatorX(const QByteArray &s2)
functions.
Change-Id: Ifdb0b85b7423b3b9c69212639b1512b0808a7983
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
...instead of overwriting when building qmake for windows.
Change-Id: I89eb33439b03a0ad33d006d12c9896c87d271c4f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Using Visual Studio a user very seldom wants to disable the automatic
invocation of windeployqt. Hence switch from opt-in behavior to opt-out.
This also fixes first user experience to invoke qmake –tp vc and then
hit run on examples.
[ChangeLog][Platform Specific Changes][qmake] qmake-generated Visual
Studio projects now automatically invoke windeployqt by default.
Task-number: QTBUG-52008
Change-Id: Iee1607269c38c7f6c726f554978ac05477bebe5e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Set input method attribute to be aligned with read-only
value in QTextBrowser initialization
Task-number: QTBUG-52071
Change-Id: If0e64bf09e2a2d505ed66fcbfb8cd12ae39844d3
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Some Qt users include non-system OpenGL headers, resulting
in a possible mismatched redefinition of GLhandleARB.
Ideally, we'd like to skip the whole glext.h inlined portion
and rely on qopenglext.h. However, some issues remain such
as GLDEBUGPROC not being defined on OS X.
Change-Id: Ie551cf0be309234b22cd615cc3703980f48298b9
Task-number: QTBUG-46149
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
The spawn code was only used to make QProcess work on QNX 6.5.0. Fork
works on QNX 6.6.0. The QNX spawn implementation has a flaw that causes
a deadlock in certain situations. When a working directory is specified
for the process, the QNX spawn implementation stops all threads except
the one doing the spawn so that it can temporarily change the process'
working directory. This can lead to a deadlock if the thread does
anything that conficts with something being done in a stopped thread.
QNX 6.5.0 is no longer supported in Qt 5.6.0 so we can just switch QNX
to the fork implementation and get rid of the spawn implementation.
Made a QNX specific adjustment to the hardExit test. There's a bug
in the OS that the test can run into because it does something that
normal applications wouldn't.
Task-number: QTBUG-47250
Change-Id: Ib32567d2c15ce651815858000035ac5aa6f35224
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Remove parameter from QWidgetPrivate::createWinId(), add a warning and fixme
comments. Update the documentation to point the users to QWindow::fromWinId()
and QWidget::createWindowContainer().
Task-number: QTBUG-33079
Task-number: QTBUG-51853
Change-Id: I03ae922b31bb46a411889cc0260ea14a4d933492
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This fix repairs the mechanism to deploy Qt dlls as well as C++ runtime
to a wince target in Visual Studio.
Do this by adding a deploy section in the Visual Studio solution and
adding the C++ runtime from the mkspec to the files deployed to the target.
Deploy target path is set to what the wizard of Visual Studio defaults to.
Before, the c++ runtime was only deployed for executables which were built
as part of Qt.
Task-number: QTBUG-50924
Change-Id: I478010dc16e35c68578281895aa3ae14b5c96bb4
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Adapt the mkspec which was forgotten in change
b0ec05f27b.
Task-number: QTBUG-48431
Task-number: QTBUG-51686
Change-Id: Ie95e650de8b7a7027979ec637fb77c7f0357a598
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Add a 32x32-pixmap to the style and factor out a function from
QStyle::standardIcon() to assemble the icon. The 32x32 pixmap may also be used
for the 16x16 case with devicePixelRatio=2.
Change QLineEditIconButton to use QStyle::standardIcon() instead of
QStyle::standardPixmap passing the QWindow to obtain the correct pixmap
from the icon.
Task-number: QTBUG-49374
Change-Id: I9895230f66911752cc13b7212609141610df0977
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>