Commit Graph

3937 Commits

Author SHA1 Message Date
Frederik Gladhorn
c83c08d84f Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2013-11-20 12:18:23 +01:00
David Faure
e1c0a1b56c QProgressDialog: add unittest for the auto-show feature
Change-Id: I244d0b740467a09e8833f4debb95b19e45df371f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-11-20 09:03:09 +01:00
Friedemann Kleint
1b9be3f481 Testlib.selftest: Improve process execution, run on openSUSE.
Give processes a more complete environment (openSUSE
requires more variables to start an X11-process),
add test column indicating whether a test is
supposed to crash. If it is not, report crash reason.

Change-Id: I1e0ad59824963f69ee425f331d845741be2b3928
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-11-19 22:47:43 +01:00
Christoph Schleifenbaum
7e768dde39 Widgets: Never revoke focus by click on focused widget.
When clicking on a widget currently focused, w/o having Qt::ClickFocus
set as focus policy, the focus should stay on the widget and not get
propagated to the widget's parent.

Task-number: QTBUG-34042

Change-Id: I53f1153829cc7228de02a90e38125b5cf4ee5008
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-11-18 20:38:41 +01:00
Frederik Gladhorn
72ea790085 Merge remote-tracking branch 'origin/release' into stable
Change-Id: Ie6d44caf1d630cb029178a1af40c637f24a25ee7
2013-11-18 12:27:04 +01:00
Thorbjørn Martsum
aafbd7392e QHeaderView - do not ignore -1 as minimum section size
We claim that -1 is a special automatic value, but calling
setMinimumSectionSize with -1 is unfortunately ignored due a
regression in 524c3e05e8

Change-Id: I7d7e5dbbf78e561849d2f2352c9edb2df36aa181
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-11-17 20:49:00 +01:00
Marc Mutz
eb122a6fe4 tst_QAlgorithms: fix compilation with C++11 enabled
GCC refuses to use a merely static const uint array in a constexpr function.

Fix by making the array constexpr if supported by the compiler.

Change-Id: Idd59d3f74f8f4e98aad82bc892f4a6469932df9f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-11-17 09:48:17 +01:00
Marc Mutz
3e803b5180 QCollator: enable move semantics
This necessitates adding d==0 checks in QCollator. By documenting that
moved-from instances can only be assigned to or destroyed, we can
limit the functions in which to check for d==0 to the assignment
operator and the destructor.

Doing otherwise would destroy all advantages of move semantics by
introducing a heap allocation to re-populate other.d.

Add a test for this (QCollator didn't have any before).

Change-Id: Ic6ff202072822bebfd5e48259c3d0fa345a63118
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-11-17 09:47:07 +01:00
David Faure
2026e50259 QCommandLineParser: add word-wrapping algorithm
Rather than breaking at column 79 precisely, break entire words,
to improve readability.

Change-Id: Ie30db00f0e6ed95cce87480c3b91804826c6076b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-11-17 00:45:03 +01:00
Martin Pley
6c04c21c10 Crash fix in QTreeView::sizeHintForColumn().
Vertical scrollbar may get out of sync. When this happens, the calculation of
firstVisibleItem will retrun "-1". This must be handled in ::sizeHintForColumn().
Added an auto-test for the crashes.

Task-number: QTBUG-34717

Change-Id: I867fd144ef3ce45e382337c5eafe345f573cd944
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2013-11-16 16:40:46 +01:00
Friedemann Kleint
afe8e36872 Stabilize tst_qabstractitemview.
Center windows on screen to avoid conflicts with Unity taskbars,
observe minimum geometry for Windows, move cursor out of the
way for Mac. Introduce QScopedPointer to ensure cleanup in
case of failures.

Change-Id: Ic169e015e795597457b8e85a28ff7fcb7b9b9430
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-11-16 14:57:10 +01:00
Friedemann Kleint
e2557933cb Remove QTRY_ macro from tst_qabstractitemview.
Change-Id: Ic8b8e5c242b640581aa735a3716666d4e7ff44eb
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-11-15 12:42:36 +01:00
Jan Arve Saether
de5b3780cf QFormLayout: Avoid assertion with negative spacings.
It's not really clear if styles *must* return a non-negative value for
QStyle::pixelMetric(PM_Layout{Vertical,Horizontal}Spacing), but both
QBoxLayout and QGridLayout seems to be robust enough to handle this.
They will simply make sure that the spacing is never negative.
We therefore make QFormLayout equally robust.

Task-number: QTBUG-34731

Change-Id: I62235bfcd8adf7757cf15bc9927b29650ae6459d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-11-15 09:15:13 +01:00
Alan Alpert
7d72516b52 Change platform selectors to match qmake selectors
Previously matched Qt.platform.os, however that can only provide one
string. Multiple selectors can be present at once, so we can provide
both unix and linux instead of having to pick the most specialized one.

Task-number: QTBUG-34796
Change-Id: I219517d740fa7385e923a9e09cb7e241378fbaee
Reviewed-by: David Faure <david.faure@kdab.com>
2013-11-15 06:36:44 +01:00
Marc Mutz
38e90ad2b3 qcompilerdetection.h: add Q_COMPILER_UNIFORM_INIT
Up to now, the feature classe Uniform Initialization was subsumed by the
Q_COMPILER_INITIALIZER_LISTS flag together with support for
std::initializer_list.

This caused at least two problems:
1. On QNX, the standard libray does not ship <initializer_list>, even
   though the compiler (a GCC 4.6, IIRC) supports it. But since there
   was only one Q_COMPILER flag for both, support for the compiler-only
   part of the feature had to be disabled, too.
2. MSVC 2013 supports initializer lists, but has a bug that renders full
   uniform initialization support, as required for QUuid, useless.

By splitting the feature into two, we can separate them better, and do
so in QUuid, which is the only class that currently takes advantage of
uniform initialization (to provide constexpr constructors).

Since Q_COMPILER_INITIALIZER_LISTS worked as a flag for uniform
initialization so far, with the two known exceptions above,
UNIFORM_INIT is defined whenever INITIALIZER_LIST is, except that
I don't revert UNIFORM_INIT on QNX as I do for INITIALIZER_LISTS
and that I expect the MSVC 2013 features to set INITIALIZER_LIST,
but not UNIFORM_INIT.

Task-number: QTBUG-34705

Change-Id: I81916e950a0f3aab3de7977e0326d2de3d31b14c
Reviewed-by: Yuchen Deng <loaden@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-11-15 06:30:53 +01:00
Andy Shaw
3396ba5612 Match up the specified paper size to an existing one if possible
When EnumForms was used then the dmPaperSize was not always correct for
the custom paper sizes available on some printers. By using
DeviceCapabilities we can be sure that the information is correct in this
respect.

This also fixes respecting of the custom paper size if one is given and
there is no corresponding existing paper size for it.

Task-number: QTBUG-34276

Change-Id: I9924d5be8527027fc434261e37f6c7aae66210c3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-11-14 21:15:35 +01:00
Marc Mutz
4d1ece8b44 QKeySequenceEdit: simplify clear()
As the test case shows, clear() is semantically equivalent to
setKeySequence(QKeySequence()), so implement it that way.

Change-Id: Id68edbbf85aac3bcff82c81310c38274ed8e6708
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-11-14 18:59:54 +01:00
Mitch Curtis
f1053d94f5 Fully expand entities to ensure deep or widely nested ones fail parsing
With 46a8885ae4, we failed when parsing
entities whose partially expanded size was greater than 1024
characters. That was not enough, so now we fully expand all entities.

Amends 46a8885ae4.

Change-Id: Ie80720d7e04d825eb4eebf528140eb94806c02b1
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-11-14 17:43:58 +01:00
Gunnar Sletta
105da329a3 Skip tst_QGraphicsItem::ensureUpdateOnTextItem() on OSX 10.7
Change-Id: Iedb8ed3ac797d11c47f08b92507401e2e1e96c14
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2013-11-14 15:24:47 +01:00
Simo Fält
ee53530a0e Mark tst_qgl as insignificant in angle build
All ci nodes are currently missing 3d support, when that is enabled
this test will start to fail.

Task-number: QTQAINFRA-711
Change-Id: Ie6b840e290a9371fa895681e58d6dedf55b777e6
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-11-12 07:11:07 +01:00
Peter Hartmann
becdfa6fab QSslConfiguration: rename [get]session() to [get]sessionTicket()
to reflect the fact that this returns and sets the whole session
ticket, and not just the session ID.

Change-Id: I00fe2bc4197dbcd7a02b3ae4f2f84e3a2a7edad0
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-11-08 18:58:27 +01:00
Olivier Goffart
34d21610ba QVariant: Convert automatically from enum types to integral types.
[ChangeLog][QtCore][QVariant] Variant containing enum types can now
be converted to integer

Change-Id: Ibbbc9ae29ab45d67c582fa2d406afc19c5dc41ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-11-08 16:45:26 +01:00
Olivier Goffart
2ee97f505b Fix QVariant::canConvert with longlong
Add few cases where conversion to or from LongLong was missing

We need to make it work if we want to use variant.canConvert<qint64>

[ChangeLog][QtCore][QVariant] Fixed QVariant::canConvert with longlong

Change-Id: I0f65073802b62d99250601dd90a8cd2e4d934b60
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-11-08 16:45:26 +01:00
Friedemann Kleint
dd262dc7f5 Revert "Fix setVisible() of QWidget has no effect in QTreeWidgetItem"
It introduces  QTBUG-34653 (Qt Designer widget box no longer
repainted after collapsing items or using the filter).

This reverts commit 04de24c644.

Task-number: QTBUG-13522
Task-number: QTBUG-34653
Change-Id: Ieb9766e7f15acea901fce4ad7142aa72557b9957
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-11-08 16:45:26 +01:00
Kai Koehne
79b975756a Revert "Add tracing to logging framework"
The tracing API still misses some real-world exposure. Let's
re-do this in dev to have more time.

This reverts parts of following commits:

466e0dff4b
7a47aebe9e
a652bab6a7
8f0654ceb8
4162522edd
32f27b4367
9ff81bdc1a

Change-Id: If97340c37b8b3363f597683336a8390d5ff386f1
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-11-07 11:29:30 +01:00
Marc Mutz
ecfbb4e441 tst_QFlags: make constExpr() check compile on clang trunk
The problem is the verifyConstExpr<>() line involving the ~ operator.

The result as an integer is a value that can no longer be represented
in an int. This is known at compile time and thus template deduction,
which only has an int to match against, fails.

To fix, use an unsigned int as the first template argument of
verifyConstExpr<>().

Clang's error message for this is really sub-optimal, cf.
   http://llvm.org/bugs/show_bug.cgi?id=17834

Change-Id: I3a77dc54d2bee12b016d75724ac1bd7801f4cf2d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-11-07 03:06:29 +01:00
Stephen Kelly
8ef5e700b8 QMetaType: Fix conversion between module types.
Change-Id: I7215b4599c3f0459139b32b6571f0a9e60182ee9
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-11-06 16:15:15 +01:00
Marc Mutz
569dec8e78 QIntegerForSize: add test
Make sure that the size of QIntegerForSize<N>::{Signed,Unsigned} is
actually N.

Change-Id: I221304f7c420e80758ef7b115bafb7cf1f8c8829
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-11-06 00:35:43 +01:00
Andy Shaw
0cdf2a8023 Revert "Ensure CSS rules are inherited from the parent tags"
Since the original change caused a problem with the CSS
rules being always inherited where in some cases this should
not be happening.

This reverts commit 6f65466137.

Change-Id: I6e9cf163d752b1869b5e967a7ab59963d655ba87
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-11-05 23:04:16 +01:00
David Faure
44d48862c0 QStandardPaths: add GenericConfigLocation
This is what ConfigLocation was meant to be. A directory shared by all
applications. Unfortunately when I wrote the fallback on Windows,
I picked DataLocation (which is app-specific) instead of
GenericDataLocation (which is shared between apps). This makes it
impossible to have config files shared between apps, e.g. for libraries.
It also makes ConfigLocation quite inconsistent (on Windows one cannot
use it to load another app's config file, while it works everywhere else).

All this is fixed by GenericConfigLocation, which is shared between apps.

Change-Id: I23a755131061d4fea01e13dd1038fbd8ef333a5d
Reviewed-by: Alex Richardson <arichardson.kde@googlemail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-11-05 19:08:08 +01:00
David Faure
ec12d641fa tst_qurl: add test for matches() with empty vs null case
Change-Id: I0f31eed9af0a7f1aed9ce5118b49ddbbff4f5f39
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-11-05 19:08:08 +01:00
Olivier Goffart
94ad841ab5 Test that QMetaObject::invokeMethod is exception safe
Change-Id: Ie4662b7e475dc3d1ce9f36e8219361d9507622b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-11-05 17:37:05 +01:00
Olivier Goffart
73efc9a2cd Test exceptions in signals and slots
Only DirectConnection is tested

Change-Id: I525c6a65428489c34e58d1d9600b4e5ebda733b9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-11-05 17:37:05 +01:00
Mitch Curtis
46a8885ae4 Disallow deep or widely nested entity references.
Nested references with a depth of 2 or greater will fail. References
that partially expand to greater than 1024 characters will also fail.

Change-Id: Id4e49d6f7cf51e3a247efdb4c6c7c9bd9b223f6e
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-11-05 15:55:17 +01:00
Friedemann Kleint
161e8653c3 Disable clear button in read-only QLineEdit.
Task-number: QTBUG-34315
Change-Id: I6c318879aee907c080e871a541da4ba5eadd71ed
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-11-05 09:16:47 +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
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
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
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
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
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
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