for the case when the boundary finder is assigned to an invalid one.
Change-Id: I5b60984ff3fd99972fcae21895684bd83b012780
Reviewed-by: Simon Hausmann <simon.hausmann@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>
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>
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>
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>
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>
tst_QWinOverlappedIoNotifier::multipleOperations starts asynchronous
read and write operations on the same named pipe handle.
The received notifications must contain the right byte count and
OVERLAPPED pointer corresponding to the I/O operation.
Change-Id: I6f3fa5cf3ca6d62fcb9bc7073d28611fcfa7d98a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
When doing multiple I/O operations on the same handle, we get notified
for every operations. These must be distinguished by comparing the
pointer to the OVERLAPPED struct.
We now pass the OVERLAPPED pointer via the notified signal and let the
receiver decide if it wants to handle this notification.
Change-Id: I4efe70f39c6ae5282b949f2f4b21f6e7dd3df785
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
The programs in the example isn't used in the test.
Examples should be in the right directory and be of a certain
quality.
Change-Id: Id77bd1295efb3387fa54c379eb9c882cdc5b88bd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
For consistency, this behavior has been kept across Qt versions... Just
get rid of it.
Also fixes native child widgets not being notified of the change of
window handle (winId) when being reparented.
Updated auto-test.
Change-Id: I3616dc0f1c32a519d78a4846297d6d4a6e926fbf
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reported by David Faure.
In KDE a DEPRECATED macro gets defined in a header file created by cmake.
The define is not guarded with #if Q_CC_GNU or similar because at cmake
time the compiler is determined. Therefore moc suddenly sees this gcc
specific token and stumbles over it.
This patch simply defines an empty __attribute__ macro that will expand
to nothing and thus become invisible to moc's "C++ parser" after the
pre-processing.
Change-Id: I4448b9ac3f72b6334e32b27484401fb0fca23a0c
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Replace storage and operator int() return types with unsigned int
if the enum is unsigned.
This fixes a number of exisiting warnings, in particular with
Qt::MouseButton under GCC.
Change-Id: Ia12d36212329aec3e9d62a5fbd38809a6c2b36d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This class belongs to QThreadPool/QRunnable more than to QtConcurrent, so
move to QtCore, where QThreadPool awaits it.
Change-Id: Ibf20288a986593bf779453427c2dae8db1e1423a
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
No compatibility header needed. While this wasn't marked as private API,
it wasn't documented, either.
This is a prerequisite for moving QFuture to QtCore.
Change-Id: I8e986e6e2a22fbe5cf08d0600ec39ae9ae993e20
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Leave the old name as a deprecated typedef; adapt users.
This is a prerequisite for moving QFuture back to QtCore.
Change-Id: I81dcee2c7e6eb234c16f3f42e2415ca0da3dc4f8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
ICC apparently optimises 0 * anything directly to zero, even when it
should be doing a multiplication to conform to IEEE requirements. GCC in
fast-math mode does the same, but that also makes the rest of the
function unreliable, so we try to turn off fast-math mode if we can.
Task-number: QTBUG-22340
Change-Id: I0e3c5f4927b0a6bcb3189bb156c18843fc4b29b9
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
In cocoa the timers are associated with main run loop but
the way font and color dialog tests are executed the modal
dialog run loop is only run in cocoa. This causes timers to
not to fire and test cases to hang.
Unfortunately this does not completely fix the test failure
because the QTest::keyClick is not working with cocoa
native dialog helpers and therefore the tests are marked
with QEXPECT_FAIL.
Task-number: QTBUG-24320
Task-number: QTBUG-24321
Change-Id: I88740a20ad2b794b6ca15e1b6455f436ffd39335
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Task-number: QTBUG-27336
Don't check 'widget != m_widget' in
QWidgetWindow::handleDragEnterMoveEvent() since the current window's
parent widget may be the actual drop target. I replace it with a check
'!widget->isWindow()' to prevent we pass through a top level window.
I also change 'widget->mapFrom(m_widget, event->pos())' to
'widget->mapFromGlobal(m_widget->mapToGlobal(event->pos()))' since m_widget
may not be widget's parent.
Change-Id: Ia4f10f85ccdf1e27223ddc51afabd98b5d16f2fb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Expecting results were not correct. The test is passing.
Task-number: QTBUG-22362
Change-Id: Ie41c262019f76aace9062d7897d7934dc7437c3a
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
The entire test is currently skipped while only the last part is
causing problems.
Move the out of memory test code to its own test function and skip
only this function with the appropriate bug number. By allocating too
much memory this test is causing a crash.
Task-number: QTBUG-27361
Task-number: QTBUG-22342
Change-Id: Ia308099b7f12cf2c567b62063a7bbcc6fb38515b
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
According to the repo history the tailFile was introduced with the
S60 port but the functionality it's testing was never implemented.
Task-number: QTBUG-22341
Change-Id: I16e8e43bbd799f05f8b136925cb0add0b918289e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
It is time to clean up some of our legacy code. These styles have
not been actively maintained for a long time and I think it is safe
to say that they should no longer belong as part of the default
distribution of Qt. We dont support any platforms based on CDE with
our source packages.
Note that even if we are removing these styles from the default
distribution of Qt, applications that depend on them
will still be able to bundle the existing (and unmodified) styles
along with their own source code as we are not breaking compatibility.
Change-Id: I1709630c20ba8e8088cd01628628d86856db57a4
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Use PlatformClipboard::isAvailable() and omit relevant test
cases when QT_NO_CLIPBOARD is defined.
Change-Id: I7e7b20a0a18f1a82987564f0e5e6c76d9207bc4b
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Use PlatformClipboard::isAvailable() and fix build
when QT_NO_CLIPBOARD is defined.
Change-Id: I18c3af42fe39cf7618c2530723149848a10db985
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
QMetaType has a way to "switch off" some types from the build.
QtMetaTypePrivate::TypeDefinition<T>::IsAvailable is defined as false
for all unaccessible types. Sadly that information was never used by
gui and widget handlers. The patch implements it.
Change-Id: Ie5835be4c88cfbbca8a4e9199e31ddfc20cae190
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Jing Bai <jing.bai@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The back-end might report screen orientation changes at any point and we
record it in screen.d->orientation. However QScreen::orientation()
returns the orientation filtered according to the mask.
Changing the mask sends a notification to the back-end, which might send
another update as a result of a possible subscription to system services
(accelerometer). However on platforms where no subscription is required, where
the platform plugin ignores the mask and always sends the latest orientation,
we should "simulate" the update by updating the filtered orientation according
to the new mask. The function is cheap to call as it won't emit any signals
unless the orientation actually changes.
This patch also adds missing flush() calls after handleScreenOrientationChange
calls in the tests to ensure that the (synthetic) window system events are
actually delivered to QScreen/QGuiApplication.
Change-Id: Iebdd050f947e658ff5bc388629aa4cb31ab497fe
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Commit ef2efafcc6 introduced a call to
QWindowSystemInterface::sendWindowSystemEvents() in
QGuiApplicationPrivate::init(), which in its implementation ends up calling
sendPostedEvents() before flushing and processing any pending (internal) window
system events.
This patch changes the call in init() to use
QWindowSystemInterface::flushWindowSystemEvents() instead, which is more gentle
in that regard.
The provided unit test verifies that no posted events are processed during the
execution of the QGuiApplication constructor while at the same time verifying
what the original changed tried to do: Allow a generic plugin to provide window
system specific defaults that are implemented using the event queue of
QWindowSystemInterface.
Task-number: QTBUG-26886
Change-Id: I129a907c00d947df60fe1a02efc67857580fce24
Reviewed-by: David Faure <faure@kde.org>
This fixes a regression introduced in Qt 4 commit
e855b199319c932f2e9500235775f961bc32e41a.
The problem was that by handling the wheel event in event()
instead of wheelEvent(), we lack the guard clause in QWidget
that doesn't even call the handler if the widget is disabled,
and the code didn't handle this itself.
Fix by reimplementing wheelEvent() instead, which we can now
do because we can break BC.
This commit just moves the code. Another commit will clean
up the implementation of wheelEvent().
Task-number: QTBUG-27308
Reported-by: chenjiexin
Task-number: QTBUG-21534
Reported-by: Martin Koller
Change-Id: Ibe6b89a81fe889f839c205b859a1492b39a4ddc3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
CUPS paper sizes may differ from Qt paper sizes slightly and thus fail
the strict comparison in qprinter tests. This is needed for the
followup patch which initializes the cupsplugin with CUPS/PPD defaults.
Change-Id: Ie66f77ead0204de0fc7c7913005fa516d57d34eb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Use QStyleHints::showIsFullScreen() where necessary.
Notice that QWidget::show() already calls showFullScreen()
if appropriate, and Qt::X11BypassWindowManagerHint doesn't
do anything in the XCB platform plugin.
Change-Id: Ib8f61188c075170d646894388561cbb3f72daee8
Reviewed-by: Caroline Chao <caroline.chao@digia.com>