Commit Graph

3224 Commits

Author SHA1 Message Date
Mitch Curtis
6497649730 Check for both A and P when converting QDateTime to string.
hasUnquotedAP currently only checks for an a or A, which is wrong
according to both the toString documentation and the comments for
hasUnquotedAP.

Change-Id: I03015734b846fe761085cf8f8fca2b29210cff97
Reviewed-by: Jon Severinsson <jon@severinsson.net>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-10-30 00:06:26 +01:00
Thorbjørn Lund Martsum
af437047a2 QMap - improve QMap stl-map ctor
We can insert directly on the most left-most Node.

We always enforce an insert here (unlike the insert call),
but that is not a problem since the keys in a std::map are unique.

Change-Id: Ib409b90ffc57a5a43dab4a4b08d34f6fdabd057f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-29 22:21:32 +01:00
Konstantin Ritt
7aa0adf130 QFontEngineMulti: Fix possible crash in stringToCMap()
in case when the layout is partially initialized.
We shouldn't access any data except of indices
if GlyphIndicesOnly flag has been passed in.

Change-Id: I264689b498e0f9de8b5c040d47dbae4f6ef391c4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2012-10-29 20:31:08 +01:00
Jan Arve Saether
c360fbcd6c Do the actual removal of the Soft Keys API and related code
In addition to the actual removal of the softkeys API in QAction,
this commit removes some enums related to the softkeys feature:
  Qt::WA_MergeSoftkeys
  Qt::WA_MergeSoftkeysRecursively

It also removes some "zombie" enums:
  Qt::WindowSoftkeysVisibleHint = 0x40000000,
  Qt::WindowSoftkeysRespondHint = 0x80000000,

  (The only implementation that used these were removed when
  qapplication_s60.cpp and qwidget_s60.cpp were removed.)

Change-Id: Ib6fc6d543def4757383d5f19256199d9d190c614
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-29 20:27:27 +01:00
Caroline Chao
2eefa819c4 Test: refactor tst_QProcess
Remove QSKIP and instead omit the whole tests when appropriate.

Remove QSKIP from crashTest, crashTest2 and exitStatus on Windows,
the tests are now passing.

Add a guard in testForwarding to check if QT_NO_PROCESS is defined.

Change-Id: Icba4d773315e3bf87764a381742168b51cf169c0
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-29 13:57:15 +01:00
Caroline Chao
9c0544f884 Test: remove QSKIP in tst_QEventLoop::throwInExec()
Instead omit the whole test when appropriate.

Change-Id: I60c34b020f6e25e865bbe0182395d4fc6419f65e
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-10-29 13:57:09 +01:00
Sergio Ahumada
328a9420d0 test: Update task number for QAccesibilityLinux autotest.
Reference tasks with detailed information of failures rather than generic
task for blacklisted tests.

Task-number: QTBUG-27732
Change-Id: I0f0f500d255ea8748dd98d066deeaf1dfcdb7ec8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-10-29 13:51:18 +01:00
Friedemann Kleint
8fedf68369 Fix qfile:invalidFile() test.
The test expects 'fail:invalid' to be an invalid file,
which it no longer is on Windows 7. It also assumes that
f: is an invalid drive. Fix by picking a drive that does not exist.

Task-number: QTBUG-27306
Change-Id: I9d9b36c50fc31d2561d3c4eec66f65d96084f0d7
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-29 13:46:50 +01:00
Jan-Arve Saether
b626b98b95 Implement QAccessibleLineEdit::characterRect()
It was probably not implemented because it needed to access
private APIs.
However, accessing those from this a11y plugin is unproblematic.

Forward-ported from Qt 4.8 with change
d2fb64d52fc6ec229d775f829a9a0cb3d251aad3 (and then slightly improved)

Change-Id: Ifa2d48c152fd75fc1fff49a05369787a7db3b902
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2012-10-28 00:50:09 +02:00
Frederik Gladhorn
596f23554a Clean up index handling in itemviews accessibility.
Change-Id: Icc017c7df9cb0dc4bf17e5168c1e3acda6af7523
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-10-27 14:22:52 +02:00
Frederik Gladhorn
0ceb6541d7 Make table test use smart pointers for interfaces.
Change-Id: I9669da2ef398f12c4d6d584e7032dea13b148a81
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-10-27 14:22:48 +02:00
Thorbjørn Lund Martsum
6e4d7bbb0b QMap 5.0 - keep track of leftmost node (BIC)
This suggestion keeps track of the most left node.
The point is that constBegin() becomes a lot faster.

That speeds up iteration a bit, and makes it O(1) to get the
first element. The penalty in insert and remove is very small.
On large trees it seems to be less than 1%.

It should be noticed that constBegin() is a very common hint
on my planned change to 5.1, and this opperation will without
this patch cost 2 x log N. One when the user calls the hint
with begin - and one where it is compared with begin.

Other std::maps has a very fast begin(). E.g
http://www.cplusplus.com/reference/stl/map/begin/
(begin with constant time)

Change-Id: I221f6755aa8bd16a5189771c5bc8ae56c8ee0fb4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-27 07:35:57 +02:00
Thorbjørn Lund Martsum
cfc3eeea1b QMap - use hint on insert in QMap::toStdMap
Giving the std-map a hint (normally) improves insert performance.
There seems to be no reason not to provide this hint.

Change-Id: I4344607ebf54574a3ae9666d87a41a3c14762361
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-27 07:35:48 +02:00
Sergio Ahumada
67a0f546c5 test: Remove dead code from tst_QPixmap
Change-Id: I1945a0f431364f47a43cf7f600ad38fdba5f4a08
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-10-27 00:24:16 +02:00
Sergio Ahumada
f224d073d5 test: Don't fail if the network test server is not set up
Leftover from 704a4e4747

Change-Id: I437da91be31259a748303bd7cf20ff0c8bcf53b4
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-26 17:08:03 +02:00
Mark Brand
5bddaf76e0 QComboBox: new signal currentTextChanged
Adds NOTIFY to currentText property.

Test included.

Change-Id: I3e92b585ad6697891d61537c82f6ab9e8beb1a00
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-10-26 15:24:19 +02:00
Mark Brand
84787d82ee QComboBox: fix use in QDataWidgetMapper/QItemDelegate
QItemDelegate and QDataWidgetMapper use the WRITE method on the USER
property to set a value in a widget. This did not work for QComboBox
whose USER property currentText lacked a WRITE method.

This change adds the missing setter and flags it as the WRITE method.

The setter setCurrentText() simply calls setEditText() if the combo
box is editable. Otherwise, if there is a matching text in the list,
currentIndex is set to the corresponding index.

Test included.

Follow-up to 816c554017 which restored
currentText as the USER property.

Task-number: QTBUG-26501
Change-Id: I5f2f999e60b09728ca03ead4e28fe36d1f3ee189
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-10-26 15:24:00 +02:00
Stephen Kelly
49555e3ac9 Add a CMake macro to test module includes
The variations of includes which should work are tested. For example,
in the case of testing the QtCore module and QObject include, the
following includes are generated and compiled:

      #include <QObject>
      #include <QtCore/QObject>
      #include <QtCore>
      #include <QtCore/QtCore>

As the private include directories are not available to the compiler,
this also tests that private headers are not included from public ones.

Change-Id: Id03d0fe290c9691e0f7515015892991d1701ab72
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-10-26 15:23:30 +02:00
Andy Shaw
356f3c89b8 Fix syncing of visibility and enabled for menus on Cocoa
Fixed menu handling on Cocoa so if a menu is enabled/disabled or made
visible or not then it will keep this in sync with the appropriate
native menu entry.

Change-Id: If269185fcf065fb1b2f60d6ef8c27c107eb4509f
Reviewed-by: Pasi Matilainen <pasi.matilainen@digia.com>
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2012-10-26 14:53:09 +02:00
aavit
03967c4f0b Adjust autotest files for raster engine to new default pen
Fix those test scripts that assumed cosmetic default pen, and
improve testing coverage of cosmetic vs non-cosmetic pens in general.
Ref. I04d910e9700baf7f13a8aac07a3633014bb9283e

Change-Id: I2bb3525c21a8e9c8dd1f16e7dcd225195df43c1b
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-10-26 11:53:12 +02:00
Friedemann Kleint
d0aa81ee10 Fix a crash in QFileDialog when selecting an invalid name filter.
When nameDetailsVisible is set to false and an invalid/empty
string is passed to selectNameFilter(), the regexp used to
strip the filter off the suffixes returns empty and a crash
occurs.

Change-Id: I926ea49514ff25a103977d8121fca1cf83d647f5
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-10-26 11:51:56 +02:00
Oliver Wolff
deac55becd Properly check for widget's visibility in doublespinbox autotest
Change-Id: If9e08ab5c84090729537e2a060257564c62fda9a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-10-26 00:26:35 +02:00
Mark Brand
9b710bc13b correct spelling in comment
Change-Id: I6ffa96ac9cda0701c99f839804f400a167fcf9a7
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-10-25 22:41:24 +02:00
Sergio Ahumada
b8dd9e3041 test: Remove QSKIP from tst_QFileDialog2
In task227930_correctNavigationKeyboardBehavior()

Task-number: QTBUG-23602
Change-Id: I07f40dbc3840c232e09ff1327f00e3fd9c16c22f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2012-10-25 16:22:50 +02:00
Sergio Ahumada
c3237f58ab test: Remove tst_QPixmap::grabWindow() function
QPixmap::grabWindow() was deprecated by 41914453d3

Task-number: QTBUG-20863
Change-Id: I7e675c124cd96cf1815b65e57f3fba19e5065066
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-25 16:22:43 +02:00
Caroline Chao
044f5b7fb8 Test: remove QSKIP from tst_qstring
Instead omit the whole tests when appropriate.

In particular:

- When Q_CC_HPACC is defined the tests fromStdString and toStdString are
crashing. Omit the tests in this configuration since the compiler is not
supported.

- Clean the localeAwareCompare() by removing the code where Q_OS_WIN is
defined but not Q_OS_WINCE. System and user locale cannot be set on
Q_OS_WIN other than Win CE and some code could never be reached.

Change-Id: I72ae3246bf8c2a73d14cce45dde14bcb8001d8b3
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-10-25 16:22:39 +02:00
Simon Hausmann
f45d6414ad Fix qmake's pro file cache to interact correctly with write_file
When writing a file with write_file() we have to inform the pro file parser
cache to discard the file if it's existant in the cache, to ensure that
calling include() after write_file() always works.

Change-Id: I7d09269a57de55ca30b0e11dd40770de9f919f64
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-10-25 16:22:00 +02:00
Stephen Kelly
dee57bc910 Core/kernel: Make some signals private.
There are more opportunities in QtCore and the rest of Qt to make signals
private instead of public. This is a test-dart to see if there is any
reason not to do this.

It would be nice to make QObject::destroyed private, but as it has a
default argument it would be source incompatible to anyone connecting
to the SIGNAL(destroyed()) instead of SIGNAL(destroyed(QObject*)).

Currently the function-pointer-based connect syntax does not accept
a functor (or lambda) with a different number of arguments than the
signal. Olivier says a fix for that might come in 5.1, but for now
the qfiledialog2 test is changed to not use that anymore.

Also, the function pointer for a private signal can not be assigned to
a local variable, so the qmetamethod test is changed to not do so
anymore.

Change-Id: Iaf776b822f9ba364f2c184df0c6b23811da56e44
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-10-25 15:56:14 +02:00
Stephen Kelly
92c739cf50 Implement viewOptions logic in QTableViewPrivate.
This is similar to the patch 05aa8c6c12
which was applied to QListView.

Task-number: QTBUG-26548
Change-Id: I38ff07230673a93a32b01a7f1951d0378d94185b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-10-25 14:10:04 +02:00
Stephen Kelly
1550c46179 Add missing test for the Qt5PrintSupport module.
Change-Id: Ic3860cc13fbb37a1d3ae63ad100b7d722a987272
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-10-25 14:10:04 +02:00
aavit
52ccbd8911 Fix: don't override the new non-cosmetic default pen in qwidget
As QWidget initializes any painter created in paintevent handler to
have the pen color of the palette's foreground, setting it to 0 width,
i.e. cosmetic, it negated the effect of the recent change to default
1-width non-cosmetic, ref. I04d910e9700baf7f13a8aac07a3633014bb9283e

This caused scaled painting with default pen on QImage and QWidget
to yield different results.

Change-Id: I930b64bf7c0a8c84b9ea3edb49adc813370fed0e
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-10-25 14:10:04 +02:00
Sergio Ahumada
704a4e4747 test: Don't fail if the network test server is not set up
Not having access to a network test server is not a failure per se
but rather an enviromental condition not met at run-time.

Change-Id: Ie7d10ca5fbf2df45fb1fd1ac19718c9fae855c03
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-25 14:10:04 +02:00
Joerg Bornemann
b5d55f3a35 fix flakiness of tst_qlocalsocket::processConnection
QSystemSemaphore is persistent after a crash and we'd have to toggle the
Open/Create flag. Waiting for the server being available by trying to
connect is much more reliable.

Change-Id: I510814cef189b43658911f8ade3cf831ae6c7e58
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-10-25 10:19:48 +02:00
Rohan McGovern
22975c56a6 Unmark tst_qgroupbox as a parallel test
Judging from recent failures in the call to QTest::qWaitForWindowActive
in this test, the test may not be parallel-safe as previously thought.

Change-Id: I0a05eafd9086207ea3fc73f611bf834b657d5b8a
Reviewed-by: Toby Tomkins <tjtomkins@gmail.com>
2012-10-24 02:29:17 +02:00
Sergio Ahumada
048d28a674 test: Remove QSKIP from tst_QSettings::fileName()
Change-Id: I24ed2d182faff989f62f192246ebf95ca492c10d
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-24 01:39:06 +02:00
Sergio Ahumada
cdd75e9e4b test: Remove QSKIP from tst_QClipboard::copy_exit_paste()
Change-Id: Ib64680dbd966940c56ab089ff1b7727b237fdaee
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-24 01:39:04 +02:00
Sergio Ahumada
cd0c6d69fa test: Rename test case name TestQtJson -> tst_QtJson
This allows us to follow test naming convention which should start
with "tst_"

 Before:
  TestQtJson::initTestCase()

 After:
  tst_QtJson::initTestCase()

Change-Id: Id83ccc324776399184c3665565eb8d045bfee2e2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-24 01:39:02 +02:00
Sergio Ahumada
ead0e0029a test: Fix tst_QDir.equalityOperator()
On Fedora 17 /sbin/ is a symlink now, so this test fails there.
Using /usr/ instead.

Change-Id: Ie35902fc093101191bdbf33324e20835d1da1528
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-24 01:39:01 +02:00
Mitch Curtis
b016597db8 Return invalid datetime when calling addMSecs with invalid QDateTime.
This is in line with what QTime::addMSecs and QDate::addDays do, for
example.

Change-Id: I902112486727f74f669a97bde6c42028e0838f8d
Reviewed-by: Jon Severinsson <jon@severinsson.net>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-10-24 01:38:58 +02:00
Mitch Curtis
8310533975 Improve QTime test coverage.
Change-Id: If47de3dc047ac4f8a4a1498cf225e03bbbf4110e
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Jon Severinsson <jon@severinsson.net>
2012-10-24 01:38:56 +02:00
Mitch Curtis
6a7a08b4a8 Improve QDate test coverage.
Some statements could not be tested, such as default cases of switches
where all possible cases are already handled and some statements where
the system locale is used.

I also removed some statements that would never be reached and hence
will never be able to be covered by tests.

Change-Id: I8ea3071f66d942d986e65708732af6751d36b5e3
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-10-24 01:38:54 +02:00
Mitch Curtis
811bf4da67 Output leading zeroes for yyyy date formats in QLocale::toString().
Converting the date 1 January 0001 to a string in the format
"dd MMMM yyyy" currently results in the string "01 January 1", but it
should be "01 January 0001".

Task-number: QTBUG-27287
Change-Id: Ia025da7343d1c36aaee34c47c6db551a6e89595f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-24 01:38:49 +02:00
Miikka Heikkinen
32cbcca911 Stabilize tst_qfontdialog test case.
The delayed quit signal used as failsafe to ensure exit from event
loops interfere with later test if the test case works normally,
as closing the last toplevel window will also exit the event loop.

Fixed by stopping the quit timer if nested application exec loop
is exited.

Change-Id: If87655f1f28f50e27a64f3430c9f65bb3ab7dd70
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
2012-10-23 12:03:50 +02:00
Giuseppe D'Angelo
bbda968a0a Fix QRegExpValidator::validate docs about the pos parameter
The code sets it to input.length() iff the regexp doesn't
match the string, while the docs say it's *always* set.

Therefore, make the docs match what the code does and
add a simple test to enforce it.

We're not changing the code to match the docs because

1) it's better to stay conservative (we don't want
to break existing behaviour);

2) this behaviour mimics what the int/double validators do
(they don't move pos at all).

Change-Id: I958074558de6b0fc5944101c6535fc7e00442ae9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-22 22:42:26 +02:00
Jens Bache-Wiig
087e4bc517 Remove Cleanlooks and Plastique
We have a new style Fusion that will replace these styles.
They will be moved to a separate
module rather than included in platforms that do not need them.

Change-Id: I51ebbcad5406e99130e5b12e62ba624d1489088c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2012-10-22 19:36:43 +02:00
Samuel Rødal
b213d5bfa3 Make QPen default to 1-width non-cosmetic.
Use the Qt4CompatiblePainting render hint when painting with QPainter to
treat default constructed QPens as cosmetic still.

The NonCosmeticDefaultPen render hint gets documented as obsolete, since
it was in any case not respected by the raster nor OpenGL paint engine.

Change-Id: I04d910e9700baf7f13a8aac07a3633014bb9283e
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-10-22 19:36:43 +02:00
Stephen Kelly
efc475a996 Fix integer overflow in QSpinBox.
Change-Id: Ic204d42fbdffc44576f7e76132bc53621e836299
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-22 19:36:43 +02:00
Marc Mutz
2ec2edc24d normalise signal/slot signatures [QtGui tests]
Change-Id: I42e11de9ef1d8a04b2a8e200afb84f2245f3361a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-10-22 08:41:27 +02:00
Mitch Curtis
13846e8013 Revert removal of commented out tests in tst_qdatetime.cpp.
Two lines were commented out but were removed with
Ib6ceb1cb7fb4c6eca672495f96d9cfd907853c85. They have been replaced
as expected fails.

Task-number: QTBUG-22833
Change-Id: Ib154a31bffcdc8e43c6ad236df193e99334652c6
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-10-22 03:21:33 +02:00
Marc Mutz
a438267c84 normalise signal/slot signatures [QtCore tests]
Normalise all signal/slot signatures in tests/*/corelib,
except in tst_QObject, where they might be test data.

Change-Id: Id4e101f285b1676bb583b0afae06d235e599e24b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-22 03:21:01 +02:00
Sze Howe Koh
d7e8b57d0a Remove the QThread::terminated() signal
The signal is removed from the API; all references to it are removed
from documentation; the unit test that checks for its emission is
modified to listen for QThread::finished() instead.

The QThreadPrivate::terminated flag is also removed, as it served no
purpose other than to trigger the emission of QThread::terminated()

As discussed at http://lists.qt-project.org/pipermail/development/2012-October/007216.html
the signal is not guaranteed to be emitted after every termination,
rendering it useless.

Change-Id: I7b0c45d7889da0d33875545331606f2208ee56fc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-10-19 20:25:16 +02:00
Konstantin Ritt
9690548113 QFont: Don't invalidate engine unless request has been changed
This makes QFont do a "light" detach when the font attributes data has been changed.
The new test clearly shows that the engine is now shared between
two font instances after changing the kerning attribute.

Change-Id: I59db822f459f02d111686dba7101b98e361fada9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-19 18:04:36 +02:00
Andreas Hartmetz
bdc115d969 detach() safely in QVector::erase(), and update callers to not detach.
remove() can use non-detaching iterators internally before calling
erase(), which hasn't been exploited so far, so that the detach() in
erase() never actually detached. When using erase() from outside,
you can't do it legally without calling begin() or end() that detach()
before erase() is called.
Now remove() doesn't detach anymore, and detaching in erase() works.
With new tests that fail after changing only the erase() callers
and pass again after fixing erase().

Change-Id: I47c0a9e362dce8628ec566f5437d951755de96c8
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-19 18:04:11 +02:00
Marc Mutz
848c88c7a2 normalise signal/slot signatures [QtSql tests]
Change-Id: I06573bc2ad58378dd835565cd07d711bfc760411
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-10-19 13:02:17 +02:00
Caroline Chao
f948294f5e Test: remove QSKIP from tst_QStringList::initializeList()
Instead omit the whole test when Q_COMPILER_INITIALIZER_LISTS
is not defined.

Change-Id: I34017484a027b95a2677e1c4cb9231fa2aeb5680
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-19 09:41:36 +02:00
Caroline Chao
33aea0cc1c Test: remove QSKIP in tst_QLocale::emptyCtor
Instead omit the whole test when appropriate.

Change-Id: Iebd569676cc7b2f8fe4a1d272107e092410d397b
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-19 09:41:36 +02:00
Thiago Macieira
320c4e31e1 Make QContiguousCache with zero capacity not crash
These containers don't make sense and will just result in no action
being taken (all items added will simply be discarded), but it
shouldn't crash due to a division by zero.

Update the documentation to explain the fact.

Task-number: QTBUG-27339
Change-Id: Ib9acf5c0a9a826e6853e7beaf5e56511fde98dc6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Ian Walters <ian@walters.id.au>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-19 07:50:29 +02:00
Caroline Chao
f7f9a28a26 Test: remove QSKIP from tst_QDateTime::fromString_LOCALE_ILDATE
Instead omit the whole test when Q_OS_WIN is not defined.

Change-Id: I311538ce839353d4d5e83edfd12c68968fe61215
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-19 02:44:52 +02:00
Jason Barron
a61788d139 Change the default major version of QGLFormat to 2.
This is being changed because:
- The OpenGL paint engine in Qt only supports GL2
- QML2 only supports GL2
- QSurfaceFormat has a default value of 2

Applications that want to use GL1 on a QGLWidget will have to
explicitly request this format using QGLFormat::setVersion.

Task-number: QTBUG-27589

Change-Id: Ieb283ef7d6e15a29ec28ce7e4363dbf477decaa7
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-10-19 02:43:05 +02:00
Joerg Bornemann
c54a2dca16 tst_qlocalsocket: get rid of QtScript dependency
Removing the lackey executable that needs QtScript to be built.
This was a qscript bastard that was able to run a client and a server
script. It's replaced by a C++ version with the same functionality.

Nice side effect: the two second wait per test row could be removed.
The client executable is now waiting for the server to be created.

Task-number: QTBUG-24142

Change-Id: I135b75abf6620d3b0af50dc226ea8c81c2bf4149
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-10-19 02:43:05 +02:00
Sergio Ahumada
221bd941ff test: Moving tst_QProcess::echoTest_performance()
tst_QProcess::echoTest_performance() is not an unit test but a
performance test, so moving it from 'tests/auto/corelib/io/qprocess'
to 'tests/benchmarks/corelib/io/qprocess'

Change-Id: I796788534eafc5ca3b8d86c0ec46998285fd4b8f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-10-19 02:43:05 +02:00
Samuel Rødal
7b8e10ddd0 Fixed inconsistent QPainter fill rules for aliased painting.
Qt 5 is the time to get rid of all the old inconsistencies in the raster
paint engine caused by trying to preserve the old X11 based
coordinate system where (0, 0) is in the center of the top-left pixel
instead of the upper left corner of said pixel. However, this was only
adhered for line drawing and path / rect filling, and not for image or
pixmap drawing and not at all when doing antialiased painting. By
defining the antialiased coordinate system as being the right one and
letting the aliased fill rules follow from that we finally end up with
some consistent behavior that doesn't lead to surprises and workarounds
in application code.

It is still possible for applications to get the old behavior by
setting the QPainter::Qt4CompatiblePainting render hint. This should
make porting easier for the few cases where an application relies on the
aliased fill rules we used to have in Qt 4.

Task-number: QTBUG-27500
Change-Id: If86b95e77d838ec83033d64af86632b9a73c74a9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-19 02:43:05 +02:00
Stephen Kelly
d84f449bcd Make sure uints remain uints when editing in itemviews.
Task-number: QTBUG-22974
Change-Id: I07428862c4dffc629f868f3010f663eb655922d0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-19 00:44:54 +02:00
José Millán Soto
8bed283f13 Correct accessibility index handling in QListView
QListView::currentChanged and QListView::selectionChanged changed to
use 0-based indexes instead of 1-based indexes.

Change-Id: Ie618970c9a37ec76156dbfab2e86685c3c8f374c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2012-10-19 00:44:54 +02:00
Marc Mutz
a4ffbfefe7 normalise signal/slot signatures [QtNetwork tests]
Change-Id: I2491cfe421a811d00759224da03580b3dcc2a091
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-10-19 00:44:54 +02:00
Marc Mutz
b5b165ffb3 normalise signal/slot signatures [QtDBus tests]
Change-Id: I4a0441d37e455dce28072ee3650b2062bec65759
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-19 00:44:54 +02:00
Marc Mutz
bb73c085a6 normalise signal/slot signatures [QtWidgets tests]
Change-Id: Iffab60f0911a55e4be09faeb29df0bae1ea2eb19
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-10-19 00:44:54 +02:00
Tero Ahola
8b6de46771 Modified vertical alignments of simple widgets on OSX
Adding QCheckBox, QComboBox, QLineEdit etc. into an HBox layout or grid
layout makes the layout look like a snake's trail. Fixed the positioning
of these widgets to make the layouts visually more appealing.

Updated qmacstyle auto-test accordingly.

Task-number: QTBUG-13635
Ammended-by: Gabriel de Dietrich
Change-Id: I89461f9aad68ea8488070ed06257b9b8e7f493c5
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2012-10-18 21:45:46 +02:00
Andy Shaw
d060620e6c Use the right properties when checking the frame's margins
Changed it to check the Frame*Margin property instead of the
Block*Margin property as this was incorrect for a QTextFrameFormat.

Task-number: QTBUG-22173
Change-Id: I2c3066165fb592ed034874b1180593822859f933
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2012-10-18 20:56:05 +02:00
Oswald Buddenhagen
6226fcdc3e add a .qmake.conf file which load()s qt_build_config
that way we don't have to auto-generate code for that in the configures.

note that we now load qt_build_config.prf instead of just qmodule.pri,
which means that exceptions_off is set everywhere. we forcibly re-enable
them for testcases to minimize the deviation from default 3rd party usage.
testlib selftests are not qt testcases, so the one that needs exceptions
needs to enable them explicitly.

Change-Id: I1b9360bb11f2e80c92a2b63a7c45991ad17fda1b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-10-18 17:42:40 +02:00
Gabriel de Dietrich
92e4ec7a14 Bring back Mac dependent code in QBoxLayout, QGridLayout
We also made an accessibility auto-test more stable, so that it would
not be influenced by this patch.

Task-number: QTCREATORBUG-7966
Change-Id: I6ce4e2361c8847aee5dd1cf5664c29cd2d83e38d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-10-18 15:19:48 +02:00
Caroline Chao
5c57d1eacb Test: remove QSKIP in tst_qarraydata
Instead omit the whole tests when appropriate.

Change-Id: Id4ec171528d4b4d6849b2478ac4f4a2332789b55
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-18 14:55:23 +02:00
Caroline Chao
8506850cc8 Test: remove QSKIP from tst_QTextStream::stillOpenWhenAtEnd
Instead omit the whole test when Q_OS_WINCE is defined.

Change-Id: Ifd09048687db95913f39a64cffb42a743af8fa81
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-18 12:24:55 +02:00
Rohan McGovern
bfbeaffda8 Fix compile with -no-widgets
Remove more unnecessary references to QtWidgets in accessibility
implementation.

Disable accessibility tests (which rely on QtWidgets) when QtWidgets is
not available.

Change-Id: I57315537779d31af1245d42d1b4c49174016da54
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2012-10-18 12:24:11 +02:00
Caroline Chao
0b23cd186c Test: remove QSKIP in tst_QDataStream::stream_QIcon
Instead omit the whole test when Q_OS_WINCE is defined.

Change-Id: Ic69accb138121d2b39f068cef181da13b18e46ee
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-18 12:23:44 +02:00
Caroline Chao
6dfeee624a Test: remove QSKIP in tst_file
Instead omit the whole tests when appropriate.

Change-Id: I5eae127a497e290c5e4ba1a81a8f325c300471c1
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-18 12:23:23 +02:00
Caroline Chao
1fef528d33 Test: remove QSKIP in tst_QDir::dotAndDotDot
Instead omit the omit the whole test when Q_OS_WINCE is defined.

Change-Id: I8c0f12c63bbc4567edb3a8626ab060d5ce38f3cd
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-18 12:22:51 +02:00
Marc Mutz
a23be1b3e1 normalise signal/slot signatures [QtOpenGL tests]
Change-Id: Ie8a56873013ad2408d792e371a7d3e2ecf1f9c2c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-10-18 12:22:31 +02:00
Caroline Chao
8a2d1ce2c6 Test: remove QSKIP and remove whole test cases instead.
Change-Id: I8b625d20a2cf9215cbfdb96cd252bf1c81bba522
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-17 21:06:30 +02:00
Caroline Chao
ceb5474d5f Test: remove QSKIP in tst_QDBusMarshall::receiveUnknownType
Omit the whole test and relative types if DBUS_TYPE_UNIX_FD is not defined
since the test is not relevant in that case (D-Bus library too old).

Change-Id: I167622f485c0f34d64984c4fa96be974e54f56bc
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-17 21:05:57 +02:00
Caroline Chao
c5ec39b6cc Test: remove QSKIP from tst_qtconcurrent
Instead omit the whole tests when appropriate.

Change-Id: I3a22d010b658e54d7d234b786173c62977a50c7d
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-17 21:05:27 +02:00
Caroline Chao
a530c3381b Test: remove QSKIP in tst_QSharedPointer::lambdaCustomDeleter
Instead omit the whole test when Q_COMPILER_LAMBDA is not defined since
the test is not relevant in that case.

Change-Id: I541da96a881fa0c9be38ae5c0f86df047dd8fc6b
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-16 20:43:37 +02:00
Caroline Chao
c35c913916 Test: remove QSKIP from tst_QThread::stressTest
Instead omit the whole test when Q_OS_WINCE is defined.

Change-Id: Id6f4e65c994115b8bab45f9fbf21dd255d204ea6
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-16 20:43:37 +02:00
Caroline Chao
fdc9ce5908 Test: remove QSKIP from tst_QSocketNotifier::posixSockets
Instead omit the whole test when Q_OS_UNIX is not defined.

Change-Id: If0ee3345c25f6b1baa38845edfd08ec26a45d6f2
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-16 20:43:37 +02:00
Caroline Chao
18a3ebe4e5 Test: remove QSKIP in tst_QDirIterator::hiddenDirs_hiddenFiles
Instead omit the whole test when Q_OS_WIN is defined.

Change-Id: I08060168edb2353f4960129b1c0654fea165ca6c
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-16 20:43:37 +02:00
Caroline Chao
c8c0bdffb7 Test: remove QSKIP in tst_QDataStream::stream_QPixmap
Instead omit the whole test when Q_OS_WINCE is defined.

Change-Id: I356af3ea145012142b3cf2af0b5d813d4be07a25
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-16 20:43:37 +02:00
Caroline Chao
4fc515de4e Test: remove QSKIP from tst_LargeFile::mapOffsetOverflow
Instead omit the whole test when Q_OS_MAC is defined.

Change-Id: I7d35c99ecd69b3c5bb8f8590342edd9665300709
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-10-16 20:43:37 +02:00
Shawn Rutledge
78f946f6dc QScreen manual test improvements: fields resize, better formatting
It's necessary to set the fieldGrowthPolicy on the QFormLayout in order
to have expanding fields on the Mac.  Geometry formatting with
negative x and y values looks better.  Display fewer
decimal digits for double fields.

Change-Id: Icb252c0c3fb7b605253e04c3361beba124570840
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-10-16 17:31:31 +02:00
Frederik Gladhorn
5fb7d6240b Mark linux accessibility test as insignificant.
The test was not run so far and chances are that it would block
the CI completely.
So disable it for now, enable it again as soon as breakages have been fixed.

Change-Id: I452c02027b37a604eefbadb253c9a4d5041ef159
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-10-16 15:29:15 +02:00
Caroline Chao
782cae4104 Test: remove QSKIP in tst_QCoreApplication::argc
Instead omit the whole test when Q_OS_WIN is defined since
the test is invalid on this platform.

Change-Id: Idb77df96b0c2a223cddbfffb4e24c6d1f5d33dfb
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-16 15:29:15 +02:00
Caroline Chao
d81cf44a6b Test: remove QSKIP from tst_qstextstream
Instead omit the whole tests when Q_OS_WINCE is defined.

Change-Id: Idb15d622c9e1dbe4c8ec6a43c34a88e7fef2a384
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-16 15:29:15 +02:00
Caroline Chao
26dddabcaa Test: remove QSKIP from tst_QProcessEnvironment::putenv
Instead omit the whole test when Q_OS_WINCE is defined.

Change-Id: I19e35b837709c92e0202c6a96d113367bc6c92c2
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-16 15:29:15 +02:00
Stephen Kelly
c153f471d2 Remove QImageReader benchmark dependency on QtWidgets.
The QLabel is not actually used.

Change-Id: Ia3f43b734fa52ad002111943ed1ba55b9e8a678c
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-10-16 15:29:15 +02:00
Mark Brand
e437051ff5 QComboBox: replace homebrew with QSignalSpy for editTextChanged test
Change-Id: Id4c81ae71d6dc87f9ad7cfb99a89d335162e1f75
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-16 13:36:43 +02:00
Giuseppe D'Angelo
8f79ab3549 Fix QComboBox icon testing
The icons used were always null -- the files used to create them were
not present. So

1) add back the files used for the test (qtlogo.png,
copied from src/widgets/dialogs/images/qtlogo-64.png, and qtlogoinverted.png,
its copy rotated by 180°);

2) use QFINDTESTDATA to get the paths to the files.

Change-Id: I26f094079e037116e49e2a95345c2dea7496eecb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-10-16 10:47:41 +02:00
Stephen Kelly
f7241e8cb9 Exclude a QCOMPARE in tst_QListWidget instead of excluding the whole class.
The original bug was reported as a different test failing. Looking
through the CI logs, that test now always passes, but fastScroll fails
unstably. The fastScroll test is already excluded on Mac, but the patch and
reason for that predates the public git history.

This is a regression since marking the entire test as insignificant,
and shows why insignification of tests should be as narrow as possible.

Narrow this one now.

Task-number: QTBUG-21098
Change-Id: I0d6c22e422af190c9e6331e123db38022af28e4b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-10-16 08:41:48 +02:00
Stephen Kelly
f696205b37 Use the mkspec name Qt was configured with instead of default symlink
The default symlink is not available on Windows, so the qplatformdefs.h
header is not available there. Instead we can bypass the symlink and
use the actual mkspec name directly.

Change-Id: I1d7e05f35c1ff56befab5bed307cb1755ade8377
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-10-16 08:41:48 +02:00
Janne Anttila
cae1eeafff Mark tst_networkselftest as an insignificant.
The ftpProxyServer test case is failing constantly in Digia hosted
Qt-Project CI system, especially on Windows machines. Because this
failing autotest is blocking the use of Digia hosted CI system,
it is marked as an insignificant for now.

There is a bug report QTBUG-27571 created to fix the problem.

Change-Id: I196ad76823874dbc85b1f5abbaf020e02b3c410e
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-10-16 06:48:06 +02:00
Titta Heikkala
bdcece7d46 Revert a change to printer orientation
Reverting change: Ia6bc9ae14d79a646e61bfc97652f9f5af90738b3
The previous change does not set the printer correctly. It looks
based on the tests that the correct printer is set, but in reality
the default printer is used (even though printerName() is returning
the printer set).

Updated taskQTBUG4497_reusePrinterOnDifferentFiles() test case
so that it generates PDF instead of PS. Testing the binary output
can't be guaranteed to work in this case.

Change-Id: Iee111f2c2dec84f86344a38816c21e191f5373ea
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2012-10-15 22:01:47 +02:00
Miikka Heikkinen
698d5a2b9f Improve Qt::WA_UnderMouse accuracy
Qt::WA_UnderMouse is set/cleared when widgets get enter/leave events.
When there is a popup active, Qt::WA_UnderMouse should always report
false, but this was not happening, because existing state was not
cleared when popup was opened.

Dispatch a leave event for last mouse receiver when a popup is
opened to update the Qt::WA_UnderMouse state. This is roughly
equivalent to what happens on Qt4.

Task-number: QTBUG-27478
Change-Id: I7739e75727213e748ab2f42f1027d32325d89fb0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-15 21:11:57 +02:00
Sergey Hambardzumyan
21b5c1d4a9 tst_qfile: remove QSKIP's -> omit whole test cases instead
Change-Id: Ibc01790992e839e3afde4b52682cb155c7f3f5f8
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-15 20:57:58 +02:00
Konstantin Ritt
3e030a9652 QRawFont: improve performance and safety of glyphIndexesForString()
As of 98c1eb1750, partially initialized
QGlyphLayout is ok for stringToCMap() if GlyphIndicesOnly flag is set,
thus we can use the glyphIndexes buffer directly and avoid copying.
Also add some checks to guarantee we're not falling into an undefined behavior
for the empty text or NULL buffer.

Change-Id: I662953703e4c65edbebabbe4b753972417d963f3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2012-10-15 10:18:31 +02:00
Thiago Macieira
24a231d7a3 Re-revert "Delay creation of the process manager"
This reverts commit daba2c507ad42c66dafa6a29cffa94e9641e0c58,
re-applying commit d9c06bf25210b3d0b31ee6126e57bcb82c292da1, because
the change was accidentally brought back in commit
eae8fb8599.

There's a potential deadlock when a QProcess is created while a
QCoreApplication is instantiated but never executed, or if the main
thread waits() for the child thread.

Task-number: QTBUG-27260
Change-Id: I9e0fdc0341b3063de90979377bac35f2a827b260
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-10-15 04:52:08 +02:00
Olivier Goffart
21426f281e moc: parse properly the gcc extension for variadic macro
Task-number: QTBUG-27547

Change-Id: I983b96b09c405e5330327092e56164b9921a2d0f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-14 20:53:42 +02:00
Rafael Roquetto
703fa6c361 Do not skip tst_QClipboard::copy_exit_paste on QNX
This test is valid on QNX platforms.

Change-Id: Ic9657c2b92628a649ab52367135dcb3a77450913
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-10-13 21:23:12 +02:00
Janne Anttila
faac9bbaf9 Change hostname for dnslookup 'notfound' test cases.
Microsoft DNS server used in Digia hosted Qt-Project CI system,
returns 'Server failed' error for 'invalid.' hostname. Because
the purpose of these autotests is to test 'notfound' use case, it should
be ok to use also 'invalid.invalid' hostname in these DNS queries.

Change-Id: I9e9c829f3858e7fa23feffd2ede018b19f676857
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-10-13 05:51:19 +02:00
Oliver Wolff
57fac2e83a Do not accept key events if a widget is disabled
The disabled state was handled in qapplication_xxx.cpp before.
As the platform integration only knows about windows and
not widgets the state check is now done in qwidget. This commit
just adds key events to the list of events which are ignored
if the widget is disabled. This list also contains mouse events
for example.

Task-number: QTBUG-27417

Change-Id: I55949e1c1aaa992ba71df51c5b5e8177ec6f1e86
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-13 05:51:19 +02:00
Simon Hausmann
9ab8c0ae98 Fix moc preprocessor-only mode with input that contains seemingly invalid identifiers
In WebKit we use moc -E to pre-process various files before throwing at
further build creation tools. The pre-processing is used to filter out
code depending in #ifdef'fed features.

The latest addition to the family of pre-processed files is the CSS grammar,
which is written in Bison. It contains rule lines like

   $$ = parser->createFoo()

and when pre-processing this moc stumbles over the dollar sign. Instead
of ignoring un-tokenizable input we should add it to the current token
if we're in preprocessor-only mode, otherwise the $$ gets eaten and we
produce data-loss by printing out less characters than.

Change-Id: Ib32e7c04b38dd2ba3726201e76f27405f7ea6c0d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-10-13 05:51:19 +02:00
Giuseppe D'Angelo
491247acd4 Make QValidator tests do not require a QApplication
Change-Id: I9aae997e33672203470b0429cc061a1adf88dfe9
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-13 05:51:19 +02:00
J-P Nurmi
6b04ee10e6 Auto tests: revise cursor dependant tests
Cursor dependant auto tests are currently skipped in various ways.
Some are checking PlatformQuirks::haveMouseCursor() that tries to
detect if the desktop environment is MeeGo, using obsolete Q_WS_X11.
Some are skipped if QT_NO_CURSOR or Q_OS_WINCE is defined and
some are actually missing the approriate guards.

=> unify by defining QTEST_NO_CURSOR in qtest-config.h when
appropriate ie. for platforms that have no regular mouse cursor
support or when QT_NO_CURSOR is defined.

Task-number: QTBUG-22551
Change-Id: I9a1e0e3156617945ae46226c79268955454c8a9a
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-13 05:51:19 +02:00
Friedemann Kleint
d738595d71 Stabilize Accessibility/Combo test.
The Windows combo animation causes a delay, introduce
QTRY_VERIFY. Fix warnings about being unable to
set geometry on Windows.

Change-Id: I52ca960c06f023ade3afe85f31deaf8e32edff26
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-13 05:51:19 +02:00
Konstantin Ritt
ec4593d6d0 QGlyphRun: Fix isEmpty() and boundingRect() didn't work after setRawData()
Change-Id: I44a347ef24961493d6b8353abbb215c713ccce52
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2012-10-13 03:17:53 +02:00
Konstantin Ritt
4717d36c91 Fix QTextBoundaryFinder usage cases in QAccessible2
Make the implementation safer and closer to what
http://www.linuxfoundation.org/collaborate/workgroups/accessibility/ia2/ia2_implementation_guide#boundaries
requires us to do.

Change-Id: I00af4697e52a9b6e7f5d7b3f403b29126fa1517b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-10-13 03:17:39 +02:00
Stephen Kelly
ff1a514913 Mark QTreeView test as significant.
I can't find any failures in the CI logs, as reported by the bug.

Even if there is still an unstable test here, it is not appropriate
to mark the entire test as insignificant, as that hides regressions
in the entire class.

Task-number: QTBUG-23638
Change-Id: I1aeaf6e725bf28e9ac03c9330a67e51241b9272b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-10-12 07:52:50 +02:00
Konstantin Ritt
da7111be51 QTextBoundaryFinder: Fix handling of break opportunities
Add BoundaryReason::BreakOpportunity flag that will be returned by the
boundaryReasons() when the boundary finder is at the break opportunity
position that might be not an item boundary.
This is the same as (StartWord || EndWord) in Grapheme and Sentence modes;
in Word and Line modes, BreakOpportunity flag might occur between the words
or in between of Line boundaries (e.g. in conjunction with SoftHyphen flag).
In other words, the text boundaries are always break opportunities, but not vice versa.

StartWord and EndWord flags has been deprecated by new StartOfItem and EndOfItem
flags which are not about the word boundaries only. In line breaking,
StartOfItem and EndOfItem are set for the mandatory breaks only.

Change-Id: I79bf297e2b988f5976f30cff0c8ca616385f6552
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-12 07:44:51 +02:00
Konstantin Ritt
8b41f22f5c Fix tst_QTextEdit::fullWidthSelection2() for shadow build
Search for the test data files in the test data directory, not in the current dir.

Change-Id: I746e717bae575364102c1bb5c2888332d94c374f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-12 07:44:34 +02:00
Samuel Rødal
dfb55f8a6c Fixed cosmetic line drawing where begin and end points are equal.
This case has typically required specific work-arounds in other
rendering paths as well.

Task-number: QTBUG-25153
Change-Id: I217e710a30222792ebca3bf297e438d944c32992
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-11 13:11:48 +02:00
Pierre Rossi
9adf7fb708 Revert "Handle additional format ranges when itemizing."
This reverts commit 101d04681f.
That change seems to have introduced a few regressions, and
Creator hits an assertion that it introduced because it assumes
the additionalFormats consists of well-formed ranges
(QTCREATORBUG-7995).

Change-Id: Ic4ae761e6e7f6df8a6b5ca565ceb250647420c15
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-10 23:27:03 +02:00
Giuseppe D'Angelo
361ab4fe86 Move QValidator tests to QtGui
Q*Validator classes are not in QtWidgets,
so move them where they should stay.

Change-Id: Ie6ea45a026e640fad131002bc9762c575235f3f4
Reviewed-by: David Faure <david.faure@kdab.com>
2012-10-10 23:27:03 +02:00
Morten Johan Sorvig
d4d81fe68a Remove handleSynchronous* functions.
There are now two different ways to implement synchronous
event processing. The platform plugins can choose which
one to use.

1) flushWindowSystemEvents()
   Use to flush the event queue at one point, making
   preceding calls synchronous.

2) setSynchronousWindowsSystemEvents(bool enable)
   Makes all handle* functions synchronous, bypassing
   the event queue completely.

Change-Id: I020b80c731fd13f855a377d7c91d06a4e39b6a0b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2012-10-10 19:49:22 +02:00
Jan Arve Saether
9f96bf2023 Fix a regression with regards to hfw behavior in QStackedWidget
This is a regression because we made QStackedWidget actually
support heightForWidth in 4.8. This was done with change
4780f94e391b5e881497c5228661dead42c821fa.

The problem was that heightForWidth was not calculated correctly
because some of the pages were hidden. The hidden pages were
actually not contributing to the hfw of the QStackedWidget at all.
This again caused the QStackedWidget to change its heightForWidth()
value when the current tab changed, which again could cause "jumps"
in the UI when switching tabs (as demonstrated in the task).

The problem was that the patch relied on calling
QWidgetItem::heightForWidth(), and this function would return -1
if the widget was hidden. However, QWidget::heightForWidth() does
not have this magic and returns the proper hfw value regardless
of its visibility.

One could argue about the correctness of this patch, but since
QStackedLayout::sizeHint() disregards QWidgetItem::sizeHint() (it
asks the widget directly), we do the same in
QStackedLayoutHFW::heightForWidth() for consistency.

In addition, QStackedLayout enforces that only widgets can be added
to it, and you cannot add your own QLayoutItem subclasses to it:

  qWarning("QStackedLayout::addItem: Only widgets can be added");

Task-id: QTBUG-24758

Change-Id: I349cf8f4215e4581ea237ef773d53dcdf3db176b
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2012-10-10 14:22:58 +02:00
J-P Nurmi
f92f78094d tst_QMenuBar: remove QSKIP's -> omit whole test cases instead
Change-Id: I2cf356c5790fd7f2b27a9032e2effacd098b3d05
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-10 14:04:02 +02:00
Konstantin Ritt
f0ee31dc93 QTextBoundaryFinder: Introduce BoundaryReason::MandatoryBreak flag
that will be returned by boundaryReasons() when the boundary finder
is at the line end position (CR, LF, NewLine Function, End of Text, etc.).
The MandatoryBreak flag, if set, means the text should be wrapped at a given position.

Change-Id: I32d4f570935d2e015bfc5f18915396a15f009fde
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-10 13:26:13 +02:00
Konstantin Ritt
008e5ba61a Invalidate old QImage data if load()/loadFromData() has failed
This guarantees one will never get `!img.isNull()` after
load()/loadFromData() has failed, even if the image was
not null before.
Apply the same fix to QPixmap and QPicture.

Change-Id: Ida1ad6a6f0fc830df8e75ada0c163fc2d3360dea
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-10-10 13:24:23 +02:00
Gabriel de Dietrich
06332df743 Mac: Bring back "Text boxes and list only" tab navigation
Added ThemeHint::TabAllWidgets as a mean to access that platform
specific bool. The default implementation returns always true when
querying QPlatformTheme::themeHint().

Several auto-tests had to be updated to reflect for qt_tab_all_widgets'
type change. One XFAIL removed from tst_QApplication::focusChanged().

Task-number: QTBUG-24372
Change-Id: Ie1f0486c19898fe54c53aa4a27e378485075e512
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2012-10-10 13:15:57 +02:00
Gabriel de Dietrich
5715455901 tst_QApplication: Make sure the native style is being used
The tst_QApplication::args() auto-test sets the style to windows style
but there is no way to reset the style back to the native one. This
makes tst_QApplication::focusChanged() fail on Mac in some cases,
since not all the styles respond the same way to tab vs. strong
focus changes.

Change-Id: I91e39c1dd0fad4d90f3a13ab50a5e9758922ac28
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2012-10-10 13:03:00 +02:00
Stephen Kelly
43325a23f3 Delete the QVariant ctors taking global Qt enum values.
They have unexpected results in Qt 5 (the Qt::GlobalColor one works
as expected in Qt 4, but was removed in Qt 5):

 QVariant v = QVariant(Qt::red);
 qDebug() << v; // QVariant(int, 7)
 v = Qt::red;
 qDebug() << v; // QVariant(int, 7)

The correct way is to use:

 QVariant v = QVariant::fromValue(QColor(Qt::red));

The deleted constructors are the ones for which there is a class
with an implicit constructor taking the enum, and that class is
a built-in metatype.

QLocale::Language and QKeySequence::StandardKey would also fit
the description, but I can't include the header for QKeySequence
as it is in QtGui, and I don't want to include the qlocale header
in qvariant.h. Putting a QLocale::Language is probably very
uncommon anyway.

The QTextFormat test is doing the wrong thing, but the result isn't
being tested. Added new tests which fail before the patch.

Change-Id: Ia38a0784990f4d40ff7457a86daf58aabd4964eb
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-10-10 08:45:22 +02:00
David Sansome
c3ffcbd9a2 Scale icons returned by QIcon::fromTheme.
The icon engine behind icons that are loaded from QIcon::fromTheme does
not scale any pixmaps that it returns. When using an icon theme with an
incomplete set of icons (for example, only a "128x128" folder),
QIcon::pixmap will always return 128x128 pixmaps even if you ask for
one of size 22x22.

This is contrary to the QIcon::pixmap documentation that says "The
pixmap might be smaller than requested, but never larger."

This patch uses the same code that is in the main QIcon class in the
PixmapEntry QIconLoaderEngineEntry to scale pixmaps if they are too big.

Change-Id: Ic25a3628ac82cfb899574245f658490a2dd49d54
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-10-10 08:45:22 +02:00
Jon Severinsson
85c47eed6b Change QDateTime::addSecs() and QDateTime::secsTo() to use qint64.
addMSecs() / msecsTo() have always used qint64, and when QDate was changed
to use a 64-bit julian day, QDateTime::addDays() and QDateTime::daysTo() was
changed to use qint64 in order to support the full extended range, but
addSecs() and secsTo() seems to have been forgotten.

Change-Id: I3acc35ee2bcc9f353650eb42f97d428f706b2db6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-10 08:45:22 +02:00
Konstantin Ritt
2672c4fa91 Update the Unicode Data and Algorithms up to Unicode 6.2
Version 6.2 of the Unicode Standard is a special release
dedicated to the early publication of the newly encoded Turkish lira sign.
In addition, there are some significant changes to the Unicode algorithms
for text segmentation and line breaking to improve breaking for emoji symbols.

For more details, see http://www.unicode.org/versions/Unicode6.2.0/

Change-Id: I21cfd4f307e41b41a19d36cce87f7a44c2661bc2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-09 03:04:41 +02:00
Rohan McGovern
0776746d47 tst_qfiledialog: fixed typo causing semi-random completer() failure
completer_data() was attempting to find the first folder which did
not begin with a '.' character under QDir::root() for usage during the
test.

However, a typo caused it to find the first folder even if it _did_
begin with a '.'; unless the first folder returned by entryList()
was ".", in which case no folder would be found.

Change-Id: Ie95f1add797973d06a8d5f2fa32935366a008de5
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-09 00:25:57 +02:00
Christian Strømme
0ed3cf2a1c Removed the "tst_QVector::outOfMemory" test.
The test is useless as we assert if the requested size exceeds
a certain limit. We could, as an alternative,
throw an exception, but in the end it's the caller's responsibility
to ensure that the requested size is a sane value.

Task-number: QTBUG-27285
Change-Id: I738950a6a2b51671a54e4d25c7e4c3ac0d7f63b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-08 17:38:20 +02:00
Friedemann Kleint
27e901de92 Stabilize test qmenu::pushButtonPopulateOnAboutToShow().
Do not leave an allocated menu in member lastMenu behind that
interferes with the consecutive QTBUG7907_submenus_autoselect().

Change-Id: I80fc9de9ca63367264f642023a244c1d7d8ada7f
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
2012-10-08 17:27:57 +02:00
Pierre Rossi
101d04681f Handle additional format ranges when itemizing.
This is useful when the additional formats are used on a
text layout using a raw font. It can also come in handy for
input methods operating on a QTextDocument.
We now consider all format range edges to generate the
associated items. The capitalization can be overridden via
the additionnal formats mechanism.

Adds an autotest that checks that this works with font capitalization.

Change-Id: I782d2c48d05b0dfbad480a9ca77198465292b358
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-08 17:22:56 +02:00
Friedemann Kleint
0e8a2788d8 Fix Windows: QStandardPath::findExecutable() to check suffixes.
Append the Windows executables suffixes from the PATHEXT
environment variable.

The previous code had a bug since the 'break' statement
bailed out of the inner loop only.

Factor search code out into a separate functions, avoiding
repeated invocations of list.constEnd() and variable
assignments in the old code.

Add a static function that is called on Unix and on Windows
for executable names with a suffix.

Call another function applying a candidate list of suffixes
in case an executable name without a suffix is passed.

Lower case the extensions from PATHEXT, streamline code.

Split up the test, add a _data() slot for clarity.

Task-number: QTBUG-27457
Change-Id: I2bf34de52aeadddd3b937ad1e22191c3c850fd26
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-10-08 17:21:35 +02:00
Thiago A. Correa
7e6e141234 QSqlQuery::value string overload
Introduce value overload to take field name as a parameter.

This allows for terser application code that avoids explicit
calls to QSqlRecord::value().

Change-Id: I02b6712cd5ec41633b902714315b5716c17d1a9b
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-10-08 08:55:28 +02:00
Friedemann Kleint
274c258521 Use jom in tst_qmake.
Speed up compiling the tests.

Task-number: 26023

Change-Id: Ib5e872cc6cde09ac90f426a8f6e7cfea509d02e2
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-10-08 08:46:21 +02:00
Friedemann Kleint
8924506992 Increase tst_qmake more time on Windows.
The test compiles examples, which takes a long time.

Task-number: 26023
Change-Id: If794b046aa07737f3076aace8d585dc44027cc6b
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-10-08 08:46:07 +02:00
Mark Brand
244eeae406 QSqlTableModel::selectRow(): don't expand cache if there is no change
Test added.

Change-Id: Ibd72ef2aeee482abbd22991573460e55dc577457
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: David Faure (fixes for KDE) <faure@kde.org>
2012-10-05 03:16:25 +02:00
Mark Brand
c1f15c0485 QSqlTableModel: record(row) must use virtual data()
Commit fbf010a266 introduced a version
of record(row) that includes the generated flags, but it neglected to
populate the values using virtual data() as QSqlQueryModel correctly
does.

Test included lest we forget again.

Change-Id: I49d0f8f87cd0c5078aa6a0e8373b2cffc01f2387
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-05 03:16:22 +02:00
Mark Brand
a97c2d8c83 QSqlTableModel: restore use of virtual setData() in setRecord()
setRecord() should use setData() as intended so that reimplementations
of setData() in subclasses will be respected.

Commit 11bd543d90 failed to consider this.

Test added which should prevent this mistake being repeated.

Change-Id: Ia2d930cd42b5a27521bb389edb1b07fb1bf0fa36
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-10-05 03:16:21 +02:00
Mark Brand
10ff9de91b QSqlTableModel: don't cache unchanged value in setData()
This is good for performance in terms of avoiding unnecessary
database activity and keeping the cache smaller.

Detail:
This change was not included in the big refactoring of QSqlTM. The
idea was that the model shouldn't second guess the intention of the
application and maybe the application wants to cause a submit.
It was a marginal consideration.

Now I think it's clear that our interest in not unnecessarily
expanding the cache outweighs that. In addition, applications can now
call selectRow() if they worry that the database values for the row
have changed and want to set a value back again.

Test added.

Change-Id: I63814dcb63a96c6ba1c8cc227807725a954a0b68
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2012-10-05 03:16:19 +02:00
Mark Brand
5fe272f68a QSqlTableModel: fix segfault when overriding selectRow()
The STL-style iteration over the cache in submitAll() assumed the
iterator would remain valid until reaching cache.end(). This failed
to consider that virtual selectRow() might be overridden so that
it removes rows from the cache. For example, it might call select()
which would empty the cache.

The new approach checks at each iteration whether the row is
still in the cache. Using foreach here is justified by its fitness
for purpose and readability.

New test included.

Change-Id: Idee8807ede239c3ba56ff1604574c49f47385ad2
Reviewed-by: David Faure (fixes for KDE) <faure@kde.org>
2012-10-05 03:16:12 +02:00
Sergio Ahumada
92c756677f test: Remove QSKIP from tst_QToolButton::triggered()
This test actually passes on Mac OS X, so removing the QSKIP

Task-number: QTBUG-24374
Change-Id: I0b761ca9c30afc9d511e9962ee1c0958b863b374
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-04 12:55:23 +02:00
Stephen Kelly
f37d3e2cd9 Fix segfault when delegates change properties on editors.
The solution is similar to that
in b84e180263 which affected
QSortFilterProxyModel.

Task-number: QTBUG-25370

Change-Id: I6bbb9d9786bcb2c9fa8027ab8a7cc13664784b8d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-04 12:15:49 +02:00
Stephen Kelly
d24b867e56 CMake: Improve QT5_GET_MOC_FLAGS macro
We need to handle CMAKE_INCLUDE_CURRENT_DIR for include directories.
Otherwise generated files located in the current binary directory are
not found as expected.

e.g. *.json file as meta data for Qt5's plugins generated at build time.

Change-Id: I14ae1e7013f9d8b485aa990d50db4a03ca4f4b81
Reviewed-by: Yuchen Deng <loaden@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-10-04 11:58:48 +02:00
Sergio Ahumada
b4bf76fffc tst_QLocale: remove QSKIP, wrap Q_OS_MAC/Q_OS_WIN
Change-Id: I44755379561b98e43dd19c8c01b40349be203e14
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-10-04 09:09:15 +02:00
Leonard Lee
122b09c1d0 Remove #if 0 usage in QElapsedTimer autotest.
Given QElapsedTimer t1, t2 variable, the t1-t2,
t1+1000 (add 1 second) operations not supported.

Task-number: QTBUG-22446
Change-Id: Idd87f778c212831aa7f92242452538d113c9cfcf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-04 03:03:35 +02:00
Leonard Lee
679a4e98c7 Fix #if 0 usage in collections autotest.
Removed inappropriate use of #if 0 in collections autotest.

Task-number: QTBUG-22471
Change-Id: Ibf4e5fae8e671ebfd0dc5734875fcc8879b330af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-04 03:03:17 +02:00
Frederik Gladhorn
375f5b4424 Remove unused function.
Change-Id: Ie8eecf7e4a7475ac84a66b6055149ce92d019785
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2012-10-03 17:34:40 +02:00
Christian Strømme
403b15488b Fix for integer overflow in QString::replace
Task-number: QTBUG-22967

Change-Id: I604e6a725d46eab4c4369ebb54e8c9ea1350f492
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-03 17:30:30 +02:00
Konstantin Ritt
3d620088b4 Fix QTextBoundaryFinder assignment operator
for the case when the boundary finder is assigned to an invalid one.

Change-Id: I5b60984ff3fd99972fcae21895684bd83b012780
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2012-10-03 16:34:32 +02:00
Thiago Macieira
f89fd779fc Overhaul a little the QUrl error reporting.
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>
2012-10-02 22:34:42 +02:00
Thiago Macieira
4f52a95099 Update some error messages in QUrl::errorString()
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>
2012-10-02 22:34:42 +02:00
Thiago Macieira
ceca141d0c Remove the annoying qWarning when QUrl::setPort is out of range
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>
2012-10-02 22:34:42 +02:00
Thiago Macieira
59ad0019dc Make QUrl::errorString() usable for QtTest output in invalid URLs
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>
2012-10-02 22:34:42 +02:00
Thiago Macieira
adce435a0c Make QUrl::toString() / toEncoded() return empty for invalid URLs
Change-Id: I6ebb4ad2901a9bacb09fb81082202f37ebbc2e97
Reviewed-by: David Faure <faure@kde.org>
2012-10-02 22:34:42 +02:00
Thiago Macieira
7d62f8ace5 Add two compound URL invalidity cases for isValid()
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>
2012-10-02 22:34:42 +02:00
Thomas Hartmann
ad41111167 QProcess.tests: adding test for channel forwarding
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>
2012-10-02 13:22:49 +02:00
Andy Shaw
ef3a544436 Rename createLocalFile to createNativeFile & deprecate createLocalFile
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>
2012-10-02 10:43:48 +02:00
Joerg Bornemann
07c95ad7f3 typo fixed in tst_QLocalSocket::verifyListenWithDescriptor_data
Change-Id: Ic549c8fa7f98052a45b391d6a9bfef3d2557c709
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-10-02 08:06:11 +02:00
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
Caroline Chao
e14099cfbc Test: Remove QSKIP from tst_QWidget::raise
Remove QSKIP("Not yet sure why this fails."), the test is passing
on Mac.

Task-number: QTBUG-22321

Change-Id: I5f09d067b1cc837c5e3ada5bbd34091fe1fd723d
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-09-25 18:36:32 +02:00
Caroline Chao
9f98fe04c1 Test: tst_QFile::writeLargeDataBlock() unstable failure as XFAIL
The current check is not enough to catch the unstable failure.
Update the test to catch the failure in all cases.

Task-number: QTBUG-26906

Change-Id: I2e37a1f6513df768cd410df7c91a9fd843150e57
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-25 18:36:09 +02:00
Caroline Chao
01a985ac5b Test: Remove QSKIP from tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut
The test is passing on Ubuntu 11.10.

Adding qWaitForWindowExposed after the line edit show() call to ensure
the line edit is actually shown on the screen.

Task-number: QTBUG-24518
Change-Id: I2af65bef76d171b36032120738dfbd7cfff51d7f
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-25 18:36:01 +02:00
João Abecasis
0c2b7b1020 Fix default-constructed QFileSystemEntry
Member variables for lastSeparator, first and lastDotInFileName are now
initialized to -1 (non-existing), where the previous value of zero would
mean a separator/dot at that position and resulted in path() returning
'/', instead of '.'.

Tests were expanded for better coverage of empty state and
default-constructed instances.

Change-Id: Ie27547886b52224d38b5be0b4f920c9927fd440f
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-25 00:08:16 +02:00
Lars Knoll
6ddef0007a Test case for moc handling defines
Added some test cases that check that moc
correctly expands #defines

Change-Id: I7fe6eed129d46ca9281d73064571cae43b32410d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-25 00:08:16 +02:00
Mark Brand
7389c09637 QSqlTableModel::selectRow(): fix failure on uncached rows
This method was originally intended for refreshing rows after
submitting changes. It should also work for refreshing rows
that are unchanged (i.e., not cached), but did not because
constructing the primary values depended on the cache. As a
consequence, the WHERE clause for the query was not created.

Fixed by deriving primary values for uncached rows from the
query record. Note that the cache is still authoritative for rows
it holds. This is important because the prmary values there may
differ from the original query record due to changes to columns
of the primary key.

Includes new test.

Change-Id: I41cca2cbf26019d4b495ffa6d876e2b55ec57803
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-09-24 21:27:51 +02:00
Andy Shaw
8b7b6b6969 Add a manual test for QMacCocoaViewContainer
Added a test for QMacCocoaViewContainer which will enable the testing
of the fixes coming

Change-Id: I73e9540bc58411634f0da7d398eca4b7ffafba8e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2012-09-24 21:27:51 +02:00
Caroline Chao
99f2bdd28f Test: Enabled tst_QFile::invalidFile
The test is not hanging on Windows anymore.

On Windows, add an expected failure for the failing case.

Task-number: QTBUG-22801
Task-number: QTBUG-27306

Change-Id: Iede95766504f3e8a278a4554a5967ca333aae3bf
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-24 21:27:51 +02:00
Thiago Macieira
3827fd2a37 Add some tests for compatible and incompatible custom deleters
Change-Id: I2bb7f597aab0f00a250881602e6a6bb7bfe42e18
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-24 21:27:51 +02:00
Stephen Kelly
05aa8c6c12 Implement viewOptions() logic in QListViewPrivate.
The private method is called in several places in QListViewPrivate,
but before this patch, the implementation in QAbstractItemView was
 called. This meant that the options were not set properly,
resulting, for example, in icons in icon mode being laid out in
list mode (on the left and small).

This is a regression resulting from
8eab9cbce2 and
3578e05b29. Other views are not
affected in a similar way.

Change-Id: I753cb99410e367266753eaf2fa43361b9212ab96
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-24 18:01:07 +02:00
Jędrzej Nowacki
c06106f28d Fix potential breakage in QString.
Negation operator ("!") have precedence over bitwise and ("&").

Change-Id: I39e2d99da6eaa4477bbe35a1259f745e05c9841a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-24 16:53:13 +02:00
Marc Mutz
c00bd8d677 Use QStringList::join(QChar) overload where applicable [QtCore]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: I81c378ef6aeeada5e116f1394cc9fc67f901ffd6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-23 23:30:18 +02:00
Sergio Ahumada
1395b81935 test: Remove QSKIP from tst_QFocusEvent::checkReason_ActiveWindow()
This test actually passes using the "xcb" platform and fails otherwise.

Second, the Jira task is misleading since it refers to
tst_QFocusEvent::checkReason_Shortcut()

Change-Id: Icab91ace8c214d958b534c5cebae900242522372
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-22 23:40:02 +02:00
Friedemann Kleint
f6155aec30 Redirect keyboard/mouse grab to the widget parent window.
Use the native parent's window if the widget in question does not
have one. This should be in line with Qt 4.8 using effectiveWinId().

Remove redundant code in grabMouse(QCursor).

Change-Id: Id6ab192e739221fe89f865f4d2f7a6d4671a190b
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-22 20:46:30 +02:00
Marc Mutz
15953e9503 QModelIndex: clean up integer size confusion in the API
QAIM::createIndex() took either int or quint32, but QMI::internalId()
returned qint64.

In the new interface, createIndex() takes, and internalId() provides,
integers of type quintptr.

This matches the storage size of the void* in the model index and
avoids truncation.

Remove the
  createIndex(int, int, quint32) and
  \obsolete createIndex(int,int,int)
overloads.

This makes a literal 0 in the third parameter ambiguous now.
The solutions have been noted in changes-5.0.0.

Change-Id: I0a0ecd8430eaf695129a4d09d14d4e30745485c4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-22 20:45:12 +02:00
Iikka Eklund
be15856f61 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-22 19:20:11 +02:00
Konstantin Ritt
ceb9a8232c A step out from Harfbuzz (reduce dependency)
Introduce QCharAttributes and use it instead of HB_CharAttributes everywhere in Qt
(in Harfbuzz, the HB_CharAttributes is only used in the text segmentation algorithm
which has been moved from HB to Qt (well, most of it)).
Rename some members to better reflect their meaning,
remember to keep HB_CharAttributes in sync with QCharAttributes.
Also replace HB_ScriptItem with a (temporary) QUnicodeTools::ScriptItem struct
that will be replaced with a more efficient/friendly solution a bit later.

The soft hyphen and the mandatory break detection has been factored out
of the default text breaking algorithm to a higher level in order to refactor
the QCharAttributes bitfields and to optimize the implementation for the common case.

Change-Id: Ieb365623ae954430f1c8b2dfcd65c82973143eec
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-22 00:47:40 +02:00
Caroline Chao
e3d334e7c3 Test: Update QSKIP message of tst_QVector::outOfMemory
This test is crashing. Specify the bug report number in the QSKIP
message.

Task-number: QTBUG-22343
Task-number: QTBUG-27285

Change-Id: I4d4ead4f54944a545103a3d01c5c9d302d7fb1df
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-22 00:47:40 +02:00
Caroline Chao
e7dccd9e03 Test: fix warning for tst_QPluginLoader::loadGarbage
Garbage libs (under elftest) are numbered from 1 to 5 and not from 0 to 4.

Change-Id: Ia0162372bf5cd1fb53a0442543c5a65716880611
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-22 00:47:40 +02:00
Samuel Rødal
ed8dec360c Fixed multiple modal windows from all blocking each other.
A modal window in front in the modal window list should never be blocked
by a modal window further back in the list. This was taken care of in
QGuiApplicationPrivate::isWindowBlocked(), we just need to make sure it
gets called when a new modal window gets shown so that its blocked
status is up to date.

Task-number: QTBUG-27206
Change-Id: I590f1715e66067edb178081352636f34fe54a885
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2012-09-21 22:04:00 +02:00
Shawn Rutledge
f4c1ae6726 Added manual test for QScreen properties
Shows property values in fields which auto-update when the properties
change.

Change-Id: Ib97566a74cb8d0fff5f85bf97783e89dfb07481f
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-09-21 22:03:53 +02:00
Jens Bache-Wiig
fe966e5f48 Fix regression in QAbstractScrollArea
The style hint SH_ScrollView_FrameOnlyAroundContents was currently
being ignored by QAbstractScrollArea. This looks like an accidental
regression following 10c6f015f4.

This code path does not execute on mac so it should have no impact
on that patch.

Change-Id: I78ca0a6b87dfdd7d426acbb3ef49480390211af2
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-09-21 02:44:22 +02:00
Samuel Rødal
72aaba336c Fixed inconsistent rounding of square cap pens.
A horizontal line should round up at the same time as a vertical line
with square cap, when rendering at subpixel coordinates. Thus, the
special casing in the cosmetic stroker of offsetting by half a pixel
should be for flat caps instead of for square caps.

Task-number: QTBUG-26013
Change-Id: Ic09249337f814c7de95a17976ec9e651561a744b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-20 23:08:44 +02:00
Oswald Buddenhagen
33e0d5c939 remove mentions of borland from project files
Change-Id: I3049b24ae287bee50aca1de06664a2309df69edf
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-09-19 19:54:44 +02:00
Mitch Curtis
63bc298fb3 Pass correct argument to QShortcutEvent ctor in tst_qabstractbutton.cpp
The QShortcutEvent constructor takes "int shortcutId" as its second
argument, not a bool. Since the default shortcutId is 0, this test
passed, since false == 0.

Change-Id: I43bbae4613f3badb1578dccec76dcdd3c96a3a2f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-19 19:54:44 +02:00
Miikka Heikkinen
ede4f5e23b Fix mapping to/from global coordinates for child/embedded windows.
QWidget's mapToGlobal() and mapFromGlobal() functions assumed that
if the widget reports it's a window or if it has no parent widget, it
must be a top level window whose coordinates are in global coordinates.
This is not true for child QWindows or embedded native windows
(QAxWidgets).

Changed the logic for mapping coordinates to use equivalent methods
from QWindow if widget has a window handle, and changed QWindow's
methods to map coordinates using native methods if window is embedded.

Also fixed newly failing accessibility autotest. The geometry related
failures there popped up because now the position of the rect returned
by accessible interface is actually correct while widget geometry still
reports position 0,0 before widget has shown up.

Task-number: QTBUG-26436
Change-Id: I658fafd0ce01eb1604ba255efeeba3073ca0189f
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-09-18 14:52:38 +02:00
Richard Moore
5ea896fbc6 Disable SSL compression by default.
Disable SSL compression by default since this appears to be the a likely
cause of the currently hyped CRIME attack.

Change-Id: I515fcc46f5199acf938e9e880a4345f2d405b2a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2012-09-18 14:12:17 +02:00
Tomasz Duda
60f4fc8b70 HTTP header may be damaged - fix, unit test
"HTTP/1.1 100 CONTINUE\r\n"
If the header from a server is splitted between two packets
the first packet contains "HTTP/1.1 100" and the second one
contains " CONTINUE\r\n", one space (0x20) is skipped. After
processing the line looks in this way "HTTP/1.1 100CONTINUE".
QHttpNetworkReplyPrivate::readStatus(QAbstractSocket *socket)
is called twice, if a http header is splitted as above.
The function always removes whitespace from the beginning of a packet,
even if it is the second part of a http header.

QHttpNetworkReply returns QNetworkReply::RemoteHostClosedError
due to damaged http header during processing.

Improvement of unit test.

Task-number: QTBUG-27161

Change-Id: Ifc2949f62473209b4032185effbf5078b4130cda
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-18 00:59:08 +02:00
Sergio Ahumada
f0b922a3af test: Mark tst_QTabBar::sizeHints() failure as XFAIL
The test has one stable failure on Mac OS X, so mark this
with QEXPECT_FAIL and remove the QSKIP

Task-number: QTBUG-22320
Task-number: QTBUG-27230
Change-Id: I7660df5770c39788792068a5b68e8236551288c4
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
Reviewed-by: Caroline Chao <caroline.chao@nokia.com>
2012-09-17 09:14:05 +02:00
J-P Nurmi
7329ad3ee5 Attempt to stabilize QMenu auto tests
Change-Id: I7d8260570a280182990d78e07d696aa4b46e1747
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-15 19:35:25 +02:00
Rafael Roquetto
31f94e0285 Blackberry: fix tst_QFileInfo::fileTimes()
The Blackberry OS uses a filesystem with the noatime option,
which returns a "wrong" access time.

Change-Id: I04cdb899699e819a36e0917e30d750067b33388d
Reviewed-by: Tobias Koenig
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Peter Hartmann <phartmann@rim.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2012-09-14 19:07:15 +02:00
Kai Koehne
1dd4790aee Autotests: Use qInstallMessageHandler
qInstallMsgHandler got deprecated in Qt 5.

Change-Id: Ib36983e66b3a8090b99f14e3fd4e210602a3f018
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-14 15:23:15 +02:00
Pekka Vuorela
5f974a4faf Avoid deprecated QTest method in unit test
Change-Id: I1d6fc84962ba29a8963f99b87cccb4af465a2935
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-09-14 11:18:17 +02:00
Sergio Ahumada
34cd8fd566 tests: Don't omit the body of a test function with QT_BUILD_INTERNAL
Changing it outside of the test function definition to avoid running
empty/inapplicable test functions.

Change-Id: I713560cde7f715696984ed082d682900f5f1bcdd
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Caroline Chao <caroline.chao@nokia.com>
2012-09-14 06:24:38 +02:00
Jan Arne Petersen
a386194f99 Fix QDBusServer with more than one connection
Create a new QDBusConnectionPrivate for every new connection in
qDBusNewConnection instead of creating a single QDBusConnectionPrivate
in the QDBusServer constructor which gets assigned the latest connected
DBusConnection in qDBusNewConnection (and loses track on all previous
DBusConnections).

Also extend tst_QDBusConnection::registerObjectPeer() test with multiple
connections to the server.

Task-Number: 24921
Change-Id: I4341e8d48d464f3fe0a314a6ab14f848545d65a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-14 01:02:06 +02:00
Thiago Macieira
81b00670f2 Use QElapsedTimer instead of QTime to measure elapsed time
QElaspedTimer is a lot more efficient.

Change-Id: I66d9514108f800a45181d8960b01a5e7d3fa9e80
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-13 22:40:34 +02:00
Thiago Macieira
53a7778b90 Increase the fuzziness of the QSemaphore test to 50 ms
The test tries to acquire a semaphore that isn't ready, so it will
timeout. The test is working properly.

The only problem is that 10 ms is too strict. For a wide variety of
reasons, especially since the Qt CI system runs multiple tests in
parallel, the program may not run again in that 10 ms window.

Change-Id: Ic0f684895f73646db5f1cc783fe9ef75fb1ab02b
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-13 22:40:27 +02:00
Markku Heikkila
d1d4647b74 Fixed: QFileInfo::lastModified() returning wrong value.
Fixed so that empty QDateTime is returned for non existing file.
Fixed also created() and lastRead() to return empty QDateTime for
non existing file.

QFileSystemEngine::fillMetaData() returned true for non existing
files. This was also corrected.

Task-number: QTBUG-25811

Change-Id: I523eb99e4405b4b813b2950f85cc646239181d07
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Christian Stromme <christian.stromme@nokia.com>
2012-09-13 19:33:08 +02:00
Caroline Chao
cecc2c6851 Test: Redo remove QSKIP from printsupport tests
Redoing 5704cbc462

This can't work, because the define comes from qconfig.h, not qmake.

Skipping initTestCase and cleanupTestCase when QT_NO_PRINTER is
defined.

Change-Id: I2527c018294b7518a4692f2c93da933848640b5d
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-09-13 19:33:08 +02:00