The flags here are passed to a private QVariant constructor, and they
really represent a boolean - IsPointer or not.
Because the flag for the key_type was incorrectly populated with the
flag for the value_type, memory would be corrupted when using a mapping
type whose value_type is a pointer, but whose key type was not, such as
QMap<QString, int*>
This typo has been there since the concept was introduced in commit
v5.2.0-alpha1~807 (Add container access functionality for associative
containers in QVariant., 2013-04-05).
Task-number: QTBUG-52246
Change-Id: I9ecb13c603015eed2dc2ca43947fa0ecd6be8b5a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The QScrollerTimer instance allocated by QScrollerPrivate was never
freed. I've absolutely no idea why QScroller has such a messy
d-pointer handling, so go for the easiest approach: exploit the
fact that QScrollerPrivate is a QObject and parent the QScrollerTimer
to it.
Change-Id: I500edc9d0d14b2fb9eec02712229970eb2b9fe81
Task-number: QTBUG-52280
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
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>
Fixes documentation warnings:
qtbase/src/network/kernel/qnetworkinterface.cpp:528: warning: Can't link to 'QUdpDatagram::interfaceIndex()'
qtbase/src/network/kernel/qnetworkinterface.cpp:587: warning: Can't link to 'QUdpDatagram::interfaceIndex()'
Change-Id: I6579f7880b5e183b9c68dfe08fa7671f1511fdfa
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
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>
... by replacing QString::split() with QString::splitRef()
and using the new overloaded functions:
- QLocalePrivate::languageToCode(QStringRef)
- QLocalePrivate::languageToCode(const QChar*, int)
Change-Id: I2884bdc6d3e27963ce121d659a5e092b10b4ef8c
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
... for QStringRef and QChar array.
Now we can use QStringRef arg or QChar array arg to avoid
unnecessary allocations.
Also mark these functions as Q_DECL_NOTHROW.
Change-Id: Ibe75346d80cc413e303fad886ecb82dbdb89af24
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Now we can use QStringRef arg or QChar array arg to avoid
unnecessary allocations.
Also mark these functions as Q_DECL_NOTHROW.
Change-Id: I22b08a054051e80e3f76bb543d860f3dcb6caa4f
Reviewed-by: Marc Mutz <marc.mutz@kdab.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>
The test is preventing us to take RHEL 7.1 in the CI for Qt 5.7.
Changed the paintEvent() test to be less strict about the paintCount.
Task-number: QTBUG-51809
Change-Id: I84f797442e38c66dc23862e92eda6db08bcac368
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>
Replace substring functions that return QString with
corresponding functions that return QStringRef where
it's possible.
Create QString from QStringRef only where necessary.
Change-Id: I697f776c60003629990cfd197534ffed63bafe2f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
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>
In case Qt::WindowTransparentForInput is set on a window, we
usually call [super someRelatedMethod] on a corresponding QNSView, for example,
[super mouseDown:theEvent]. Unfortunately, Cocoa will continue
to report the subsequent mouse dragging events to the first view where
mouse down occurred, despite of us passing mouse down to the next reponder.
Dragging events we'll also 'propagate' by calling super's method,
but it's not working properly, since the current view below
probably did not have that first mouse down event thus it does not have m_buttons set
correctly. And even worse with the closing mouseUp event. So, let's use
-hitTest: returning nil on such a 'transparent' view so that it's ignored by mouse events.
Task-number: QTBUG-40583
Change-Id: I5e0fef3e246a29332df758a692300d478b862069
Reviewed-by: Morten Johan Sørvig <morten.sorvig@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>
Cleaning out the workarounds for the discontinued "Embedded Android"
platform of Boot2Qt.
Change-Id: I0ff9d770e82a43457fb7e5da0428f4597ead4038
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Replace QMimeType::inherits() by a check using the list of parents
since only the direct children are needed to build the tree.
Change-Id: I041f21c4b94c8a250f7402a6f550f987c64f8fe8
Reviewed-by: David Faure <david.faure@kdab.com>
Describe the platforms better because right now the only difference
is the "pro" tag which is easy to miss.
Change-Id: Ia3e31ed97799bf7f8b76ee3d0bb95c7ded7692db
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.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>
All symbols are available through eglGetProcAddress().
Change-Id: I636f9555f578dc5cf517995a4fcb01b0cd7f7698
Reviewed-by: Lars Knoll <lars.knoll@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>
Update files using old header.LGPL3 to header.LGPL
Update files using old FDL template to use new one
Update files using old BSD template to use new one
Change-Id: I36a78272516f9953d02956522f285b40adfc8915
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.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>