Commit Graph

3105 Commits

Author SHA1 Message Date
Frederik Gladhorn
dc532a6bef Accessibility: clean up test
Use smart pointers.
Navigation to siblings is long gone.

Change-Id: I81a10633960eefb9738990682734dcfbdd65330c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-11-05 19:05:04 +01:00
Sergio Ahumada
ccc4fbdf3f test: Remove some QSKIP's from tst_QStyle
Change-Id: Ic277889a75871a8bf72ab2eb2b97e6deeed498e9
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-11-03 11:21:47 +01:00
Antti Harju
8fb379dc8a Improve QByteDataBuffer::read() performance with partial reads
Add a read position variable to eliminate excessive memcpy'ing when
reading a partial buffer.

Specifically, fix performance issue of reading large files from
QNetworkDiskCache in QtWebKit2.

Task-number: QTBUG-27522
Change-Id: I21edc909bf9223971b2c3db5f1fa6b89c5b61c5f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Antti Harju <antti.harju@ixonos.com>
2012-11-03 00:24:37 +01:00
Thorbjørn Lund Martsum
e0fc088c0c Qt 5.0 QTreeView. Prevent manual moving of the first section
This prevents the user of moving the leftmost column.

There will be no API to allow move of the tree-structure.
It is very weird to do that, so it shouldn't be a problem.

In case it is a big problem somewhere it can be hacked with:
QTableView unused;
unused.setVerticalHeader(tree->header());
tree->header()->setParent(tree);
unused.setVerticalHeader(new QHeaderView(Qt::Horizontal));

Task-number: QTBUG-332

Change-Id: I3a251c8d0fd472ec0ad7edb20a7f3e00af7e0da8
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-11-02 19:49:22 +01:00
J-P Nurmi
3c2bfbff5f Mac: refactor scrollbar animations
Get rid of QWidget-centric QMacStyle::eventFilter() and implement the
fade out animations for scrollbars using QNumberStyleAnimation-based
QFadeOutAnimation.

Change-Id: I2000fa50d46b153e981ceafc12a53932a196382e
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-11-02 19:49:22 +01:00
Mitch Curtis
61e0fa5d68 Make it obvious that adding a QLayout to QSplitter is not supported.
It does not make sense to add a QLayout to a QSplitter, since the
splitter manages its child widgets in the same manner as a QLayout.
The result of doing so is that the child widgets inside that layout
will lead to the splitter and the layout fighting to position the child
widgets.

QSplitter::addWidget should be used to add widgets directly to the
splitter instead.

Change-Id: I640b463cae8673f87354d28636bff4dd3cfb9679
Reviewed-by: Samu Voutilainen <samu.voutilainen@gmail.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-11-02 18:07:54 +01:00
Jens Bache-Wiig
28f36ebcc2 Fix progressbar animation on macstyle
The animation is not just supposed to run when indeterminate, but
also while it is progressing.

Change-Id: If176bd230c2f6f83781e01ea77526c24d54c8477
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-11-02 18:07:35 +01:00
Stephen Kelly
9dfba89c28 Add implementations of QAIM::sibling in public APIs.
Change-Id: I2248641f2ed8735c28bd9572470520995a4a5b62
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-11-02 16:25:02 +01:00
Joerg Bornemann
000025ca1e speed up tst_QLocalSocket::readBufferOverflow
Ifdef out waitForBytesWritten on Windows.
See comment in source.

Change-Id: I7a2268d2634c2524cd8291c72dd9708e430e314e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-11-02 15:59:57 +01:00
Joerg Bornemann
c6f3d919dd fix error handling bug in QWindowsPipeReader
If ReadFile returns with an error then we must set our internal state
accordingly. QWindowsPipeReader::readSequenceStarted must be set to
false. If ReadFile fails, we're not within a read sequence.
Also, we must handle the ERROR_BROKEN_PIPE error.

Task-number: QTBUG-25342

Change-Id: Ic9247f170fa9cc47fa7e45d0f47ccfedac06a593
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-11-02 12:16:49 +01:00
Joerg Bornemann
44e0d2b328 fix tst_QProcess::batFiles for shadow builds
Change-Id: If7a9c9aa6ba16b7744d8ef8a66b43e40f375b5e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-11-02 12:16:49 +01:00
Jon Severinsson
53e6cb3ff6 Fix the gregorian date <-> julian day calculations in QDate
The old code is just plain wrong for negative julian days. Replaced
with plain math from The Calendar FAQ [1], which is correct for all
julian days, provided you use mathematical integer division (round to
negative infinity) rather than c++11 integer division (round to zero).

[1] http://www.tondering.dk/claus/cal/julperiod.php

While the conversion code works for up to around JD +/- (2^63/4), we
only use an int for the year in the API, so this patch limits minJd()
and maxJd() to 1 Jan (2^31) BC and 31 Dec (2^31-1) AD, respectively.

Note that while the new conversion code looks like it would be more
expensive than the old, gcc will in fact be able to optimize it to be
slightly faster (probably because x86 hardware implements round to
negative infinity, and so GCC manages to optimize floordiv to a single
instruction, compared to the three instuctions needed for operator/).

In the following test application, run with a release mode Qt and
redirecting stderr to /dev/null, I measured an improvement from
6.81s +/- 0.08s to 6.26s +/- 0.16s user time over five runs on an
otherwise idle x86_64 system.

int main(int, char *[])
{
    int year, month, day;
    qint64 jd;
    for (qint64 i = Q_INT64_C(-1048576) ; i < Q_INT64_C(1048576); ++i) {
        QDate::fromJulianDay(i).getDate(&year, &month, &day);
        jd = QDate(year, month, day).toJulianDay();
        qDebug() << jd << year << month << day;
    }
}

Change-Id: Ifd0dd01f0027f260401f7f9b4f1201d2b7a3b087
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-11-02 12:16:49 +01:00
Samuel Rødal
f01b498310 Introduced QWindow properties {min/max}imum{Width/Height}
These are useful when QWindow is exposed to QML.

Change-Id: I7ec49ef365183e2c784605889e8ea22c2ef34781
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-11-02 12:16:49 +01:00
Mitch Curtis
56552a5633 Improve QDateTime test coverage.
Change-Id: Ic521d9d2ffb1b8e3b14d9cebdeb3dc7a5e08580e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-11-02 12:16:49 +01:00
Jan Arve Saether
12e92ff807 Expose IAccessibleTable2 to non-conformant screen readers
This seems to be the established practice.

Change-Id: I75a65d722a026ab0eb1805688743f46aba406e6c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2012-11-02 10:28:34 +01:00
Janne Anttila
0c1bbf0386 SSL certificate printing: Fix auto test for OpenSSL 1.0.1 version.
Different OpenSSL versions  produce slightly different output when
dumping a certificate.

Change-Id: Ida98b24422302e287641be074d6740ca292cf203
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-11-02 03:58:16 +01:00
hjk
196c5bfe0f Compile fix for tst_qstylesheetstyle.cpp
There was a semicolon missing.

Change-Id: Id2eb843604907acf952d7d238f80ba8a7010ccd1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-11-01 16:12:15 +01:00
Stephen Kelly
3de5a8e78b Strip trailing whitespace in itemviews.
Using

 git ls-files -z |     xargs -0 sed -i 's/ \+$//'

in the relevant directories.

Change-Id: I861ef9952fb32ed2db9ec8b67864ec7d0d61f0f2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-11-01 16:10:32 +01:00
Christian Strømme
731ba8ed08 Fix for leak in QFuture
To avoid leaking when converting a QFuture<T> to a QFuture<void> we need
to have a separate ref. counter for QFuture<T>. When the last QFuture<T>
goes out of scope, we need to clean out the result data.

Task-number: QTBUG-27224

Change-Id: I965a64a11fffbb191ab979cdd030a9aafd4436c2
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-11-01 16:09:29 +01:00
Oliver Wolff
8f62bb343b move QSystemSemaphore autotest from qtscript to qtbase
As the script dependency for that autotest is not really needed it should
be moved to qtbase.

Task-number: QTBUG-27705

Change-Id: I4ce0d34aca97cadd79b157b0f7c90c406bed4295
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-11-01 15:59:58 +01:00
Friedemann Kleint
a5e95ce39e Add manual test for dialogs.
Implemented for QFileDialog, currently.

Task-number: QTBUG-27621
Change-Id: I0c9b7628aa92e3fbca6f737448a7c469893764f1
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-10-31 21:52:30 +01:00
Sergio Ahumada
dea233f0ac test: Remove QSKIP from tst_QSettings::dontReorderIniKeysNeedlessly()
Change-Id: I7b804592398869278e9a0fec982c235c41f2c3d7
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-31 19:56:51 +01:00
Sergio Ahumada
aa49ad58ad test: Moving tst_QMimeDatabase::inheritsPerformance() test
tst_QMimeDatabase::inheritsPerformance() is not an unit test but a
performance test, so moving it from 'tests/auto/corelib/mimetypes/qmimedatabase'
to 'tests/benchmarks/corelib/mimetypes/qmimedatabase'

Change-Id: I59e84f61559023659f101666683870f2ca1d2034
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-10-31 19:56:42 +01:00
Janne Anttila
8c4d02f97a Use qt-project.org in tst_hostinfo - qt.nokia.com changed IP address.
qt.nokia.com is also going to disapper in future, so I think it is better
to use qt-project.org.

Change-Id: Ice550fe657a33609472b8e4b8630d7649f9c9fb5
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-10-31 17:26:44 +01:00
Stephen Kelly
03b9b423b0 Generate instances of types in the CMake tests.
All modules currently have a test_modules CMake test. The
new module_includes test has very similar requirements, and can
obsolete the hand-maintained test_modules tests in all modules.

After all test_modules have been removed in other repos, the
module_includes test can be renamed to that name.

The types chosen need to have a constructor which can be invoked
with no arguments. QtConcurrent has no public classes which fit
that description so it is still tested separately

Change-Id: Id7929cd32b3112c293cbf5e6964cc894a697f9b1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-10-31 07:16:03 +01:00
Thomas McGuire
fc0cbef595 QNX: Use inotify on QNX systems that support it
Change-Id: Ia9bf8d3c202b17746036e203268ef6229aaa900d
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-10-30 14:52:14 +01:00
Miikka Heikkinen
a48508cd76 Send leave to most recently entered window when modal dialog is shown.
If a modal dialog was shown as a response to button click, the button
retained its hover highlight, because it didn't get leave event.

Fixed by tracking the most recently entered window and sending a leave
to it when modal dialog is shown that blocks it.

Also modified tst_QGuiApplication::modalWindow() autotest to check
for enters and leaves.

Task-number: QTBUG-27644
Change-Id: I387647e18a762a39d523e3df31221b9583a39f9d
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-10-30 12:53:46 +01:00
Andy Shaw
50ec06da2c Only use the user set page margins for custom paper
When the QPrinter is initalized then it will set up page margins based
on the default paper size. If the paper size is changed to be a custom
one then it should disregard the margins for the default paper size.

If the page margins are set explicitly beforehand then it will use these
page margins.

Change-Id: Ic535c3a80b8b217dbd5eb5f4fb2cbc0ab1354563
Reviewed-by: Titta Heikkala <titta.heikkala@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2012-10-30 12:53:46 +01:00
Sergio Ahumada
bf722c1ab3 test: Remove QSKIP from tst_QByteArray::literals()
Change-Id: I07b53cd12790d2161964dd09c5a69fe8aff7c90d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-10-30 12:53:46 +01:00
Sergio Ahumada
fd7b3ffe5c test: Remove QSKIP from tst_QPainter::drawText_subPixelPositionsInRaster_qtbug5053()
Change-Id: I1aa329323767a3e849beca8fe41e39dbe98de4ee
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-30 12:53:46 +01:00
Sergio Ahumada
792eb1029d test: Remove QSKIP from tst_QListView::setCurrentIndexAfterAppendRowCrash
Change-Id: I8d48722b412895e43aa8a522354c5d67d83c19dd
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-10-30 12:53:46 +01:00
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