qwidget_qpa.cpp was setting cursor directly to platform window, so
QWindow didn't actually know what cursor was supposed to be shown.
Since QWindow now supports setting cursor and has override cursor
handling there, set cursor via QWindow instead of platform window.
Also changed QGuiApplication override cursor handling so that
it will query the cursor from QWindow if there is no override cursor.
With these changes, widget's custom cursor will be properly shown
when final override cursor is restored.
Task-number: QTBUG-24674
Change-Id: I2d2bb1027779256f9d6de560b6533f45e205ffe9
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
The library name changed back from quick1 to declarative, so the
debug option should be renamed accordingly.
Change-Id: I192520a0a4de4764cf93da8cdbb14e24ba7de093
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On linux with the new plugin debug output was
a bit too generous. Instead use environment var:
If QT_DEBUG_ACCESSIBILITY is set, give the full a11y output.
Change-Id: I1c9e2078e38799f91468cfc2d9ddcaa36ba4fa03
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The mouse events were being stolen by the modal dialog, preventing the
combo box to update itself. Key events were being properly forwarded,
but this was probably due to the different way key events are being
delivered.
Change-Id: I5bfc4800fad9fd4122a212e6fdec13811a7e647b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
The function wglCreateContextAttribsARB will fail if we request a
context version higher than is supported. We therefore upper-bound the
requested version by the version of the static context. This results
in context creation succeeding and having the closest possible match
to the requested format.
The xcb qpa plugin is modified to operate similarly to the windows
plugin in that it now creates a "static" context which is used to
limit the versions of contexts requested by the user.
Change-Id: I277ad7cc82edfdf7b9d8502ad921c8175feb1a4a
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Mac OS X 10.7 comes with the family of Stix fonts, some
of which exposed an ugly layout bug in the QFontComboBox
because the ascent/descent ratio is very large due to
a very high ascent, so centering the text vertically might
cause most of the text to be clipped away.
The solution is to detect when the ascent is larger than the
height of the destination rectangle (hence a large part of the
characters will be clipped) and use the actual bounding rect
for centralizing instead. Since this only happens for a
very few of the fonts, the overhead of getting the bounding
rect should be tolerable.
This is a port of 4679c6901fc7c388fdf6c022d3499708222ef1f1 from
Qt 4.8.
Task-number: QTBUG-26691
Change-Id: Ia2014775e5baf0568df3290f2dc4ad64fb5a74bd
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
for the case when the boundary finder is assigned to an invalid one.
Change-Id: I5b60984ff3fd99972fcae21895684bd83b012780
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This event can be used by any platform plugin to implement
special application panels/overlayed menus.
Currently used by QNX only.
This replaces sending fake Qt::Key_Menu presses in the QNX
plugin. Qt::Key_Menu is already used when invoking context
menus with the keyboard.
Change-Id: I9c8f1743fd147a07c11883323800017376915ae1
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
On Mac usually release frameworks are used during development so asserts
don't tend to get fired. Since the menu code did not crash in Qt 4.8,
it was decided that we should ensure that the same code does not crash
now so instead we warn instead of asserting for those cases.
Change-Id: I923e5591202cb2ad801074ce3ad2a11d7190cee8
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Keep the original QString that triggered the parsing error, instead of
just one QChar. This provides more powerful error messages, like:
Invalid IPv6 address; source was "http://[:::]"; scheme = "http", host = ""
(QUrl cannot keep invalid hostnames)
Invalid port or port number out of range; source was "http://example.com:abc"; scheme = "http", host = "example.com"
(QUrl cannot keep a non-numeric port number)
Invalid path (character '%' not permitted); source was "foo:/path%?"; scheme = "foo", path = "/path%25%1F"
(the tolerant parser runs first, so the faulty component is fixed)
This stores the error state in a special structure which is not
allocated under normal conditions, keeping the memory consumption
down. On 32-bit systems, QUrlPrivate does not increase in size; on
64-bit systems, it grows by 8 bytes.
Change-Id: I93d798d43401dfeb9fca7b6eed7ea758da10136b
Reviewed-by: David Faure <faure@kde.org>
Make both invalid hostname messages start with "Invalid hostname". And
split the empty port error from the invalid port one.
Change-Id: I870d1ed6fb07ec494f553871a37ed167141ffc06
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Just so the code generation is a little better.
Change-Id: I2a43a4df0ae67900c465a6c2b4f2b8ba284dbbaa
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: David Faure <faure@kde.org>
They're never accessed outside of qurl.cpp anyway, so let the compiler
know that it doesn't need to generate a full out-of-line copy for them
in case it does inlining.
Change-Id: I2be069b3fd2658eff9ad3023c21c8ae653c389ab
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: David Faure <faure@kde.org>
It used to return bool because setHost returns bool and, therefore,
setAuthority could fail. However, the return value is never checked,
in either parse() or QUrl::setAuthority(), because there's no error
recovery.
This is a small optimisation.
Change-Id: I25660d66cfad64ca5b9706cc38afa0e97ba3ee0b
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: David Faure <faure@kde.org>
That's what we have QUrl::errorString() for. This will become evident
especially now that QUrl::toString() / toEncoded() return empty if
there are errors.
Change-Id: I64a84e9c6ee57c0fc38cc0c58f5286ddc1248d1f
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: David Faure <faure@kde.org>
As the comment says, an empty scheme is not permitted. However, if
that error were to happen, QUrl falls back to parsing the URI as an
"URI reference", starting with the path.
E.g., ":/foo" is a path of ":/foo", which will in turn trigger the
compound "colon before slash" error.
Also, we don't percent-decode in the scheme.
Change-Id: I438a61e17323c7722ddcc64792577a9ecb869c4b
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: David Faure <faure@kde.org>
If an URL is invalid, let's indicate that in the test output. To be
helpful, let's make QUrl::errorString() include the component form of
the URL.
Change-Id: Iaafe16973ded79c7ea688fbb23808d91253e8c14
Reviewed-by: David Faure <faure@kde.org>
These two errors can only happen if one calls setPath() explicitly. They
cannot happen for parsed URLs, which is why they are only caught with
isValid(). It's not possible to set the error condition in setPath()
either because they depend on the presence / absence of the authority
and scheme.
Also update all the unit tests that set a path not starting with a slash
and were just "freeloaders" on the previous behaviour.
Change-Id: Ice58cd4589a850452d7573a5b19667bbab2fb43e
Reviewed-by: David Faure <faure@kde.org>
Position the QIODevice correctly for DIB (==BMP without file
header).
Task-number: QTBUG-26690
Change-Id: I7922b4e830a92dcc19f1b52e305ca9ff3fd5d9f5
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Since we no longer do the sanity checking against
gtk-qt-theme at startup, there
is no longer any need to inherit from cleanlooks.
Cleanlooks should no longer be needed as it has been
completely replaced by Gtk style and this dependency
is not required at this point.
Change-Id: I05b59278cd3ff915df49a7ad2d04494258db0d42
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Like Qt 4. Use the presence of the "-psn_" command-
line argument to detect Finder launches.
Link QtGui against the Cocoa framework due to CFBundle
usage.
Change-Id: I947ae53462072fbdb23afcc0a13ce6b26d02c191
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Got complaints while running file dialog example. Adding in
the release pools will fix the problem.
Change-Id: Ib33fddd5aedfc3e4aaa6fdd8995bbc8c8098267c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
A staysOnTop window with a parent would never stay on top. The reason
was that we placed the window on the same level as the parent, which
would undermine the staysOnTop flag.
The fix for this is to always level the window to _at least_ as the same
level as the parent, but never lower. A code path for this already
existed in the windowLevel function for popups. so we factor that out
and use it for all cases.
Task-number: QTBUG-27410
Change-Id: I0c30194be33703f54b6c2fe7f3088a9febcd1e2c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
xcb uses 32bits for xcb_keysym_t, but Xlib uses 64bit longs on 64bits
systems for KeySym and all other XIDs on the client side. Passing
an xcb_keysym_t* to XLookupString, expecting a KeySym*, would overwrite
the next 32bits in memory and possibly cause a crash.
This patch makes sure that a KeySym* is passed to XLookupString, and use
the signature declared in Xutil.h to make sure the types are right.
Encapsulate it in qxlibconvenience.cpp since including Xutil.h inside
qxcbkeyboard.cpp causes macro expansion problems.
Change-Id: I68451a24cb44a43dfa4382b5dce1ea7845f14e26
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Occasionally drag-and-drop was returning empty mimedata due to
using wrong value for timestamp. Accoring to the xdnd specification
we must use timestamp from XdndPosition or XdndDroptime for retrieving
the data.
Task-number: QTBUG-27367
Change-Id: Iadb6b6989cfc4e8ab241e2fd0ded59355108f22f
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
This patch fixes broken code in handleSelectionRequest(). There are 2 cases
when this function is called:
1) When XdndDrop has arrived (on mouse release)
2) When drop has not occurred yet (while mouse are still pressed down)
Second case was not working due to this bug.
Task-number: QTBUG-27405
Change-Id: I913cfd332128a28861e2fcc027b406eb821d2597
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Bug introduced when porting from Xlib to xcb. Xcb returns
actual number of bytes read while Xlib returns number
of 8-bit, 16-bit, or 32-bit items stored in the returned data.
Task-number: QTBUG-27403
Change-Id: Ia64da1953ec7be8d32cc591565cd1b41ce8d7dbb
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
This tests QProcess::setProcessChannelMode().
The tests verifies if testForwarding really forwards
the output of testProcessEcho (spawned by testForwarding).
Change-Id: Ifc4164569256aeaeab0edef42116986272362c01
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
We're setting the default texture unit anyway, and glActiveTexture would
require resolving through QOpenGLFunctions.
Task-number: QTBUG-24555
Change-Id: Id8d660baaa1532e7b8e623673f501703c76fac65
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
As it was confusing to use the term local file when referring
to a file that was accessible using native APIs and not just
a file that was on a hard disk somewhere already the function
name has been changed.
By renaming it to createNativeFile we keep it consistant with QFileInfo
which has an isNativeFile() function too.
Test also added.
Task-number: QTBUG-3169
Change-Id: I410e7ed28133d68fd312c6c0faf3f7191460d7ce
Reviewed-by: João Abecasis <joao@abecasis.name>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QWindow::setWindowFilePath sets the file path of the document
that is currently represented by the window.
The window system might display it in the window's title bar
along with an icon matching the file type.
Task-number: QTBUG-27299
Change-Id: I8f620d1262fc0b4cd16884198b16853b73ce3b1f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>