On Windows, trailing spaces in a filename are silently ignored, so we
need to strip it before trying to open a file with it. Otherwise it ends
up being stripped later and in a case like " ." it will end up causing
Qt to think that a folder exists when it does not.
[ChangeLog][Platform Specific Changes][Windows][QtWidgets][QFileDialog]
Handled the case of having trailing spaces in a filename correctly so if
the filename ends up being empty that the parent path is used instead.
Change-Id: I6500cc3a44746bf4a65e73bcfb63265a0a97c8a3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Trigger QOffscreenSurface's fallback mode (hidden QWindow and a regular window
surface) instead. queryDummyContext() already works like this but the same must
be done for any QOffscreenSurface.
Task-number: QTBUG-36900
Change-Id: I64176ac6704e9d6ed768fa3d456c40c8818be6dc
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Allow the developers to define a splash screen which will be visible
until the first window is created.
[ChangeLog][Android] Allow the developers to define a splash
screen which will be visible until the first window is created.
Task-number: QTBUG-30652
Change-Id: I5da80be417ffffb03e66009f45745d4b387d2912
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Android is using double buffering, so, we need to repaint the bounding
rect of the repaint region, otherwise black holes will appear.
Change-Id: I21f36a6f5f1a6c64b605c0fef3af10dfdc5ec6e2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
The QTextLayout::FormatRange is larger than void* and thus should not be held in
QList. Use a QVector instead.
This is public, but as of yet unreleased API.
Change-Id: Ie04a561b43c91c3b2befb3cac2981821f84d5f77
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Otherwise, OleFlushClipboard() might query the data again which causes
problems for QMimeData-derived classes using QPixmap/QImage.
Task-number: QTBUG-36958
Change-Id: I89e58eeb64bd3481e89ad789f310f19ddb4604a2
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
So far we did bind the definition of Q_COMPILER_VARIADIC_MACROS to
C++11 (so gcc, clang will not define it in default gnu++98 standard).
However, variadic macros are a feature of the gcc preprocessor since
version 2.97, and are enabled in the default configurations on gcc, clang,
icc.
This might cause warnings and errors though if one enables additional
warnings in gcc, clang (e.g. by -pedantic). Anyhow, as a precedent
qglobal.h already relies on 'long long' ... The warning can be disabled
by adding '-Wno-variadic-macros'.
[ChangeLog][Compiler Specific Changes] Variadic macros are now enabled
more liberally for gcc, clang, icc. If you have warnings (because you e.g.
compile with -pedantic), disable them by -Wno-variadic-macros.
Change-Id: Ie979b85809508ad70cab75e6981f20496429f463
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commit f4dd534 introduced a regression, so that QFontMetrics reported
a wrong size (to be more specific width) for FreeType fonts.
The calculation of glyph advances has to to reflect (rounded)
integral number of pixels. This was only done when the glyph was cached.
So in some cases the first call to QFontMetrics::size gave a different
result than the second.
This patch reverts f4dd5344fb.
The tst_QFontMetrics::same auto test only happened to work on some
platforms, on BlackBerry for instance it did not. Extended the test
case to make sure it works for different font sizes.
Change-Id: Ia5bb9abd3ff98193c9bba048b85207672ed8d9c3
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This comment is wrong and should be removed. The manifest is always
generated.
Change-Id: I281737dd6a358380fb557063eadae88909f5078b
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
-new layout for landing page
-updates to title sizes and changes to footer
-fixes to general paragraph issues
-index.qdoc changed in qtdoc repository
Task-number: QTBUG-36411
Change-Id: Icb4fb0374e474137686f4cb67c64dc0249fef2c4
Reviewed-by: Martin Smith <martin.smith@digia.com>
-Qt Examples and Tutorials page does not need the table of contents.
Task-number: QTBUG-36838
Change-Id: Id51ebc7cba7831a24cd9d8e8e6bde7f96bece326
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
After 37ca2224ec it's necessary to
read the saved QSettings again after creating widgets, in order to
deal with the settings which only affect widgets (such as saved
bookmarks). It's also necessary to read them if widgets are not used
though, because some of the settings affect native dialog options.
Task-number: QTBUG-36888
Change-Id: I8cf53db864b173c50a876a1d5ce29c1e073fcaa6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
By ensuring that the widget is already polished before doing a repolish it
means that if you reset the stylesheet then it unsets any changes that
the stylesheet had applied to the widget.
Task-number: QTBUG-18958
Change-Id: Ie0aeda0dac9f2211b7feca138c115cf2b48aac80
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
When the emulation paint engine was no longer needed then it would still
end up using it because the flags would prevent it from being switched
back. This ensures that it has the right engine when something triggers
it to be switched.
Change-Id: I7571923d16cbebd9fdd34560631b561c07a724f7
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Fall back to /var/tmp instead of /tmp if neither TMPDIR nor TEMP are set.
/tmp is not a true filesystem on BB10 but rather a symbolic link to /dev/shmem
For more info see
http://www.qnx.com/developers/docs/6.3.0SP3/neutrino/user_guide/fsystems.html#RAM
Change-Id: Ie690ed74ffd81b52ef4623458c3ff88629aee00a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QHash uses an array representing the difference between 2^i and
the next prime; when growing, it calculates 2^x + array[x] (with
`x' representing the "hash table size in bits").
For some reason lost in history the differences are actually wrong
and the calculation above leads to using composite numbers.
Hence: use the right sequence and always produce primes. The right
sequence is actually A092131 from OEIS: http://oeis.org/A092131
Note that the sequence starts at A(1), but we need A(0) too.
Also we truncate the sequence to when growing too much, just like
the old code did, and use powers of two in that case instead.
Task-number: QTBUG-36866
Change-Id: Id2e3fc9cb567c0fdca305dee38f480e17639ca04
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Currently the only supported SPDY version is 3.0.
The feature needs to be enabled explicitly via
QNetworkRequest::SpdyAllowedAttribute. Whether SPDY actually was used
can be determined via QNetworkRequest::SpdyWasUsedAttribute from a
QNetworkReply once it has been started (i.e. after the encrypted()
signal has been received). Whether SPDY can be used will be
determined during the SSL handshake through the TLS NPN extension
(see separate commit).
The following things from SPDY have not been enabled currently:
* server push is not implemented, it has never been seen in the wild;
in that case we just reject a stream pushed by the server, which is
legit.
* settings are not persisted across SPDY sessions. In practice this
means that the server sends a small message upon session start
telling us e.g. the number of concurrent connections.
* SSL client certificates are not supported.
Task-number: QTBUG-18714
[ChangeLog][QtNetwork] Added support for the SPDY protocol (version
3.0).
Change-Id: I81bbe0495c24ed84e9cf8af3a9dbd63ca1e93d0d
Reviewed-by: Richard J. Moore <rich@kde.org>
Currently the bundle identifier is build using com.yourcompany +
QMAKE_BUNDLE. This patch adds the handling of
QMAKE_TARGET_BUNDLE_PREFIX to build the bundle prefix.
Task-number: QTBUG-19006
Change-Id: I014279da6dbef393b0df36f6d4995e40ab105316
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Padding the bounding rect was not enough, as we failed to shift the glyph
accordingly so that it would end up in the center of the bounding rect.
We also didn't take subpixel-positioning into account, which may shift the
position of the glyph too far to the right to be within the image size that
we reserve.
There are still cases where the glyphs seem clipped compared to the same
text rendered with CoreText, but that's because we end up shaping the
text slightly differently, resulting in different subpixel positions
than what CoreText chooses.
Change-Id: Icb88c829f86457b16bdecbc4c24b3f1c23448261
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Instead of padding the image size manually, we rely on alphaMapBoundingBox
to give use the right glyph metrics.
For clarity, a few function arguments were renamed in the affected code.
Change-Id: I84c31e613a1048ea839a390af70342e5388ed0cb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Instead of the glyph cache having its own cache type that always mapped
one to one to a font engine glyph format, causing confusion and needless
conversions, the glyph caches now use QFontEngine's glyph format enum.
This also removes the iffy use of an int for the glyphFormat in the font
engines.
Change-Id: I529bad5c179e004f63e152f7dcc311d298c3db98
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
ICC defaults to "fast math" mode, which allows it to do non-compliant
operations that may or may not result in unexpected values. Generally, it's
ok, but apparently the code in qlocale_tools.cpp is too complex, so we're not
taking chances.
I can't rule out an issue in the code, though.
Task-number: QTBUG-36795
Change-Id: Ica5cb77fb3a65d22ae8ad22e13b4ba78f1b5dadf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
It is in nearly all cases much faster (in our benchmark it is
about a factor 8) - and it also makes the code more readable.
Change-Id: I075e1d1a96756e5e9a2bf53b5479094f7d87883d
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
updateBlock is part of the interface of QAbstractTextDocumentLayout
however QTextDocumentLayout implementation is not invoking it.
This commit adds similar behavior to QTextDocumentLayout as the
QPlainTextDocumentLayout (QtWidgets) has by implementing the missing
functionality.
[ChangeLog][QtGui][QTextDocumentLayout]
Emit updateBlock signal in QTextDocumentLayout.
Task-number: QTBUG-36743
Change-Id: I7f812d4d5d7c2148393ee672fb0db6c0b2e73783
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This fixes compilation of Qt for Android when configured with
"-no-widgets". One good use-case for that configure switch is
that QtSvg loses the dependency to QtWidgets.
Change-Id: I8a645d9fee6ce0467ff0b5d1d62531b7c6272aab
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This partially reverts 5764f5e6ea and
fixes the problem differently.
After this commit, "file:///foo" is still equal to "file:/foo", but
"foo:///foo" becomes different from "foo:/foo", as it should be.
Task-number: QTBUG-36151
Change-Id: Ia38638b0f30a7dcf110aa89aa427254c007fc107
Reviewed-by: David Faure <david.faure@kdab.com>
The drawing code currently only optimizes the bilinear interpolation
under specific conditions that allows the optimizations used there.
The patch adds a SSE2 version of the fallback 4 pixel interpolation.
Change-Id: I4e8a2ba6cb44647105a9b24e38b3ab755a435050
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
In case the QPlatformTheme does not provide a QPlatformMenu the
QPlatformSystemTrayIcon is not able to forward the menu because the
QPlatformMenu pointer passed to updateMenu is always null. Providing a
QPlatformMenu in the QPlatformTheme implementation should not be a
requirement for having the menu in the system tray icon. There are
cases where no QPlatformMenu should be created by the theme, e.g. if
the X11 implementation of QSystemTrayIcon gets provided by the xcb
plugin.
The change adds a virtual method to QPlatformSystemTrayIcon to create
a QPlatformMenu. This method is called from the QPA implementation of
QSystemTrayIcon if the QMenu's platformMenu is not present. Thus the
system tray icon is able to provide a custom implementation of the
menu. This gets installed through a new internal method in QMenu to set
the platform menu. It creates the required connections and sync the
state to the QMenu to the newly created QPlatformMenu.
Last but not least QPlatformMenu is extended by a method to create a
QPlatformMenuItem. The default implementation delegates to the platform
theme. This allows to provide the menu item implementation for the
system tray icon without providing the QPlatformMenuItem through the
platform theme.
Change-Id: I17234bd8bcf8c05f8bd786feff0cf8f860430e82
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The setting of the default format of Raster_A8 was mistakenly
moved down to below the override of Raster_RGBMask.
Change-Id: I52ee19180471c6f5c8d6824ee35f8d39632c9d94
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This fixes regression introduced in f864bdaf59
(in resolveAdditionalFormats(), formatIndex(si) returned an invalid
block format index due to non-empty specialData->resolvedFormats)
Task-number: QTBUG-36759
Change-Id: I4da13d2edaf1987bcd85b2ef326e9d22345eb8f3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Turns out that \obsolete means "Qt3Support", while the correct tag
is \deprecated.
Change-Id: Id9896893f3078a0d516bd8751bce0b2df441509d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
0x80000000 is too big for a signed 32-bit int, so the compiler ends
up choosing a 64-bit number. Then it will not be the same size as
the parallel enum QDialogButtonBox::ButtonRole, which does not have
these extra flags. By making EOL be the same as InvalidRole and
changing Reverse to 0x40000000, we don't need to use 0x80000000 at
all, so again the compiler can choose a 32-bit representation
for both if appropriate. EOL is used as a terminator in the
static const int buttonRoleLayouts table and therefore as a terminator
in arrays returned from QPlatformDialogHelper::buttonLayout().
It's internal API so it's OK to change in a minor release, but
QtQuick.Dialogs is also looking for the EOL now, so we should avoid
changing it again if possible. This is mainly for efficiency and
for avoiding surprise data type conversions when casting from one
enum to the other.
Change-Id: Ia7b7ce43c8f929d09dd999769e9b7114f695e9a4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
When the focus changes, screen sends a focus deactivated change for the focus window.
Depending on the order, this might deactivate the window focus completely. This
for example leads to problems with QComboBox.
Change-Id: Ia57f061a765c1f971d86d941b17f573ce9221ae1
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>