Commit Graph

2863 Commits

Author SHA1 Message Date
Joerg Bornemann
618c5f854f QWinOverlappedIoNotifier test for multiple I/O operations added
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>
2012-10-02 08:05:58 +02:00
Joerg Bornemann
94dc0c6594 QWinOverlappedIoNotifier: multiple I/O operations on the same handle
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>
2012-10-02 08:05:55 +02:00
Joerg Bornemann
d3c24d241e remove tests/auto/network/socket/qlocalsocket/example
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>
2012-10-02 08:05:48 +02:00
Joerg Bornemann
1cf6bbfcf1 make tst_QLocalSocket::listenAndConnect faster
Replaced qWait/QCOMPARE with QTRY_COMPARE.

Change-Id: Ic534443c187f791c75fe9528251bf47e54f33eed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-10-02 08:05:45 +02:00
Yoann Lopes
65d4dea41a QXcbWindow: Don't recreate window when reparenting.
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>
2012-10-01 15:48:08 +02:00
Simon Hausmann
310031188c Fix moc stumbling over gcc __attribute__ extensions
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>
2012-10-01 14:27:14 +02:00
Jędrzej Nowacki
abcdc7fd87 Make documentation of QVariant::isNull more explicit.
Task-number: QTBUG-22933
Change-Id: I1d8d3fc778ba00bcad11caaaf8af7d87186f18e8
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2012-09-29 02:31:35 +02:00
Marc Mutz
ac9be327f8 QFlags: use unsigned int when the enum's underlying is unsigned
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>
2012-09-28 23:50:10 +02:00
Marc Mutz
427a271426 Include qexception.h instead of qtconcurrentexception.h
Change-Id: I9a54412b77596aa74af7a513c33b10eb52257db2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-28 23:50:10 +02:00
Marc Mutz
7d21abfca3 Move QFutureSynchronizer back to QtCore
This class, too, belongs with QFuture.

Change-Id: I41a532ca66c156f1631e4b22ffc1a5879c854488
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-28 23:50:10 +02:00
Marc Mutz
08c50599f1 Move QFutureWatcher back to QtCore
This belongs with QFuture.

Change-Id: I555cd01c1d3890fbbaca4fd8a9170292ea4eb0fb
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-28 23:50:10 +02:00
Marc Mutz
727f25214e Move QFuture from QtConcurrent to QtCore
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>
2012-09-28 23:50:10 +02:00
Marc Mutz
a65a98399b Move QtConcurrent::ResultStore as QtPrivate::ResultStore to QtCore
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>
2012-09-28 23:50:10 +02:00
Marc Mutz
3a29976eac Move QtConcurrent::Exception as QException back to QtCore
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>
2012-09-28 23:50:10 +02:00
J-P Nurmi
5414a9a03b tst_QDateTimeEdit: cleanup whitespace & follow Qt coding style
Change-Id: Iae04cd0c9ac6ea85621b293f2ce184d673548e9b
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-28 21:12:21 +02:00
Thiago Macieira
928fc8d939 Update the NaN tests to deal with non-conformance better
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>
2012-09-28 10:11:00 +02:00
Teemu Katajisto
7615b54ce8 Run application main run loop in color/font dialog test
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>
2012-09-27 23:51:30 +02:00
jian liang
0a7e8350ae Fix drag and drop with native widgets
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>
2012-09-27 23:51:30 +02:00
Caroline Chao
67391eedfe Test: Enable tst_QWMatrix::operator_star_qwmatrix
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>
2012-09-27 21:13:52 +02:00
Caroline Chao
47d635b011 Test: Split tst_QVarLengthArray::oldTests
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>
2012-09-27 21:13:52 +02:00
J-P Nurmi
171c638a89 tst_QLabel: remove QSKIP, wrap Q_OS_MAC
Change-Id: If67dbb07900bfa8f1bcf55aa457bd90ef0550900
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 21:13:52 +02:00
J-P Nurmi
41dc50edff tst_QMenu: remove QSKIP's -> wrap Q_OS_WINCE
Change-Id: If8cb4a7dc0630aca83e4796bffb46f547abc4b6f
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 21:13:52 +02:00
J-P Nurmi
70bef120b7 tst_QMainWindow: remove QSKIP, wrap Q_OS_MAC
Change-Id: Ided3c4cbdc7508a36e96351b5f60d79532bb7f26
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 21:13:52 +02:00
J-P Nurmi
2d70dde68a tst_QAbstractButton::keyNavigation(): QSKIP -> XFAIL
Task-number: QTBUG-22286
Change-Id: If2c0e9181f2d954f3487dbb4c3f440d26a38adb6
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-27 18:35:55 +02:00
Joerg Bornemann
52e6a908bd remove no-op test from tst_qfile
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>
2012-09-27 15:50:17 +02:00
J-P Nurmi
4a9bdbd8cc tst_QCommandLinkButton: cleanup whitespace
Change-Id: Ia1aab643f7b93b0532a38b27d7777fbcf5f489bc
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 15:21:41 +02:00
Jens Bache-Wiig
570ae40f57 Remove CDE and Motif styles from qtbase
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>
2012-09-27 15:16:16 +02:00
J-P Nurmi
05978af3a1 tst_qcheckbox: remove duplicate code
Change-Id: Ic5d7694251e42a6d5ad7fea19137b71bc499ac94
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-27 15:03:15 +02:00
J-P Nurmi
507b90ac86 QtWidgets auto tests: revise clipboard related tests
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>
2012-09-27 09:15:00 +02:00
J-P Nurmi
b0b7d9cf6b Revise QClipboard auto tests
Use PlatformClipboard::isAvailable() and fix build
when QT_NO_CLIPBOARD is defined.

Change-Id: I18c3af42fe39cf7618c2530723149848a10db985
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-27 09:14:51 +02:00
J-P Nurmi
12e5464fa3 Auto tests: add PlatformClipboard::isAvailable()
Change-Id: Ie04060c2cae61ff8268644e9cd8001a1f5745f31
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-27 06:07:13 +02:00
J-P Nurmi
f7ae890e24 tst_QDialog: fix Q_OS_WINCE & QT_NO_SIZEGRIP usage
Change-Id: I443381ef4f10492eeda0fc681c390e0cd4d4125e
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 06:07:11 +02:00
J-P Nurmi
12130ff65f tst_qsidebar: remove duplicate code
Change-Id: I8ee59022199fda7ea56891a2f924954cb4aefa42
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 06:07:10 +02:00
Jędrzej Nowacki
60d096ff6d QMetaType build fix with Q_NO_CURSOR and friends.
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>
2012-09-27 02:37:19 +02:00
J-P Nurmi
a86b3d76a5 tst_QMessageBox: fix Q_OS_MAC usage
Change-Id: I1a3c1c88956d85343e693588ca0522c4b7d62072
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 02:31:11 +02:00
Simon Hausmann
ce1f994e9b Fix QScreen::orientation() not always being updated after changing the update orientation mask
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>
2012-09-26 19:55:00 +02:00
Simon Hausmann
c4e736cf9d Fix events being processed on application start
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>
2012-09-26 19:54:19 +02:00
Marc Mutz
aec5b76b51 [QTBUG-27308][QTBUG-21534] Don't mouse-wheel-scroll QScrollBar when disabled
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>
2012-09-26 19:06:47 +02:00
Teemu Katajisto
0b2068eafd QtPrintSupport: allow slight deviations from pre-defined paper sizes in tests
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>
2012-09-26 10:08:59 +02:00
J-P Nurmi
54d18cdc29 Auto tests: remove PlatformQuirks::isAutoMaximizing()
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>
2012-09-26 10:08:59 +02:00
Kai Koehne
f052ee467d Fix MinGW/gcc warning about NOMINMAX being redefined
Commit 5230d62fe added a #define NOMINMAX, which conflicts with a
NOMINMAX definition in the MinGW headers. Just use the same definition
as in MinGW to fix the gcc warning.

Change-Id: Ib21dd323ebbdca5d143e394c7631303e0c72541a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-26 10:08:59 +02:00
Caroline Chao
371c21b9a8 Test: tst_QFile::writeLargeDataBlock() unstable failure as XFAIL
While the large data block can be written to a file, the test is
also showing instability while reading back the written block.

Adding another expected failure to address this instability.

Task-number: QTBUG-26906

Change-Id: I9704d441cf2bd6d7ef0f9023240ea61bb89561b6
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-09-26 10:08:59 +02:00
Jonas M. Gastal
4920090da0 If accept fails, stop accepting new connections and emit error signal.
Task-number: QTBUG-24778
Change-Id: I6c5b685b3f861a0fafc1475c41bb35cede17d712
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-26 04:03:51 +02:00
aavit
aa9728450c Misc. updates to the lancelot autotest framework
Moving more logic into the protocol and framework, easening
the burden on the autotest implementation.
Implementing several new features in the server and
report, like fuzzy matching and static baselines.

Change-Id: Iaf070918195ae05767808a548f019d09d9d5f8c0
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2012-09-26 04:03:48 +02:00
Janne Anttila
bf05abddfd Fix qstringlist autotest build for WinCE.
WinCE does not have setlocale, used SetUserDefaultLCID correspondingly
as it is done in qstring autotest for WEC7.

Change-Id: I7866bf0f365c7c6efbf3b439cdd9a281c6a1b2e0
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-09-26 04:03:48 +02:00
Sergey Hambardzumyan
931640391a test:Remove QSKIP from tst_QPainter
Removed QSKIP ("currently broken... ") from tst_qpainter.cpp.

Change-Id: I2a5af009198d26015779ca368ef82188ddf1b060
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-26 04:03:41 +02:00
Marc Mutz
0842d32441 QFileSystemModel: fix permission mangling
The old code masked out write flags before returning permissions
from permissions() or data(FilePermissions) in order to force
QFileDialog to disable the rename and delete actions. This was to
fix Task 143519, but introduced QTBUG-20503.

Instead, revert to the pre-143519-bugfix code and do the necessary
check in QFileDialog directly.

Also add a testcase for 143519.

Reported-by: Gilles Pascual
Task-number: QTBUG-20503
Task-number: 143519

Change-Id: I140109341c0ed40722e3aac4327c2a740fb014c2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-09-26 04:03:41 +02:00
Mitch Curtis
6b6fefad48 Remove duplicate words and punctuation from documentation.
Change-Id: I5550c62d412510bc2c5acceb2cae7d2f2ef6a8d3
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2012-09-26 04:03:20 +02:00
Konstantin Ritt
a798b956b9 QCharAttributes: add wordStart/wordEnd flags
A simple heuristic is used to detect the word beginning and ending by
looking at the word break property value of surrounding characters.
This behaves better than the white-spaces based implementation used before
and makes it possible to tailor the default algorithm for complex scripts.

BIG FAT WARNING: The QCharAttributes buffer now has to have a length
                 of string length + 1 for the flags at end of text.

Task-Id: QTBUG-6498

Change-Id: I5589b191ffde6a50d2af0c14a00430d3852c67b4
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-09-26 03:09:57 +02:00
Sergio Ahumada
aeb21c73c5 test: Mark tst_QMdiSubWindow failures as XFAIL
The test has lots of failures, so mark these with QEXPECT_FAIL and
remove the QSKIP.

Task-number: QTBUG-22310
Task-number: QTBUG-27274
Change-Id: I0d38cedb581741b6edae5d1c3f4410714099a7fb
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-25 20:28:06 +02:00