Commit Graph

4372 Commits

Author SHA1 Message Date
Liang Qi
c2b8ebe9db tests: make qt_on_cocoa build again
QPA was public since 36547f4eff.

Change-Id: I838cc0736dc75e5301dd41f3ea89848f300443d4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-11-04 15:42:09 +01:00
Andrew Knight
04d1da1c1b Fix QTimeZone test compilation on WinRT
WinRT doesn't use the Windows Timezone backend, so don't build the
Windows test.

Change-Id: I32620546de3ad1f19402cc1359f8038200c915ec
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-11-04 11:16:34 +01:00
Andrew Knight
8120083436 Replace use of putenv in test case
This should be using qputenv; putenv is deprecated on MSVC.

Change-Id: I7c27cf5f7955624fa3553b7a34ab11c6fae462b8
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-11-04 11:16:16 +01:00
Friedemann Kleint
dd5f1ab454 Fix compilation of the manual dialogs test with Qt 4.
This is useful for comparisons and bug fixes.

Change-Id: Ib5c5bcb7df4b15779be0b613782206f052c94430
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-11-01 16:37:36 +01:00
Jan Arve Saether
7b33bd4110 Fix stability issues in tst_qwidget with VERIFY_COLOR
The grabbing always grabbed the desktop. This caused it to also grab
tooltips, siderbars etc that could overlap the window which again
caused the pixmap comparison to obviously fail.

This will currently only fix it on windows. If needed, it should also
be fixed for other platforms.

Task-number: QTBUG-30566
Change-Id: I5cee8651e1d94dedded0acae8b19f351acd976c4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-11-01 14:52:47 +01:00
Chengyong Xie
04de24c644 Fix setVisible() of QWidget has no effect in QTreeWidgetItem
Check if the item is hidden before show the item(QWidget)

Task-number: QTBUG-13522
Change-Id: I1c605d5cb8a80f340e9b7601612d3760f51cb4a7
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2013-10-31 19:41:49 +01:00
David Faure
a9b6a78e54 QThreadPool: fix race at time of thread expiry.
The current synchronization mechanism was racy: decrementing waitingThreads
and then hoping that the wakeOne will wake a thread before its expiry
timeout happens. In other words, on timeout, a just-assigned task would
never run. And then no other task would run, if maxThreadCount is reached.

Fixed by using a queue of waiting threads (rather than just a count), and by
moving the wait condition into the thread itself, so we know precisely
which one we're waking up, and we can remove it from the set of waiting threads
before waking it up, and therefore it can determine on wakeup whether it
has work to do (caller removed it from the queue) or it expired (it's still
in the queue). This is reliable, whereas the return value from QWaitCondition::wait
isn't reliable, when the main thread has already decided that this thread
has work to do.

Task-number: QTBUG-3786
Change-Id: I1eac5d6c309daed7f483ac7a8074297bfda6ee32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-31 17:45:58 +01:00
Friedemann Kleint
33a88d6cd7 Stabilize moveChild/showAndMoveChild-tests.
Pass window flags on to ColorWidget constructor and use a window
frame + stay on top-hint for the moveChild/showAndMoveChild tests
to make the screen grabbing more reliable.

Disable animations on Windows since they seem to affect screen
grabbing as well (fading in of windows).

Task-number: QTBUG-30566
Change-Id: I8eacfc203d26674dc1b283d6643f3d434f218f26
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-10-31 14:22:25 +01:00
Jørgen Lind
aa92cab346 remove compiler warning
Change-Id: I40750320d21165333b195aca7564a6f4ee9d9eef
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-10-30 13:09:47 +01:00
Marc Mutz
ed827acc27 QSignalBlocker: (new) RAII class for QObject::blockSignals()
I don't think I ever worked on a project of non-trivial
size that didn't at some point add a QSignalBlocker.

This commit adds code, tests and documentation. Later
commits will convert naked blockSignals() calls to use
QSignalBlocker.

The implementation is purely inline to avoid the heavy
overhead of cross-dll function calls for this miniscule
task. This should not be a problem because QSignalBlocker
only uses public API and a pattern that we anyway need
to keep working until Qt 6, at least, so even changing
the implementation later will be no problem as the old
implementation lurking in non-recompiled code will be
acceptable, too.

This implementation is an evolution from KDTools'
KDSignalBlocker, with the following changes:
- Implements unblock() and reblock()
- Uses the return value of blockSignals() instead of a
  separate signalsBlocked() call.

Change-Id: I1933dfd72a0f5190324be377cfca3c54cf3d6828
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:56:44 +01:00
Simo Fält
c1f76a3347 Adding CI utilities to Android test script
It is now configurable if test results are stored in xml, plain text
or in both formats. Default is xml, like it was,
Max runtime is also configurable so that we can reduce the CI round.
With default setting it takes more than eight hours within current
CI node.
The latest test result dir is linked as latest.

Change-Id: I5d27cefe17e4f86648132db7ec104711d993c3de
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-10-30 11:29:04 +01:00
Stephen Kelly
fae95d5da3 Test that Qt tools can handle ' as a digit separator.
Change-Id: I0a3446d02184989c32367e66d4f5d9e464a56ec6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-30 09:44:07 +01:00
Joerg Bornemann
721ec98501 remove qt_windows.h include from qwineventnotifier.h
We must not include qt_windows.h in public headers,
otherwise we're cluttering the environment with a colorful
bouquet of Windows API preprocessor macros and typedefs.

Task-number: QTBUG-34058

Change-Id: I415717ea2a47f39e7f4b7ce1c1df9d49afc99278
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-29 19:59:17 +01:00
Gabriel de Dietrich
12981e70a8 MacGui tests: Remove references to CGPostMouseEvent
CGPostMouseEvent is obsolete and known to have "undocumented special
cases and undesirable side effects." The newer Quatz API doesn't
allow neither multiple mouse button events nor preserving the mouse
cursor location.

Change-Id: I121b02fd01e2990488b05e45431cbdc13589656e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-10-29 18:30:48 +01:00
El Mehdi Fekari
2a704239ea QLocale: Add auto tests for Poruguese(Brazil) and Greek locales
Change-Id: Ib1b553efb39a150710ceb609d2cb099f19f73e35
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-10-29 16:09:53 +01:00
Oto Magaldadze
e913972d52 added QAbstractSpinBox::setGroupSeparatorShown function.
[ChangeLog][QtWidgets][QAbstractSpinBox] QTBUG-5142 - This will
allow a group (thousand) separator to be shown in QSpinBox
and QDoubleSpinBox widgets.

Task-number: QTBUG-5142

Change-Id: I2e23f5f83c93bb092a2dbd784e06d17d40d42909
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-10-29 12:12:16 +01:00
Marc Mutz
1ea191276e QWizard: give all buttons an objectName
Only Commit, Finish and Cancel didn't have an object name, yet.
Also Extract Method on the switch statement, add a test, and
use QStringBuilder.

Task-number: QTBUG-29924
Reported-by: Leo Arias

Change-Id: I8c29606bc53e9d4caab631da2089e971a9da2d75
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-10-28 12:05:22 +01:00
John Layt
041abb9316 QPrintSupport: Move QAbstractPrintDialog test into QPrintSupport
Move the test for QAbstractPrintDialog from widgets into printsupport

Change-Id: Ia7595fa650a7ad565df3090207500ed06564e842
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-10-26 00:39:51 +02:00
J-P Nurmi
1f22c1d981 Introduce QTextDocument::baseUrl
Required for QQuickText & friends to implement image resource handling
in a clean way - to get rid of QQuickTextDocumentWithImageResources and
eventually make QQuickTextEdit's document interchangeable.

Change-Id: I97314a6c3e2d5726539d5722795a472631388cb0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-10-25 14:18:05 +02:00
Frederik Gladhorn
840f6a40e6 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ie56539b2e0be611a363b5f15ae5412a78d6945a2
2013-10-24 12:48:42 +02:00
Shawn Rutledge
7e30d3afd3 QFileDialog can delete files too, not just directories
After Ic12de12ec51c20de52d040514e90be5e783add43 this functionality
was broken.  Added an autotest.

Task-number: QTBUG-34159
Change-Id: I8f41b7073dc57fea855ab87796f09e8a91520d13
Reviewed-by: David Faure <david.faure@kdab.com>
2013-10-23 19:09:54 +02:00
J-P Nurmi
a83983d861 QTextHtmlParser: restore the default link color from app palette
The default link color used to be resolved to the link color of the
application palette, but got lost during the Qt 5 modularization (see
commits 7351a43 and 3f9a7f9).

Task-number: QTBUG-28998
Change-Id: I7f07427f6c03f83c557100938ad9f7a39349d303
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-23 00:01:44 +02:00
Tasuku Suzuki
109bf980b3 Fix a bug in QSqlQuery::isNull documentation
the method returns true if there is not such field.

Change-Id: I25db8de4561d3e0604f3e64edc1810140ba4aad2
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-10-22 17:05:47 +02:00
Gunnar Sletta
72a7882cec Better QWindowContainer by not relying on native widgets.
We change the behavior slightly from the initial implementation in
5.1. Forcing the use of native child widgets is causing massive
performance issues so instead, we attach the embedded QWindow directly
to the root window. The only exception is QScrollArea and QMdiArea
which still enforces native windows for the entire parent chain
to make clipping and stacking work.

Task-number: QTBUG-34138
Change-Id: If713637bd4dce630552ace2f8ad6b2e86c063721
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-10-22 10:46:21 +02:00
Friedemann Kleint
2d107c20b9 Fix settable style hints.
Introduce QStyleHintsPrivate and introduce internal
setters called by QApplication.

Task-number: QTBUG-33991
Change-Id: Id61f8b1e2b5c9cfd7b4713aaded66e93e6f63719
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-10-22 10:04:48 +02:00
Sergio Ahumada
bdc558019a tests: Replace Q_OS_MACX -> Q_OS_OSX
Use the correct identifier for the OS X operating system.

Change-Id: I7158a6b77e5e7418bc6b0a565f003500820a346d
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-10-21 10:37:56 +02:00
Simo Fält
32ca647067 Enabling CI usage for runtests_androiddeployqt.pl
- Fixed issues when having multiple devices connected at the same
  time.
- Fixed hard coded paths
- Removed not existing function call, which caused test run to exit
  too early.
- Added possibility to add and connect to device, configured as env
  variable.

Task-number: QTQAINFRA-641
Change-Id: I8c1e003ce4ffbc9fdd9572dc55eef8fe92330cba
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-10-20 09:37:33 +02:00
Oswald Buddenhagen
bae926e66d exclude gui-needing tests from -no-gui build
Change-Id: I91f7211efe44cbb41aa3058f85869a6babf121f3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-10-18 20:05:27 +02:00
Andy Shaw
c057e23b02 When creating QVariant(QPolygonF()) this should be a null variant
The handling of the null QPolygonF case was not correct as it would
always be seen as valid. This ensures it is treated in the same way as
QPolygon when it is in fact null.

[ChangeLog][QtGui][QPolygonF] When a QVariant holds a QPolygonF()
then it will be correctly seen as a null QVariant.

Change-Id: Icae34f513c3a8e1dd3f50cb64a3d13ae7c636cc4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-10-18 20:05:09 +02:00
John Layt
93f5e0598a QDateTime - Fix RFC 2822 Date Formatting
The RFC 2822 date format should always use en_US locale for month and
day names instead of whatever the system locale is.  Also remove some
duplicate code.

Change-Id: Ia2f7ee405b4e0e2f04980301783b9488628da73f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-17 23:31:10 +02:00
Kurt Pattyn
979a55a1ef Add explanation to QEXPECT_FAIL statements
Added clarifying explanations to the QEXPECT_FAIL statements.
Now it should be easier to understand what is expected from the parser.

Change-Id: I1dacd60564f292d9ce43de7254525c34fa7cdc55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-17 09:50:58 +02:00
Kurt Pattyn
add2bf739a Allow non-character codes in utf8 strings
Changed the processing of non-character code handling in the UTF8 codec.
Non-character codes are now accepted in QStrings, QUrls and QJson strings.
Unit tests were adapted accordingly.
For more info about non-character codes,
see: http://www.unicode.org/versions/corrigendum9.html

[ChangeLog][QtCore][QUtf8]
UTF-8 now accepts non-character unicode points; these are not replaced
by the replacement character anymore

[ChangeLog][QtCore][QUrl]
QUrl now fully accepts non-character unicode points; they are encoded as
percent characters; they can also be pretty decoded

[ChangeLog][QtCore][QJson]
The Writer and the Parser now fully accept non-character unicode points.

Change-Id: I77cf4f0e6210741eac8082912a0b6118eced4f77
Task-number: QTBUG-33229
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-17 09:50:58 +02:00
Morten Johan Sørvig
89ef515177 Add JSON parsing support to qmake.
Add qjson* implementation files from corelib/json
to the qmake build. Add a read-only compile mode,
enabled by defining QT_JSON_READONLY.

Add qmake built-in function parseJson(file, into)
which parses a json file into the given variable.

qmake uses a flat key -> value-list implementation
for storing variables, which means that some hackery
is need to represent arbitrarily nested JSON. Use a
special "_KEYS_" variable for arrays and objects:

Arrays:
["item1", "item2"]
$${array._KEYS_} -> 0 1 2
$${array.0} -> "item1"
$${array.1} -> "item2"

Objects:
{ "key1" : "value1", "key2" : "value2" }
$${object._KEYS_} -> key1 key2
$${object.key1} -> value1
$${object.key2} -> value2

Change-Id: I0aa2e4e4ae14fa25be8242bc16d3cffce32504d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-10-17 08:07:25 +02:00
John Layt
6a63554bf8 QDateTime - Fix toTimeSpec() for invalid datetimes
Check if the datetime is valid before converting it to a different time
spec.  If it is invalid then just change the spec to keep behavior
consistent with 5.1.

Task-number: QTBUG-34020
Change-Id: I6630ec1d50f810a2178ab3222bd32af018085f81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-16 21:29:17 +02:00
Kai Koehne
15ddb91bc7 Print non-default categories in default message handler
Change the default output of the logging framework to prefix messages
with a 'category: ' in case the category is not "default", so that e.g.

  QLoggingCategory cat("qt.core.codes.windows");
  qCWarning(cat) << "MultiByteToWideChar: Cannot convert multibyte text";

will print

  qt.core.codes.windows: MultiByteToWideChar: Cannot convert multibyte text

while output from qWarning etc will show unaltered output. This should
help users to discover categories, and to group output together.

Change-Id: Iac2e1514f7dc5671966c36a440a119c857564cfc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-10-16 17:10:15 +02:00
Oswald Buddenhagen
e7c5891927 don't test Qt::codecForHtml() - build with -no-gui
the function is a trivial wrapper for the QTextCodec one, so there is
little point in explicitly testing it.

Change-Id: I0c4950e5a54b7ffff9ba73a001cedb517497a596
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-16 17:10:15 +02:00
Oswald Buddenhagen
f14e268694 don't erroneously claim that gui support is needed
Change-Id: Ia7b1f02cab9fa0fc9e487ca49d75e85ed0cfee9d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-16 17:10:15 +02:00
Eskil Abrahamsen Blomfeldt
f1b46a5ee0 Android: Add test script based on androiddeployqt
There are a few problems with the Quadruplor setup in Qt 5.
First of all, it doesn't work with modules, since it has
a hard coded library dependency list. Second of all, it
duplicates the application template, so changes need to also
be duplicated. This often gets out of sync. Third of all,
it duplicates a lot of deployment rules which are now contained
in androiddeployqt.

Task-number: QTBUG-33996
Change-Id: I0630a38aeba7d0075df8fae671abc311fc36de61
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-10-16 08:39:57 +02:00
Eskil Abrahamsen Blomfeldt
5c64847ba3 Android: Build autotest service against android-10
No need to default to yet another SDK here. This is a left-over
from Necessitas, which supports versions down to android-4.

Change-Id: I2e79be641288c14f92c205b30f2db6db793d783f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-10-16 08:39:48 +02:00
Friedemann Kleint
8178a6cab1 Add missing operators QMargins -=,+= (int).
Task-number: QTBUG-34079

Change-Id: If61cc01ba70345b01f13072769d3a38f23e8cefc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-15 18:20:37 +02:00
Andy Shaw
89c01c3242 Only emit messageChanged() if the message has actually changed
This fixes QStatusBar so it is back to the original behavior of only
emitting the signal when the message has changed. The intention of the
code that caused this to break in the first place is kept intact.

Change-Id: I2f57c2abec01246ed924626ad954ac9ff9889855
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-10-15 13:01:59 +02:00
Jan Arve Saether
4684f2179b Change return type of imagePosition to QPoint
QAccessibleImageInterface already has an API to return the
size of the image.

This function ensures that their API's are not overlapping.

Alternatively, we could merge both functions into
QAccessibleImageInterface::imageRect(), but the assumption is that
images change position more often than their size.

Change-Id: I55c25cdff187b9f497828f04cfd5f969cfbc451f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-10-15 12:42:17 +02:00
Shawn Rutledge
37ca2224ec QFileDialog: don't create widgets if the platform dialog will be used
This is a performance and memory optimization which also fixes bugs
that are related to creating widgets, file system models etc.
despite using platform native dialogs.  Similar to
785bc64f8e for QColorDialog.

Task-number: QTBUG-33039
Change-Id: Ia1aa7ec1f43b47006b9ebd377aed15c958538a17
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-10-15 08:14:48 +02:00
Andy Shaw
5c301f4121 Account for QPolygonF type when loading/saving the QVariant
When the QPolygonF type was added to QMetaType it did not bump up the
values in load() and save() for QVariant.

Task-number: QTBUG-33981

Change-Id: I7ad99cda70620c5449c15527c3daf920972d047f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-10-15 08:14:48 +02:00
Simo Fält
cd13fe44cd Skip tst_QGraphicsItem::paint() on Mac OS X 10.7
The test is randomly failing on CI when ran on 10.7.

Task-number: QTBUG-31454
Change-Id: I79fce9a37616c6abaee960e338f8eea8fe6f31cf
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-10-15 06:20:01 +02:00
Friedemann Kleint
12b68ed072 Stabilize tst_qmenu on Mac.
Position cursor outside and move once more.

Task-number: QTBUG-33972

Change-Id: If060f1359361981cf1243d8d2a4ebef181689d74
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-10-14 17:29:37 +02:00
Frederik Gladhorn
f86ffab402 Accessibility: simplify dockwidget accessible
This patch merges the two classes that were used to make
dock widgets accessible into one.
The title bar does not need to be represented by its own
accessible object.

In addition the buttons on the toolbar are now labelled.

Task-number: QTBUG-33946
Change-Id: Id90d8c09f15ed683e64dbe3f6ac55bca7a0b300f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-10-14 15:00:15 +02:00
Andy Shaw
3fe242781e Export the block's line-height settings to html
Task-number: QTBUG-28404

Change-Id: I87e03ecd981c302a5aefdadf7bcfd9729e37bd13
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-10-12 00:02:04 +02:00
Oswald Buddenhagen
580096d611 rewrite qtMetaObjectInheritance() without gui
Change-Id: Ie024a3ee755cfe4996ed442686cd73ce13a2d5ff
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-11 21:03:39 +02:00
Oswald Buddenhagen
9c5e63ceb3 support building with -no-gui
Change-Id: I1c418e2aa6c01dbc40156a3494a7f7ddc95beca3
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2013-10-11 21:03:30 +02:00
hjk
7a47aebe9e Let QLoggingCategory::defaultCategory return a pointer
The pointer can be null. Going trough the reference invokes undefined
behavior here.

Change-Id: Ia84e4e732cdcbbaee0f5f0679765d18069ea8b2d
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-10-11 19:15:29 +02:00
Friedemann Kleint
2b8e571f84 Stabilize tst_QComboBox::keyBoardNavigationWithMouse.
The cursor needs to be within the view from start on Mac.

Task-number: QTBUG-33973
Change-Id: I313c9fd1c3a917e135a92497f1818d1b0d8b7698
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-10-11 18:47:27 +02:00
Frederik Gladhorn
d0eb444a49 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ib8cfeee7d9ca15e8ad520e428b72c200827a8628
2013-10-11 16:12:35 +02:00
Andy Shaw
6f65466137 Ensure CSS rules are inherited from the parent tags
When CSS was set in the head tag then it was not being inherited by the
child tags. This ensures that the inhertiance happens and that the deeper
the CSS is set then it will ensure that it has precedence over the ones
set on the parent.

A test is added that shows the standard inheritance from the head tag and
the precedence from child tags in effect too.

Task-number: QTBUG-28770

Change-Id: I30be3ec141b2cd8d6e0db8a92669aed34da93b33
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-10-11 12:05:59 +02:00
Sergio Ahumada
da0cb32b8e Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-10-09 15:50:11 +02:00
Albert Astals Cid
7f3e3c1099 Compare QIcon QVariants by their cache key
This makes it so that two QVariants created from the same
QIcon (or from QIcons that were assigned one from eachother)
compare to true.
Unfortunately creating two QIcons with the same path and
comparing them still gives false as they have different cacheKeys

Change-Id: Iafe2bc4082a830f9c6469f083c26a7abbe4b35c5
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-10-09 13:15:54 +02:00
Oswald Buddenhagen
d3ba95f5c1 don't unnecessarily use qtgui
Change-Id: Ia4162d75ef6ebf87f36d40163d5ffc89eae64dc6
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-10-08 20:39:03 +02:00
Sebastian Schuberth
ac5f4a8e76 Allow to use short names for Windows Registry root keys
Change-Id: I58b7681bb49e93b7577bc559d754c81d3c6f007b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-10-07 19:09:37 +02:00
hjk
32f27b4367 Replace QLoggingCategory::isEnabled by non-template functions
This yields the same results as previously and is more in line
with existing interfaces.

Change-Id: I0bf0372bf18f3bfde579385cddbe594bf71e3c52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-10-06 19:47:31 +02:00
Frederik Gladhorn
f191fe7cab Fix potential crash: adding int to string
qtbase/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp:652:36: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
        f.write(QByteArray("i am " + i));
                           ~~~~~~~~^~~
qtbase/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp:652:36: note: use array indexing to silence this warning
        f.write(QByteArray("i am " + i));
                                   ^
                           &       [  ]

Change-Id: Icc966559be3c2cde3416193b8a1ddab7e0323ade
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-04 01:19:38 +02:00
Frederik Gladhorn
d8fc0da235 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/plugins/platforms/minimal/qminimalintegration.cpp
	src/plugins/platforms/offscreen/qoffscreenintegration.cpp

Change-Id: Ica85deeab5c5038ac004718e25194b1157343480
2013-10-04 00:44:18 +02:00
Friedemann Kleint
cdf0c5905b Fix temporary file leak in tst_qfiledialog2.
Change-Id: I5a1e601e3aa6e84300efa09bfbd9232fecab903e
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2013-10-03 21:43:56 +02:00
Oliver Wolff
8cbc90ffb2 Winrt: Skip qthread autotests, which are not supported (yet)
Change-Id: Ib1047731667ba8a7b9db2f62924eb42a6b85b4fd
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2013-10-02 12:36:09 +02:00
Oliver Wolff
ffb92a5691 Winrt: tst_qthread: Added QEXPECT_FAIL where needed
Change-Id: I88d98421978e0f5c55af8647f3f74c265b45bd37
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2013-10-02 12:36:07 +02:00
Andrew Knight
c6af0a504f WinRT: Fix various test compilations
- Remove irrelevant test subdirs via .pro files
- Follow WinCE codepaths where applicable
- Replace unsupported Win32 APIs with WinRT equivalents

This does not aim to fix any failures in the tests themselves; it only
makes them compile.

Change-Id: Ia82bc0cc402891f8f6238d4c261ee9152b51be80
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-10-02 12:36:05 +02:00
Frederik Gladhorn
04acfea2d2 Fix QStandardPath test on some linuxes
On one suse box I have both /usr/bin/sh and /bin/sh which means that the
test should prefer the one first in the path instead of random order.

Change-Id: Ie94bf8404479fa42a36a8ee45e09986114693871
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-02 11:11:23 +02:00
Jan Arve Saether
649e0b6002 AccessibleRelation::get_relationType didn't handle all enum values.
Add some more tests for relations
Change-Id: I934cd6aed36ca5ca88786325ed364fbc3abfc6f7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-10-02 00:03:24 +02:00
Tor Arne Vestbø
2c925906f5 Base tst_QGuiApplication on tst_QCoreApplication to increase GUI ED coverage
The QCoreApplication test has quite a few test cases that we would like
to exercise using the GUI event-dispatcher. Instead of duplicating the
tests for the GUI dispatcher, we inherit tst_QCoreApplication, which
also lets us add extra tests that are specific to tst_QGuiApplication.

Change-Id: Ib411457131b8d3fed871f682c1c0568577f6127d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-10-01 18:00:17 +02:00
Friedemann Kleint
d8a489ccc2 Fix temporary directory leak in tst_qsavefile.
Task-number: QTBUG-33769

Change-Id: I5177f09df22fd2b9b0d9eca4301c383c600d5ab8
Reviewed-by: David Faure <david.faure@kdab.com>
2013-10-01 12:28:22 +02:00
Andrew Knight
aa5f78cb33 OpenGL autotests: verify create()/makeCurrent()
If create() or makeCurrent() calls fail, the test should fail fast.

Change-Id: I025c541f94c8eee492cf0e1545bfbb8027eff2a7
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-30 14:18:38 +02:00
Friedemann Kleint
99b3e68f20 tst_qsavefile: Check temporary dir and output open errors.
Change-Id: Id28306ad414050a37b7779525f36edc3e15281b5
Reviewed-by: David Faure <david.faure@kdab.com>
2013-09-30 13:37:58 +02:00
John Layt
475cbed244 QDateTime - Fix round-trip of second occurrence times
At the Daylight Tme to Standard Time transition, the local time repeats
itself, i.e. 2am occurs twice. Qt's behavior when setting this using
the local time is ambiguous, as it depends on the system implementation
of mktime, which behaves differently on different platforms.  Currently
this behavior remains undefined.  When setting using an msecs or time_t
value however we can determine the correct instance to use and cache it
to ensure that any conversion back from local time to msecs is performed
consistantly on all platforms.

Note that caching this value will result in any calculations being wrong
should the system time zone change, or its rules change.  This will be
fixed in Qt 5.3 when the system time zone change signal is implemented
and QDateTime switches to using QTimeZone instead of mktime to provide
consistnt behavior across platforms.

The QTimeZone spec does not require this fix as it already caches the
correct offset in setMSecsFromEpoch().

Change-Id: I799588db474e744a6d81e80f6a0442920569ebd3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-27 21:47:55 +02:00
Sergio Ahumada
16a36239ab Merge branch 'stable' into dev
Change-Id: I06694436322a7810a163b27b8a059cee2b046f06
2013-09-27 11:15:09 +02:00
Jan Arve Saether
e37001aad7 Say hello to qFloatDistance()
This function is useful if a floating point comparison requires a
certain precision. The return value can be considered as the precision.
For instance, if you want to compare two 32-bit floating point values
and all you need is a 24-bit precision, you can use this function like
this:
if (qFloatDistance(a,b) < (1 << 7)) {   // The last 7 bits are not
                                        // significant
    // precise enough
}

Task-number: QTBUG-32632

Change-Id: I020a58d2f9f9452ac3c510b4bb560dc806f0d93c
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-27 07:57:23 +02:00
Liang Qi
5b70efb125 Mac: QWizard default background pixmap works again
Task-number: QTBUG-26722
Change-Id: I579111b5d34f8e3cdc6bb016d9c0e42ec3ffb8c9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Stephen Chu <stephen@ju-ju.com>
2013-09-26 20:42:33 +02:00
John Layt
77dc33dcdb QLocale - Fix Mac date format code translation
Mac uses the CLDR format codes which need to be translated into their
Qt equivalent.  The existing code mistranslates the year code, is
outdated for a number of new codes introduced in recent versions of
CLDR, and by default accepted any codes it didn't recognize.

This change updates support to the latest version of CLDR, fixes the
treatment of years, and defaults to ignoring any new format codes
added in the future.

Note that this change cannot have auto tests written as the system
locale formats change between versions of OSX.  Testing must be
done manually by changing system locale and formats.

Task-number: QTBUG-25057

Change-Id: I69dda25b4a0b38d3971995644546306876922d57
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-09-26 20:42:33 +02:00
Marko Pellikka
e120ad442d QString::reserve fix to avoid truncation
In case of implicit memory sharing, QString::reserve caused data
truncation if given size was smaller than size of data.

Task-number: QTBUG-29664
Change-Id: If2da5ad051385635ebb829c18b5ebaa349f08e8a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-09-26 18:45:16 +02:00
Tor Arne Vestbø
a3530859e9 Expose QTest::currentAppName() and remove hard-coded argv[0] in tests
Except where we're actually testing QCoreApplication::applicationName()
and friends.

Change-Id: I25514884c11f43a4f82b1f818f822dc3d79f69a3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-09-26 18:45:16 +02:00
Kamil Trzcinski
d7af71b318 threading support for winrt
Change-Id: Ife296e15ddf727c3f53ab3d3d84634b5c7bbf85c
Done-with: Maurice Kalinowski
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-26 17:26:51 +02:00
Tor Arne Vestbø
d4ec6331bb tst_QNetworkReply: Don't remove file if never created
If we end up QSKIP'ing the test 'wronlyFileName' is never created.

Change-Id: I2ccbfdb630b58d7904e73b476a65a82a45ab90d7
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2013-09-26 08:40:38 +02:00
Ivan Komissarov
f3a723f2ec Add QKeySequenceEdit
Change-Id: I497309d3e6cbf38b298afb5ff3cb1ed6a0e82000
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-09-24 10:55:17 +02:00
Stephen Kelly
72d6717b26 moc: Don't stumble over MSVC __declspec.
Commit 310031188c (Fix moc stumbling over gcc __attribute__
extensions, 2012-10-01) applied similar logic for GNU style
attributes.

Change-Id: I550eaefd703b4e974e6ffae7716f02074c8a8823
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-24 10:09:14 +02:00
Andy Shaw
be8999038f When calling setPageSizeMM then the size needs to be passed as MM
This simplifies the code a bit and ensures that it is respecting what
the relevant function expects the size to be as.

Change-Id: Iec88fab84c27a33d6f1a9e9413ea6beb0a39c68d
Reviewed-by: John Layt <jlayt@kde.org>
2013-09-23 23:17:35 +02:00
Jan Arve Saether
bb9cc387f0 Fix a c&p bug in the IA2 bridge when returning the row description
Unfortunately we returned the column description when the AT client
asked for the row description....

Change-Id: I46bc0edb4fd0f7cc6d98d7d6e0d8ca6f77553a26
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-09-23 16:08:34 +02:00
Marc Mutz
05cd06cff3 tst_QReadWriteLock: replace a volatile bool with an atomic int
Fixes the obvious race between the test of 'release' in the thread
and the setting of 'release' in the test function.

Change-Id: I92df52d7b18e8154f17229a3dbd4a0e58f4a3b5b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-23 02:47:49 +02:00
Marc Mutz
c0251f3041 tst_QMutex: fix a race
The code uses a QSignalSpy to check whether the thread started,
but the signal emission (and subsequent appending to the spy) and
the check for spy.count() before the final thr.wait() are not
synchronized:

The signal emission happens-after the thr.start() and -before the
final thr.wait(). Likewise, the spy.count() happens-after thr.start()
and -before thr.wait(), but neither one happens-before the other.
Thus, there is a data race.

The wait(200) between thr.start() and mutex.unlock() doesn't help,
either, because we check only that it doesn't return true, iow, we
check that it timed out. But it will happily do that if the thread
has not yet started executing, so there's no happens-before relation
to be had via that avenue, either.

I first fixed by moving the spy.count() check to after thr.wait().
In that case:
  signal emission happens-before thread finishing
  happens-before thr.wait() returning
  happens-before spy.count()
so no race.

Arguably, that makes the check rather useless, so I decided to remove
it completely.

Change-Id: I6bb47c4114961ee6e9251cfebeb4b7794ba674a9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-23 02:47:49 +02:00
John Layt
4f563cf093 QDateTime - Remove some benchmark tests
Remove benchmark tests that are no longer required as they are simple
overloads of other methods.

Change-Id: I610211543d17c077f482fa2145ac3da7d0767282
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-23 01:14:10 +02:00
John Layt
55f5b29d79 QDateTime - Add QTimeZone support
Add support to QDateTime for time zones using the new QTimeZone class.

[ChangeLog][QtCore][QDateTime] Add support for a new Qt::TimeZone
spec to be used with QTimeZone to define times in a specific
time zone.

Change-Id: I21bfa52a8ba8989b55bb74e025d1f2b2b623b2a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-23 01:14:03 +02:00
John Layt
8af776d414 QTimeZone - Add Windows backend
Add backend implementation for Windows times zones.

Change-Id: I30946f6672488c3f1d1d05754e9479aa62cce46f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-23 01:13:58 +02:00
John Layt
7ed7d66b5a QTimeZone - Add Mac backend
Add Mac backend support

Change-Id: Iafa2dbd925e18431f571e3eac62983015f8bc977
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-23 01:13:49 +02:00
John Layt
8dfaf91038 QTimeZone - Add TZ File Backend
Add a backend for TZ Files.

If available uses ICU for the display names and  translations, otherwise
the abbreviation is used.

Change-Id: I58c777462810b1a76ea7bd95886836b70b8a3db5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-22 22:21:24 +02:00
John Layt
9c2cbee2b1 QTimeZone - Add ICU support
Add ICU backend for QTimeZone

Change-Id: I92e53a848477e366591102064b093e936f0b49d2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-22 22:21:19 +02:00
John Layt
48e2c3ac33 QTimeZone - Define new class and api
Implement the new QTimeZone class based on the Olsen Time Zone ID's.

This is the base implementation and does not include the Platform
backends which are implemented separately.

This change does include a default UTC backed to be used if no Platform
backend is available, i.e. if QT_NO_SYSTEMLOCALE is set and ICU is not
configured.  This backend also provides a default set of time zones in
the standard "UTC+00:00" offset format that are guaranteed to always
exist regardless of the Platform backend.

This change includes conversion functions between the Olsen ID's and
Windows ID's using a conversion table based on Unicode CLDR data.
This is implemented for all platforms for scenarios such as a Linux
program needing to communicate with a Windows Exchange Server using
the Windows ID.

The CLDR conversion table is included under the UNICODE license, see
http://unicode.org/copyright.html for details.

[ChangeLog][QtCore][QTimeZone] Added new QTimeZone class to support
time tone calculations using the host platform time zone database
and the Olsen time zone ID's.

Change-Id: Ibb417d08cf2663a0979d2be855d2c6ad6ad01509
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-22 22:21:15 +02:00
Marc Mutz
ab55f9f39b Q_STATIC_ASSERT: use __COUNTER__ instead of __LINE__ if the compiler supports it
When using __LINE__ to construct unique names, use of Q_STATIC_ASSERT
is limited to one instance per line of code. On compilers that support
__COUNTER__ (GCC and MSVC, probably others), we can get around that
limitation by using that one to always get a new unique number, so
use it.

Change-Id: I89bcfaa32376b7a665f03e4275e89b13fa3e650d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-22 10:32:42 +02:00
Thorbjørn Lund Martsum
42d681f9cf Add widget replace function to QLayout
Sometimes it is nice to be able to replace a widget in a layout.

Change-Id: I23a6a65e417e94d53bc48639503db1a142bc3f10
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-09-21 23:17:55 +02:00
Sergio Ahumada
a5d34b34fb Merge branch 'stable' into dev
Change-Id: I37d85631ab1165ab91457d8880c4da907a9df73b
2013-09-21 17:33:15 +02:00
Morten Johan Sørvig
2b65bba77d Add Mac type conversion functions to QtCore
New API:
    static QString QString::fromCFString(CFStringRef string);
    CFStringRef QString::toCFString() const;
    static QString QString::fromNSString(const NSString *string);
    NSString *QString::toNSString() const;

    static QUrl QUrl::fromCFURL(CFURLRef url);
    CFURLRef QUrl::toCFURL() const;
    static QUrl QUrl::fromNSURL(const NSURL *url);
    NSURL * QUrl::toNSURL() const;

Add Q_OS_MAC-protected function declarations to header
files, add implementation to _mm files.

CF and NS types are forward-declared in the header
files to avoid including the CoreFoundation and Foundation
headers. This prevents accidental use of native types
in application code. Add helper macros for forward-
declaration to qglobal.h

Add cf_returns_retained/ns_returns_autoreleased attributes
to toCFString() and toNSURL(). These attributes assists
the clang static analyzer. Add Q_DECL_ helper macros
to qcompilerdetection.h.

Add test functions (in _mac.mm files) to the QString
and QUrl tests. Split out the test class declarations
into a separate headers files.

Change-Id: I60fd5e93f042316196284c3db0595835fe8c4ad4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-09-21 05:09:41 +02:00
Jake Petroules
f9365b0acc Use the correct identifier for the OS X operating system.
This is consistent with other areas of Qt:
qmake, Qt.platform.os (QML), qbs.targetOS (QBS), and #define Q_OS_OSX.

Change-Id: Ibf98e6ba3556a14187dadae1b0235e9c907c9001
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-09-21 05:09:16 +02:00
Sergio Ahumada
642ebccaad Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-09-21 02:59:14 +02:00
Oto Magaldadze
6b95130faa QCompleter::setFilterMode() add property filterMode.
QCompleter::setFilterMode(Qt::MatchContains) will enable filtering
out entries that contain typed characters in any place, instead of the
default behavior when only those entries that start with typed characters
are displayed. Qt::MatchEndsWith is also possible.
QCompleter::setFilterMode(Qt::MatchStartsWith) will bring the default
behavior back.
Task-number: QTBUG-3414

Change-Id: I3845704c59eb8fc401e9a650c54a9c934ed28c2e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-09-20 23:45:06 +02:00
Marc Mutz
eec9567111 tst_QPainter: fix a Q_DECLARE_METATYPE coming too late
The compiler complained that the specialization was required
before it was issued. Fixed by moving it up to the others
near the top of the file.

Change-Id: I0ae162a5db5ef29f24cd1d32285a1870fdd24b9b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-20 23:45:06 +02:00
Kai Koehne
3efca77e35 Import qlogger framework
Merge most parts of the qlogger framework from

git://gitorious.org/qtplayground/qlogger.git

The categorized logging feature is a replacement for qDebug, qWarning and
friends. With logging statements in an app/library, a developer can
turn on the statements they care about and turn off the ones they don't.

Most work for this was done by Wolfgang Beck and Lincoln Ramsay.

Task-number: QTBUG-25694
Change-Id: Ib0cdfbbf3694f86ad9ec553b2ea36f09a477cded
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-20 23:45:06 +02:00
John Layt
8d6ee59948 QDateTime - Add api for isDaylightTime()
Add new method to return if the current time is Daylight Time.

[ChangeLog][QtCore][QDateTime] Added new method isDaylightTime() to
return if the datetime is in Daylight Time or not.

Change-Id: Icb93fd5dd0b2f7d83d2d4643eeb12922c1137e3e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-20 23:45:06 +02:00
John Layt
7b07c3ff78 QDateTime - Fix Daylight Transition for "missing" hour
When Daylight Time transtion goes from Standard Time to Daylight Time
there is a "missing" hour, i.e. at 2am CET the clock goes forward to
3am.  Currently QDateTime ignores this gap and considers the time to be
valid and able to be manipulated.  This change respects the transition,
so any time set in the missing hour is considered invalid, and any date
maths returns valid results.

The validity in the current time zone needs to be checked every time
isValid() is called in case the system time zone has changed since the
last time it was checked. This is done by calling mktime to check the
returned result matches the expected result.  This could be very
inefficient, but the returned offset value is cached each time so
mktime is not required to be called again within each method call,
effectively meaning mktime is called the same number of times by
each method. Note that this means any new methods added must be
careful to ensure either isValid() or refreshLocalTime() is called
first by any method needing to use the UTC value.

[ChangeLog][QtCore][QDateTime] The Standard Time to Daylight Time
transition for Qt::LocalTime is now handled correctly.  Any date set
in the "missing" hour is now considered invalid.  All date math results
that fall into the missing hour will be automatically adjusted to a
valid time in the following hour.

Change-Id: Ia652c8511b45df15f4917acf12403ec01a7f08e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-20 23:45:06 +02:00
John Layt
18322bfabc QDateTime - Change date/time storage to msecs
Change from storing the date and time as QDate and QTime to a serialised
msecs format.  This format is a direct translation of the QDate and
QTime values, it is not the actual msecs since the Unix epoch.  This
msecs format ensures we are always able to recreate the original QDate
and QTime values, but should still simplify the code and improve
performance.

Because we no longer store the explicit date and time we need to store
their isNull()/isValid() status separately.

The changes in storage results in the same memory footprint as before.

Note that this change does not optimize the code nor set out to fix the
known bugs, it only seeks to maintain the current behavior, although
some bugs are fixed implicitly.  More bug fixes and optimizations will
follow.

[ChangeLog][Important Behavior Changes] The supported date range in
QDateTime has been reduced to about +/- 292 million years, the range
supported by the number of msecs since the Unix epoch of 1 Jan 1970
as stored in a qint64, and as able to be used in the
setMSecsSinceEpoch() and toMSecsSinceEpoch() methods.

Change-Id: I98804d8781909555d3313a3a7080eb8e70cb46ad
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-20 23:45:06 +02:00
John Layt
662f23ff5b QDateTime - Add Benchmark Tests
Add benchmark tests for QDateTime.

Change-Id: I839f8bc81e6cae56d93539c7c3f999d9eec10ad7
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-20 23:45:06 +02:00
Liang Qi
9d56e9eae6 test: fix tst_QFont::defaultFamily on Mac OS X 10.8
Task-number: QTBUG-32834
Change-Id: Iac771eb0a544ae58d203717c39a13d2d21e3c3ed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-09-20 23:45:06 +02:00
Liang Qi
14a1d06113 Revert "test: Mark tst_QRawFont::fromFont() as XFAIL"
The commit 3745b0ca12 resolved this
issue.

This reverts commit 08d3b0165a.

Task-number: QTBUG-32654
Change-Id: Ie8dba4bd2efb35d44b70c67e59b4fff855edec79
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-09-20 23:45:06 +02:00
Thorbjørn Martsum
3e87d7e814 QMessageBox - make it possible to have a checkbox on the dialog
This (partly) solves

Task-number: QTBUG-2450

Change-Id: Ie2280c87b96e72acc76e806a83c4e8cc0d4e4ee4
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-09-20 22:02:00 +02:00
Jan Arve Saether
03520d7fde Add missing implementation in QAccessibleTabBar::indexOfChild
This avoids the assertion in iaccessible2.cpp(510)

Change-Id: I1a4c007ffcbcda70f0e37ef3cf55a303683b58c1
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-09-20 21:54:44 +02:00
Simo Fält
13c03d3c28 Set tst_qfilesystemmodel as insiginificant
The test has been failing on all platforms. Usually it just times out,
but it also have behavied flaky, failing with different error codes
when executed twice in a row.

Task-number: QTBUG-29403
Change-Id: Ic06638f0ffd23131b4c1aa4136f715195727e959
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-20 12:04:03 +02:00
Gunnar Sletta
2e2289e1b5 Disable tst_QFileSystemWatcher
Task-number: QTBUG-33574

Change-Id: Ieed6b87f34964a902f339215d74c0184a27eb2a2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-20 12:03:22 +02:00
Sune Vuorela
e24f75af4d Implement QMainWindow::takeCentralWidget()
This allows the application developer to restructure the application,
including moving the central widget some place else.

Change-Id: Idca2f74c190500db24404e020b0eb400e41aad10
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-09-20 11:54:13 +02:00
Mitch Curtis
438912f273 Revert 15da0a5af2.
It apparently breaks users' applications.

Task-number: QTBUG-33487

Change-Id: Iaeceb3a02b5c7b9ab839c14693aaffcdf9394bc6
Reviewed-by: John Layt <jlayt@kde.org>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-19 14:58:27 +02:00
Frederik Gladhorn
b449791c35 Make Accessibility public
There is no point in having QAccessible2, so merge it with the normal
QAccessible. The header will be removed in a subsequent commit as it is
still needed by declarative at this point in time.

Change-Id: I1fc47d484d482f25387eba827bc5a373536b7a8b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-09-19 14:55:19 +02:00
Riccardo Ferrazzo
31db8728cf Fix QFileSystemWatcher inotify
On linux using QFileSystemWatcher with inotify backend when a watched
file is moved and added again to the watched files its path is not
replaced with the new one. This behavior prevents the emission of
the fileChanged signal with the wrong file path.

Task-number: QTBUG-33211
Change-Id: Ib45d8efdf5afbf8b8f6b4b26e43f3d6ee740aca6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-19 09:13:57 +02:00
Stephen Kelly
4c83183e71 MetaType: Add assignment operator to the container iterators.
Change-Id: Ib4f2197a0ab6bd41c91de667cd3087fb40e44097
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-19 09:05:56 +02:00
Jan Arve Saether
e39d629ebe Include hidden headers in trees and tables consistently
There was a disagreement between the a11y plugin and QTreeView
whether the horizontal header should have been exposed or not.
When the header was hidden, this resulted in that we sent an event
with a child id that was wrong, or in worst case higher than
QAI::childrenCount(). This was the reason we got the warning
output as described in the task.

With this commit, we consistently *expose* hidden headers both for
QTreeView and QTableView, but ensure that their state().invisible is
set to true instead.
This makes it consistent with how hidden cells are exposed.

This also fixes a bug in QTableViewPrivate::accessibleTable2Index
where we always added 1 to the index, which was spotted while
writing the test.

Task-number:  QTBUG-33247

Change-Id: Ifd1f83d56296dd071424fdb81fce7628bc24fe0a
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-09-18 11:28:22 +02:00
Stephen Kelly
2af188c6d0 MetaType: Fix operator{++,--}(int) with the type-erased const_iterators.
Similar to commit 8b062418 (MetaType: Fix operator{+,-}(int)
with the type-erased const_iterators., 2013-09-11), explicitly
create a copy of the iterator and intialise it.

Change-Id: I8b9edef40ca00c826f72768cba4a0992e55371f8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-17 14:05:01 +02:00
Dario Freddi
76b06f993e QObject: allow connecting to functors with a receiver object
Up to now, it was only possible to connect to functors in a direct
way, without being capable of using Qt::ConnectionType. This patch
allows for specifying a receiver for Functors and function
pointers, hence making it possible to specify effectively the
connection type.

To do this properly, it was needed to add an enum in FunctionPointer
representing whether the considered function is a member function
or not, to reduce ambiguity upon overloaded calls.

Moreover, now senders are checked for the existence of a slot obj
as well. This way, should the context be freed, the slot obj and
the functor contained in it will be freed as well.

On a side note, connecting to a static slot
(like QCoreApplication::quit) specifying the receiver object is
now compiling.

Change-Id: I46474099413b1dc6ca4db9934191d469baeef070
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-16 23:46:30 +02:00
Alan Alpert
b674b15dff Add QFileSelector API
For easy cross-platform and cross-device UIs, automatic asset swapping
based on filename is being developed. This API provides the logic for
the swapping, so that applications can use it themselves with the same
logic as any automatic swapping done in application templates.

Selector set is initially minimal, aiming for just platform selection
and enabling a common selection mechanism for Qt platforms to use.

Change-Id: I219517d740fa7385e923a9e09cb7e241378f857a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-16 19:42:22 +02:00
Tor Arne Vestbø
4bae7158d3 Don't send posted events from QWindowSystemInterface::sendWindowSystemEvents
The responsibility of sendWindowSystemEvents() is to process events from
the window system. Historially that logic was part of the QPA/QWS event
dispatcher, which naturally also sent posted events. Through refactoring,
the code at some point ended up in in the QWindowSystemInterface class,
still with the posting of events in place.

This resulted in QPA event dispatchers adopting a pattern of just calling
sendWindowSystemEvents(), as that would cover both posted and window system
events. Other event dispatchers would call sendWindowSystemEvents(), and
then use a base-class implementation from QtCore for processing events,
resulting in two calls to QCoreApplication::sendPostedEvents() per
iteration of processEvents(). This breaks the contract that processEvents
will only process posted events that has been queued up until then.

We fix this entanglement by removing the sendPostedEvents() call from
QWindowSystemInterface::sendWindowSystemEvents() and move it to the
respective event dispatchers. For some EDs it means an explicit call
to sendPostedEvents, while others were already doing sendPostedEvents
though a separate source (GLib), or using a base-class (UNIX/BB), and
did not need an extra call.

We still keep the ordering of the original sendWindowSystemEvents()
function of first sending posted events, and then processing any
window system events.

Task-number: QTBUG-33485
Change-Id: I8b069e76cea1f37875e72a034c11d09bf3fe166a
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-09-16 15:22:40 +02:00
Frederik Gladhorn
8c6755aeec Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/tools/qstring.cpp

Change-Id: Ifc6cd3a0f1cf14cc0fe6cf30afb0c7f40cfdbc3e
2013-09-16 14:52:40 +02:00
Shawn Rutledge
26ddb586ac xcb: QWindow never uses XCB_GRAVITY_CENTER
Center gravity doesn't mean center the window, it only affects the
method of converting between internal window bounds and decorated bounds.
So wanting to have each dialog centered w.r.t. its transient parent
is not a reason for using center gravity.  Instead it caused the
bug that when you resize a QMessageBox by clicking the Show Details
button, it jumps downwards on the screen.

Task-number: QTBUG-32473
Change-Id: I3fabf3caa1e4d10fd4f7508e297f73efe5cc51b6
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-16 14:15:06 +02:00
Marc Mutz
63b6a9e6e4 tst_QTextLayout: fix unhandled enum value in switch warning
Change-Id: I006286487a409d492fe398a2fed5dd854f758f9f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-09-16 14:13:11 +02:00
David Faure
aabbd27dda Simplify QFileSystemModel::remove by using QDir::removeRecursively
This also fixes it in case of hidden or system files, which
were missing from the filter (found by Denis Kovalskiy).

Change-Id: Ic12de12ec51c20de52d040514e90be5e783add43
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-16 12:12:09 +02:00
Marc Mutz
c8411a0281 tst_qurlinternal: fix a use of memcpy on overlapping memory
The old code smply copied 100 shorts from the pointer passed into the
ushortarray ctor, regardless of the actual bounds of the original array.

Fix by making the ctor take the array by deference, deducing the size
as a template parameter, and only copying that much.

Fixes asan trace:
==18660==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x7fff3c56de00,0x7fff3c56dec8) and [0x7fff3c56dd60, 0x7fff3c56de28) overlap
    #0 0x457161 in memcpy asan_interceptors.cc:330
    #1 0x4c40fe in ushortarray::ushortarray(unsigned short*) qtbase/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp:62
    #2 0x4b0437 in ushortarray::ushortarray(unsigned short*) qtbase/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp:63
    #3 0x47b643 in tst_QUrlInternal::idna_testsuite_data() qtbase/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp:119
    ...

Change-Id: Ie497bc8d337bc680a562482ca71ace535797ffb3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-14 23:41:06 +02:00
Marc Mutz
95b62e5a71 tst_QSettings: add missing () around a macro argument use
'val' was set to
   QList<...>() << ... << ...
further down.

Fixes a Clang warning.

Change-Id: I5fe80d87dbe2c1d50652dfd7b6c5f4a9198cd467
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-14 23:40:53 +02:00
Olivier Goffart
7d7e8ae3fa Use Q_STATIC_ASSERT to report error about missing Q_OBJECT
Q_STATIC_ASSERT gives better error with C++11 enabled.

Aslo the qt_check_for_QOBJECT_macro had warning on some compiler since
it used null reference

Change-Id: Ic6115da800064b00c50a5762f0b79f5f656bf750
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-14 20:33:29 +02:00
John Layt
e76c312eb8 QDateTime - Switch to using msecs based functions
A number of QDateTime functions directly use or modify the data stored
in the private, but future changes to store msecs and status make this
maintenance more complicated.  Where possible simplify this code to use
the standard msecs functions, standard constructors, or public api
instead.  This greatly simplifies the functions and the following msecs
storage code changes.

This is an intermim step towards storing the time in msecs.  Some
functions will be slower as a result of this change, optimization
will take place after all the msecs changes are completed.

Note this also removes a test that used valid QDates outside the range
of msecs, this change in behavior will be documented in the final
mscs change.

Change-Id: I6ef710f24babc7024091010064082e9be0b5bbfe
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-14 18:31:00 +02:00
John Layt
3a8b8edd01 QDateTime - Add test case for Daylight Time Transitions
Test the Daylight Time transitions.  QDateTime does not correctly deal
with many of these scenarios so those tests are marked as QEXPECTFAIL.
These bugs will be progressively addressed in coming commits.

Change-Id: I01eba9d6143a792f081542cb198e221efcf28e98
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-14 11:38:15 +02:00
Thiago Macieira
cc74159702 Base64: Implement the "base64url" encoding and the stripping of '='
The "base64url" encoding is defined in RFC 4648, which is the newest
version of Base64. There are also a few situations where the ending
'=' is not desired.

Change-Id: I9bb9fa55817b57d125189e4e795d6fde97caea6d
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-09-14 03:20:25 +02:00
Thiago Macieira
131b3e5dca QStandardPaths: add a test that just dumps the values
Change-Id: I79bcc1974988b3d712a40e89a3ec4aeb7be1fb5e
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
2013-09-14 03:20:25 +02:00
John Layt
92b0a7fa3e QTime - Add public api for get/set msecs since start of day
Add new public api to get and set the number of msecs since the start
of the day.  Modify QDateTime to use the new msecs api.

[ChangeLog][QtCore][QTime] Added new methods fromMSecsSinceStartOfDay()
to create a new QTime from an msecs value, and msecsSinceStartOfDay()
to return the QTime as the number of msecs since the start of the day.

Change-Id: I285b725b883f1f5524fda87ca81bd64ed99fe6f4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-13 22:06:26 +02:00
hjk
63a382a930 Add a static QFileInfo::exists(fileName) function
This avoids dynamic construction of the private class. According to
the benchmark we go from 4,550 to 3,900 instruction reads per iteration.
(without change 32629676 the baseline is 5,600)

Change-Id: I5df925e30dbd49bdde87173e481820574ce5abe1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-13 19:37:51 +02:00
Stephen Kelly
8b0624182b MetaType: Fix operator{+,-}(int) with the type-erased const_iterators.
Make sure we don't modify the lhs. Instead copy it and advance the
copy.

Change-Id: I3440e8e175bfc299f8f83b816faca54fa3f79e43
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-13 14:37:41 +02:00
Richard Moe Gustavsen
31b4461097 moc: add -M<key=value> to ease static qml plugin linking
A module plugin in qml belongs to a URI/namespace. This
uri is resolved run-time by QtDeclarative by knowing the
path of the qmldir that references the plugin.
For static plugins this becomes a problem, since we lost
the information regarding which plugin belongs to which
qmldir, since a static plugin has no file path.

To avoid pushing the responsibility of clarifying this
onto the application developer, it is better to embed this
information into the meta data of the plugins themselves.
Since this information can be resolved by the
build system, a new option to moc has been added:
-M<key=value>
that will let you add meta tags to the meta data from
the command line to each class that has an IID specified.
For the URI case, we can then e.g do:
-Muri=QtQuick.Controls -Muri=QtQuick.Controls.Private

Change-Id: I81a156660148fc94db6f3cac0473e9e1c8458c58
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-13 11:48:08 +02:00
Thiago Macieira
f4ebb06189 Remove Q_PACKED from structures that do not need to be packed
These structures do not need to be packed. With some compilers, Q_PACKED
was defined to be empty, which means that the code was working fine
without packing. Or there were some lingering problems on those
platforms (MSVC) and we're now exposing them in all platforms.

Actually, it shouldn't be a problem anywhere. QCharAttributes, quint24
and QFontEngineQPA::Glyph have only char/uchar members, so they're
packed already (they have alignof == 1). The only platform where that
wasn't true was ARM OABI, which we don't support anymore.

QFontEngineQPA::Header seems to always come from a QByteArray, so it
doesn't neeed to be packed either. However, just to be sure, I'm
inserting a check for alignment.

And QFontEngineQPA::Block isn't used anywhere.

Change-Id: Iacfa25edf336ef2a03aeb6e40ae90937a21661ae
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-13 11:47:06 +02:00
Stephen Kelly
546d52e605 Add a convenient way to get a type-erased smart pointer from a QVariant.
Any known smart pointer in a QVariant can be handled in this way. The
metatype system can be informed of new smart pointer types using an
existing macro which is now documented.

This is very similar to the existing infrastructure
for containers.

Change-Id: Iac4f9fabbc5a0626c04e1185d51d720b8b54603d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-11 12:24:42 +02:00
Jędrzej Nowacki
ec846146b4 New QStringRef methods.
New functions left, right, mid were missing in the api.

Change-Id: I3590a84431555d009d5012b204c111385bdceed3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-11 08:06:21 +02:00
David Faure
aba336c2b4 QUrl: ensure that setPath("//path") doesn't lead to scheme://path
which would interpret 'path' as a hostname.
The check is in the public setPath so that the internal one can still
support parsing URLs such as ftp://ftp.example.com//path.

[ChangeLog][Important Behavior Changes][QUrl and QUrlQuery]QUrl now
normalizes the path given in setPath, removing ./ and ../ and duplicate
slashes.

Change-Id: I05ccd8a1d813de45e460384239c059418a8e6a08
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-11 01:26:07 +02:00
Thiago Macieira
8fa0e4d1d2 Add a simple test for QVariant carrying a QSharedPointer<QObject>
Change-Id: Ibe17355c7ed8d4af7fda6261d72cfd64779471a7
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-11 01:26:07 +02:00
Sergio Ahumada
bcbec4bc49 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-09-10 23:22:23 +02:00
David Faure
32fa8ab704 QCommandLineOption: improve runtime warnings
Change-Id: I48a278acf3a8eb0cfa829deb65cf65dfd8ec23af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-10 19:07:07 +02:00
David Faure
4ff6951550 Fix escape handling in qWinCmdArgs
-DKEY="VALUE" was correctly turned into -DKEY=VALUE,
but -DKEY=\"VALUE\" was turned into -DKEY=\VALUE"
due to the erroneous check ('quote' is still 0 when
encountering the first '\' character).

This fixes QCoreApplication::arguments() as used by
moc.exe after porting to QCommandLineParser.

Further investigation shows that double-quotes and single-quotes
are handled differently. The tests now ensure that this parser
respects what Windows sends in argv, and in particular that
QTBUG-15379 doesn't regress, as well as fixing QTBUG-30628.

Task-number: QTBUG-15379, QTBUG-30628

Change-Id: I95062c9a6022632b321b2f6fae3089f07be7b5c6
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-10 19:05:19 +02:00
Stephen Kelly
955052c0d9 Teach CMake about Qt 5 plugins.
Change-Id: Idd3225759f9f5ec620f79e29035eb176f965bef7
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-10 14:38:18 +02:00
Konstantin Ritt
b0b786a2f0 Deprecate QFontDatabase::supportsThreadedFontRendering()
As of 5.0, this always return true.

Change-Id: If225c7219e283da97e870f0d66a87b21c3cacfc0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-10 09:44:04 +02:00
Stephen Kelly
a1898f4466 Metatype: Remove the need for runtime-registration of 3rd party containers.
Replace that need with a macro so that registration of the
container helper conversions is done at the time of registration
of the container (usually when it is put into a QVariant).

Change-Id: I823fb3fdbce306ebc9f146675ac43724cec678d5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-09 21:28:41 +02:00
Caroline Chao
56bbf3c2d5 QMetaMethod and QDBusMetaObject: Give public access to signal methods
To be consistent with signals which are public since Qt5.

Change-Id: I633077e37d0851b118c22da0681e8b8b1892ddbb
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-09 16:21:10 +02:00
Mathias Hasselmann
50e2db6a75 Add first/last accessors to QMap
QMap explicitly sorts its entries by key value. For an ordered container
it's (often?) useful to access the first or last entry, for instance to
quickly compute the next key of the mapping. The first entry is easily
accessible by the STL begin() method, but for accessing the last entry
pretty ugly iterator arithmetics must be applied: *(end() - 1). With
their first() and last() accessors the container classes QList and
QVector provide a much nicer method of accessing extrema, so for
consistency this syntactical sugar also should be applied to QMap.

Change-Id: Ibd544acbad8c3ac16f12a1e74362207ea1694375
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2013-09-08 16:13:16 +02:00
Sergio Ahumada
2346ae1675 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I9ee4176f0a0078908d49896508826154c9f71530
2013-09-07 16:18:32 +02:00
Marcel Krems
730bc064a0 Forward QGraphicsView::mouseDoubleClickEvent
Do the same as in mousePressEvent.
Otherwise it is not possible to handle the event
in one of the graphics views parents.

Task-number: QTBUG-8061
Change-Id: I67c7635361a9ed595c513c28ea016e6253fa2101
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2013-09-06 23:21:18 +02:00
John Layt
94a7576658 QDateTime - Change debug output to ISO Format
Change the debug format from Qt::TextDate to a more detailed ISO style
format including better time spec output.

[ChangeLog][QtCore][QDateTime] The debug datastream is now an ISO-like
format instead of Qt::TextDate

Change-Id: Iddbb8199c3bfbf7bca845482617e7a85da43259d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-06 18:08:56 +02:00
Stephen Kelly
15a17323ed Make the automatic 1arg and 2arg metatype macros work with namespaced Qt.
Change-Id: I64aa3cacd0cf57235ad43f089716765b384ef412
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-06 16:18:37 +02:00
Stephen Kelly
2ff15ff065 Fix the automatic declaration of smart pointer types.
Before this patch,

 qRegisterMetaType<QSharedPointer<double> >("QSharedPointer<double>")

without a metatype declaration fails to compile, whereas it works
with Qt 5.1 (ie, before commit e9a69c3ba9)

Change-Id: I9408f711c9df810ff29b879b7696dab81c1160f1
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-06 16:18:32 +02:00
John Layt
61b56a89a1 QDateTime - Clean up Qt::DateFormat formatting and parsing
Clean-up the implementation of toString() and fromString() methods in
QDate, QTime and QDateTime code to be more consistent in ISODate and
TextDate behavior, especially when handling TimeSpec.

Reformat some code so all methods are consistent in appearance and
function to make maintenance easier.

This changes some corner-case behavior in TextDate and ISODate, but
this either fixes bugs or makes the behavior match the documentation.

Change-Id: I457aa1d7cd4f448cd9f8a2e80ec635f3cb98e58c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-06 01:53:11 +02:00
John Layt
35af88b37e QDateTime - Switch to using the QLocale date formatter
Switch the implementation of toString() methods in QDate, QTime and
QDateTime to use the QLocale formatter, and remove the now redundant
QDateTime formatter.

Change-Id: Ie4f17c8a6e31acde3ce066f19835bb2b83351ce8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-05 23:20:09 +02:00
John Layt
dd488bb7a4 QLocale - Improve date formatter
Modify the QLocale date formatter to be consistent with the QDateTime
date formatter and able to replace the QDateTime formatter in a
subsequent change.

Fix the treatment of negative years.

The internal QLocale::timeZone() has been replaced by the
QDateTime::timeZoneAbbreviation() to ensure the correct tz for the
date/time is used rather than always the current system default.

Change-Id: I2ef26700856e2e69b979069226aa504ecbb50071
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-05 23:20:09 +02:00
Oswald Buddenhagen
50a8a5e795 add QProcess::InputChannelMode
this enables forwarding standard input from the parent process.

Change-Id: I7ee72b9842acc96320d4da693b95dd15d9a7b4d4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-09-05 21:17:44 +02:00
Oswald Buddenhagen
fba0a30791 add QProcess::Forwarded{Output,Error}Channel
Change-Id: Ifc5ed20c38f3228ef25c28681f296d0456b61abe
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-05 21:17:39 +02:00
Stephen Kelly
239fe290ad Center the QColumnView on-screen, in case that helps avoid the test failure.
Task-number: QTBUG-32927
Change-Id: Icf0301d583b2ca6e2e099a19eb1f91feac1fb975
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-05 15:26:44 +02:00
Stephen Kelly
f69ace7341 QVariant: Make it possible to extract a QObject* from a wrapper without conversion.
Change-Id: I3a054d87d12e08d72dd4c77b6d467dc63f9a2231
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-05 13:01:46 +02:00
Stephen Kelly
d1a8623ecb QVariant: Don't crash when doing user-defined conversion to QObject*
The destructor of the ConverterFunctor calls unregisterConverter. If
the instance is static (as it is in qmetatype.h), then this method
can be called after the QGlobalStatic has already been destroyed.

Change-Id: I33b70734cbe09dfa888e887280c349e43ad1b855
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-05 13:01:39 +02:00
Oswald Buddenhagen
40925fe74a fix warnings - qprocess needs a qcoreapp instance
Change-Id: Icf36c2e76595d8f2ed470da13e78c465cfa962f9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-05 11:18:59 +02:00
Oswald Buddenhagen
78d6c9c002 remove redundant forwardedChannels() test
forwardedChannelsOutput() actually tests forwarding. also having the
older test only eats CPU cycles.
rename the new test to the old name for clarity.

Change-Id: I16a326c8692bb594d7df7897bc53d31b23c66d90
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-05 11:18:59 +02:00
Oswald Buddenhagen
4028f54213 make error reporting in forwardedChannelsOutput test more useful
Change-Id: I0350ddfd6740d2a2cd3e0f49220cdaa83b854abf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-05 11:18:59 +02:00
Oswald Buddenhagen
60f8b2f4d0 micro-optimization/-clarification
close stdin and let the process finish right away instead of first
waiting for a reaction (which is not supposed to come) and then
finishing.

Change-Id: Ifcf200eead5ed95217843e105f9d2dbb5398d646
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-05 11:18:59 +02:00
Giuseppe D'Angelo
9fc2c729b4 Make tst_qalgorithms compliant with the Standard
§24.4.1 [iterator.traits] of N3337 makes it *mandatory* to define the
various types

    std::iterator_traits<Iterator>::{value,pointer,...}

for any given iterator.

§24.4.1.2 makes it enough to define them within our iterator class.

Change-Id: I1305c8392d224889b09395e30ecc77b194020a15
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-05 09:48:22 +02:00
Stephen Kelly
3f6ed5566f Revert "Implement move-ctor and move-assignment-op for QScopedPointer"
This reverts commit 5b9006bbdb.

Also revert "Doc: Enable documentation for QScopedPointer's rvalue ref functions"

This reverts commit 5f8416ec65.

Adding a move contructor to QScopedPointer makes no sense, because moving
means 'escaping the scope', which breaks the fundamental point of
QScopedPointer.

Change-Id: I4ac1b108bf199af6e436fa1629aa2d3b93c27724
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-05 08:20:19 +02:00
Corentin Jabot
5a02d30a78 Add an advisory interruption mechanism to QThread.
To ease interruption of long running tasks, a new method
QThread::setInterruptionRequested() can be called.
The task can check QThread::isInterruptionRequested()
and act upon it by stopping itself.

These methods are designed to replace the use of a global variable
and other hacky ways to stop a task running in another thread.

Change-Id: I17622dd60d2262078210e7e4294ad6c53a6dc179
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-05 08:20:18 +02:00
Tor Arne Vestbø
eb614cf7e7 Don't assume processEvents(WaitForMoreEvents) will process timers
The WaitForMoreEvents flag only guarantees that we will process _some_
events -- either if they are in the event queue already, or by sleeping
and then waking up to process an event. This event might be a system
event, not the timer firing, so a single call to processEvents() is
not enough to guarantee that the timer has fired. Instead we do a
Q_COMPARE with a timeout, where we continiously process events until
we see that the timer fired.

Change-Id: I5dc04377f04190f3505be22e877af73d11b7547d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-05 02:32:57 +02:00
Paul Olav Tvete
b855e57804 Fix layouts with expanding items with maximum size
Layout items with a Preferred size policy would be treated as fixed
size if they were in the same layout as an Expanding item (or one with
a stretch factor).

This occurred e.g. if a layout was configured similar to this:
1. One item with ExpandFlag/stretch but with a maximumSize set,
   e.g. (100x100).
2. Another item with 'just' GrowFlag, and a maximum size bigger than
   its  size hint.

If the above layout was resized to e.g. (200x50) it would cause the
expanding item to correctly get the size (100x50), but the 'growing'
item would not stretch beyond its size hint.
Instead, it would distribute space around both items, behaving as if
the 'growing' item was fixed'.

The expected behavior is to continue to grow the 'growing' item after
the expanding item has reached its size limit.

Task-number: QTBUG-33104

Change-Id: Ie410653d905f7ca4d702528dafb269f30a0e4f61
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-09-04 15:09:47 +02:00
Richard Moe Gustavsen
8b7a8efe66 QPluginLoader: add 'staticPlugins' function
Currently there is no API to extract the meta data
from static plugins. This is needed in e.g QtDeclarative
for loading static module plugins.

This patch moves the 'staticPlugins' function from
QLibraryPrivate into QPluginLoader, and makes it public.
As such, we now also export QStaticPlugin.
Since an application developer cannot do much with raw
metadata, we add a new function
QStaticPlugin::metaData() that returns the QJsonObject
for the plugin. The old metaData function is
renamed 'rawMetaData'.

Change-Id: Idb0bf9ad8ebb13340565512e1998b26e762a357e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-04 09:38:35 +02:00
John Layt
5ec1c7727b QDateTime - Add api for Time Zone Abbreviation
Add a new method to return the time zone abbreviation for the current
time spec.  For LocalTime this is the abbreviation returned by mktime.

This new method will later be used in changes to the date formatter
and QTimeZone.

Note this change does not implement WinCE support.

[ChangeLog][QtCore][QDateTime] Add method timeZoneAbbreviation() to
return effective time zone abbreviation.

Change-Id: I265a5e96c72eb7236974f80f053f1fb341e3c816
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-03 14:31:06 +02:00
Friedemann Kleint
835a7bc0a0 Skip tst_QGraphicsProxyWidget::popup_subwidget on Windows.
Task-number: QTBUG-33213
Change-Id: I1c8daa3a859f9d0d760054f1d8934abd84f62f0d
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2013-09-03 12:48:03 +02:00
Andrew Knight
a2643e2b17 Fix test compilation when QT_NO_CURSOR is defined
The implicitConstruction() test case will fail to compile if QCursor is
unavailable.

Change-Id: If26743995505a48da648a2fa2a498debec91c933
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-03 12:05:59 +02:00
Andrew Knight
cd582f8410 Add QT_NO_PROCESS guards in tests where they are missing
A handful of tests lack QT_NO_PROCESS guards, making them non-compilable
on Qt builds with no QProcess support. This commit does not change
QProcess-specific tests, which should be left out of the build using the
.pro file mechanism.

Change-Id: Iac8562428abc1f59ccbb23bf5c3a919785e41f12
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-03 08:42:24 +02:00
Thorbjørn Martsum
0bcfa3d5d9 QHeaderView - add maximum section size
When we auto resize it is handy to be able to limit the maximum
size (just like the minimum size).

[ChangeLog][QtWidgets][QHeaderView]A maximumSize for sections
has been introduced. The maximum section size is by default
the largest possible section size which in Qt 5.2 has been
limited to 1048575 pixels.

Task-number: QTBUG-4346

Change-Id: Ida9cbcc11bd5c4498e319df2e6379c69a7033c04
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-02 16:26:21 +02:00
David Faure
8f4b6f1cd1 item delegates: fix clicking on tristate checkboxes.
QCheckBox cycles through the 3 states, but item delegates didn't
do that.

Change-Id: Iad1e464341033ca357925fe8064f53bb584459f4
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-02 16:26:21 +02:00
Sergio Ahumada
0a3eb0fe44 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-09-02 16:26:21 +02:00
Andrew Knight
3097129192 Fix remaining use of QTEST_NOOP_MAIN
QTEST_NOOP_MAIN was removed in Qt 5, but was still in the source of the
QProcessEnvironment auto test.

Change-Id: I0048c330c9d4e99c46192cc05ffd3b77d404fb6d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2013-09-02 14:59:02 +02:00
Andrew Knight
a05a3f6550 Remove qguieventloop from auto tests if network is unavailable
This test relies on network support.

Change-Id: I8918a7fe2f411fcaa2e4300486b8a66c63898221
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-02 14:59:02 +02:00
Andrew Knight
2e75cd55db Remove qopengl auto test when Qt is not configured with OpenGL support
Change-Id: Id2fbf9308c5dbce5e7778f0d841cc8bda784a80f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-02 14:59:02 +02:00
Morten Johan Sørvig
8fc97fdfc7 Revert Mac event loop changes.
"Make QGuiApplication::exec() run within NSApplicationMain()"
"Make Qt process native and timer events on Cocoa applications"
"Cocoa: Fix QFontDialog, QColorDialog auto-tests"

This reverts commits
1e14762b8d
e4b2a0b4ba
df7944e7d7

Change-Id: I80b65b5ee0297b090f807bd420664233dfc44f7b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-02 13:07:35 +02:00
Oswald Buddenhagen
a1133b215a add QProcess::nullDevice()
Change-Id: I15273fa3f3ba323a835350153f2a20404f12420b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-30 21:16:55 +02:00
Thorbjørn Martsum
2c916d47ef QTreeView - fix next focus when there is no current index
Before we went through non hidden indexes, but we never considered
the visual order. This patch fixes that issue.

Though it was wrong before, it probably never was a big problem
since it was unlikely that the tree (on logical index 0) was
swapped or hidden, but

658e42e77a

makes it more likely that problems with wrong focus could occur.

Change-Id: Ic7b6cd2df1f8638be1a7c9e6df27f428685869fc
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-08-30 21:07:46 +02:00
Olivier Goffart
b49327145e QMetaMethod::invoke: compare the QMetaType id of the return types
Since Qt5, the QMetaObject do not contains the string name of the
builtin types, but only the QMetaType id. QMetaMethod::typeName
convert back from the id to the string. But if the type is aliased,
the string of the main type is returned.

This was the case for example for qint64 which is transformed to
"qlonglong".

This causes a regression in QMetaType::invoke when trying to invoke a
method which return an aliased type, since the string comparison would
fail.

Fix the problem by also comparing the metatype id.

Changelog: QMetaMethod::invoke: Fix return of aliased meta type

Task-number: QTBUG-33222
Change-Id: Iec7b99dcbf7b23eb818de74f413e4451ce510ac4
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-08-29 17:03:41 +02:00
Gabriel de Dietrich
df7944e7d7 Cocoa: Fix QFontDialog, QColorDialog auto-tests
The new Cocoa event dispatcher made apparent some deficiencies in the
way the dialog helpers were being hidden. In particular, we would not stop
a dialog helper's modal loop when closing the dialog, resulting in the
auto-tests hanging. Also, since the QApplication event loop is runnig with
[NSApp run] in the stack, the previous workarounds are no longer needed.

Task-number: QTBUG-24321
Change-Id: Ifba713c286638d78a699c319a15683d09714f06f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-08-29 12:44:24 +02:00
David Faure
ee9b9d9fd9 QFileDialog: add MIME Type filters
Currently just a convenience method for setNameFilters(), it uses
QMimeType to create a name filter from the glob patterns and
description defined in each MIME type.

In the longer term, this API could be used to do proper mimetype-based
filtering using QMimeDatabase::mimeTypeForFile() in the builtin
QFileDialog (aka "not native"), instead of only looking at globs via the
name filters.

Change-Id: I0edccf5f30c514481b47cd100d743d1ed7a24024
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-08-29 10:25:01 +02:00
David Faure
5eb91476f1 tst_qthreadpool: fix flaky test I introduced in last commit
(dacf9961da)
In order to see 2 active threads, we must check activeThreadCount() before
the runnable finishes.

Change-Id: I1a48b41e0c1fd81a65d915b9bd1e741ff267ed2b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-08-29 10:25:01 +02:00
Thorbjørn Martsum
6ee9baf044 QLinkedList - extend the auto test.
This extends the QLinkedList auto test. This is copy paste
with small edits from the QList auto test.

Change-Id: I5bce7ee304998d1c7258f11b2f31a7fb87706936
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-29 08:16:44 +02:00
John Layt
ad77048d1f QDateTime - Extend fromMSecsSinceEpoch API
Add convenience methods for fromMSecsSinceEpoch() and
fromTime_t() to enable direct creation of other time specs
than LocalTime without the overhead of unncessary conversions.

For example instead of:
  QDateTime dt = fromMSecsSinceEpoch(12345).toUtc();
the following saves two conversions:
  QDateTime dt = fromMSecsSinceEpoch(12345, Qt:UTC);

This will improve the performance of the new QTimeZone class.

[ChangeLog][QtCore][QDateTime] Added convenience methods for
fromMSecsSinceEpoch() and fromTime_t() to take time spec to be used in
returned datetime.

Change-Id: I133635bfe3d35ee496a287257e13b2d600225a38
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-08-29 00:32:08 +02:00
John Layt
13c16bbd06 QDateTime - Improve and expose Qt::OffsetFromUtc
The Qt::OffsetFromUtc TimeSpec was made public in Qt 4.4 but the access
methods were never made public in the apidox effectively meaning the
feature was never used.  The implementation was also incomplete and
inconsistent.

This change cleans up the implementation and exports new public API for
using the TimeSpec using new method names consistent with the new
QTimeZone support.

This change increases the QDataStream Version number for Qt 5.2 to 15.

The behavior of one constructor has changed slightly to be consistent
with the rest of the feature, but this behavior was never documented.

[ChangeLog][QtCore][QDateTime] Fully implement support for Qt::TimeSpec
of Qt::OffsetFromUTC, added new methods for offsetFromUTC(),
toTimeSpec(), and toOffsetFromUTC().

Task-number: QTBUG-26161
Task-number: QTBUG-29666

Change-Id: If3cc7fc9778ca2b831644408ae749448d5975a3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-08-28 19:08:14 +02:00
Friedemann Kleint
e9c771d6cc Stabilize tst_qmenubar.
The test was re-using a main window and menu bars for all tests,
clearing and repopulating them. Rewrite the code to be able to
use menu bars and windows on the stack separately for each test.

Change-Id: I13ab31b26b70bc8537e8d8ab164051b3197cd68e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-08-28 15:50:28 +02:00
Peter Hartmann
627a394fb7 network test settings: support newer FTP server versions
... which are used by the new test server image.

Change-Id: I72ffa73d3e254b278fb9063d32b633b156bd3ec0
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-08-28 12:45:34 +02:00
Thorbjørn Martsum
fd871694e7 QButtonGroup - add buttonToggled signals
QButtonGroup emits signals on clicked, pressed and released for
buttons in the group, but for some (insuffienct) reason it did
not emit anything for toggle (the only signal that it didn't emit
anything for).

This patch changes that, by adding handling of that signal to
QButtonGroup.

Task-number: QTBUG-14857

Change-Id: I88bcd7b060b78c7ff05ea1adf7baaddfe6d463be
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-08-28 12:15:43 +02:00
Frederik Gladhorn
190fa97c83 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	examples/widgets/doc/src/addressbook-fr.qdoc

Change-Id: Id1196e8e0c6445f1616c3f29234c974d809f8e48
2013-08-27 22:51:09 +02:00
Paul Olav Tvete
f3c019649b Test layout engine fundamentals
Done with Jan Arve

Task-number: QTBUG-33104

Change-Id: I8319748536d448d1c37a26527ced53156d8c2f56
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-08-27 22:00:48 +02:00
Friedemann Kleint
78d7192338 Close menu on 2nd click on QMenuBar.
Task-number: QTBUG-32807
Change-Id: I0c3c25c6acf92bc30c1bcfc09003209b572ec777
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-08-27 19:12:06 +02:00
Friedemann Kleint
5bb4817142 Center widgets using UpdateWidgets in tst_qwidget.
Try to stabilize doubleRepaint and others, try to get them away
from taskbar areas.

Change-Id: Icae8da575999afccb314edafd7deb16446e3d1c2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-08-27 19:12:06 +02:00
Peter Hartmann
2109965a4e QTcpSocket auto test: rely on IMAP port, not SMTP port
The new test server image will not have a SMTP service installed, and
the network self test does not check for that either.

Change-Id: I1063777832148e184de4ddf21d9154364f644e1e
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-08-27 19:12:06 +02:00
Peter Hartmann
5cb6260a36 QNetworkReply auto test: Skip tests failing due to Squid issues
This test works with no Qt version (4 or 5) when testing with the
Squid (HTTP proxy) version deployed on the new test server image.

Task-number: QTBUG-33180
Change-Id: If244526a4baed9f3836dade007fe0f15649a8f86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-27 19:12:06 +02:00
Sean Harmer
a70c0ad1d1 Add operator[] to QVectorND classes
Change-Id: Ia786d4fab64da974bb60f24c05325925d42a1e70
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-08-27 17:50:40 +02:00
Mitch Curtis
507f1889e2 Add QJsonValue::toInt().
It's a nice feature to have.

MSVC also complains about using doubles to create enum values, so
the ugly workaround is:

enumValue = MyEnum(qRound(json["myEnumValue"].toDouble()));

[ChangeLog][QtCore][QJsonValue]Added QJsonValue::toInt().

Change-Id: I1a200b912abf66b2e96390b1980caff26cfa2685
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-27 08:01:29 +02:00
Thorbjørn Lund Martsum
934f062203 QAIV - Fix scollbars with ScrollPerPixel to scroll 1 pixel.
The documentation says that we scroll one pixel

Quote:
"QAbstractItemView::ScrollPerPixel  (value 1)"
"The view will scroll the contents one pixel at a time."

However until now Qt has tried to be smarter than the
documentation, but is actually getting in the way of the user,
where a manual set value to setSingleStep will continuingly
be overwritten (on e.g resize).

This patch ensures the behavior described in the documentation
for the vertical headers - and leaves the control to the user.

[ChangeLog][QtWidgets][QAbstractItemView]  QTBUG-7232 - In ItemViews
scrollbars will now by default only scroll 1 pixel when scrollMode
is set to scrollPerPixel. That is it will (when scrollMode is
scrollPerPixel) do what is stated in the documentation, and no
longer automatically adjust the scrollbars singleStep. The user
can now control that value.

Task-number: QTBUG-7232

Change-Id: I8a61d3100be65d0c4ee32aad58caed019aa2669c
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-08-26 09:40:59 +02:00
David Faure
404598b613 Long live QCommandLineParser!
The QCommandLineParser class provides a means for handling the command line options.

QCoreApplication provides the command-line arguments as a simple list of strings.
QCommandLineParser provides the ability to define a set of options, parse the
command-line arguments, and store which options have actually been used, as
well as option values.

Done-with: Laszlo Papp <lpapp@kde.org>

Change-Id: Ic7bebc10b3f8d8dd06ad0f4bb897c51d566e3b7c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 21:33:39 +02:00
Thorbjørn Martsum
c35b55f076 QLinkedList - fix insert with iterator when the list is shared.
Before a call to erase on a shared instance would imply that the
item was inserted into the shared data (i.e all instances)

Change-Id: I655ccf04b1ad9bf82e6bfade58929538fa7df000
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 15:36:30 +02:00
Thorbjørn Martsum
97f867212f QList - fix insert with iterator on shared instance
This patch ensures correct detach when insert with an iterator is
called on a shared instance (i.e same behavior as QVector)

Change-Id: Id660eacd3cc7b633456dfa989997bbad747e1df2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 15:36:30 +02:00
Thorbjørn Martsum
ea25495703 QLinkedList - fix erase with iterator when the list is shared.
Before a call to erase on a shared instance would imply that the
item was removed from the shared data (i.e all instances)

This patch improves the behavior to detach and erase the item
specified by the iterator (i.e same behavior as QVector)

Change-Id: Ib3cfb5363c86b400886c80b75b0c20ca854ce801
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 15:36:30 +02:00
Thorbjørn Martsum
5fc13cc06a QList - fix QList::erase when the list is shared
Before calls to erase on a shared instance would in release mode
imply that items were removed from the shared data (i.e all instances).
In debug mode it would assert.

This patch improves the behavior to detach and erase items
specified by the iterator(s) (i.e same behavior as QVector)

Change-Id: I89b69446cb1ffd43a98402b7ab1ec9a59bceb8e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 15:36:30 +02:00
Thorbjørn Martsum
a5c7a9032e QMap - fix erase with iterator when the map is shared
Before a call to erase on a shared instance would imply that the
item was removed from the shared data (i.e all instances)

This patch improves the behavior to detach and erase the item
specified by the iterator (i.e same behavior as QVector)

Change-Id: Ia44db84fc1388d92308bf0d2b32539ac4d53850b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 15:36:30 +02:00
Thorbjørn Martsum
93ffb81df6 QHash/QSet - fix QHash::erase when the hash is shared
Before a call to erase on a shared instance would imply that the
item was removed from the shared data (i.e all instances)

This patch improves the behavior to detach and erase the item
specified by the iterator (i.e same behavior as QVector)

Since QSet uses QHash it improves QSet the same way.

Change-Id: I850b1efcf7bdfc85ceddb23128b048af95f75063
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 15:36:30 +02:00
David Faure
dacf9961da QThreadPool: fix counting of waiting threads
QTBUG-21051 has a testcase where activeThreadCount() could actually
end up at -1 (converted to an autotest in this commit).
The reason was: start() calls tryStart() which returns false due to
too many active threads (reserveThread() causes this), so it calls
enqueueTask() - which actually wakes up the waiting thread, but
it didn't decrement the number of waiting threads.

Note that tryStart() is "if I can grab a waiting thread, enqueue task and wake it"
while start(), in case tryStart() fails, wants to "enqueue, and then if I can grab
a waiting thread, wake it". This is why enqueue shouldn't wake; waking must happen
only if we can grab a thread (d->waitingThreads > 0).

Task-number: QTBUG-21051
Change-Id: I3d98337103031c9bdf0bf365295f245be0c66aa7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 13:09:46 +02:00
Thiago Macieira
7c2a418857 Add unit test to ensure %3A in a path isn't decoded to ':'
QUrl("http%3A%2F%2Fexample.com") has only a path of
"http%3A%2F%2Fexample.com". In Qt 5.0 and 5.1, the %3A would get decoded
to ':', which in turn makes the URL invalid (colon before first slash).

Found via discussion on the interest mailing list.

Change-Id: I7f4f242b330df280e635eb97cce123e742aa1b10
Reviewed-by: David Faure <david.faure@kdab.com>
2013-08-23 21:39:23 +02:00
Andy Shaw
1baf293548 Move SnapToDefaultButton from QPlatformDialogHelper to QPlatformTheme
Since QPlatformTheme covers all dialogs whereas QPlatformDialogHelper is
really only for the native dialogs then the SnapToDefaultButton hint is
moved as it has relevance for all dialogs

Task-number: QTBUG-32631

Change-Id: I1dce0bb4abcd4cfd39c4a199a33fc7078176ab4b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-08-23 08:42:35 +02:00
Stephen Kelly
48f332f802 Add more comparisons to narrow down error case.
Task-number: QTBUG-32927

Change-Id: I83d6def83c37febd8cd83676bff9d74f364ecfad
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Simo Fält <simo.falt@digia.com>
2013-08-22 19:14:03 +02:00
Olivier Goffart
8a96679493 moc generated code should compile with QT_NO_KEYWORDS
Don't use the 'emit' keyword in the moc generated code for properties
with MEMBER

Task-number: QTBUG-33094
Change-Id: I5a0950e9c7a0dee347a6a6c79098e3e7d4776014
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-22 16:03:28 +02:00
Olivier Goffart
2bd40c53ef moc: Fix related objects containing itself
This may happen when we have namespaces and the qualified name is used
to scope an enum.

Task-number: QTBUG-32933
Change-Id: Ic4923bbfb138387bae1e3694172661ace8342089
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-22 16:03:28 +02:00
Olivier Goffart
c20b358703 moc: Issue a warning instead of an error when macro argument mismatch
moc's C++ is not 100% accurate, so better process the invalid macro with
a warning rather than an error.

Such errors occurred in the QSKIP macro with variadic arguments since
that macro is defined conditionally.
It is also causing problem in boost header (cf task QTBUG-29331)

Task-number: QTBUG-29331
Change-Id: Ice6a01b675286540d6470c8e36920b7efd39b540
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-22 07:11:33 +02:00
Thiago Macieira
c374f4441a Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-08-22 02:04:39 +02:00
David Faure
1de1470189 QUrl: Use decoded mode by default for individual getters/setters.
This fixes the wrong value for path() and fileName() when a
path or file name actually contains a '%'.

userInfo() and authority() are not individual getters, they combine
two or more fields, so full decoding isn't possible (e.g. username
containing a ':').

[ChangeLog][Important Behavior Changes][QUrl and QUrlQuery]QUrl now
defaults to decoded mode in the getters and setters for userName,
password, host, topLevelDomain, path and fileName. This means a '%'
in one of those fields is now returned (or set) as '%' rather than "%25".
In the unlikely case where the former behavior was expected, pass PrettyDecoded
to the getter and TolerantMode to the setter.

Change-Id: Iaeecbde9c269882e79f08b29ff8c661157c41743
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-21 23:50:44 +02:00
David Faure
f874a5dd8b QUrl: fix host(FullyDecoded), it shouldn't trigger EncodeUnicode.
Change-Id: I9a62d5eb8b099b659cfcfc591c983b3d73ca9569
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-21 23:50:33 +02:00
David Faure
028def2ada Add benchmark for QThreadPool.
The current question is whether activeThreadCount() should be lock-free
(using atomic ints) or mutex-protected, so this tests start()
and activeThreadCount() directly.

Change-Id: Ica4a2ad023c2002e3c7d81558e6b9ee64af7f690
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-08-21 23:50:23 +02:00
David Faure
e8bc599a74 tst_qgraphicsproxywidget: fix memory leak
Change-Id: Ib449dc05cebd333310d6ea6b434c9db7082bdee9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-08-21 23:49:59 +02:00
Thorbjørn Lund Martsum
7523bbb0c0 QComboBox - only react on a mouse-release if we had a mousepress
In delegates we get into trouble with calling showPopup in
setEditorData (edit by double click) - and that is not reasonable.
The user has requested edit - and therefore it is natural to save
a click for the user and show the popup at once.

However that fails since we have the mouse down and as soon as we
release the mouse we will call hidePopup.

This patch ensures that the mouseReleaseEvent, that caused the
problem is only considered if we have had a mousePressEvent.

Change-Id: Ibe031fcb9ad2158f6969e41127bbb5f651b9cae6
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-08-21 21:08:08 +02:00
Sergio Ahumada
7978cef796 tests: Make the QT assignments more explicit
Remove unused 'QT -= gui' and replace some others with
'QT = core ...'

Change-Id: I2d14fae963afc21dbd21a4acdbba2c30cdf8fa61
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-08-21 19:05:52 +02:00
Stephen Kelly
8074693425 CMake: Allow specifying a TARGET in invocations of macros.
Forward-port of 9ce60ff509c4ff27fe861fc5b2080f50897a68c4 (Qt4Macros:
Allow specifying a TARGET in invokations of macros., 2013-02-26)
from cmake.git.

This causes the INCLUDE_DIRECTORIES and COMPILE_DEFINITIONS to be
used from the specified target when running moc.

Change-Id: I868a35ade3c6b059e64d226291cf2046709d86d4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-08-21 16:39:55 +02:00
Stephen Kelly
ee50096830 Populate INTERFACE_LINK_LIBRARIES property in the cmake files.
This is new in CMake 2.8.12 and replaces the old properties
matching IMPORTED_INTERFACE_LINK_LIBRARIES_<CONFIG>.

Change-Id: I5d4c454972f2535f6792e95718c73d80c56ac24c
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-08-21 16:39:55 +02:00
Stephen Kelly
74a153e4b8 Add debugging output to randomly failing test.
The result at

 http://thread.gmane.org/gmane.comp.lib.qt.ci-reports/12118

shows an unusual value. The expected output is

 QDEBUG : tst_QColumnView::scrollTo() last= 0  ; HorizontalOffset=  -256
 QDEBUG : tst_QColumnView::scrollTo() last= -256  ; HorizontalOffset=  -512
 QDEBUG : tst_QColumnView::scrollTo() last= -512  ; HorizontalOffset=  -768
 QDEBUG : tst_QColumnView::scrollTo() last= -768  ; HorizontalOffset=  -1024

Change-Id: I8db091f4390cb1a41547d44ca966d172ac278e1a
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-08-21 16:39:55 +02:00
Peter Hartmann
fcd212e7ba QNetworkReply auto test: adapt to new session life time
... supported on the new test server. Once the new server image is in
place, we can only allow for the new life time hint of 300 seconds.

Task-number: QTBUG-33040
Change-Id: Id6ad9983789cc6badf3fc2f6628bf79379988201
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-08-21 14:48:04 +02:00
Frederik Gladhorn
c8ca300e49 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	qmake/doc/src/qmake-manual.qdoc
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/src.pro

Change-Id: I0a560826c420e46988da3776bd8f9160c365459a
2013-08-21 11:03:18 +02:00
John Layt
2f2a799f3d QDateTime - Fix tests to correctly restore time zone
The unit tests were caching the original TZ value to restore later
after testing with different TZ values.  The problem is reading TZ will
return a null value if no override TZ value is set, and if you then set
the TZ to null the system assumes UTC and not the system time zone.
Instead we need to unset TZ if it was null to start with.

Change-Id: Ib0625b1712e565f9fdfa99e2ffe1e5d74f059354
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-21 01:20:01 +02:00
Oswald Buddenhagen
b4c0d9166e change reporting of missing files
use the new parser flags to report all i/o errors directly.

as a notable side effect, the "WARNING" prefix is gone (even though
it is still treated like that, which is mildly insane to start with).

Change-Id: I084375d5e7a3314ae763795f7c318804a9fb84b6
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-08-20 22:56:12 +02:00
David Edmundson
725bdc3fd2 Fetch StandardKey shortcuts from QPlatformTheme
This allows platforms to dynamically alter their keyboard
shortcuts, for example if they are user-configurable on that
platform. Current behavior remains the same.

QEvent previously used the hardcoded values in QKeySequencePrivate so
this was modified to use QKeySequence::keyBindings().

In order to keep the speed of QEvent's former binary search, we moved
this code to QPlatformTheme::keyBindings(), making it faster for all
keyBinding lookups.

As we now need to search by StandardKey instead of by shortcut the list
is reordered and a test is changed to reflect that.

Change-Id: Iefb402fbbe8768be2208ce036f3c2deed72dcc6c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-08-20 22:22:21 +02:00
Rohan Garg
e2322c885f Extend QStyle API with a SH_Splitter_OpaqueResize styleHint
Currently the default for QSplitter::opaqueResize is hard coded,
which is less than ideal. Instead this should be provided as a
style hint via QStyle so as to give a more uniform look to all
applications.

Change-Id: I5711811f7b672e36aafcd292ed320308570a0390
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-08-20 20:09:20 +02:00
Frederik Gladhorn
cbb4a88262 Skip tst_QGraphicsProxyWidget::deleteProxyForChildWidget on Win
This tests crashes a lot lately.

Task-number: QTBUG-29684

Change-Id: I6892238dc071f050b0208dd5b4843629fa707347
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-08-20 17:59:39 +02:00
David Faure
2ccf995725 tst_qgraphicsproxywidget: skip crashing test on Mac/Windows.
Created QTBUG-33067 for tracking the issue, after some debugging.

Change-Id: Iaf5556db2e0858e40a7cf6c9dbbe7e6fd6120bac
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-08-20 17:59:27 +02:00
Simo Fält
d91afa1558 QtBase: Skip some tst_qwidget steps in Ubuntu 11.10
Same steps keeps failing on Ubuntu 11.10 without valid reason.

Task-number: QTBUG-30566
Change-Id: Ic7bf65496ff9ad9c4fdef42a30b808aa2c45a1e5
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-08-19 14:24:28 +02:00
Giuseppe D'Angelo
76f32cadb2 Fix QGraphics(Ellipse)Item autotest
Change-Id: I6d5d702e97a0186979bd3bdcd0526d53afeecbd8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-08-19 14:24:28 +02:00
Giuseppe D'Angelo
a45d8edb6c Fix QPointF::division autotest
Change-Id: I567c1252b63aff4273bf15c0d52817f058ea0703
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-08-19 14:24:28 +02:00
Gatis Paeglis
641d33273e Add manual test for shortcuts
Change-Id: I98ba26d97ca60c4a4e22da3b856d0e7e366e6690
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-08-19 12:13:56 +02:00
Sergio Ahumada
b0b754632e test: Skip some more qsslsocket flaky tests [part 2]
Task-number: QTBUG-29941
Change-Id: I28e71f952fcade6ab0aa76db71a1e2f408952830
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-08-16 17:08:24 +02:00
Frederik Gladhorn
e727855476 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-08-16 16:02:19 +02:00
Corentin Jabot
0d8ba7e349 QThreadPool - Add method clear() to remove queued QRunnable.
QThreadPool::clear() method removes all queued QRunnable.

When a large number of long-running tasks are queud in a
QThreadPool its destruction, which calls waitForDone(), can
be quite long.
QThreadPool:clear() removes (and deletes when appropriate)
all QRunnable that have yet to be started from the queue
enabling a faster interruption.

Change-Id: Ie5d6028ad3cfe7e439d1db068c8d0936ff818db9
Reviewed-by: David Faure <david.faure@kdab.com>
2013-08-16 15:43:53 +02:00
Thorbjørn Martsum
f633bc7f7f QHeaderView - reduce memory usage
Though the worst case memory usage was improved in
b800d8b94a the best case usage changed.

Since best case is the same as worst case in Qt5, we should
use as little as possible, which this patch ensures.

We reduce the memory usage from 3 to 2 ints per section - which is
half of worst case in Qt4. There seems to be no bigger cost in
performance doing that. The recalcSectionStartPos is still very fast.

This patch limits the maximum section size to (2^20) ~ 1.000.000 pixels.

This alleviates
Task-number: QTBUG-32325

Change-Id: I9b7530030a31b4e35cf1ca9e32c6b936f5ea9790
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-08-16 05:34:18 +02:00
J-P Nurmi
bff78163f6 QHeaderView::paintSection(): fix visible index handling
Sections may be hidden => QStyleOptionHeader::position must reflect the
state seen on the screen. Otherwise styles will give wrong visual
results.

Task-number: QTBUG-32203
Change-Id: I7ef86496be092bf6f52ec45f757b501f38c3a431
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-08-15 11:37:27 +02:00
Frederik Gladhorn
5c23199d4e Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	configure
	mkspecs/macx-xcode/Info.plist.app
	mkspecs/macx-xcode/Info.plist.lib
	qmake/doc/qmake.qdocconf
	src/corelib/global/qglobal.h
	tests/auto/other/exceptionsafety/exceptionsafety.pro
	tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp

Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
2013-08-14 09:06:31 +02:00
Christian Strømme
c8d9b17367 Fix crash in QProcess::waitForStarted() on Unix.
Invoking waitForStarted() on a QProcess before or after an unsuccessful
call to start() (e.g., with an empty command), would execute FD_SET with
an invalid file descriptor and cause the process to abort.
The bug can be reliably reproduced on OSX.

Task-number: QTBUG-32958
Change-Id: Id25b7781168489281645e21571361ca1a71d43e3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-13 19:48:15 +02:00
Ivan Komissarov
252bad7c58 Add useful signals to QTabBar and QTabWidget
In this patch we introduce tabBarClicked and tabBarDoubleClicked to get
a finer grained information on the user interaction with the tab bar.

Done-with: kevin.ottens@kdab.com

Change-Id: I7be76a556ca09186e98f2e076fe2512d6c5e6773
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-08-13 19:28:31 +02:00
hjk
3c2c9649eb RCC: Make auto-test pick up the right binary
Change-Id: I30f42d40c69789eb1e292ab6bd1cf2c09d81b11b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-13 17:24:49 +02:00