Commit Graph

3368 Commits

Author SHA1 Message Date
Samuel Rødal
23b11e792c Added QWindow::Visibility convenience API to QWindow.
This finally makes it possible to make windows fullscreen etc from
QML by doing "visibility: Window.FullScreen". I don't see any reason
from not having the API at the QWindow-level instead of at the
QQuickWindow-level since this way it can benefit other use cases too.

Change-Id: If27344306eb563bc2ccd83296a46b1f2862e2db1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-12 15:02:53 +01:00
Mitch Curtis
4aa86461eb Ensure QDateTime can handle QDate's full range of julian dates.
Currently, using QDate::maxJd() in tests will fail. This patch changes
some ints to qint64s to prevent overflows where necessary.

Change-Id: I61ebf8f233411a7544689fd5bfa9c3abee54e933
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-12 07:29:36 +01:00
Mitch Curtis
86115848b5 Correctly detect HTML 5 charset attribute in QTextCodec::codecForHtml()
QTextCodec::codecForHtml currently fails to detect the charset for this
HTML:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9,chrome=1">
    <title>Test</title>
    </head>

This patch makes the detection of charsets more flexible, allowing for
the use of the HTML 5 charset attribute as well more terminator characters
("'", and ">").

I also added a *_data function for the unit tests.

Task-number: QTBUG-5451

Change-Id: I69fe4a04582f0d845cbbe9140a86a950fb7dc861
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
2013-02-12 01:31:26 +01:00
David Faure
b61cff8d6e qprocess autotests don't need QtGui
(this isn't true of -all- corelib/ autotests though, e.g. tst_qdatastream
uses QBitmap)

Change-Id: I314fda5d85d45cb5eece8da74156989b83cf0299
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-09 18:44:41 +01:00
Richard Moore
20bde28448 Add support for SHA3 to QCryptographicHash.
This commit adds SHA3 support to QCryptographicHash. Two implementations
are provided, one optimised for 32 bit and one for 64 bits. The code has
been written to make it easy to add further implementations, for example
ones using NEON instructions on ARM.

Change-Id: I3be9c45bbd4fcc2771d697e7f7ae74e48a831e8f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-02-09 15:58:09 +01:00
Peter Hartmann
916f0ff663 QUrl effective TLDs: update table and split into chunks of 64K
The table is there to know which domains are allowed to set cookies
and which are not. There are more than 2000 new entries since the
list has last been generated.
The split to 64K chunks was made because this is the hard limit for
strings in Visual Studio.

Change-Id: I511aec062af673555e9a69442c055f75bdcd1606
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-09 10:12:44 +01:00
Samuel Rødal
bfa1584162 Added version() and setVersion() convenience API to QSurfaceFormat.
This lets you write code like format.version() >= qMakePair(3, 2), and
format.setVersion(4, 2) instead of format.setMajorVersion(4);
format.setMinorVersion(2);

Change-Id: Ib052091cc12865ea0d5db52e468ed6cd28f14840
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-08 20:00:00 +01:00
David Faure
574e5cf9c5 Add qunsetenv(), next to qputenv() and friends.
The existing tst_qgetputenv shows that qputenv with an empty value
doesn't lead to the same result on Windows and on Unix, and there was
no way to fully delete an env var on Unix (which is needed for some
env vars where not-set and empty are different, such as TZ,
see `man tzset`).
This is also why qglobal has qEnvironmentVariableIsSet() vs
qEnvironmentVariableIsEmpty(), on the getter side.

Qt4's ifdefs around unsetenv in qapplication_x11.cpp show that this is
needed within Qt too (although this particular startup notification code
has to be re-imported into Qt5 still).

Change-Id: I631c8cddbcf933d4b9008f11aefc59f5a3c7c866
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-07 01:22:40 +01:00
J-P Nurmi
ee317360e3 QColorDialog manual test: add initial color selection
Change-Id: I956404af728ef0d70977f6c69b1059b3656edd91
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-07 01:22:40 +01:00
J-P Nurmi
0de3ea6554 Dialog testing tool: add missing enableDeleteModalDialogButton() calls
Change-Id: I012dc8c7c07fced69f8b7eda7a1686af1e11033f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-07 01:22:40 +01:00
Peter Hartmann
b5652df775 SSL: Implement session sharing and use it from QNetworkAccessManager
This improves performance since a network round trip can be avoided.

Change-Id: I1aaff7e48ef9638cb137de0f43942c3a4dd2884a
Initial-patch-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-02-06 23:24:44 +01:00
J-P Nurmi
5809471ac7 Manual test for QFontDialog
Change-Id: I2bcdd30990e88af45c8d4b2756fcdd48fc2a47d7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-05 14:42:50 +01:00
Laszlo Papp
6c6960015e Add qDegreesToRadians and qRadiansToDegrees math functions
Change-Id: I6e9fd76f2d2860f46531a72349b46193b8eeaaa7
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-05 14:40:14 +01:00
Giuseppe D'Angelo
53f9e77140 QRegularExpression: add method for extracting the capturing group names
It may be useful to know which named capturing groups are defined
in an regular expression, and for each of them, what's the
corresponding index. This commit adds the needed method
to QRegularExpression.

Note that extracting the information doesn't happen while holding
the mutex in the private -- pcre_fullinfo just reads information
from the compiled pattern, so that's thread-safe.

Task-number: QTBUG-29079
Change-Id: I50c00ee860f06427c2e6ea10417d5c0733cc8303
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-05 13:46:25 +01:00
Thorbjørn Lund Martsum
08a632ac1a QTreeView::expandToDepth - add missing emit of expanded and collapsed
Just like other functions this function should emit expanded and
collapsed.

A part of fixing
Task-number: QTBUG-8176

Change-Id: I6d801f61e6f0cb8836634cc52f0be2b610f6c728
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-02-02 08:10:55 +01:00
Friedemann Kleint
40eaa72319 Do not run tst_qfilesystemmodel for MinGW.
Task-number: QTBUG-29403

Change-Id: I91c938d9a6510ae91e54cd53e2d9df0a56b68d50
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-02-01 09:18:42 +01:00
Friedemann Kleint
8138a09e05 Replace SRCDIR-define by QFINDTESTDATA in tst_moc.
Remove srcify() function, which was warned about as unused
on Windows.

Change-Id: I731d3b6f058d4246e39dcf9a137619ae5087d751
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-31 22:14:27 +01:00
Thorbjørn Lund Martsum
3260aec38e QTreeView - emit collapsed in collapseAll()
When we call call collapase we emit collapsed. Therefore it should
also be emitted on collapseAll()

This partly solves:
Task-number: QTBUG-8176

Change-Id: I20c1388fcbbb60d12debb4a0b3b0d9fed41e2563
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-31 13:12:40 +01:00
Thorbjørn Lund Martsum
80fa4b6c8e QTreeView - emit expanded on expandAll
When we call QTreeView::expand expanded is emitted.
For the same reason we should emit expanded on expandAll()

This partly solves:
Task-number: QTBUG-8176

Change-Id: Ie85e724eec50980c68f626ec47dec5c1e08cc085
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-31 13:12:32 +01:00
Nils Jeisecke
ffea8e98f7 Update roleNames in QAbstractProxyModel if sourceModel resets.
If a sourceModel resets, it's roleNames might have changed. This
is most likely the case if sourceModel itself is also a proxy model
of which the sourceModel was changed.

Task-number: QTBUG-28982
Change-Id: I102788f2c9bf97b4002b350673f9219e32e7a052
Reviewed-by: Nils Jeisecke <jeisecke@saltation.de>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-30 15:17:05 +01:00
Friedemann Kleint
07843b1b12 Fix warning about incorrect format in tst_qlocale.
type is unsigned long, should be %lu. Replace by stream.

Change-Id: Ib0346b54a4494910b4a5927d0de45840ca53fbda
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-30 13:00:02 +01:00
J-P Nurmi
b7eaf2efdf Manual test for QColorDialog
Change-Id: I4eab3ecfbe5b6e7d663fe92d49af173fd179ba6e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-30 10:47:05 +01:00
Stephen Kelly
8eae3a923a Provide the resetInternalData slot to cleanly reset data in proxy subclasses.
This was part of Qt 4.8, but Qt 5.0 was branched before that, so
the commit was lost.

Change-Id: I2a2ab3c75a0943ac734d588ebd74bc158dd6aaaf
Reviewed-by: Nils Jeisecke <jeisecke@saltation.de>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-30 10:44:32 +01:00
Keith Gardner
159e17bc5b QStringRef: Added a trimmed() function.
Change-Id: I67c5d10f29f420e0aea95cf32b5d3c17c141899c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-29 22:28:17 +01:00
Frederik Gladhorn
3eb588078e Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-29 11:33:35 +01:00
Stephen Kelly
d315e01218 Add the Qt::ItemNeverHasChildren flag and use it in QTreeView.
It can be used to determine whether expand() should really expand.

Change-Id: If79d8c295a4ca1356e60051682b227524a065126
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2013-01-29 09:28:43 +01:00
Friedemann Kleint
00ad768f10 Do not execute tst_qfilesystemmodel in parallel.
It may interfere with other file system tests.

Task-number: QTBUG-29014
Change-Id: I32dd7428993b0da1a2f70ec3e581050012a4ff32
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-29 07:30:45 +01:00
Sergio Ahumada
07e3bcdc10 Remove QT_{BEGIN,END}_HEADER macro usage
The macro was made empty in ba3dc5f3b5
and is no longer necessary or used.

Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html
Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-01-29 01:06:04 +01:00
Peter Kümmel
70a9caf4de QVarLengthArray: add squeeze function
Add function to move back data to the stack.

Change-Id: Ic78a368459bce68629e29602e4eeae2e1afe398b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-28 16:52:40 +01:00
Friedemann Kleint
ff31462e73 Fix MinGW-Warnings in tst_qwinoverlappedionotifier.
Change-Id: I66c4e274c8b686d8a69476ad10751008f256e5a2
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-28 16:19:21 +01:00
Friedemann Kleint
2b3ed64951 Fix warning about redefinition of _WIN32_WINNT.
This is redefined by qt_windows.h

Change-Id: I6a8cb06c93c4055b166f1a214cba981d61680b9c
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-28 16:19:17 +01:00
Frederik Gladhorn
02ba93dd3d Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
2013-01-28 11:10:29 +01:00
Friedemann Kleint
322055b9c9 tst_qfilesystemmodel: Avoid commonly used folders.
Use the test's temporary directory instead of
QDir::temp() and the documents folder
instead of QDir::home(). Split out unrelated test
from data-driven sort test.

Task-number: QTBUG-29014

Change-Id: I229f0b1c0f1e43b56d19ebd43fd7cc64a85b1222
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-28 09:41:39 +01:00
Friedemann Kleint
74c3a2f4f4 Fix warning about redefinition of M_PI in tst_qwmatrix.
Change-Id: Ib5e5fe0f087448b07adfa02984524cbb10c78395
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-01-28 09:41:39 +01:00
Friedemann Kleint
e334fb6493 Fix warning about unhandled enumeration values in tst_sqldriver.
Change-Id: I4e750982aab861abbbbabe980a663f8b118cdf54
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-01-28 09:41:39 +01:00
Mitch Curtis
5c5c9c26d2 Don't emit activated on clicking disabled itemview item.
A itemview item with its flags set to Qt::NoItemFlags is considered
disabled, and therefore should not cause the activated signal
to be emitted.

Task-number: QTBUG-20490
Change-Id: If824505c46f4fcadb9265ad6d1e9337f0cee32cf
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-26 21:22:22 +01:00
Jean-Paul Delimat
4bb5566632 Add toJson() formatting argument to QJsonDocument interface
The writer delegate used by QJsonDocument to produce a Json QByteArray
supports generating a human readable Json (with spaces and carriage
returns that reflect the Json structure) and a less human readable (no
spaces nor carriage returns) but more compact Json.

The method toJson() was extended with a format argument to support
the compact Json generation.

Task-number: QTBUG-28815
Change-Id: I8d13849ab9ab6ed7c645011260251dc14a8629d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Debao Zhang <hello@debao.me>
2013-01-26 03:09:27 +01:00
Laszlo Papp
e335fb7254 Add static dotProduct methods to the QPoint(F) classes
Change-Id: I66ac9433b74341a83569a60038ea2f7a025e81b1
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-26 00:09:14 +01:00
Sze Howe Koh
63569a68d2 Doc: Fix module name format
Follow the conventions at
http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation

QtCore         -> Qt Core
QtDBus         -> Qt D-Bus
QtDesigner     -> Qt Designer
QtGui          -> Qt GUI
QtImageFormats -> Qt Image Formats
QtNetwork      -> Qt Network
QtPrintSupport -> Qt Print Support
QtScript       -> Qt Script
QtSql          -> Qt SQL
QtSvg          -> Qt SVG
QtTest         -> Qt Test
QtWebKit       -> Qt WebKit
QtWidgets      -> Qt Widgets
QtXml          -> Qt XML

QtConcurrent   -> Qt Concurrent (partial)
QtQuick        -> Qt Quick      (partial)

Also, distinguish between "module" and "library"

Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-01-25 17:27:44 +01:00
Gunnar Sletta
64134181db Introducing QWidget::createWindowContainer()
A QWidget that can embed a QWindow. This can be used
to embed a QWindow/QOpenGLContext based window or a
full QQuickView.

Change-Id: I8415b5ae38562fc00b46150fa70b56fd9b19a80c
Reviewed-by: Jørgen Lind <jorgen.lind@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-25 14:11:07 +01:00
Frederik Gladhorn
9a5ab30d52 Improve QAccessibleApplication
Add more testing.
This uncovers that currently the QDesktopScreenWidget
shows up as child of the app. Fixed by not creating
QAccessibleInterfaces for QDesktopScreenWidget.

Also don't crash in indexOfChild when called with 0.

Change-Id: I9fb1e47e8f1f33189e6125f56f274a7b94ecd0dd
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-01-25 11:58:23 +01:00
Pasi Petäjäjärvi
05b4000e01 Fixed checking HOME variable return value using isEmpty()
Return value of the QFile::decodeName(qgetenv("HOME")); is never null
if HOME environment variable is not set. So need to check the return
value using isEmpty() instead.

Task-number: QTBUG-28912
Change-Id: Ic57b1978d63e99b056cde35ca8cb9d2a07ff8ce8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-25 08:51:09 +01:00
Stephen Kelly
314e5ce5ee Add an umbrella cmake config file for Qt 5.
Change-Id: I96b6e96539a84a5919992afbaee757fa080b7ae0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-24 20:37:34 +01:00
Frederik Gladhorn
d0c360fd88 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-24 18:34:11 +01:00
Friedemann Kleint
9c6a91d07b Manual file dialog test: Add showModal().
Modal dialogs can now tested by just showing or running exec().
Remove connection of accept() from applySettings().

Change-Id: I5e3c0e6405ce5682f39d10a9c06b9d61be10ed3f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-24 16:28:16 +01:00
Frederik Gladhorn
627d9cbd3c Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/plugins/platforms/windows/qwindowsdialoghelpers.cpp

Change-Id: I4ca87d44129fa5c1d8541cd58b8d62bc69080688
2013-01-24 16:02:55 +01:00
Frederik Gladhorn
4730742f69 Stabilize tst_qabstractslider
When simulating hight load, this test failed 4 times out of 80 runs
on my machine.
With this patch I could no longer reproduce the failure.

Change-Id: I42748de0200b9094c8facf0e33f3794002ec1d01
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-24 15:16:19 +01:00
Tor Arne Vestbø
fed2d237b7 Extend lance-tests for text/statictext to check flipped/negative scale
Change-Id: I0504a6676f1acaa13ea1826e945d1faa51dd4e48
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2013-01-24 13:45:01 +01:00
Roman Pasechnik
45be71bf7d Added initializer list constructors for Qt associative containers.
Affected: QSet, QMap, QMultiMap, QHash, QMultiHash.

Task-number: QTBUG-25679
Change-Id: I01f3ecfbca805f4c053a75232188bd2a77fdb1f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-24 11:38:54 +01:00
Andreas Aardal Hanssen
6476d6728e Make sure QGraphicsItem notifies changes to focusScopeItem.
A glitch in QGraphicsItem's logic made it update the focusScopeItem
pointer, but fail to notify the change to QDeclarativeItem through the
d_ptr->focusScopeItemChange() virtual function, hindering
QDeclarativeItem from emitting focusChanged() correctly for focus
scopes that do not have focus.

Two lines were moved, and a comment updated to reflect the reason
why the "return" is needed at this point. It's clear that the
calls to focusScopeItemChange() are unrelated to the return.

Task-number: QTBUG-29260
Change-Id: I12ba9161b16d34c3689401a92c86d2047989f7bd
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Alan Alpert <aalpert@rim.com>
2013-01-24 02:20:34 +01:00