Labels would use a statically defined font for <pre> blocks.
Use the one defined by the QPlatformTheme instead, through
QFontDatabase::systemFont(FixedFont)
Task-number: QTBUG-50564
Change-Id: I5491bd0defce651bdf809bcbc6a529a900f4959b
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
To calculate the real count we need to use the actual fixed point
increment and can not use the floating point value increment wass based
on since it might round differently.
Includes auto-test by Gabriel de Dietrich.
Task-number: QTBUG-50153
Change-Id: Ia973088f361c90370fa20bac14a4b8f373b5d234
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The QKeySequence test no longer uses private members (since commit
725bdc3fd2), so that is no longer needed.
Also, remove the unused include from the test.
Change-Id: I4d252bb3efd7282f74c44e48444c23ab51d48ea5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This reverts commit 4c71db7567.
It's too risky for 5.6, we should let it cook in dev for a while
and backport when ready.
Change-Id: I91e677e65d967f29c84a254cd3dffc8bb847b263
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Resetting focus_window and other internal QGuiApplication variables before
calling setVisible(false) and destroying the platform window means that the
platform window can't reason about whether or not it was the focus window
unless it can resolve that using native APIs. We should let the platform
window take care of resetting the focus window and related states, and
only execute our fallback logic if the plugin doesn't do the right
thing.
We also use QPA to update the state instead of modifying the internal
QGuiApplication variables directly, so that events and signals are
emitted as a result of the reset.
The QLineEdit test gets two added calls to processEvents(), since
assuming that activateWindow() is synchronous is not correct, and
would result in the QMenu resetting the focus window to 0 on destroy.
Task-number: QTBUG-46414
Change-Id: I562788393ed0ffd77d7a4be2279862322f721c1a
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Parse the requested family before we're looking/saving into the cache,
thus hitting the cached EngineData for:
* quoted family names (eg. QFont("'Arial'"))
* non-simplified family names (eg. QFont(" Arial "))
* substituted family names (\sa QFont::insertSubstitution())
* explicit fallback list, where possible (eg. QFont("Tahoma, Arial"))
This also improves the cache hitting for the font engines in some cases.
Change-Id: I18cdc3e8d669cccec961f84e9b27329402e2b7ed
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
We depend on the assumption QFontCache::findEngine(key) for key.multi=1
returns a font engine of type QFontEngine::Multi;
guarantee that by checking it in a single place.
Change-Id: I287da4fd62deb22fc5520cde5b0505bc44547609
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Both constructors were taking a pointer, so they participated in
overload resolution along with QTextDocument and QTextFrame pointers.
Instead, make them take references and move them to the private section
of QTextCursor. That necessitated adding a method to QTextCursorPrivate
to access that private constructor from non-friend classes.
Change-Id: I7e6338336dd6468ead24ffff1410e3bc534d77dd
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)
Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The test inserts strings "0" ... "9" into the text document,
takes the half of resulting document's size, makes half of
lines invisible and compares sizes. On OS X 10.11 after inserting
"4" the width changes, so making "4" invisible also reduces the width
and QCOMPARE(currentSize, previosHalfSize) fails. Instead of digits,
insert the same string "A" 10 times.
Change-Id: Ie88a0442703f98949cea9bcdb694cecee59695f3
Task-number: QTBUG-49848
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
While a native dialog is open, the application message queue is
handled by the native event loop which is external to Qt. In this
case, QEventDispatcherWin32::processEvents() does not run and socket
notifiers will not be activated. So, this patch moves the notifier
activation code into the window procedure, which enables socket
event processing with native dialogs.
Task-number: QTBUG-49782
Task-number: QTBUG-48901
Change-Id: Icbdd96b2e80c50b73505f4fe74957575b83d6cf1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
- Do not save geometry when going from maximized->fullscreen
- Use SW_SHOWNA instead SW_SHOWNOACTIVATE as otherwise the
maximized geometry is restored.
- Add a test for Windows.
Task-number: QTBUG-49709
Change-Id: Ic81e7398ee90d499a50b02192a45cb09276a2105
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Adds NEON version of interpolate_4_pixels used by smooth upscaling, and
bilinear sampling.
The SSE2 version is reordered to match the NEON version so they have
the same order of operations and a faster version that loads directly
into vector registers.
Testing is extended so we have a test of smoothness that can catch more
possible mistakes.
Change-Id: I0de4aecf5cb79468e7c8f19f421aa24b2955547c
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
TEST_HELPER_INSTALLS cannot be used on platforms with no
QProcess support.
Change-Id: I2a6a283d94ca4487fc628449c53fc37140dd291d
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Move some code (like registrations of meta types) from init() to
initTestCase() in the process.
Change-Id: I57db5156647cfadab554fbed853b2e68b2815f3b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
QColor always uses unpremultiplied alpha, but the new QImage methods
were based on the QRgb versions which might be either. This patches fixes
the two new methods so they treat QColor alpha correctly.
Change-Id: I78a5b875ad4e78ad7fde3b811c6187482b4f6d15
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This follows up 130c2baa93.
Change-Id: I2f6c9b4f995af427cec9a2162b782039debf8564
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
QVariant was using QColor::name() to convert a color to string, which by
default loses alpha value. The patch is fixing the problem by always
including the alpha value in the string when required.
[ChangeLog][Core][Variant] QVariant(QColor)::toString() uses
QColor::HexArgb format when the alpha component is different from 1.
Task-number: QTBUG-37851
Change-Id: I887460c1ea151180ba99d64dd873ba9d6e2268f2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
On Windows, the wrong value was used to calculate the
design-to-device scale. The assumption has been that tmHeight
in the TEXTMETRIC is the pixel size of the em square, but
it is not, it's the height of the font (ascent + descent).
The pixel size of the font is defined to be the em square size
in pixels.
On OS X, the kerning data was never actually read from the
font. I've added a lazy initialization for this similar to
the one in the FT engine.
This was discovered when investigating QTBUG-48546, as it turned
out that the kerning information extracted by Qt in this case was
different from the one used by Harfbuzz.
I've changed testfont.ttf to kern "_2" so that the digit is positioned
directly on top of the underscore and constructed a test.
[ChangeLog][QRawFont] Fixed kerning on advances in QRawFont for
OS X and Windows.
Change-Id: Ic9a321ad119ea880cef89b861c75a820ab8d3182
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Use a QTemporaryFile in readFromFileAfterJunk() instead writing
to the current directory which might not have write permission.
Enclose each call to QFile::open() in QVERIFY2() with error message.
Change-Id: I3c5da31c6681a2396cee473cafe7d92c5c220de3
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Create a temporary directory instead of writing to the
test data directory or home path (Android).
Change-Id: I6af583e5da91eefb603eaae179e7d789487dc626
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
VS2010 is not supported in Qt5.7+
Task-number: QTBUG-31611
Change-Id: I4b2bd703f6462e6f0a4de9e75bca8316b8707680
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
The EcmaScript format for printing doubles in exponent form differs
from Qt's format only in this aspect. EcmaScript explicitly prohibits
leading zeroes in exponents. It is thus worthwhile to add those flags
in order to be able to generate and parse doubles in compliance with
EcmaScript.
[ChangeLog][QtCore][QLocale] Additional flags in QLocale::NumberOption
allow generating and parsing doubles in EcmaScript compliant format.
Change-Id: Ia7b82c2e67bb8b80bd890014ff5cd4563faf2a03
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The platform is no longer supported or actively maintained, and is
in the way for improvements to the Unix event dispatcher and QProcess
implementations.
Change-Id: I3935488ca12e2139ea5f46068d7665a453e20526
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The ppm decoder used a fixed size buffer to discard comment lines,
which would fail for comments longer than 100 characters.
Task-number: QTBUG-49414
Change-Id: I92e910e025cf7584a6ff1c0e5b0e8a4ab281d479
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
The test is new and something seems to go wrong on the Ubuntu test
machines.
Since it ends up failing a lot, blacklist it for the time being.
Task-number: QTBUG-49388
Change-Id: I06de7ba15aaee68351a747e3a06c0150018b39de
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>