'styles' are only defined in the qt build internals, when the
examples are compiled inside a configured Qt source. That's not
the case for the examples e.g. in the Qt SDK.
(windows is a default style on all platforms, anyway. So I
think the check is superfluous in the first place.)
Task-number: QTBUG-36655
Change-Id: I7114619efd479408dad99c8514f8e33ddcab7c7c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Remember the engine index for each sub-item and avoid moveGlyphData()
where possible (ie. when there are no glyph indexes to care about).
Also don't memmove data we didn't ever initialize.
Change-Id: Ib8e5fd937a10e4e3c8c0e18961a2e2c1a4167924
Reviewed-by: Ahmed Saidi <justroftest@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
The old code wasn't good enough to catch all the glyph (de)composition cases,
thus leading to an assertion in QTextLayout's addNextCluster() helper.
The new code catches all the corner cases and introduces somewhat
better performance to the HB-NG shaper backend.
Change-Id: I5b6c673395a4a039dc55b200abbf74b0ba5d0829
Reviewed-by: Ahmed Saidi <justroftest@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
The RGBA8888 formats was incorrectly using the qt_gradient_quint32
which is argb specific. This caused vertical gradients but only
vertical gradients to be drawn incorrectly.
This changes the RGBA8888 formats formats to use the generic gradient
method and renames qt_gradient_quint32 to qt_gradient_argb32 to
indicate its limitation.
Change-Id: Ia1cd48ca7f4f78b64f31d6263e81cd8ac3b0954e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
For normal #includes, moc simply ignores the missing file, but it could
generate problems later. It's a problem when the file being sought is
the FILE from plugin metadata. A very good example of this is Qt
Creator:
coreplugin.h:49: Error: Plugin Metadata file "Core.json" does not exist.
Change-Id: I16af04b477f52c6bd53c14147ec777b358dfdf50
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
LRESULT should be non-zero if the application can quit,
and it is always handled.
Task-number: QTBUG-35986
Change-Id: Ic8b0ecc731d3efaf94e2a62491918d379fe59f5c
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
The debug output of all categories will be visible by default,
except from the "qt.*" categories. "qt.*" categories are private
and their default debug output will be hidden.
[ChangeLog][QtCore][Logging] Enable qCDebug's for all categories except qt one's
Change-Id: Ibe147c8bbe0835a63b3de782288b9c3251321d8f
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
RGBx8888 to ARGB32_PM is incorrectly using the RGBA8888 to ARGB32_PM
which asserts the input format is RGBA8888. Since the routine also
performs an unnecessy premul, we should be using a the generic rgba2argb
routine.
Change-Id: I7b67328f804f5f2a9664a35c04836679e8c8b8e5
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
The XDG specification for file URIs requires us to use triple slashes in
file:/// for URLs with absolute paths. I don't like special-casing any
particular scheme, but we've done it for file for many years now.
Since we need to test this situation in a couple of places, it's easier
to just cache the result once, in setScheme (both functions).
Change-Id: I078b45b5b6c861f4caee082b4730fd6f67684ae4
Reviewed-by: David Faure <david.faure@kdab.com>
Calling this function associates the given native
toolbar with the QWindow. QWindow will then set
it on the native NSWindow at the appropriate time
during window creation.
Change-Id: I2a50f79b2a0453cc739f8d68e965e37b95998083
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
QNSWindow inherits QNSPanel regardless of the kind of QWindow. With
NSPanels, pressing escape is equivalent to dismissing the panel.
That is not the behavior we aim at for normal toplevel QWindows.
Task-number: QTBUG-36694
Change-Id: I1a1c138183cc43c968249442021f334cd37f7ce0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This patch optimizes the unpremultiply method further by using a
lookup table to avoid any divisions at all.
The opportunity is taken to export both premultiply and unpremultiply
since they are commonly used methods relevant to the exported QRgb type
that can be both premultiplied and unpremultipled ARGB.
[ChangeLog][QtGui][QColor] Exported highly optimized methods for
premultiply and unpremultiply of QRgb values.
Change-Id: I658bcf57b0bc73c34c1765b64617d43b63ae820b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Don't delete the thread object without detaching it, use detach()
instead of CloseHandle(), and avoid a double-delete.
Change-Id: Ia169a96fb32805e06abe099c3c35e97ce485f088
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
private api, but useful for 2d gui code that suddenly finds itself
needing to get a set of textures onto some fbo
I didn't want to include ARB_copy_image since it looks like its from
texture/renderbuffer -> texture/renderbuffer while this class implies
texture -> write fbo. We could wrap ARB_copy_image in QOpenGLTexture or
some other class or we can add it later.
I have not added any QOpenGLTexture functions since this class opperates
on the GLuint identifier. We can add overloads later.
Change-Id: I3e565b33466c1c183a249a33c3e82c6786debd55
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
NVDA for example reads name and value, so that most of our
accessibles would lead to the same text being read twice in a row.
Instead use Name as that's best supported on all platforms.
[ChangedLog][QtWidgets] Fixed accessibility issues that would lead to
screen readers reading the same text twice.
Task-number: QTBUG-36678
Change-Id: I6c5c9cdcf5392c7135a65bd30f87a590c3c07fb4
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
The basedir xdg spec says:
"All paths set in these environment variables must be absolute.
If an implementation encounters a relative path in any of these variables it
should consider the path invalid and ignore it."
Therefore we ignore relative paths including the empty string.
Change-Id: I8f779b78981018051b16de23b2514f2e62b7ab39
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
tst_QDir::tempPath already checks that there is no trailing slash.
Except of course when the path is "/" or "C:/", but we can't do much
about that unlikely corner case.
Change-Id: If71d5de1aeebc6720348cecbf659b7fceb83fb0e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This is a no-op because QDir::cleanPath() already takes care of removing
the trailing slash.
Change-Id: Ic19d9a9dd7e377e04447c3ebc776b025f5f0c43a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Instead of "blacklisting" Unix platforms that don't have Linux headers,
do the opposite and check for Q_OS_LINUX in the framebuffer code that
has Linux-specific code.
This should help fix the build on other Unices, such as the BSDs.
Change-Id: Icb6edf34bb20c9a98843b6dc0e2a87ee71fcd046
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This change does not modify the actual algorithm implemented. It only
updates the source code so that the code generation is more optimal:
- change only one variable per loop (the "offset" variable)
- unroll the tail expansion of the last 15 characters
The Neon code for the toLatin1 codec most likely benefits from the
unrolling of the tail too, but I can't verify that I haven't broken
anything.
Change-Id: I8a92fd3c1aa700e6f8b0c8ebdb1978ade394757f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
In case the window manager supports _NET_ACTIVE_WINDOW a client message
is sent to the root window and the window manager is expected to either
activate the window or mark it with demands attention.
In addition the code unconditionally also called xcb_set_input_focus
which breaks the intention of sending the client message. Thus it is
now only done if the WM doesn't support the protocol. This was also the
logic in Qt 4.x in QWidget::activateWindow (qwidget_x11.cpp).
In addition set_input_focus is only called if the window is a toplevel.
Change-Id: Iec4c02f0ea62db30a4b347d474fdfd2f05b8895b
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
On platforms like the Raspberry Pi the EGL implementation is not
compatible with X. This means that while EGL and Open GL ES can be enabled,
and will work fine with platform plugins like eglfs, EGL (and thus GL) should
be automatically disabled in xcb, otherwise a compilation error will occur
since xcb assumes the native handle types are the corresponding Xlib types.
Task-number: QTBUG-36551
Change-Id: I2cc4c558abb4b25d422a2c01da9b75b865ace402
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
...due to a typo introduced in d8225fab8f and stricter checks
introduced in 4e319ca4c4.
This uses recently added QStringIterator to decrease the code duplication.
Change-Id: Ib1c2519db1c4d65f3ac14e6f9ae3fa272860b1dd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Use NSWindow and NSView accessors on QCocoaWindow
instead of QGuiApplication and nativeResourceForWindow.
Change-Id: Iabee1e42dd119726d932f89c66a90810463d70db
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Fixes an issue introduced in b8a38a6737. We forgot
to check for category validness, and printed qCDebug(c, ""...)
unconditionally for compilers not supporting variadic
macros.
Change-Id: I779a97dacd7ea559f0d91473aad2c29e73ea2f89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This should fix the build on platforms like the BSDs, where linux/fb.h does
not exist.
Change-Id: Ia06403d71c3aaa0e177c85dcefa7986647777ae0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The slot object was deleted after the mutex was relocked, which caused
a deadlock in case the functor destructor locked the same mutex again.
Change-Id: I5b4fb22fdb4483f91c89915872bfd548c31b0eea
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Add the required printsupport plugins to the QTPLUGIN variable
as is done for the QPA plugin.
[ChangeLog][QtPrintSupport] Made the Qt buildsystem automatically include the
necessary plugins so that static applications can print.
Task-number: QTBUG-29663
Change-Id: I0e2e3b0f25dd5714bd187711c85893926b0c4e85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove findDragOverWindow(); no longer try to find the window under cursor
since that would require synthesizing drag leave events. This is left to the
DnD handling of QWidgetWindow, which searches the child which accepts drops.
Task-number: QTBUG-33635
Change-Id: I844041bb862bb0382147be4e28f880a26843c453
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Only top level windows of certain types should be drop sites. Add code to
update drop site registration to setParent().
This ensures the drop site is unregistered for example when winId()
is invoked on a parentless widgets which is later inserted into a layout.
Task-number: QTBUG-33635
Change-Id: Ia3161ecd59753f3f39d2a5967e9cb922cf0b9203
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
In KDE, without this patch, the Q_ASSERT in the following code fragment
fails:
QFileDialog dialog;
QStringList list = QStringList() << "c (*.cpp)" << "h (*.h)";
dialog.setNameFilters(list);
QString filter("h (*.h)");
dialog.selectNameFilter(filter);
dialog.show();
Q_ASSERT(dialog.selectedNameFilter() == filter);
The reason for the fail is that the selectNameFilter() does not properly
propagate the filter to the QPA plugin. So the first part of this patch
adds d->options->setInitiallySelectedNameFilter(filter); in the function
QFileDialog::selectNameFilter().
The second part of this patch makes sure that the initially set name
filter in the QFileDialogOptions "options" is not overwritten in the
helperPrepareShow() function. This is achieved by adding an if(),
following the if() for the initiallySelectedfiles() the line below.
With this patch, the Q_ASSERT() holds true in KDE Framework 5's
file dialog integration.
Change-Id: I15d8c88a0fa3cdc03e3330f3458bbad139a71212
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
For consistency with all other sources of paths, which do not return
a trailing slash, as tested by the unittest. This avoids double slashes
in paths, after apps append something to the path.
Change-Id: Iabcde11eee27df0b185780e2b655fbbb02ed63b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Makes it easier to add code in the future too.
No-op change.
Change-Id: I228c36813ccf8ee95ed4b6cbbc20af3178d1b84a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
In addition to being more common and consistent with QCommandLineParser, this
will make it possible to add the documentation for these options
in the QCommandLineParser-generated help output.
[ChangeLog][General] Builtin command-line options such as -reverse,
-session, -style etc. now all support double dash, e.g. --reverse,
--session, --style...
Change-Id: Ia2e22c854ccc6a9d7b863b1234317005bc822191
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Add qt_mac_resolveOption().
Support setting options using either an environment
variable or a QWindow property, with a default fallback
value. The options are resolved with precedence in
the mentioned order.
Adds options for the following:
NSView setWantsBestResolutionOPenGLSurface
NSVIew setWantsLayer
NSOpenGLContext NSOpenGLCPSurfaceOrder
The window properties use the _q_mac_camelCase format.
The environment variables use the QT_MAC_ALL_CAPS format.
Change-Id: I1978a02d62e107a2120d81ffdd0f7b32f7731644
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Disassembly shows that the compiler does not perform the zero-expansion
by itself. It always opts to copy byte-by-byte, which is not very
performant.
Change-Id: I08780902461d9e3e6b7b54298f41d1eca61339c4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QScreen::grabWindow() is not always reliable because it grabs from the
framebuffer. (The window might then be covered by other windows, e.g.
"Stays on top"-Windows, popups etc).
If QScreen::grabWindow() fails we therefore fallback to
QWidget::grab(). This will not grab from the frame buffer, but it will
ask the widget to render itself (with its current state) to a pixmap
and return it.
QWidget::grab() should usually return the expected pixmap, and the
pixmap it gives is not subject to the state of the window manager.
This means that both QScreen::grabWindow() *and* QWidget::grab()
must produce an unexpected pixmap in order for the test to fail.
Change-Id: I276554155bb1e5b510d2a2d43628d91669464fe2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Do not use deleteLater() to delete the thread.
Task-number: QTBUG-36357
Change-Id: Ie7c87b92a7c73d5fbac01d4951d387ee2facd05c
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Follow-up to 91d3298: qt_timezone() expects the number of seconds west
of UTC, whereas tm_gmtoff returns the number of seconds east of UTC, and
contrary to the timezone variable it is not oblivious to DST.
We have to account for those two facts and make sure we return a value
compatible with what timezone would have.
Change-Id: Iacb9077f50d4c847ac09e5a7e952d0e4cd22da1b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In the future, we might want to refactor this code to inconditionally
use the common Desktop / ES2 subset (like the rest of Qt does),
and then resolve only the functions actually available at runtime.
For now, state why we're doing that on Windows.
Change-Id: Ic21035bcd88ddc1d9274fd90a146c2824d783b25
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
OpenGL ES 2 doesn't support 1D textures. So introduce a proper
feature flag and warn if we try to allocate one there.
Change-Id: I73cf58c1f257d2472564f45bff222231e39aca52
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>