Commit Graph

3365 Commits

Author SHA1 Message Date
Mehdi Fekari
786a6466e8 Add autotests for Indonisian and Catalan locales
Change-Id: Idbf14ee6f0cd83acfdc407408794aac7ad91c054
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-23 13:01:34 +01:00
Friedemann Kleint
3df0a41a7f Fix qstring-literals test for MinGW.
The test is compiled since QT_UNICODE_LITERAL is always defined
on Windows and ref.isStatic()) then fails since C++ 11 is not
enabled.

Task-number: QTBUG-29014
Change-Id: I357574a493c5191f1463e7ee5851d7db0e569315
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-23 12:41:35 +01:00
Gunnar Sletta
2692db542e Implement focus handling of child windows for cocoa.
Change-Id: I1e05ef39aa67f8febdd27215d8ad05d26ece7caa
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-01-23 12:41:35 +01:00
Frederik Gladhorn
586fabb3b5 Disable only accessibility bridge without dbus on linux
Keeping accessibility and only disabling the bridge will
enable more builds to work.

Warning about disabling accessibility disabled is needed
because in QStyle it is used to discover semantics about widgets
(if a toolbutton is in a toolbar).

Change-Id: Iae4e6ab63479743bdd70cba4b1954ec7cf3f88e9
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-01-23 10:56:34 +01:00
Pasi Petäjäjärvi
416e73a0fc Check existence of QProcess feature before using it on Qt autotests.
VxWorks does not have QProcess support.

Change-Id: I20ed479125097d468a1aa50afb18c3749f0fbb98
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:59 +01:00
Thiago Macieira
3c6bb0ed8b Make the QtDBus object tree keep a count of active children
The new member variable activeChildren shall contain the number of
direct children that are active. This number differs from
children.count() because the vector may contain empty entries that
haven't been garbage-collected yet (obj == NULL and activeChildren ==
0).

When this count drops to zero, we know we can simply erase the vector of
children.

Change-Id: Ia20604d3fac852ea4a6e8862d934fbb936fa5e18
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-23 07:54:00 +01:00
Frederik Gladhorn
c608ec8254 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/io/qsavefile_p.h
	src/corelib/tools/qregularexpression.cpp
	src/gui/util/qvalidator.cpp
	src/gui/util/qvalidator.h

Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
2013-01-22 18:40:13 +01:00
Thiago Macieira
f7eff72517 Add a new Q_GLOBAL_STATIC implementation
Unlike the previous implementation, this implementation is locked:
only one initialisation is ever run at the same time. It is
exception-safe, meaning that a throwing constructor will restart the
process.

Also, start using the thread-safe behaviour that GCC has offered for a
long time and C++11 requires.

Change-Id: I20db44f57d258923df64c0051358fd0d9a5ccd51
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-22 17:15:58 +01:00
Friedemann Kleint
326a5e0bca Fix testlib-selftest for MinGW.
Fix float format and exclude crashing sub-binary.

Task-number: QTBUG-29014
Change-Id: I404f971edeb128263122a194f23e2806d6fd3bd0
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-22 17:15:58 +01:00
Tor Arne Vestbø
f5c6a5d06b Don't build lance as application bundle on Mac OS
Change-Id: I23732b4ec0dc45d9d3a2cc5f21dad2cb33af5830
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-22 14:56:47 +01:00
Frederik Gladhorn
15a3243556 Accessibility Linux: Make dbus registration async
Change-Id: I74043be04f4ee17089353304fdc007a7f22cdea0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-01-22 14:11:14 +01:00
David Faure
e01b163404 QTestLib: improve output when comparing lists fails.
Only QStringList was handled before, now any QList is handled.
A specialization for QStringList is still needed though, due to the way
template matching works.

Example with QList<int>. Before:
FAIL!  : tst_QTextCodec::threadSafety() Compared values are not the same
   Loc: [../tst_qtextcodec.cpp(2057)]

After:
FAIL!  : tst_QTextCodec::threadSafety() Compared lists differ at index 0.
   Actual   (res2.toList()): '0'
   Expected (mibList): '3'
   Loc: [../tst_qtextcodec.cpp(2057)]

Change-Id: If0fdec3236ddb78a679ee549aba569ef5571c395
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-22 13:29:33 +01:00
Friedemann Kleint
c73dc44606 Fix cleanup of temporary files in test of QFileInfo.
Change-Id: I0d21fc05a7d816acab5f7284f905bf971a5c04da
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-22 13:29:25 +01:00
Friedemann Kleint
267e2bbee4 MinGW: Disable tests in tst_qstring that use unsupported formats.
Task-number: QTBUG-29014

Change-Id: I7dc879c456da8dabe02a2bce07e8628d176ca9d1
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-22 13:29:14 +01:00
Jan Arve Saether
e17dddfd3b Make hierarchy of actions in menubars more consistent.
There is an assumption that the interface returned from iface->parent()
would have iface as one of its children (thus,
parent->indexOfChild(iface)
should always return an integer != -1, indicating that it is a child.

This is a good assumption, otherwise an hierarchy would be presented
differently depending on how it is traversed.

However, a QMenu created like this:
QMenu *menu = new QMenu("weird parent", mainWindow);
mainWindow->menuBar()->addMenu(menu);

will have a different ancestor sequence than a menu created like this:

mainWindow->menuBar()->addMenu("ok parent");

This is because it will walk up the QObject hierarchy.

This patch tries to deal with that by looking at which widgets the
action of the menu is associated with before determining which should
be the accessible parent.

Change-Id: I00dad8a94463f772d7b1f5d66fdb36b2e8d3aea2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-21 18:57:27 +01:00
Jan Arve Saether
fb4aef9c70 Accessibility: Test for do not crash if the column count is 0
This tests the fix submitted in bb5e11b56d

Task-number: QTBUG-28611

Change-Id: I7b15aa6b46be3607bd7079294d8e7d18bd507d1c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-21 15:28:28 +01:00
Friedemann Kleint
04773fe72e Reduce invocations of QFINDTESTDATA in tst_qfileinfo.
Introduce variables for the paths used in the test and
check in initTestCase().

Change-Id: Ie801266e30cd860e5bdf079c1182fe385f9598c7
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-21 12:15:01 +01:00
Friedemann Kleint
52e14e05fa Fix temporary file leak in tst_qfileinfo.
Change-Id: I0d679638d5a9564f612ae5e70717f164b74aefb0
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-21 12:14:53 +01:00
Gerhard Gappmeier
9bbebb9144 Add support for defining properties from member variables.
This associates properties with member variables and
avoids writing getter and setter methods manually.
The metaCall() method directly accesses the member variable,
so additional method calls can be avoided.
The metaCall() setter code also supports NOTIFY signals,
which means the according signal is emitted when the property
gets written.

Task-number: QTBUG-16852

Change-Id: I88a1f237ea53a1e9cf65fc9ef2e207718eb8b6c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-19 17:36:55 +01:00
Peter Hartmann
5bc5be22e8 QNetworkReply auto test: also test uploading data via HTTPS
... and not only HTTP.

Change-Id: I1190e07fdacd9bdfb218c8932e0e5e2c0c6fc6ab
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-18 17:58:48 +01:00
Friedemann Kleint
aacf4d0263 Fix a crash when minimizing a QQuickWindow.
Send empty expose event and flush queue when minimizing.

Task-number: QTBUG-28439
Task-number: QTBUG-26424

Change-Id: I2e921a86660f946ced7af735cdf197fb666e2934
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-18 15:42:59 +01:00
Friedemann Kleint
ced523af7a Fix crashes in tst_qthreadpool on Windows.
Qt 4.8 shows frequent crashes in runMultiple apparently caused
by the QMutex construction in the free functions by different
threads. Use a common QMutex class member instead.

Change-Id: I851d4e2d3637a7b4f404ed843f5360c10caa21f5
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-18 14:16:52 +01:00
Sergio Ahumada
48e0c4df23 Update copyright year in Digia's license headers
Change-Id: Ic804938fc352291d011800d21e549c10acac66fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-18 09:07:35 +01:00
David Faure
00e0923e60 Output std error from qmake/make when the test fails.
This is intended to make it easier to understand what's happening when
this test is flaky during CI.

Change-Id: I13163c244cb99414d90b5f71c365a4ff2216bc83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:29 +01:00
David Faure
ff8362d65e QSaveFile autotest: restore permissions using RAII
So that the QTemporaryDir can happen even on error.

Change-Id: I728d49eac8bd65e1919fd314a95387949e134de0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:22 +01:00
David Faure
2d5fe45379 QSaveFile: test the case of an existing, but readonly, target file.
Change-Id: I296d9c2598b8c72e2fd3e6ec80a615364b7eddeb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:16 +01:00
David Faure
e993df8771 Add class QSaveFile.
This QIODevice uses a temporary file for writing, so that in case of
write errors, the writing operation is canceled, without losing any
existing file. It also avoids having a partially-written file visible
by other processes, at the final destination.

Change-Id: I9482df45751cb890b1b6f1382ec2eea3eb980627
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:11 +01:00
Peter Hartmann
170bf2a59a QDateTime auto test: stabilize currentDateTimeUtc2 test
... by trying more often to get dates close enough to each other.

Change-Id: I370f7cd61bbb84fbb77ea96ff9fd82c1a6f1f76a
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-17 12:57:43 +01:00
Frederik Gladhorn
e3a10e15ff Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-16 23:51:11 +01:00
Friedemann Kleint
34572dadc6 Dialog testing tool: Control life cycle of non-modal file dialogs.
Keep the non-modal file dialog around and delete only on request,
such that one can simulate repeated invocations of show() on
the same dialog for testing native dialogs.

Change-Id: I80d0f1dfafbc02a31be192098121654a01025174
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-01-16 17:06:12 +01:00
Sergio Ahumada
eb87a0f409 tst_bic: Add linux-gcc-ia32 bic data for QtXml
Change-Id: I43670f41f41f465e5684362de64c355b68a1dbf7
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
2013-01-16 08:25:28 +01:00
Frederik Gladhorn
7075e29199 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/widgets/styles/qstyleanimation.cpp

Change-Id: Iae570895be6544de80f9c1ec309d1a08c59daff8
2013-01-16 01:22:45 +01:00
Frederik Gladhorn
122ee7a367 Merge "Merge remote-tracking branch 'gerrit/release' into stable" into refs/staging/stable 2013-01-15 19:47:44 +01:00
Frederik Gladhorn
270a51b775 Merge remote-tracking branch 'gerrit/release' into stable
Change-Id: Ieb104d0e390218a063082c93bc9c7e412af2166d
2013-01-15 18:14:13 +01:00
Friedemann Kleint
d3dc0f2122 Fix renaming of files that differ only in case.
This currently fails on case-insensitive file
systems since the check for existence then triggered
and indicated "file already exists".

Check on the file id (inode or file id) whether
the target file is really a different file for a
case-changing rename.

Task-number: QTBUG-3570

Change-Id: I1b2d40850692e02142ee23d2c753428de00aedc6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-15 16:36:20 +01:00
Friedemann Kleint
bb5e11b56d Fix crash in tst_qaccessibility.
Release the table item below the table test instead of releasing
the text item twice.

Change-Id: I74d283d50a39b9a4570b73a8297ed3dbb2de2271
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-15 15:48:41 +01:00
David Faure
d147285d64 Add Q_COREAPP_STARTUP_FUNCTION macro.
This is necessary for initializing things in a library, which require
a QCoreApplication instance (unlike Q_CONSTRUCTOR_FUNCTION, which runs
before that). Example use cases: KCrash (segv handler), and KCheckAccelerators
(debugging tool triggered by magic key combination).

Change-Id: I5f4c4699dd4d21aea72b007989ba57467e86ed10
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-15 14:58:35 +01:00
Thiago Macieira
856f209fb6 Change all shmget calls to user-only memory
Drop the read and write permissions for group and other users in the
system.

Change-Id: I8fc753f09126651af3fb82df3049050f0b14e876
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-15 04:34:27 +01:00
David Faure
6b9545a980 QUrl: methods for converting QStringList <-> QList<QUrl>
This is a very common thing to do, e.g. in order to send urls via DBus.

Change-Id: I277902460ee1ad6780446e862e86b3c2eb8c5315
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
David Faure
327b2ba3b7 Add class QDebugStateSaver for writing QDebug operators correctly
Had to move QTextStreamPrivate to a private header, to be able to use
its new internal Params struct from qdebug.cpp

Change-Id: If28e25f27bbd04b1825a5eb3e2ef83ecad72e7b2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
Ruslan Nigmatullin
d4adcfb8cc Added QMessageAuthenticationCode
QMessageAuthenticationCode is HMAC implementation based on
QCryptographicHash abilities. HMAC is often used in OAuth and similar
authentication protocols.

Change-Id: Ifc73947ad06c36a1b770315b7e89ba5c01c5e79e
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
Orgad Shaneh
b6963f109a QMenu: Fix nested popup when keyboard shortcut is used
Task-number: QTBUG-20403

Change-Id: I2a5fe00dd16e9dc1ec0d742a8f48083fc2954996
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
2013-01-14 16:28:21 +01:00
Thiago Macieira
dc131e3a53 Make QDBusPendingReply behave like QDBusReply when dealing with errors
QDBusReply allows one to extract a QVariant and the type reply from an
error reply and getting a default-constructed value. This is useful when
a valid reply can never contain the default-constructed value (0, false,
empty strings, empty arrays, etc.), so it simplifies error checking.

More importantly, qdbusxml2cpp was changed a while ago from generating
QDBusReply to generating QDBusPendingReply, so we need to have the same
behavior.

Task-number: QTBUG-29046
Change-Id: Ia873b9fd4311c0d4e94f0ef623ba405c20bc0e8c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-14 13:03:50 +01:00
Thiago Macieira
60fc88a09c Resolve some race conditions on tst_QSharedMemory
This test runs fine almost all of the time on systems with 1
processor, which were the norm when the test was written and are still
the way that the Qt Continuous Integration system works as of
today. But it falls flatly on multi-processor systems.

The root of the problem is that QSystemSemaphore recreates the
semaphore if it disappears underneath it. However, the recreation
process is not thread-safe at all: if two threads race to recreate it,
weird things might happen. strace on Linux shows that a thread got
stuck trying to acquire the semaphore:

  <... nanosleep resumed> NULL) = 0
  stat("/tmp/qipc_systemsem_market5c9f73af73334ffe350c60ec076e5744db0ecda3", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
  stat("/tmp/qipc_systemsem_market5c9f73af73334ffe350c60ec076e5744db0ecda3", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
  semget(0x51001388, 1, IPC_CREAT|IPC_EXCL|0600) = -1 EEXIST (File exists)
  semget(0x51001388, 1, IPC_CREAT|0600) = 114786308
  semop(114786308, {{0, -1, SEM_UNDO}}, 1 <unfinished ...>

This problem does not happen if the creation and destruction of the
QSharedMemory (which uses QSystemSemaphore) does not race with other
threads or processes attaching and detaching. For the threads test
it's easy. For the processes, we use stdin and stdout as a
communication channel.

Change-Id: Ie11b135431d4abfc59234654848b67f622eb03c9
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-14 11:35:17 +01:00
Giuseppe D'Angelo
9110d4f1ed QString::contains overload that returns the match results
This convenience overload allows one to write

    QRegularExpression re1, re2, ...;
    QRegularExpressionMatch match;
    QString subject;

    if (subject.contains(re1, &match)) {
        // ...
    } else if (subject.contains(re2, &match)) {
        // ...
    } // ..

One can then inspect the results of a successful match in each block
(as well as extracting the captured substrings, etc.).

Change-Id: I0fb8be8b577656e8db994198f8105c26c4fe67b0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 10:26:59 +01:00
Giuseppe D'Angelo
65fba49d63 Introduce default ctors for QRegularExpressionMatch(Iterator)
This allows to put them in containers, and to enable subsequent
features for QString.

Change-Id: I3b3fe695ffe6930331ed9f670738376722e0fc36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 10:25:39 +01:00
Sergio Ahumada
4bd4c811f2 tst_bic: Add bic data for QtConcurrent and QtPrintSupport
Task-number: QTQAINFRA-321
Change-Id: I2699a13c3d8a7df9b12049e0337501a4e24d2d64
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
2013-01-14 09:18:43 +01:00
José Millán Soto
08bc730b41 Implement QAccessibleActionInterface in QAccessibleTableCell
Implemented QAccessibleActionInterface in QAccessibleTableCell to allow
selecting and unselecting table cells, as there was no way of selecting
or deselecting a simple cell using accessible tools.

tst_qaccessibility.cpp was modified to test the new methods.

Change-Id: I7bdfe0b363a9813d4a7c62e96b6c924b163f2121
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-11 21:24:23 +01:00
Michael Brasser
f156e578d7 Ensure raster pixmap cache key is the same as that of pixmap.toImage()
This is done to support texture uploads in an image provider. It ensures
we can load the texture using QImage in the image provider, and when
it is later painted as a pixmap, the cacheKey will be identical
(assuming no format conversion was required).

Change-Id: I54229511ed91ce5430cc478af5aff0d96685a2da
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-11 21:24:23 +01:00
Shane Kearns
7e91b5a2bc Fix incorrectly disabled autotest
One of the IPv6 autotests was always disabled instead of being disabled
only when the system has no IPv6 support.

Change-Id: I34dffbeae6ba85a706bfeb0cc4750a4514b73a65
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-01-11 14:01:10 +01:00
Jędrzej Nowacki
63c68cadec Enable tst_qwidgetsvariant test
The test for a magic reason was not build by default.

Change-Id: I21c7fc959d76d6faac0091495f965f3da6d415b1
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-11 12:02:21 +01:00
Mehdi Fekari
7ff47c7bfa Add an autotest for Canadian locale(dateFormat)
Change-Id: I68a91a418c418e113ecfe66769a7b3bc46de380c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-01-10 15:52:55 +01:00
Stephen Kelly
ccbff3fce5 Clean up some metatype declarations and registrations
Change-Id: I0826f6502cc45279f29f248f5f28f4fc9e6c8b4e
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-09 18:19:12 +01:00
Sergio Ahumada
63f24f6ba8 Merge branch 'stable' into dev
Change-Id: I7f0dab6bdb1f3cc1d3e6c30166ff6db9dfae37e9
2013-01-09 11:49:47 +01:00
Sergio Ahumada
bbb9abf7fb tst_bic: Remove 'timex' class from linux-gcc-{amd64,ia32}
'timex' is not a Qt class, so there is no need to check it.

Change-Id: Ic77b3518e5a7eaf2c2bc7dcd98d1f9aebf4b655d
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2013-01-09 09:11:46 +01:00
Oliver Wolff
083d2c8bb8 Removed hardcoded values from tst_qgraphicsview::scrollBarRanges
Instead of testing the "windows" and "motif" styles, that test should
actually test the scrollBarRanges for all available styles. To be able
to do that, the magic numbers 16 (width/height of scrollbars) and 4
(spacing for the faux motif style) were replaced and instead of setting
the explicit values in the data the "number of scrollbars/spacings to
add/remove" is saved in a struct and the value of these (depending
on the style) is obtained in the test run.

This change does not also cause the fusion style to also be tested but
also fixes this test for Windows 7 and 8 (Aero) where the scrollbar
width/height is not 16 but 17.

Task-number: QTBUG-28611
Task-number: QTBUG-29002
Change-Id: I5d103018fde81cee6e6e89cd414426768b2dc8e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-09 08:59:26 +01:00
Sergio Ahumada
d8a3bcc6c4 test: Add bic data for linux-gcc-ia32
Task-number: QTQAINFRA-321
Change-Id: I990f0c525fbd0b0b3818b0f7d86ed99438821baa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-08 19:50:18 +01:00
Friedemann Kleint
54fd35b134 Fix warnings about not being able to set Window geometry on Windows.
Fully decorated windows cannot be smaller than 160x30 (Large fonts).
Enlarge Windows or remove Window frame  to get rid of decorations.

Task-number: QTBUG-28611
Change-Id: Idb6ee94fb8d0760d5f97042b3084557f11e9fdf9
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-08 13:54:04 +01:00
Michael Brüning
41acb58f23 Add auto test for HTTP cache fix for QTBUG-28035.
Adds an auto test that verifies that the replies to POST and PUT
requests are not cached even though they contain a max-age header and
that subsequent GET requests are reloaded from the server.

Change-Id: I188ae1200cb5551e164722c0f479719be8d11bfb
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-01-08 11:13:27 +01:00
Jędrzej Nowacki
ae2359d49e Merge "Merge branch 'stable' into dev" into refs/staging/dev 2013-01-07 18:07:29 +01:00
Giuseppe D'Angelo
998899cf3a Introduce QRegularExpression::NoMatch match type
This match type doesn't do any match at all; it's only necessary to
properly introduce default constructors for QRegularExpressionMatch
and QRegularExpressionMatchIterator (since they return the match type
that created them).

Change-Id: Ibfe92459c7fdd23129cf3afe073cd443c461ddeb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-07 16:11:19 +01:00
Friedemann Kleint
bc5a2336ab Provide operators for QMargins.
Provide addition/subtraction for QMargins as well as
multiplication and division for int/qreal similar
to QPoint. Add unary minus.

Change-Id: If4eb831cfd610b34b5ca361619b1636031811d0a
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-01-07 16:11:19 +01:00
Friedemann Kleint
6ecc3e76e8 Add API dealing with QMargins to QRect.
- Addition of a QMargin to a QRect.
- Removal of a QMargin from a QRect.
- Remove implementation from Windows platform plugin.

Change-Id: Iae54bc13e94a7ece48853b1d3f3de2bfc154d2dd
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-01-07 16:11:19 +01:00
Giuseppe D'Angelo
41ec7c32ac Improve QRegularExpression autotests
Check that the regular expression, the match type and the match options
returned by QRegularExpression/QRegularExpressionIterator are the
same ones passed to match / globalMatch.

Change-Id: Ibd282379bb60b53d614b1d56a7e08b3d6c236da6
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2013-01-07 16:11:19 +01:00
Frederik Gladhorn
cdf13ce286 Merge branch 'stable' into dev
Conflicts:
	tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp

Change-Id: I6b8d505fc22f052c307ca27f58f7d16f98965f47
2013-01-07 15:18:16 +01:00
Stephen Kelly
21d607c81a Automatically register method types in QSignalSpy.
Change-Id: I3655291dca6dbd3d8d09ee835b85983caa911b64
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-07 12:06:00 +01:00
Giuseppe D'Angelo
2d8910cbed Introduce QRegularExpressionValidator
QRegularExpression counterpart for QRegExpValidator.

Change-Id: Ib391e73dd49e32aeb9b48e6f2217b67a17a83a11
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-07 12:04:53 +01:00
Sergio Ahumada
a8321f21fb Add bic data for tst_bic
- Add initial set of amd64 data
 - Add QtWidgets to global.cfg

Task-number: QTQAINFRA-321
Change-Id: I9bffaa00ac01976546629988ac69965383eb2efd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-06 19:16:02 +01:00
Mehdi Fekari
33f603c4a3 Update qlocale autotest
Add additional tests for the updates in the Qt4.8 qlocale data (CLDRv2.0) already existing in Qt5 locale data (CLDRv22.1):

- The NumberingSystem for some Indic and Slovak locales.
- The Month/Day name in Irish/Gaelic locale.
- The AM/PM Text in Turkish locale.

Change-Id: Iaea4f13ec79f94ab937b97f8ae60eb8d8f217c4b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-06 14:29:48 +01:00
Stephen Kelly
cf22e8ea4e Tests: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: Ifd116dee32a450ff89a9a1011e26b434765d6e95
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-06 11:23:45 +01:00
Stephen Kelly
ba82958af9 Widgets: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: Ibe8e2ec867afb4051a3c7eef806d9cd86945928b
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-04 18:44:31 +01:00
Stephen Kelly
cc69dff01b Gui: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: I95b8b4b674e85b2b3c374931f6231d60f35be984
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-04 18:39:08 +01:00
Stephen Kelly
79f1afc23c Core: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: I54523eb854619917123d8816d3cd6c3a1f5b4c55
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-04 18:39:05 +01:00
Thiago Macieira
a094bf5a89 Don't increase the reference count if dynamic_cast failed
If the dynamic_cast failed in QSharedPointer::dynamicCast or
qSharedPointerDynamicCast, we should avoid creating the QSharedPointer
that shares the weak and strong reference counts. In Qt 5, this does
not imply a leak since the original pointer is stored internally for
deletion. In Qt 4 it implies a leak under certain circumstances, which
this change fixes.

Task-number: QTBUG-28924
Change-Id: Id2de140de4cf676461e14b201ad250c53666b79d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-04 17:30:19 +01:00
Peter Hartmann
bf5e7fb265 SSL certificates: blacklist mis-issued Turktrust certificates
Those certificates have erroneously set the CA attribute to true,
meaning everybody in possesion of their keys can issue certificates on
their own.

Task-number: QTBUG-28937

Change-Id: Iff351e590ad3e6ab802e6fa1d65a9a9a9f7683de
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-01-04 15:19:17 +01:00
Jan Arve Saether
07e69c7896 Make textEditTest pass on Windows 8
We make it pass by relaxing the comparison of the characterRect....

Change-Id: I900e0601d9e1e568c12a3952cf42657743345013
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-04 13:20:06 +01:00
Jan Arve Saether
32f7db7686 Fix autotest of textEditTest to use currentFont() instead of font()
Change-Id: I5c9b2ad494a7daf9b07804f77c4692d49e774261
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-04 13:20:06 +01:00
Stephen Kelly
ad330f327e DBus: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

In some cases, the type is required to be registered with the typedef
name, so those Q_DECLARE_METATYPE uses remain for now. In a future
patch we can also remove those and the typedefs themselves.

Change-Id: I5721955c86f566ae09024203954840f817bd3088
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-04 13:20:06 +01:00
Jon Severinsson
cf2a75e41b Fix QGuiApplication::keyboardModifiers() and QGuiApplication::mouseButtons()
Previous commit b2363a935c fixed keyboardModifiers() after QPA event
processing, but broke QTestLib, which expects spontaneous input events
sent to qApp->notify() to update keyboardModifiers() and mouseButtons().
The commit also did not fix mouseButtons() after QPA event processing,
and missed keyboardModifiers() after QPA Tablet event processing.

This commit fixes all these shortcommings in b2363a935c.

Includes test case by David Faure <faure@kde.org>

Task-Number: QTBUG-26887
Change-Id: I8518b06c4ce86ea7b35120e3353a45ea2a81d356
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-04 13:20:06 +01:00
Frederik Gladhorn
ca2f44680c Merge branch 'stable' into dev
Conflicts:
	examples/widgets/painting/shared/shared.pri
	src/corelib/tools/qharfbuzz_p.h
	src/corelib/tools/qunicodetools.cpp
	src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
	src/plugins/platforms/windows/qwindowsfontdatabase.cpp

Change-Id: Ibc9860abf570e5ce8b052fb88feb73ec35e64bd3
2013-01-04 11:12:05 +01:00
Jan Arve Saether
cf5264fd67 Cleanup verifyHierarchy. Remove dead code and add indexOfChild test
Change-Id: I4f423cf2f08b657329b7fb5e225e7b8b3f17e4af
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-03 20:18:06 +01:00
Stephen Kelly
ee7dbf97bb Benchmarks: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: Iba4b7f8ff7a1c7974d144b955cbf064e43b36ec7
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-03 18:19:28 +01:00
Stephen Kelly
330ad41b7d Network: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: Ifdce72af844901665c4ebab11507216ba5f00fc1
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-03 18:19:28 +01:00
Peter Kümmel
8e3d4f5e87 Don't read from deleted member variable
QNetworkProxy::setApplicationProxy deletes factory set by
QNetworkProxyFactory::setApplicationProxyFactory.

Change-Id: Iaafd62d1cdb2045d69c7359cacc513056216826c
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-01-03 18:19:28 +01:00
Eskil Abrahamsen Blomfeldt
248ccb2889 Fix possible crash in QTextDocument
With trailing spaces in some cases, we would not get the
"no justification at end of paragraph" special case, and continue
in the code, getting the unexpected case where line_length becomes
< 0 which would lead to memory corruption because we were writing
outside our buffers. I added an assert to catch this type of bug
earlier, and I added the trailing spaces to the test for the end
of the paragraph.

The test case added is one example which would crash.

Task-number: QTBUG-27354
Change-Id: Id720a6fa55dbc709ce04dd5321e55687bf960d75
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-03 16:15:37 +01:00
Stephen Kelly
4319f698c8 Remove metatype registration of built-in types.
As they are built-in, they are effectively registered at compile-time
already.

Change-Id: I7ae6ba16088eab5d19213fa7b07c2a7760988a86
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-03 16:15:37 +01:00
Sergio Ahumada
83188c6499 test: Change trolltech.com:443 to qt-project.org:443
trolltech.com seems to be shut down already

Change-Id: Ic90ce01aeb51b6f154b9bbf4762c365a398c9e3d
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-03 11:32:17 +01:00
Thorbjørn Lund Martsum
28a21d98ef QAbstractItemView - allow deselect in single selection mode.
This patch allows single selection to be cleared with the normal
control modifier. This affects e.g QTreeView and QListView.

Task-number: QTBUG-8836
Change-Id: I7fd50b987acc3552b36657409568192763257536
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-02 16:09:14 +01:00
hjk
03a666760c Speed up and fix QByteArray::setNum()
Going through QLocale and QString is not really needed.

This also makes the result of the conversion of negative numbers
in bases other than 10 independent of the architecture and
implements the documented behavior of treating them as
unsigned types.

Change-Id: Ibc231dc5241deb5cbadd9796484a8b5f79c29410
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-30 10:44:44 +01:00
hjk
4eac2c4728 Add test for QByteArray::setNum
Change-Id: I66f3954433bf50fb23fdaeef804838d993e965b5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-12-28 15:09:19 +01:00
Thiago Macieira
3adbcb58d5 Fix QMutex::tryLock with negative values
The Linux futex implementation had a Q_ASSERT for positive values, but
the documentation says that negative values should be interpreted as
infinite (equal to lock()).

Test that too.

Change-Id: I2f96a502d672732781e88e49797756ca9a809121
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-23 20:34:46 +01:00
Thiago Macieira
7ee9551b62 Add support for multiple arguments to QSharedPointer::create()
Requires C++11 rvalue references and variadic templates so we can
implement perfect forwarding.

Change-Id: I62e47d1ffd0c61e8386f9f246aa79031b7430b46
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-23 17:51:45 +01:00
David Faure
8b2728ec38 QUrl::fromUserInput: fix for urls without a host.
QUrl::fromUserInput("http://") was invalid, which doesn't make sense
since QUrl("http://") is valid. Same for "smb:" which is actually
even more a valid URL from a user's point of view.

Change-Id: I371ac393d61b49499edf5adbbc2a90b426fe9e5d
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-23 10:50:28 +01:00
Andy Shaw
69627730ea Fix QSqlQuery test in relation to PSQL support
Some things needed to be corrected for testing with PSQL, this was
checked against the the PostgreSQL documentation to confirm that the
exepected behaviour is correct.

Change-Id: I45a6b343e9eb920fcae2a62910ecc956abcac0f0
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-12-22 14:43:28 +01:00
Thiago Macieira
e1a1e80d46 Make sure that the strict parser is also operating on setXxx
These cases weren't handled before.

The validateComponent function is copied from QUrlPrivate::parse, with
the added modification that it now needs to check the gen-delims for
the userinfo.

Change-Id: I055167b977199fa86b56a3a7259a7445585129c6
Reviewed-by: David Faure (KDE) <faure@kde.org>
2012-12-21 20:54:51 +01:00
Oswald Buddenhagen
586adeabe4 add and use qtHaveModule() function
this is much more elegant than the so far propagated !isEmpty(QT.foo.name).
also replace feature-specific tests (no-gui and no-widgets) and the
obsolete contains(QT_CONFIG, foo) syntax.

Change-Id: Ia4b3c8febcabf9eeca67b1f9173a523820b1038b
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-12-21 19:05:02 +01:00
Sergio Ahumada
7706c31eaa Fix some typos
Change-Id: I4e8d9bd8ea66ec810e4f1fbfd8ddbf25c4b3d980
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2012-12-21 19:05:02 +01:00
Konstantin Ritt
9b0fab6b62 Update Qt internals to use QChar::Script
...and remove the outdated QUnicodeTables::Script enum.
QFontEngineData now has one extra slot that never used
(engines[QChar::Script_Inherited]). engines[QChar::Script_Unknown],
if accessed, would be set with a Box engine instance, and could be used
as a minor optimization some time later.

In order to preserve the existing behavior, we map all scripts up to Latin to Common.

Change-Id: Ide4182a0f8447b4bf25713ecc3fe8097b8fed040
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-12-21 19:01:35 +01:00
Friedemann Kleint
04a5a74685 Add a manual test for QFile.
Add a command line program allowing to test rename, copy, etc.

Task-number: QTBUG-28246

Change-Id: Ie9667f03b65a874475700ec9ecd91ca2ed32ed97
Reviewed-by: David Faure (KDE) <faure@kde.org>
2012-12-21 15:08:35 +01:00
J-P Nurmi
71fdc0d8a6 Tests: stabilize tst_QAbstractScrollArea::setScrollBars2()
Use QWidget::isVisibleTo(parent) instead of isVisible(), just like
QAbstractScrollArea::replaceScrollBar() does. This removes the need
of using QCoreApplication::processEvents() to deliver the actual
hide event just for testing if the scrollbar was requested to be
hidden as it should.

Change-Id: Ie9a816e7b871d280a4b3d9d76adb10601915bd56
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-12-20 21:16:53 +01:00