The sanity check added in d16508a285
didn't actually catch the case where the invalid data is large
enough to contain the offset table and table directory. Added sanity
checks to all the code that accesses the font data now, so this
should fix crashes with partial data as well as invalid data.
Task-number: QTBUG-37190
Change-Id: Ie43f10d8cf0b09007783b9b1c4d91bfed8c6b0f0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
identified by static analysis from
http://www.viva64.com/en/b/0251/
Change-Id: I0042336d9598415b978bf9819e74639685c627b5
Reviewed-by: Martin Smith <martin.smith@digia.com>
This patch removes the need for the user to put a dot at the end of the
bundle prefix which makes it's use more consistent and intuitive.
The prefix is based on what Xcode calls the "Company Identifier",
basically "com.digia" plus the product name. Changing that to
"com.digia.prefix-" and the product name to "Foo" results in a bundle
identifier of "com.digia.prefix-.Foo" which is in line with Xcode.
Change-Id: I9b62fc4dee1df51b523ce890a8896ea58ea2c62d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
-transferred group page from qtdoc repository
-added description in example pages
-set the example documentation to use the standard Qt thumbnail
-added an entry in the help index for the example page
Change-Id: I9d5747bc329b5ecc15acd2eb3139696931166c6f
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Call [NSApp endModalSession] at the correct time.
Calling cleanupModalSessions() from processPostedEvents()
resulted in endModalSession being called from within
[NSApp runModalSession] - ending and cleaning up the
the modal session while Cocoa is still using it.
Move the cleanupModalSessions() call to to after
runModalSession returns.
Task-number: QTBUG-37699
Change-Id: I5868def36f6869667b0bbe33733286e3e49488eb
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This reverts parts of commit d9875f7bff,
in particular the code for "2. Make interrupt() use [NSApp abortModal]"
abortModal is not the right way to end a modal session,
and introduced bad side effects, as reported in
QTBUG-34677.
Restore this part of the event dispatcher to the
Qt 4 state.
Change-Id: Iacc2d4a0757807c87c4320c93ed4db186622945c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This reverts commit ff3dcc49c4.
The reverted commit is an incorrect bug-fix for a
regression introduced by adding a call to
[NSApp abortModal] in change d9875f7b.
Change-Id: I1307d1790ada740e0552d62267b6009cbccd6c4c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This reverts commit a9cbddf473.
The reverted commit is an incorrect bug-fix for a
regression introduced by adding a call to
[NSApp abortModal] in change d9875f7b.
Change-Id: If23463ebdfe2ff64c68739dbece73a13773683c9
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Call clear() in the destructor of QOpenGLTextureGlyphCache class to
prevent QOpenGLGlyphTexture object leak.
Change-Id: I290b09b0786d30603391e6855a21e9232b112739
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
These functions are not used anywhere. Since the classes are not
documented, we're free to remove the inline functions.
The implementation of the const function in QMapNode is also bogus: it
discards a const qualifier.
Task-number: QTBUG-39301
Change-Id: Ib8fd10a4da4b58a62cef17017ea6127c4d964325
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QRasterPaintEngine::alphaPenBlt makes the assumption that a device with
bit depth 32 has optimized alphamapBlit and alphaRGBBlit routines.
This will fail on RGBA8888 format resulting in some text not being
rendered.
Change-Id: Ia7d88bb0e3094894affceda1acc42396b67b3677
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Note added in QNetworkReply and QSslSocket documentation.
Task-number: QTBUG-16770
Change-Id: I2dd8cfb913ec29a96b5465a905cd213713b8d537
Reviewed-by: Richard J. Moore <rich@kde.org>
This change improves the synced resizes of xcb windows and adds support
for synced resizes of glx windows.
The QXcbWindow keeps a better track on whether the window manager
expects a sync and can be in one of three states:
* no sync required
* sync required, but configure notify event not yet received
* sync required and configured
By tracking this in the QXcbWindow itself the backing store can make
use of this information and doesn't need an own heuristic to decide
whether a sync is needed.
Also this allows to add support for synced resizes of windows with an
OpenGLSurface. This is accomplished by checking the sync state after
swapping buffers. As the OpenGL context may be bound to a background
thread the sync is done using a QueuedConnection to ensure that the
sync happens in the thread which created the xcb window.
So far this is only added for GLX.
This significantly improves the resize experience of QQuickWindow and
also the initial mapping with a composited window manager in case the
compositor uses the sync protocol to determine whether the window is
ready to get painted on screen.
Change-Id: Ied0261873043d785dec652d2821fc3638292fa36
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
If the call to SQLNumResultCols fails for whatever reason then it will
not be correctly caught since the count might be higher than 0 since it is
uninitalized. This ensures that if it fails then it does not try to act as
if it succeeded.
Task-number: QTBUG-39137
Change-Id: Ifae8c1f7fac8416643f2317747f87295642a7935
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
For ASCII content, this improves the throughput because the conditional
is no longer on the codepath to storing, so the processor can perform
the store at the same time as it's doing the movemask
operation. However, the gain is mostly theoretical: benchmarking with
mostly ASCII content shows the algorithm running within 0.5% of the
previous result (which is noise).
For non-ASCII content, we're comparing the cost of doing a 16-byte store
(which may be completely overwritten) with the loop copying and shifting
left. Benchmarking shows a slight gain of a few percent.
Change-Id: I28ef0021dffc725a922c539cc5976db367f36e78
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
The static initialization of QDBusConnection::systemBus() can occur
before the creation of QCoreApplication. This causes a warning from
QDBusConnection and may cause the application to crash on exit.
Since QDBusConnection::systemBus() is just an accessor, there is no
real advantage to storing a static reference to it.
Task-number: QTBUG-39248
Change-Id: I4401810c7c2ffd21a30f9ffd41b3a46e7e09214c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
As ANGLE doesn't support GL_RGBA as the internal format for its
multisampled framebuffer extension, use GL_RGB8_OES to ensure a working
out-of-the-box experience.
Task-number: QTBUG-39283
Change-Id: Icb364225e74e5d3480a8617131a56e9f65f04ba5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Mark the window as not opaque and give it a transparent
background when layering OpenGL below the window.
Change-Id: I2188842249c592f17619f7a2c3ef1fd30958987e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Cast the NSWindow to a QNSWindow instead. Now there
is no way we can fail to maintain the hash properly.
Change-Id: I5fd03b6fad964a61fadb3460b7063fd43ff25c79
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Clear the QCocoaWindow pointer stored on the QNSWindowHelper
when detaching from the platform window. This makes
sure callbacks from cocoa does not try access deleted
Qt window objects.
Task-number: QTBUG-39141
Change-Id: I4672eae92940dcbd59a2848e56f94b50a828bbf6
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
For whatever reason direct2d and the raster engine disagree by one pixel
about the positioning of positively sloping aliased lines. To get the same
output, we shift such lines by one pixel.
Change-Id: I4b20319770c02e3fdd212b3535ccae3c27ca9f2f
Reviewed-by: Risto Avila <risto.avila@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
If you do sock->write(data) followed by sock->close() then the data
written is not transmitted unless you flush when using QSslSocket but
is when using QTcpSocket. This change makes QSslSocket work like
QTcpSocket.
Change-Id: Ia2e1c021dc48ac0d573f78da782ea77641c03bc1
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
beginModalSessionForWindow will center the window and ignore
the set geometry. So to workaround this it checks the new value
against the old one and moves it back if need be.
Change-Id: I38bc74c04138992f2e0570fca666414025aeeba8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
In WindowsVista style and later the sort indicator is placed above the
text as opposed to alongside it. Therefore the extra space given is moved
to the common style allowing styles that have it placed differently to
easily ensure it is not included.
Task-number: QTBUG-19915
Change-Id: Ic21fcc1d95f4c3cc2eb9c465e1c8afb9b805389a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
IANA reserves scope ID of 0x0 to mean "no scope ID", so make sure that
we don't try to set it when reading from the sockaddr_in6 structure.
Change-Id: I71b207e6f8262ab2bf9fde993288a71ba63c7572
Reviewed-by: Richard J. Moore <rich@kde.org>
Don't use only the GL version, as vendors expose many many extensions
on viable hardware.
For instance, I have a NVIDIA G210 which supports up to GL3.3, but
which features immutable storage, immutable multisampled storage,
texture buffers and ranges, stencil texturing, and cubemap arrays.
Change-Id: Ie6023ee854b679737fca982578cb2093e10d083f
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
The documentation needs to use the defined parameter names for the signals
as this is what QML will make them available as if they are used in a
connection to that signal.
Task-number: QTBUG-35694
Change-Id: I0f56b9e1ace45cfff72c45273dd64766e3c792f2
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
On Windows, it is possible to pass native Windows paper source
ids >= DMBIN_USER to QPrinter::setPaperSource() and they are
listed by supportedPaperSources().
Task-number: QTBUG-38897
Task-number: QTBUG-38888
Change-Id: I8f1264e80ce5bdddd3873602200b24eabee00502
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Factor out common code paths from the QPixmap/QImage conversion
code and use the same algorithm for copying the image data with
alpha correction as does qt_pixmapFromWinHBITMAP().
Rename the previous version of qt_imageFromWinHBITMAP() to
qt_imageFromWinIconHBITMAP() since it is used for HICON conversion.
Task-number: QTBUG-39084
Change-Id: Ia4042c33db485c3604461a5eafd6282968b36e3b
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
A typical pattern in an application is to listen
for "enter" in a line edit and transfer focus to
the next edit in the focus chain. This would currently
not work on iOS since we would force the keyboard down
after delivering the KeyPress/release events, effectively
overriding any focus handling done by the app.
This patch will hide the keyboard _before_ sending the
events, so that we don't override focus handling done
by the app. By also hiding the keyboard using
QInputMethod, the hiding will also be delayed a bit
(in QIOSInputContext) to catch subsequent hide/show calls.
Change-Id: Ic19511d494a55d1bda963ed9bc7185d63b51bc03
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
- rectify confusion and outright disinformation about argument quoting
- say that open() is an alias for start(), not the other way round, as
this is more consistent
- apply some trickery to hide mergeable startDetached() overload
- rename program -> command where it stands for a joined command line,
for consistency
- copy less information to the various overloads
- misc language fixes and reshuffling
Change-Id: I1b9c8dbed003f551ee6855044bbfc0aedddb4757
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
The _HAS_EXCEPTIONS=0 define that was introduced in commit
f59083636b leads to lots of C4275
warnings:
non dll-interface class "stdext::exception" used as base for dll-interface class "std::bad_cast"
from the <algorithm> include in qglobal.h.
Newer versions of MSVC do not have this problem.
Task-number: QTBUG-39126
Change-Id: Ieea5adde649fe16e6b41fbbb23fd582b3bb12b89
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
the location of the import paths have changed a long time ago.
also, we can make use of QTREPOS now.
Change-Id: Iee50854b7441968c3c60538e54d9312e53d39cb6
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
now that we have QTREPOS, we can use that directly instead of collecting
the QT.<foo>.qml dirs. as a "side effect", this makes qml modules without
a corresponding c++ module available to the scan.
Change-Id: I6f172121588ec01c9fa47a99d9990bf9fcfbc69f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
we need to store commands with system path separators in the .pri files,
as we might clobber windows command arguments if we just converted
separators later on. and we can actually do that, as the path separators
are actually bound to the host system, not the shell.
we also need to shell-quote the commands, as whitespace, and more
commonly windows path separators in an msys shell, would break things.
we delay this to the last moment possible, as it does depend on the
shell.
Change-Id: I1fe6b63aebd5663b72492c32928ec397f86e336f
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Doing makeCurrent() followed by destroying the surface (and no
doneCurrent) results in still having the pointer stored internally
in the QOpenGLContext. If then a function like defaultFramebufferObject()
is called, the pointer is dereferenced.
To fix this, the doneCurrent() has to be called when the surface is destroyed
before the context without doneCurrent(). This is pretty much what the
user would expect anyhow.
Task-number: QTBUG-38994
Change-Id: Ibd4083d9291c7fd39b38ce81a988a8e0c9d55d60
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Instead of loading the default font "Helvetica", which is likely not
part of the package, load the first font found.
Change-Id: I225979986883a26c3fec72858cf32c3d1e45d902
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
It turns out that supporting HighRes painting with Direct2D is quite
simple. Two things are necessary.
First, we set the unit mode to D2D1_UNIT_MODE_PIXELS on all our device
contexts, which tells Direct2D that we specify everything in pixels.
Direct2D will internally do the required conversions.
Second, we scale font sizes according to DPI.
Previously rendering errors resulted when a highres mode was used, this
fixes those errors.
Task-number: QTBUG-39105
Change-Id: Ibb4dbea4746687228249e2c36d48c4bd6c5c7bf9
Reviewed-by: Risto Avila <risto.avila@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>