Commit Graph

3112 Commits

Author SHA1 Message Date
Konstantin Ritt
ec4593d6d0 QGlyphRun: Fix isEmpty() and boundingRect() didn't work after setRawData()
Change-Id: I44a347ef24961493d6b8353abbb215c713ccce52
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2012-10-13 03:17:53 +02:00
Konstantin Ritt
4717d36c91 Fix QTextBoundaryFinder usage cases in QAccessible2
Make the implementation safer and closer to what
http://www.linuxfoundation.org/collaborate/workgroups/accessibility/ia2/ia2_implementation_guide#boundaries
requires us to do.

Change-Id: I00af4697e52a9b6e7f5d7b3f403b29126fa1517b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-10-13 03:17:39 +02:00
Stephen Kelly
ff1a514913 Mark QTreeView test as significant.
I can't find any failures in the CI logs, as reported by the bug.

Even if there is still an unstable test here, it is not appropriate
to mark the entire test as insignificant, as that hides regressions
in the entire class.

Task-number: QTBUG-23638
Change-Id: I1aeaf6e725bf28e9ac03c9330a67e51241b9272b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-10-12 07:52:50 +02:00
Konstantin Ritt
da7111be51 QTextBoundaryFinder: Fix handling of break opportunities
Add BoundaryReason::BreakOpportunity flag that will be returned by the
boundaryReasons() when the boundary finder is at the break opportunity
position that might be not an item boundary.
This is the same as (StartWord || EndWord) in Grapheme and Sentence modes;
in Word and Line modes, BreakOpportunity flag might occur between the words
or in between of Line boundaries (e.g. in conjunction with SoftHyphen flag).
In other words, the text boundaries are always break opportunities, but not vice versa.

StartWord and EndWord flags has been deprecated by new StartOfItem and EndOfItem
flags which are not about the word boundaries only. In line breaking,
StartOfItem and EndOfItem are set for the mandatory breaks only.

Change-Id: I79bf297e2b988f5976f30cff0c8ca616385f6552
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-12 07:44:51 +02:00
Konstantin Ritt
8b41f22f5c Fix tst_QTextEdit::fullWidthSelection2() for shadow build
Search for the test data files in the test data directory, not in the current dir.

Change-Id: I746e717bae575364102c1bb5c2888332d94c374f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-12 07:44:34 +02:00
Samuel Rødal
dfb55f8a6c Fixed cosmetic line drawing where begin and end points are equal.
This case has typically required specific work-arounds in other
rendering paths as well.

Task-number: QTBUG-25153
Change-Id: I217e710a30222792ebca3bf297e438d944c32992
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-11 13:11:48 +02:00
Pierre Rossi
9adf7fb708 Revert "Handle additional format ranges when itemizing."
This reverts commit 101d04681f.
That change seems to have introduced a few regressions, and
Creator hits an assertion that it introduced because it assumes
the additionalFormats consists of well-formed ranges
(QTCREATORBUG-7995).

Change-Id: Ic4ae761e6e7f6df8a6b5ca565ceb250647420c15
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-10 23:27:03 +02:00
Giuseppe D'Angelo
361ab4fe86 Move QValidator tests to QtGui
Q*Validator classes are not in QtWidgets,
so move them where they should stay.

Change-Id: Ie6ea45a026e640fad131002bc9762c575235f3f4
Reviewed-by: David Faure <david.faure@kdab.com>
2012-10-10 23:27:03 +02:00
Morten Johan Sorvig
d4d81fe68a Remove handleSynchronous* functions.
There are now two different ways to implement synchronous
event processing. The platform plugins can choose which
one to use.

1) flushWindowSystemEvents()
   Use to flush the event queue at one point, making
   preceding calls synchronous.

2) setSynchronousWindowsSystemEvents(bool enable)
   Makes all handle* functions synchronous, bypassing
   the event queue completely.

Change-Id: I020b80c731fd13f855a377d7c91d06a4e39b6a0b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2012-10-10 19:49:22 +02:00
Jan Arve Saether
9f96bf2023 Fix a regression with regards to hfw behavior in QStackedWidget
This is a regression because we made QStackedWidget actually
support heightForWidth in 4.8. This was done with change
4780f94e391b5e881497c5228661dead42c821fa.

The problem was that heightForWidth was not calculated correctly
because some of the pages were hidden. The hidden pages were
actually not contributing to the hfw of the QStackedWidget at all.
This again caused the QStackedWidget to change its heightForWidth()
value when the current tab changed, which again could cause "jumps"
in the UI when switching tabs (as demonstrated in the task).

The problem was that the patch relied on calling
QWidgetItem::heightForWidth(), and this function would return -1
if the widget was hidden. However, QWidget::heightForWidth() does
not have this magic and returns the proper hfw value regardless
of its visibility.

One could argue about the correctness of this patch, but since
QStackedLayout::sizeHint() disregards QWidgetItem::sizeHint() (it
asks the widget directly), we do the same in
QStackedLayoutHFW::heightForWidth() for consistency.

In addition, QStackedLayout enforces that only widgets can be added
to it, and you cannot add your own QLayoutItem subclasses to it:

  qWarning("QStackedLayout::addItem: Only widgets can be added");

Task-id: QTBUG-24758

Change-Id: I349cf8f4215e4581ea237ef773d53dcdf3db176b
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2012-10-10 14:22:58 +02:00
J-P Nurmi
f92f78094d tst_QMenuBar: remove QSKIP's -> omit whole test cases instead
Change-Id: I2cf356c5790fd7f2b27a9032e2effacd098b3d05
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-10 14:04:02 +02:00
Konstantin Ritt
f0ee31dc93 QTextBoundaryFinder: Introduce BoundaryReason::MandatoryBreak flag
that will be returned by boundaryReasons() when the boundary finder
is at the line end position (CR, LF, NewLine Function, End of Text, etc.).
The MandatoryBreak flag, if set, means the text should be wrapped at a given position.

Change-Id: I32d4f570935d2e015bfc5f18915396a15f009fde
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-10 13:26:13 +02:00
Konstantin Ritt
008e5ba61a Invalidate old QImage data if load()/loadFromData() has failed
This guarantees one will never get `!img.isNull()` after
load()/loadFromData() has failed, even if the image was
not null before.
Apply the same fix to QPixmap and QPicture.

Change-Id: Ida1ad6a6f0fc830df8e75ada0c163fc2d3360dea
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-10-10 13:24:23 +02:00
Gabriel de Dietrich
06332df743 Mac: Bring back "Text boxes and list only" tab navigation
Added ThemeHint::TabAllWidgets as a mean to access that platform
specific bool. The default implementation returns always true when
querying QPlatformTheme::themeHint().

Several auto-tests had to be updated to reflect for qt_tab_all_widgets'
type change. One XFAIL removed from tst_QApplication::focusChanged().

Task-number: QTBUG-24372
Change-Id: Ie1f0486c19898fe54c53aa4a27e378485075e512
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2012-10-10 13:15:57 +02:00
Gabriel de Dietrich
5715455901 tst_QApplication: Make sure the native style is being used
The tst_QApplication::args() auto-test sets the style to windows style
but there is no way to reset the style back to the native one. This
makes tst_QApplication::focusChanged() fail on Mac in some cases,
since not all the styles respond the same way to tab vs. strong
focus changes.

Change-Id: I91e39c1dd0fad4d90f3a13ab50a5e9758922ac28
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2012-10-10 13:03:00 +02:00
Stephen Kelly
43325a23f3 Delete the QVariant ctors taking global Qt enum values.
They have unexpected results in Qt 5 (the Qt::GlobalColor one works
as expected in Qt 4, but was removed in Qt 5):

 QVariant v = QVariant(Qt::red);
 qDebug() << v; // QVariant(int, 7)
 v = Qt::red;
 qDebug() << v; // QVariant(int, 7)

The correct way is to use:

 QVariant v = QVariant::fromValue(QColor(Qt::red));

The deleted constructors are the ones for which there is a class
with an implicit constructor taking the enum, and that class is
a built-in metatype.

QLocale::Language and QKeySequence::StandardKey would also fit
the description, but I can't include the header for QKeySequence
as it is in QtGui, and I don't want to include the qlocale header
in qvariant.h. Putting a QLocale::Language is probably very
uncommon anyway.

The QTextFormat test is doing the wrong thing, but the result isn't
being tested. Added new tests which fail before the patch.

Change-Id: Ia38a0784990f4d40ff7457a86daf58aabd4964eb
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-10-10 08:45:22 +02:00
David Sansome
c3ffcbd9a2 Scale icons returned by QIcon::fromTheme.
The icon engine behind icons that are loaded from QIcon::fromTheme does
not scale any pixmaps that it returns. When using an icon theme with an
incomplete set of icons (for example, only a "128x128" folder),
QIcon::pixmap will always return 128x128 pixmaps even if you ask for
one of size 22x22.

This is contrary to the QIcon::pixmap documentation that says "The
pixmap might be smaller than requested, but never larger."

This patch uses the same code that is in the main QIcon class in the
PixmapEntry QIconLoaderEngineEntry to scale pixmaps if they are too big.

Change-Id: Ic25a3628ac82cfb899574245f658490a2dd49d54
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-10-10 08:45:22 +02:00
Jon Severinsson
85c47eed6b Change QDateTime::addSecs() and QDateTime::secsTo() to use qint64.
addMSecs() / msecsTo() have always used qint64, and when QDate was changed
to use a 64-bit julian day, QDateTime::addDays() and QDateTime::daysTo() was
changed to use qint64 in order to support the full extended range, but
addSecs() and secsTo() seems to have been forgotten.

Change-Id: I3acc35ee2bcc9f353650eb42f97d428f706b2db6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-10 08:45:22 +02:00
Konstantin Ritt
2672c4fa91 Update the Unicode Data and Algorithms up to Unicode 6.2
Version 6.2 of the Unicode Standard is a special release
dedicated to the early publication of the newly encoded Turkish lira sign.
In addition, there are some significant changes to the Unicode algorithms
for text segmentation and line breaking to improve breaking for emoji symbols.

For more details, see http://www.unicode.org/versions/Unicode6.2.0/

Change-Id: I21cfd4f307e41b41a19d36cce87f7a44c2661bc2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-09 03:04:41 +02:00
Rohan McGovern
0776746d47 tst_qfiledialog: fixed typo causing semi-random completer() failure
completer_data() was attempting to find the first folder which did
not begin with a '.' character under QDir::root() for usage during the
test.

However, a typo caused it to find the first folder even if it _did_
begin with a '.'; unless the first folder returned by entryList()
was ".", in which case no folder would be found.

Change-Id: Ie95f1add797973d06a8d5f2fa32935366a008de5
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-09 00:25:57 +02:00
Christian Strømme
0ed3cf2a1c Removed the "tst_QVector::outOfMemory" test.
The test is useless as we assert if the requested size exceeds
a certain limit. We could, as an alternative,
throw an exception, but in the end it's the caller's responsibility
to ensure that the requested size is a sane value.

Task-number: QTBUG-27285
Change-Id: I738950a6a2b51671a54e4d25c7e4c3ac0d7f63b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-08 17:38:20 +02:00
Friedemann Kleint
27e901de92 Stabilize test qmenu::pushButtonPopulateOnAboutToShow().
Do not leave an allocated menu in member lastMenu behind that
interferes with the consecutive QTBUG7907_submenus_autoselect().

Change-Id: I80fc9de9ca63367264f642023a244c1d7d8ada7f
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
2012-10-08 17:27:57 +02:00
Pierre Rossi
101d04681f Handle additional format ranges when itemizing.
This is useful when the additional formats are used on a
text layout using a raw font. It can also come in handy for
input methods operating on a QTextDocument.
We now consider all format range edges to generate the
associated items. The capitalization can be overridden via
the additionnal formats mechanism.

Adds an autotest that checks that this works with font capitalization.

Change-Id: I782d2c48d05b0dfbad480a9ca77198465292b358
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-08 17:22:56 +02:00
Friedemann Kleint
0e8a2788d8 Fix Windows: QStandardPath::findExecutable() to check suffixes.
Append the Windows executables suffixes from the PATHEXT
environment variable.

The previous code had a bug since the 'break' statement
bailed out of the inner loop only.

Factor search code out into a separate functions, avoiding
repeated invocations of list.constEnd() and variable
assignments in the old code.

Add a static function that is called on Unix and on Windows
for executable names with a suffix.

Call another function applying a candidate list of suffixes
in case an executable name without a suffix is passed.

Lower case the extensions from PATHEXT, streamline code.

Split up the test, add a _data() slot for clarity.

Task-number: QTBUG-27457
Change-Id: I2bf34de52aeadddd3b937ad1e22191c3c850fd26
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-10-08 17:21:35 +02:00
Thiago A. Correa
7e6e141234 QSqlQuery::value string overload
Introduce value overload to take field name as a parameter.

This allows for terser application code that avoids explicit
calls to QSqlRecord::value().

Change-Id: I02b6712cd5ec41633b902714315b5716c17d1a9b
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-10-08 08:55:28 +02:00
Friedemann Kleint
274c258521 Use jom in tst_qmake.
Speed up compiling the tests.

Task-number: 26023

Change-Id: Ib5e872cc6cde09ac90f426a8f6e7cfea509d02e2
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-10-08 08:46:21 +02:00
Friedemann Kleint
8924506992 Increase tst_qmake more time on Windows.
The test compiles examples, which takes a long time.

Task-number: 26023
Change-Id: If794b046aa07737f3076aace8d585dc44027cc6b
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-10-08 08:46:07 +02:00
Mark Brand
244eeae406 QSqlTableModel::selectRow(): don't expand cache if there is no change
Test added.

Change-Id: Ibd72ef2aeee482abbd22991573460e55dc577457
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: David Faure (fixes for KDE) <faure@kde.org>
2012-10-05 03:16:25 +02:00
Mark Brand
c1f15c0485 QSqlTableModel: record(row) must use virtual data()
Commit fbf010a266 introduced a version
of record(row) that includes the generated flags, but it neglected to
populate the values using virtual data() as QSqlQueryModel correctly
does.

Test included lest we forget again.

Change-Id: I49d0f8f87cd0c5078aa6a0e8373b2cffc01f2387
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-05 03:16:22 +02:00
Mark Brand
a97c2d8c83 QSqlTableModel: restore use of virtual setData() in setRecord()
setRecord() should use setData() as intended so that reimplementations
of setData() in subclasses will be respected.

Commit 11bd543d90 failed to consider this.

Test added which should prevent this mistake being repeated.

Change-Id: Ia2d930cd42b5a27521bb389edb1b07fb1bf0fa36
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-10-05 03:16:21 +02:00
Mark Brand
10ff9de91b QSqlTableModel: don't cache unchanged value in setData()
This is good for performance in terms of avoiding unnecessary
database activity and keeping the cache smaller.

Detail:
This change was not included in the big refactoring of QSqlTM. The
idea was that the model shouldn't second guess the intention of the
application and maybe the application wants to cause a submit.
It was a marginal consideration.

Now I think it's clear that our interest in not unnecessarily
expanding the cache outweighs that. In addition, applications can now
call selectRow() if they worry that the database values for the row
have changed and want to set a value back again.

Test added.

Change-Id: I63814dcb63a96c6ba1c8cc227807725a954a0b68
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2012-10-05 03:16:19 +02:00
Mark Brand
5fe272f68a QSqlTableModel: fix segfault when overriding selectRow()
The STL-style iteration over the cache in submitAll() assumed the
iterator would remain valid until reaching cache.end(). This failed
to consider that virtual selectRow() might be overridden so that
it removes rows from the cache. For example, it might call select()
which would empty the cache.

The new approach checks at each iteration whether the row is
still in the cache. Using foreach here is justified by its fitness
for purpose and readability.

New test included.

Change-Id: Idee8807ede239c3ba56ff1604574c49f47385ad2
Reviewed-by: David Faure (fixes for KDE) <faure@kde.org>
2012-10-05 03:16:12 +02:00
Sergio Ahumada
92c756677f test: Remove QSKIP from tst_QToolButton::triggered()
This test actually passes on Mac OS X, so removing the QSKIP

Task-number: QTBUG-24374
Change-Id: I0b761ca9c30afc9d511e9962ee1c0958b863b374
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-04 12:55:23 +02:00
Stephen Kelly
f37d3e2cd9 Fix segfault when delegates change properties on editors.
The solution is similar to that
in b84e180263 which affected
QSortFilterProxyModel.

Task-number: QTBUG-25370

Change-Id: I6bbb9d9786bcb2c9fa8027ab8a7cc13664784b8d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-04 12:15:49 +02:00
Stephen Kelly
d24b867e56 CMake: Improve QT5_GET_MOC_FLAGS macro
We need to handle CMAKE_INCLUDE_CURRENT_DIR for include directories.
Otherwise generated files located in the current binary directory are
not found as expected.

e.g. *.json file as meta data for Qt5's plugins generated at build time.

Change-Id: I14ae1e7013f9d8b485aa990d50db4a03ca4f4b81
Reviewed-by: Yuchen Deng <loaden@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-10-04 11:58:48 +02:00
Sergio Ahumada
b4bf76fffc tst_QLocale: remove QSKIP, wrap Q_OS_MAC/Q_OS_WIN
Change-Id: I44755379561b98e43dd19c8c01b40349be203e14
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-10-04 09:09:15 +02:00
Leonard Lee
122b09c1d0 Remove #if 0 usage in QElapsedTimer autotest.
Given QElapsedTimer t1, t2 variable, the t1-t2,
t1+1000 (add 1 second) operations not supported.

Task-number: QTBUG-22446
Change-Id: Idd87f778c212831aa7f92242452538d113c9cfcf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-04 03:03:35 +02:00
Leonard Lee
679a4e98c7 Fix #if 0 usage in collections autotest.
Removed inappropriate use of #if 0 in collections autotest.

Task-number: QTBUG-22471
Change-Id: Ibf4e5fae8e671ebfd0dc5734875fcc8879b330af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-04 03:03:17 +02:00
Frederik Gladhorn
375f5b4424 Remove unused function.
Change-Id: Ie8eecf7e4a7475ac84a66b6055149ce92d019785
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2012-10-03 17:34:40 +02:00
Christian Strømme
403b15488b Fix for integer overflow in QString::replace
Task-number: QTBUG-22967

Change-Id: I604e6a725d46eab4c4369ebb54e8c9ea1350f492
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-03 17:30:30 +02:00
Konstantin Ritt
3d620088b4 Fix QTextBoundaryFinder assignment operator
for the case when the boundary finder is assigned to an invalid one.

Change-Id: I5b60984ff3fd99972fcae21895684bd83b012780
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2012-10-03 16:34:32 +02:00
Thiago Macieira
f89fd779fc Overhaul a little the QUrl error reporting.
Keep the original QString that triggered the parsing error, instead of
just one QChar. This provides more powerful error messages, like:

 Invalid IPv6 address; source was "http://[:::]";  scheme = "http", host = ""
 (QUrl cannot keep invalid hostnames)

 Invalid port or port number out of range; source was "http://example.com:abc";  scheme = "http", host = "example.com"
 (QUrl cannot keep a non-numeric port number)

 Invalid path (character '%' not permitted); source was "foo:/path%?";  scheme = "foo", path = "/path%25%1F"
 (the tolerant parser runs first, so the faulty component is fixed)

This stores the error state in a special structure which is not
allocated under normal conditions, keeping the memory consumption
down. On 32-bit systems, QUrlPrivate does not increase in size; on
64-bit systems, it grows by 8 bytes.

Change-Id: I93d798d43401dfeb9fca7b6eed7ea758da10136b
Reviewed-by: David Faure <faure@kde.org>
2012-10-02 22:34:42 +02:00
Thiago Macieira
4f52a95099 Update some error messages in QUrl::errorString()
Make both invalid hostname messages start with "Invalid hostname". And
split the empty port error from the invalid port one.

Change-Id: I870d1ed6fb07ec494f553871a37ed167141ffc06
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-10-02 22:34:42 +02:00
Thiago Macieira
ceca141d0c Remove the annoying qWarning when QUrl::setPort is out of range
That's what we have QUrl::errorString() for. This will become evident
especially now that QUrl::toString() / toEncoded() return empty if
there are errors.

Change-Id: I64a84e9c6ee57c0fc38cc0c58f5286ddc1248d1f
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: David Faure <faure@kde.org>
2012-10-02 22:34:42 +02:00
Thiago Macieira
59ad0019dc Make QUrl::errorString() usable for QtTest output in invalid URLs
If an URL is invalid, let's indicate that in the test output. To be
helpful, let's make QUrl::errorString() include the component form of
the URL.

Change-Id: Iaafe16973ded79c7ea688fbb23808d91253e8c14
Reviewed-by: David Faure <faure@kde.org>
2012-10-02 22:34:42 +02:00
Thiago Macieira
adce435a0c Make QUrl::toString() / toEncoded() return empty for invalid URLs
Change-Id: I6ebb4ad2901a9bacb09fb81082202f37ebbc2e97
Reviewed-by: David Faure <faure@kde.org>
2012-10-02 22:34:42 +02:00
Thiago Macieira
7d62f8ace5 Add two compound URL invalidity cases for isValid()
These two errors can only happen if one calls setPath() explicitly. They
cannot happen for parsed URLs, which is why they are only caught with
isValid(). It's not possible to set the error condition in setPath()
either because they depend on the presence / absence of the authority
and scheme.

Also update all the unit tests that set a path not starting with a slash
and were just "freeloaders" on the previous behaviour.

Change-Id: Ice58cd4589a850452d7573a5b19667bbab2fb43e
Reviewed-by: David Faure <faure@kde.org>
2012-10-02 22:34:42 +02:00
Thomas Hartmann
ad41111167 QProcess.tests: adding test for channel forwarding
This tests QProcess::setProcessChannelMode().

The tests verifies if testForwarding really forwards
the output of testProcessEcho (spawned by testForwarding).

Change-Id: Ifc4164569256aeaeab0edef42116986272362c01
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-10-02 13:22:49 +02:00
Andy Shaw
ef3a544436 Rename createLocalFile to createNativeFile & deprecate createLocalFile
As it was confusing to use the term local file when referring
to a file that was accessible using native APIs and not just
a file that was on a hard disk somewhere already the function
name has been changed.

By renaming it to createNativeFile we keep it consistant with QFileInfo
which has an isNativeFile() function too.

Test also added.

Task-number: QTBUG-3169

Change-Id: I410e7ed28133d68fd312c6c0faf3f7191460d7ce
Reviewed-by: João Abecasis <joao@abecasis.name>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-10-02 10:43:48 +02:00
Joerg Bornemann
07c95ad7f3 typo fixed in tst_QLocalSocket::verifyListenWithDescriptor_data
Change-Id: Ic549c8fa7f98052a45b391d6a9bfef3d2557c709
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-10-02 08:06:11 +02:00
Joerg Bornemann
618c5f854f QWinOverlappedIoNotifier test for multiple I/O operations added
tst_QWinOverlappedIoNotifier::multipleOperations starts asynchronous
read and write operations on the same named pipe handle.
The received notifications must contain the right byte count and
OVERLAPPED pointer corresponding to the I/O operation.

Change-Id: I6f3fa5cf3ca6d62fcb9bc7073d28611fcfa7d98a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-10-02 08:05:58 +02:00
Joerg Bornemann
94dc0c6594 QWinOverlappedIoNotifier: multiple I/O operations on the same handle
When doing multiple I/O operations on the same handle, we get notified
for every operations. These must be distinguished by comparing the
pointer to the OVERLAPPED struct.

We now pass the OVERLAPPED pointer via the notified signal and let the
receiver decide if it wants to handle this notification.

Change-Id: I4efe70f39c6ae5282b949f2f4b21f6e7dd3df785
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-10-02 08:05:55 +02:00
Joerg Bornemann
d3c24d241e remove tests/auto/network/socket/qlocalsocket/example
The programs in the example isn't used in the test.
Examples should be in the right directory and be of a certain
quality.

Change-Id: Id77bd1295efb3387fa54c379eb9c882cdc5b88bd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-10-02 08:05:48 +02:00
Joerg Bornemann
1cf6bbfcf1 make tst_QLocalSocket::listenAndConnect faster
Replaced qWait/QCOMPARE with QTRY_COMPARE.

Change-Id: Ic534443c187f791c75fe9528251bf47e54f33eed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-10-02 08:05:45 +02:00
Yoann Lopes
65d4dea41a QXcbWindow: Don't recreate window when reparenting.
For consistency, this behavior has been kept across Qt versions... Just
get rid of it.
Also fixes native child widgets not being notified of the change of
window handle (winId) when being reparented.

Updated auto-test.

Change-Id: I3616dc0f1c32a519d78a4846297d6d4a6e926fbf
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-10-01 15:48:08 +02:00
Simon Hausmann
310031188c Fix moc stumbling over gcc __attribute__ extensions
Reported by David Faure.

In KDE a DEPRECATED macro gets defined in a header file created by cmake.
The define is not guarded with #if Q_CC_GNU or similar because at cmake
time the compiler is determined. Therefore moc suddenly sees this gcc
specific token and stumbles over it.

This patch simply defines an empty __attribute__ macro that will expand
to nothing and thus become invisible to moc's "C++ parser" after the
pre-processing.

Change-Id: I4448b9ac3f72b6334e32b27484401fb0fca23a0c
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-10-01 14:27:14 +02:00
Jędrzej Nowacki
abcdc7fd87 Make documentation of QVariant::isNull more explicit.
Task-number: QTBUG-22933
Change-Id: I1d8d3fc778ba00bcad11caaaf8af7d87186f18e8
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2012-09-29 02:31:35 +02:00
Marc Mutz
ac9be327f8 QFlags: use unsigned int when the enum's underlying is unsigned
Replace storage and operator int() return types with unsigned int
if the enum is unsigned.

This fixes a number of exisiting warnings, in particular with
Qt::MouseButton under GCC.

Change-Id: Ia12d36212329aec3e9d62a5fbd38809a6c2b36d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-28 23:50:10 +02:00
Marc Mutz
427a271426 Include qexception.h instead of qtconcurrentexception.h
Change-Id: I9a54412b77596aa74af7a513c33b10eb52257db2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-28 23:50:10 +02:00
Marc Mutz
7d21abfca3 Move QFutureSynchronizer back to QtCore
This class, too, belongs with QFuture.

Change-Id: I41a532ca66c156f1631e4b22ffc1a5879c854488
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-28 23:50:10 +02:00
Marc Mutz
08c50599f1 Move QFutureWatcher back to QtCore
This belongs with QFuture.

Change-Id: I555cd01c1d3890fbbaca4fd8a9170292ea4eb0fb
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-28 23:50:10 +02:00
Marc Mutz
727f25214e Move QFuture from QtConcurrent to QtCore
This class belongs to QThreadPool/QRunnable more than to QtConcurrent, so
move to QtCore, where QThreadPool awaits it.

Change-Id: Ibf20288a986593bf779453427c2dae8db1e1423a
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-28 23:50:10 +02:00
Marc Mutz
a65a98399b Move QtConcurrent::ResultStore as QtPrivate::ResultStore to QtCore
No compatibility header needed. While this wasn't marked as private API,
it wasn't documented, either.

This is a prerequisite for moving QFuture to QtCore.

Change-Id: I8e986e6e2a22fbe5cf08d0600ec39ae9ae993e20
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-28 23:50:10 +02:00
Marc Mutz
3a29976eac Move QtConcurrent::Exception as QException back to QtCore
Leave the old name as a deprecated typedef; adapt users.

This is a prerequisite for moving QFuture back to QtCore.

Change-Id: I81dcee2c7e6eb234c16f3f42e2415ca0da3dc4f8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-28 23:50:10 +02:00
J-P Nurmi
5414a9a03b tst_QDateTimeEdit: cleanup whitespace & follow Qt coding style
Change-Id: Iae04cd0c9ac6ea85621b293f2ce184d673548e9b
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-28 21:12:21 +02:00
Thiago Macieira
928fc8d939 Update the NaN tests to deal with non-conformance better
ICC apparently optimises 0 * anything directly to zero, even when it
should be doing a multiplication to conform to IEEE requirements. GCC in
fast-math mode does the same, but that also makes the rest of the
function unreliable, so we try to turn off fast-math mode if we can.

Task-number: QTBUG-22340

Change-Id: I0e3c5f4927b0a6bcb3189bb156c18843fc4b29b9
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-28 10:11:00 +02:00
Teemu Katajisto
7615b54ce8 Run application main run loop in color/font dialog test
In cocoa the timers are associated with main run loop but
the way font and color dialog tests are executed the modal
dialog run loop is only run in cocoa. This causes timers to
not to fire and test cases to hang.

Unfortunately this does not completely fix the test failure
because the QTest::keyClick is not working with cocoa
native dialog helpers and therefore the tests are marked
with QEXPECT_FAIL.

Task-number: QTBUG-24320
Task-number: QTBUG-24321

Change-Id: I88740a20ad2b794b6ca15e1b6455f436ffd39335
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2012-09-27 23:51:30 +02:00
jian liang
0a7e8350ae Fix drag and drop with native widgets
Task-number: QTBUG-27336

Don't check 'widget != m_widget' in
QWidgetWindow::handleDragEnterMoveEvent() since the current window's
parent widget may be the actual drop target. I replace it with a check
'!widget->isWindow()' to prevent we pass through a top level window.
I also change 'widget->mapFrom(m_widget, event->pos())' to
'widget->mapFromGlobal(m_widget->mapToGlobal(event->pos()))' since m_widget
may not be widget's parent.

Change-Id: Ia4f10f85ccdf1e27223ddc51afabd98b5d16f2fb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-27 23:51:30 +02:00
Caroline Chao
67391eedfe Test: Enable tst_QWMatrix::operator_star_qwmatrix
Expecting results were not correct. The test is passing.

Task-number: QTBUG-22362

Change-Id: Ie41c262019f76aace9062d7897d7934dc7437c3a
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-09-27 21:13:52 +02:00
Caroline Chao
47d635b011 Test: Split tst_QVarLengthArray::oldTests
The entire test is currently skipped while only the last part is
causing problems.

Move the out of memory test code to its own test function and skip
only this function with the appropriate bug number. By allocating too
much memory this test is causing a crash.

Task-number: QTBUG-27361
Task-number: QTBUG-22342

Change-Id: Ia308099b7f12cf2c567b62063a7bbcc6fb38515b
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-09-27 21:13:52 +02:00
J-P Nurmi
171c638a89 tst_QLabel: remove QSKIP, wrap Q_OS_MAC
Change-Id: If67dbb07900bfa8f1bcf55aa457bd90ef0550900
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 21:13:52 +02:00
J-P Nurmi
41dc50edff tst_QMenu: remove QSKIP's -> wrap Q_OS_WINCE
Change-Id: If8cb4a7dc0630aca83e4796bffb46f547abc4b6f
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 21:13:52 +02:00
J-P Nurmi
70bef120b7 tst_QMainWindow: remove QSKIP, wrap Q_OS_MAC
Change-Id: Ided3c4cbdc7508a36e96351b5f60d79532bb7f26
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 21:13:52 +02:00
J-P Nurmi
2d70dde68a tst_QAbstractButton::keyNavigation(): QSKIP -> XFAIL
Task-number: QTBUG-22286
Change-Id: If2c0e9181f2d954f3487dbb4c3f440d26a38adb6
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-27 18:35:55 +02:00
Joerg Bornemann
52e6a908bd remove no-op test from tst_qfile
According to the repo history the tailFile was introduced with the
S60 port but the functionality it's testing was never implemented.

Task-number: QTBUG-22341

Change-Id: I16e8e43bbd799f05f8b136925cb0add0b918289e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-09-27 15:50:17 +02:00
J-P Nurmi
4a9bdbd8cc tst_QCommandLinkButton: cleanup whitespace
Change-Id: Ia1aab643f7b93b0532a38b27d7777fbcf5f489bc
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 15:21:41 +02:00
Jens Bache-Wiig
570ae40f57 Remove CDE and Motif styles from qtbase
It is time to clean up some of our legacy code. These styles have
not been actively maintained for a long time and I think it is safe
to say that they should no longer belong as part of the default
distribution of Qt. We dont support any platforms based on CDE with
our source packages.

Note that even if we are removing these styles from the default
distribution of Qt, applications that depend on them
will still be able to bundle the existing (and unmodified) styles
along with their own source code as we are not breaking compatibility.

Change-Id: I1709630c20ba8e8088cd01628628d86856db57a4
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-09-27 15:16:16 +02:00
J-P Nurmi
05978af3a1 tst_qcheckbox: remove duplicate code
Change-Id: Ic5d7694251e42a6d5ad7fea19137b71bc499ac94
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-27 15:03:15 +02:00
J-P Nurmi
507b90ac86 QtWidgets auto tests: revise clipboard related tests
Use PlatformClipboard::isAvailable() and omit relevant test
cases when QT_NO_CLIPBOARD is defined.

Change-Id: I7e7b20a0a18f1a82987564f0e5e6c76d9207bc4b
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-27 09:15:00 +02:00
J-P Nurmi
b0b7d9cf6b Revise QClipboard auto tests
Use PlatformClipboard::isAvailable() and fix build
when QT_NO_CLIPBOARD is defined.

Change-Id: I18c3af42fe39cf7618c2530723149848a10db985
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-27 09:14:51 +02:00
J-P Nurmi
12e5464fa3 Auto tests: add PlatformClipboard::isAvailable()
Change-Id: Ie04060c2cae61ff8268644e9cd8001a1f5745f31
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-27 06:07:13 +02:00
J-P Nurmi
f7ae890e24 tst_QDialog: fix Q_OS_WINCE & QT_NO_SIZEGRIP usage
Change-Id: I443381ef4f10492eeda0fc681c390e0cd4d4125e
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 06:07:11 +02:00
J-P Nurmi
12130ff65f tst_qsidebar: remove duplicate code
Change-Id: I8ee59022199fda7ea56891a2f924954cb4aefa42
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 06:07:10 +02:00
Jędrzej Nowacki
60d096ff6d QMetaType build fix with Q_NO_CURSOR and friends.
QMetaType has a way to "switch off" some types from the build.
QtMetaTypePrivate::TypeDefinition<T>::IsAvailable is defined as false
for all unaccessible types. Sadly that information was never used by
gui and widget handlers. The patch implements it.

Change-Id: Ie5835be4c88cfbbca8a4e9199e31ddfc20cae190
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Jing Bai <jing.bai@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-27 02:37:19 +02:00
J-P Nurmi
a86b3d76a5 tst_QMessageBox: fix Q_OS_MAC usage
Change-Id: I1a3c1c88956d85343e693588ca0522c4b7d62072
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-27 02:31:11 +02:00
Simon Hausmann
ce1f994e9b Fix QScreen::orientation() not always being updated after changing the update orientation mask
The back-end might report screen orientation changes at any point and we
record it in screen.d->orientation. However QScreen::orientation()
returns the orientation filtered according to the mask.

Changing the mask sends a notification to the back-end, which might send
another update as a result of a possible subscription to system services
(accelerometer). However on platforms where no subscription is required, where
the platform plugin ignores the mask and always sends the latest orientation,
we should "simulate" the update by updating the filtered orientation according
to the new mask. The function is cheap to call as it won't emit any signals
unless the orientation actually changes.

This patch also adds missing flush() calls after handleScreenOrientationChange
calls in the tests to ensure that the (synthetic) window system events are
actually delivered to QScreen/QGuiApplication.

Change-Id: Iebdd050f947e658ff5bc388629aa4cb31ab497fe
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
2012-09-26 19:55:00 +02:00
Simon Hausmann
c4e736cf9d Fix events being processed on application start
Commit ef2efafcc6 introduced a call to
QWindowSystemInterface::sendWindowSystemEvents() in
QGuiApplicationPrivate::init(), which in its implementation ends up calling
sendPostedEvents() before flushing and processing any pending (internal) window
system events.

This patch changes the call in init() to use
QWindowSystemInterface::flushWindowSystemEvents() instead, which is more gentle
in that regard.

The provided unit test verifies that no posted events are processed during the
execution of the QGuiApplication constructor while at the same time verifying
what the original changed tried to do: Allow a generic plugin to provide window
system specific defaults that are implemented using the event queue of
QWindowSystemInterface.

Task-number: QTBUG-26886

Change-Id: I129a907c00d947df60fe1a02efc67857580fce24
Reviewed-by: David Faure <faure@kde.org>
2012-09-26 19:54:19 +02:00
Marc Mutz
aec5b76b51 [QTBUG-27308][QTBUG-21534] Don't mouse-wheel-scroll QScrollBar when disabled
This fixes a regression introduced in Qt 4 commit
e855b199319c932f2e9500235775f961bc32e41a.

The problem was that by handling the wheel event in event()
instead of wheelEvent(), we lack the guard clause in QWidget
that doesn't even call the handler if the widget is disabled,
and the code didn't handle this itself.

Fix by reimplementing wheelEvent() instead, which we can now
do because we can break BC.

This commit just moves the code. Another commit will clean
up the implementation of wheelEvent().

Task-number: QTBUG-27308
Reported-by: chenjiexin
Task-number: QTBUG-21534
Reported-by: Martin Koller
Change-Id: Ibe6b89a81fe889f839c205b859a1492b39a4ddc3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-26 19:06:47 +02:00
Teemu Katajisto
0b2068eafd QtPrintSupport: allow slight deviations from pre-defined paper sizes in tests
CUPS paper sizes may differ from Qt paper sizes slightly and thus fail
the strict comparison in qprinter tests. This is needed for the
followup patch which initializes the cupsplugin with CUPS/PPD defaults.

Change-Id: Ie66f77ead0204de0fc7c7913005fa516d57d34eb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-26 10:08:59 +02:00
J-P Nurmi
54d18cdc29 Auto tests: remove PlatformQuirks::isAutoMaximizing()
Use QStyleHints::showIsFullScreen() where necessary.
Notice that QWidget::show() already calls showFullScreen()
if appropriate, and Qt::X11BypassWindowManagerHint doesn't
do anything in the XCB platform plugin.

Change-Id: Ib8f61188c075170d646894388561cbb3f72daee8
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-26 10:08:59 +02:00
Kai Koehne
f052ee467d Fix MinGW/gcc warning about NOMINMAX being redefined
Commit 5230d62fe added a #define NOMINMAX, which conflicts with a
NOMINMAX definition in the MinGW headers. Just use the same definition
as in MinGW to fix the gcc warning.

Change-Id: Ib21dd323ebbdca5d143e394c7631303e0c72541a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-26 10:08:59 +02:00
Caroline Chao
371c21b9a8 Test: tst_QFile::writeLargeDataBlock() unstable failure as XFAIL
While the large data block can be written to a file, the test is
also showing instability while reading back the written block.

Adding another expected failure to address this instability.

Task-number: QTBUG-26906

Change-Id: I9704d441cf2bd6d7ef0f9023240ea61bb89561b6
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-09-26 10:08:59 +02:00
Jonas M. Gastal
4920090da0 If accept fails, stop accepting new connections and emit error signal.
Task-number: QTBUG-24778
Change-Id: I6c5b685b3f861a0fafc1475c41bb35cede17d712
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-26 04:03:51 +02:00
Janne Anttila
bf05abddfd Fix qstringlist autotest build for WinCE.
WinCE does not have setlocale, used SetUserDefaultLCID correspondingly
as it is done in qstring autotest for WEC7.

Change-Id: I7866bf0f365c7c6efbf3b439cdd9a281c6a1b2e0
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-09-26 04:03:48 +02:00
Sergey Hambardzumyan
931640391a test:Remove QSKIP from tst_QPainter
Removed QSKIP ("currently broken... ") from tst_qpainter.cpp.

Change-Id: I2a5af009198d26015779ca368ef82188ddf1b060
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-26 04:03:41 +02:00
Marc Mutz
0842d32441 QFileSystemModel: fix permission mangling
The old code masked out write flags before returning permissions
from permissions() or data(FilePermissions) in order to force
QFileDialog to disable the rename and delete actions. This was to
fix Task 143519, but introduced QTBUG-20503.

Instead, revert to the pre-143519-bugfix code and do the necessary
check in QFileDialog directly.

Also add a testcase for 143519.

Reported-by: Gilles Pascual
Task-number: QTBUG-20503
Task-number: 143519

Change-Id: I140109341c0ed40722e3aac4327c2a740fb014c2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-09-26 04:03:41 +02:00
Mitch Curtis
6b6fefad48 Remove duplicate words and punctuation from documentation.
Change-Id: I5550c62d412510bc2c5acceb2cae7d2f2ef6a8d3
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2012-09-26 04:03:20 +02:00
Konstantin Ritt
a798b956b9 QCharAttributes: add wordStart/wordEnd flags
A simple heuristic is used to detect the word beginning and ending by
looking at the word break property value of surrounding characters.
This behaves better than the white-spaces based implementation used before
and makes it possible to tailor the default algorithm for complex scripts.

BIG FAT WARNING: The QCharAttributes buffer now has to have a length
                 of string length + 1 for the flags at end of text.

Task-Id: QTBUG-6498

Change-Id: I5589b191ffde6a50d2af0c14a00430d3852c67b4
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-09-26 03:09:57 +02:00
Sergio Ahumada
aeb21c73c5 test: Mark tst_QMdiSubWindow failures as XFAIL
The test has lots of failures, so mark these with QEXPECT_FAIL and
remove the QSKIP.

Task-number: QTBUG-22310
Task-number: QTBUG-27274
Change-Id: I0d38cedb581741b6edae5d1c3f4410714099a7fb
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-25 20:28:06 +02:00
Caroline Chao
e14099cfbc Test: Remove QSKIP from tst_QWidget::raise
Remove QSKIP("Not yet sure why this fails."), the test is passing
on Mac.

Task-number: QTBUG-22321

Change-Id: I5f09d067b1cc837c5e3ada5bbd34091fe1fd723d
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-09-25 18:36:32 +02:00
Caroline Chao
9f98fe04c1 Test: tst_QFile::writeLargeDataBlock() unstable failure as XFAIL
The current check is not enough to catch the unstable failure.
Update the test to catch the failure in all cases.

Task-number: QTBUG-26906

Change-Id: I2e37a1f6513df768cd410df7c91a9fd843150e57
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-25 18:36:09 +02:00
Caroline Chao
01a985ac5b Test: Remove QSKIP from tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut
The test is passing on Ubuntu 11.10.

Adding qWaitForWindowExposed after the line edit show() call to ensure
the line edit is actually shown on the screen.

Task-number: QTBUG-24518
Change-Id: I2af65bef76d171b36032120738dfbd7cfff51d7f
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-25 18:36:01 +02:00
João Abecasis
0c2b7b1020 Fix default-constructed QFileSystemEntry
Member variables for lastSeparator, first and lastDotInFileName are now
initialized to -1 (non-existing), where the previous value of zero would
mean a separator/dot at that position and resulted in path() returning
'/', instead of '.'.

Tests were expanded for better coverage of empty state and
default-constructed instances.

Change-Id: Ie27547886b52224d38b5be0b4f920c9927fd440f
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-25 00:08:16 +02:00
Lars Knoll
6ddef0007a Test case for moc handling defines
Added some test cases that check that moc
correctly expands #defines

Change-Id: I7fe6eed129d46ca9281d73064571cae43b32410d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-25 00:08:16 +02:00
Mark Brand
7389c09637 QSqlTableModel::selectRow(): fix failure on uncached rows
This method was originally intended for refreshing rows after
submitting changes. It should also work for refreshing rows
that are unchanged (i.e., not cached), but did not because
constructing the primary values depended on the cache. As a
consequence, the WHERE clause for the query was not created.

Fixed by deriving primary values for uncached rows from the
query record. Note that the cache is still authoritative for rows
it holds. This is important because the prmary values there may
differ from the original query record due to changes to columns
of the primary key.

Includes new test.

Change-Id: I41cca2cbf26019d4b495ffa6d876e2b55ec57803
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-09-24 21:27:51 +02:00
Caroline Chao
99f2bdd28f Test: Enabled tst_QFile::invalidFile
The test is not hanging on Windows anymore.

On Windows, add an expected failure for the failing case.

Task-number: QTBUG-22801
Task-number: QTBUG-27306

Change-Id: Iede95766504f3e8a278a4554a5967ca333aae3bf
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-24 21:27:51 +02:00
Thiago Macieira
3827fd2a37 Add some tests for compatible and incompatible custom deleters
Change-Id: I2bb7f597aab0f00a250881602e6a6bb7bfe42e18
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-24 21:27:51 +02:00
Stephen Kelly
05aa8c6c12 Implement viewOptions() logic in QListViewPrivate.
The private method is called in several places in QListViewPrivate,
but before this patch, the implementation in QAbstractItemView was
 called. This meant that the options were not set properly,
resulting, for example, in icons in icon mode being laid out in
list mode (on the left and small).

This is a regression resulting from
8eab9cbce2 and
3578e05b29. Other views are not
affected in a similar way.

Change-Id: I753cb99410e367266753eaf2fa43361b9212ab96
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-24 18:01:07 +02:00
Jędrzej Nowacki
c06106f28d Fix potential breakage in QString.
Negation operator ("!") have precedence over bitwise and ("&").

Change-Id: I39e2d99da6eaa4477bbe35a1259f745e05c9841a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-24 16:53:13 +02:00
Marc Mutz
c00bd8d677 Use QStringList::join(QChar) overload where applicable [QtCore]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: I81c378ef6aeeada5e116f1394cc9fc67f901ffd6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-23 23:30:18 +02:00
Sergio Ahumada
1395b81935 test: Remove QSKIP from tst_QFocusEvent::checkReason_ActiveWindow()
This test actually passes using the "xcb" platform and fails otherwise.

Second, the Jira task is misleading since it refers to
tst_QFocusEvent::checkReason_Shortcut()

Change-Id: Icab91ace8c214d958b534c5cebae900242522372
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-22 23:40:02 +02:00
Friedemann Kleint
f6155aec30 Redirect keyboard/mouse grab to the widget parent window.
Use the native parent's window if the widget in question does not
have one. This should be in line with Qt 4.8 using effectiveWinId().

Remove redundant code in grabMouse(QCursor).

Change-Id: Id6ab192e739221fe89f865f4d2f7a6d4671a190b
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-22 20:46:30 +02:00
Marc Mutz
15953e9503 QModelIndex: clean up integer size confusion in the API
QAIM::createIndex() took either int or quint32, but QMI::internalId()
returned qint64.

In the new interface, createIndex() takes, and internalId() provides,
integers of type quintptr.

This matches the storage size of the void* in the model index and
avoids truncation.

Remove the
  createIndex(int, int, quint32) and
  \obsolete createIndex(int,int,int)
overloads.

This makes a literal 0 in the third parameter ambiguous now.
The solutions have been noted in changes-5.0.0.

Change-Id: I0a0ecd8430eaf695129a4d09d14d4e30745485c4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-22 20:45:12 +02:00
Iikka Eklund
be15856f61 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-22 19:20:11 +02:00
Konstantin Ritt
ceb9a8232c A step out from Harfbuzz (reduce dependency)
Introduce QCharAttributes and use it instead of HB_CharAttributes everywhere in Qt
(in Harfbuzz, the HB_CharAttributes is only used in the text segmentation algorithm
which has been moved from HB to Qt (well, most of it)).
Rename some members to better reflect their meaning,
remember to keep HB_CharAttributes in sync with QCharAttributes.
Also replace HB_ScriptItem with a (temporary) QUnicodeTools::ScriptItem struct
that will be replaced with a more efficient/friendly solution a bit later.

The soft hyphen and the mandatory break detection has been factored out
of the default text breaking algorithm to a higher level in order to refactor
the QCharAttributes bitfields and to optimize the implementation for the common case.

Change-Id: Ieb365623ae954430f1c8b2dfcd65c82973143eec
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-22 00:47:40 +02:00
Caroline Chao
e3d334e7c3 Test: Update QSKIP message of tst_QVector::outOfMemory
This test is crashing. Specify the bug report number in the QSKIP
message.

Task-number: QTBUG-22343
Task-number: QTBUG-27285

Change-Id: I4d4ead4f54944a545103a3d01c5c9d302d7fb1df
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-22 00:47:40 +02:00
Caroline Chao
e7dccd9e03 Test: fix warning for tst_QPluginLoader::loadGarbage
Garbage libs (under elftest) are numbered from 1 to 5 and not from 0 to 4.

Change-Id: Ia0162372bf5cd1fb53a0442543c5a65716880611
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-22 00:47:40 +02:00
Samuel Rødal
ed8dec360c Fixed multiple modal windows from all blocking each other.
A modal window in front in the modal window list should never be blocked
by a modal window further back in the list. This was taken care of in
QGuiApplicationPrivate::isWindowBlocked(), we just need to make sure it
gets called when a new modal window gets shown so that its blocked
status is up to date.

Task-number: QTBUG-27206
Change-Id: I590f1715e66067edb178081352636f34fe54a885
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2012-09-21 22:04:00 +02:00
Jens Bache-Wiig
fe966e5f48 Fix regression in QAbstractScrollArea
The style hint SH_ScrollView_FrameOnlyAroundContents was currently
being ignored by QAbstractScrollArea. This looks like an accidental
regression following 10c6f015f4.

This code path does not execute on mac so it should have no impact
on that patch.

Change-Id: I78ca0a6b87dfdd7d426acbb3ef49480390211af2
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-09-21 02:44:22 +02:00
Samuel Rødal
72aaba336c Fixed inconsistent rounding of square cap pens.
A horizontal line should round up at the same time as a vertical line
with square cap, when rendering at subpixel coordinates. Thus, the
special casing in the cosmetic stroker of offsetting by half a pixel
should be for flat caps instead of for square caps.

Task-number: QTBUG-26013
Change-Id: Ic09249337f814c7de95a17976ec9e651561a744b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-20 23:08:44 +02:00
Oswald Buddenhagen
33e0d5c939 remove mentions of borland from project files
Change-Id: I3049b24ae287bee50aca1de06664a2309df69edf
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-09-19 19:54:44 +02:00
Mitch Curtis
63bc298fb3 Pass correct argument to QShortcutEvent ctor in tst_qabstractbutton.cpp
The QShortcutEvent constructor takes "int shortcutId" as its second
argument, not a bool. Since the default shortcutId is 0, this test
passed, since false == 0.

Change-Id: I43bbae4613f3badb1578dccec76dcdd3c96a3a2f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-19 19:54:44 +02:00
Miikka Heikkinen
ede4f5e23b Fix mapping to/from global coordinates for child/embedded windows.
QWidget's mapToGlobal() and mapFromGlobal() functions assumed that
if the widget reports it's a window or if it has no parent widget, it
must be a top level window whose coordinates are in global coordinates.
This is not true for child QWindows or embedded native windows
(QAxWidgets).

Changed the logic for mapping coordinates to use equivalent methods
from QWindow if widget has a window handle, and changed QWindow's
methods to map coordinates using native methods if window is embedded.

Also fixed newly failing accessibility autotest. The geometry related
failures there popped up because now the position of the rect returned
by accessible interface is actually correct while widget geometry still
reports position 0,0 before widget has shown up.

Task-number: QTBUG-26436
Change-Id: I658fafd0ce01eb1604ba255efeeba3073ca0189f
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-09-18 14:52:38 +02:00
Richard Moore
5ea896fbc6 Disable SSL compression by default.
Disable SSL compression by default since this appears to be the a likely
cause of the currently hyped CRIME attack.

Change-Id: I515fcc46f5199acf938e9e880a4345f2d405b2a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2012-09-18 14:12:17 +02:00
Tomasz Duda
60f4fc8b70 HTTP header may be damaged - fix, unit test
"HTTP/1.1 100 CONTINUE\r\n"
If the header from a server is splitted between two packets
the first packet contains "HTTP/1.1 100" and the second one
contains " CONTINUE\r\n", one space (0x20) is skipped. After
processing the line looks in this way "HTTP/1.1 100CONTINUE".
QHttpNetworkReplyPrivate::readStatus(QAbstractSocket *socket)
is called twice, if a http header is splitted as above.
The function always removes whitespace from the beginning of a packet,
even if it is the second part of a http header.

QHttpNetworkReply returns QNetworkReply::RemoteHostClosedError
due to damaged http header during processing.

Improvement of unit test.

Task-number: QTBUG-27161

Change-Id: Ifc2949f62473209b4032185effbf5078b4130cda
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-18 00:59:08 +02:00
Sergio Ahumada
f0b922a3af test: Mark tst_QTabBar::sizeHints() failure as XFAIL
The test has one stable failure on Mac OS X, so mark this
with QEXPECT_FAIL and remove the QSKIP

Task-number: QTBUG-22320
Task-number: QTBUG-27230
Change-Id: I7660df5770c39788792068a5b68e8236551288c4
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
Reviewed-by: Caroline Chao <caroline.chao@nokia.com>
2012-09-17 09:14:05 +02:00
J-P Nurmi
7329ad3ee5 Attempt to stabilize QMenu auto tests
Change-Id: I7d8260570a280182990d78e07d696aa4b46e1747
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-15 19:35:25 +02:00
Rafael Roquetto
31f94e0285 Blackberry: fix tst_QFileInfo::fileTimes()
The Blackberry OS uses a filesystem with the noatime option,
which returns a "wrong" access time.

Change-Id: I04cdb899699e819a36e0917e30d750067b33388d
Reviewed-by: Tobias Koenig
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Peter Hartmann <phartmann@rim.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2012-09-14 19:07:15 +02:00
Kai Koehne
1dd4790aee Autotests: Use qInstallMessageHandler
qInstallMsgHandler got deprecated in Qt 5.

Change-Id: Ib36983e66b3a8090b99f14e3fd4e210602a3f018
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-14 15:23:15 +02:00
Pekka Vuorela
5f974a4faf Avoid deprecated QTest method in unit test
Change-Id: I1d6fc84962ba29a8963f99b87cccb4af465a2935
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-09-14 11:18:17 +02:00
Sergio Ahumada
34cd8fd566 tests: Don't omit the body of a test function with QT_BUILD_INTERNAL
Changing it outside of the test function definition to avoid running
empty/inapplicable test functions.

Change-Id: I713560cde7f715696984ed082d682900f5f1bcdd
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Caroline Chao <caroline.chao@nokia.com>
2012-09-14 06:24:38 +02:00
Jan Arne Petersen
a386194f99 Fix QDBusServer with more than one connection
Create a new QDBusConnectionPrivate for every new connection in
qDBusNewConnection instead of creating a single QDBusConnectionPrivate
in the QDBusServer constructor which gets assigned the latest connected
DBusConnection in qDBusNewConnection (and loses track on all previous
DBusConnections).

Also extend tst_QDBusConnection::registerObjectPeer() test with multiple
connections to the server.

Task-Number: 24921
Change-Id: I4341e8d48d464f3fe0a314a6ab14f848545d65a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-14 01:02:06 +02:00
Thiago Macieira
81b00670f2 Use QElapsedTimer instead of QTime to measure elapsed time
QElaspedTimer is a lot more efficient.

Change-Id: I66d9514108f800a45181d8960b01a5e7d3fa9e80
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-13 22:40:34 +02:00
Thiago Macieira
53a7778b90 Increase the fuzziness of the QSemaphore test to 50 ms
The test tries to acquire a semaphore that isn't ready, so it will
timeout. The test is working properly.

The only problem is that 10 ms is too strict. For a wide variety of
reasons, especially since the Qt CI system runs multiple tests in
parallel, the program may not run again in that 10 ms window.

Change-Id: Ic0f684895f73646db5f1cc783fe9ef75fb1ab02b
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-13 22:40:27 +02:00
Markku Heikkila
d1d4647b74 Fixed: QFileInfo::lastModified() returning wrong value.
Fixed so that empty QDateTime is returned for non existing file.
Fixed also created() and lastRead() to return empty QDateTime for
non existing file.

QFileSystemEngine::fillMetaData() returned true for non existing
files. This was also corrected.

Task-number: QTBUG-25811

Change-Id: I523eb99e4405b4b813b2950f85cc646239181d07
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Christian Stromme <christian.stromme@nokia.com>
2012-09-13 19:33:08 +02:00
Caroline Chao
cecc2c6851 Test: Redo remove QSKIP from printsupport tests
Redoing 5704cbc462

This can't work, because the define comes from qconfig.h, not qmake.

Skipping initTestCase and cleanupTestCase when QT_NO_PRINTER is
defined.

Change-Id: I2527c018294b7518a4692f2c93da933848640b5d
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-09-13 19:33:08 +02:00
Rafael Roquetto
4a588c27e8 Blackberry: fix tst_QFileInfo::isWritable()
This test checks the access permissions for '/etc/passwd', however the
filesystem on Blackberry is always read-only

Change-Id: I9299531397d4467287541b04184540ad6e2eae72
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2012-09-13 16:52:51 +02:00
Stephen Kelly
d7a15fbfd9 Fix crash when invalidating a QSortFilterProxyModel
Task-number: QTBUG-27122

Change-Id: Ibca46b88442f4f92422d9b3182e4bbf25716a07f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-13 16:20:11 +02:00
Eskil Abrahamsen Blomfeldt
e640ebacb9 Fix regression in QTextDocument::toHtml() with font pixel size
Introduced by 2e0003eda4. We were
missing a attributesEmitted=true which caused the output from
toHtml() to sometimes be invalid when using pixel sizes to
specify the font size.

Task-number: QTBUG-25778
Change-Id: Ied61fcaef425a590d71c0b52292ac676cb88ba52
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jiang Jiang <gzjjgod@gmail.com>
2012-09-12 16:05:12 +02:00
Caroline Chao
b88534c2d4 Test: Update QSKIP for tst_QGLThread on Mac
Task-number: QTBUG-22361
Change-Id: I6182a37dc38294011fd3b3934317f22c7297a4ca
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-12 11:01:25 +02:00
Caroline Chao
5704cbc462 Test: remove QSKIP from printsupport tests
Exclude printsupport tests from the build when QT_NO_PRINTER is
defined.

Change-Id: Iedae91666a599f4b77250abc8aac14c256fde34e
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-12 10:14:10 +02:00
Eskil Abrahamsen Blomfeldt
97b4c5a574 Stabilize qprinter test
The CreationDate entry in the two PDF files can potentially
be different depending on when the test is run. We ignore the
line for this entry when comparing the two results.

Task-number: QTBUG-27171
Change-Id: I8978678295217edd537edb0d2c25260813aa3d93
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-09-12 10:14:10 +02:00
João Abecasis
975ebdc4ab Don't manipulate immutable data
QArrayData can point to data it does not own (cf. fromRawData()), which
shouldn't be modified. Not even upon destruction, as this data can live
in Read-Only memory or be otherwise shared outside the QArrayData realm.

Change-Id: I8bdf3050a17802fb003b77d5f543fe31769a7710
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andreas Hartmetz <ahartmetz@gmail.com>
2012-09-11 23:54:57 +02:00
Friedemann Kleint
f957370206 Close popups when switching applications on Windows.
Bring back code from 4.8 (Note that ALT-TAB is not received
as key event).

Task-number: QTBUG-27146
Change-Id: I6dd2e9c88fdc4c89d26dfaa8ab47deb2be451f25
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-09-11 12:09:47 +02:00
Pekka Vuorela
e06999bd62 Remove deprecated inputItem and inputWindow from QInputMethod
Interfaces introduced and deprecated during Qt5 development.

Change-Id: I804a02df8c4a03ed6558f4a86375f97d09513d5c
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-11 09:35:28 +02:00
Eskil Abrahamsen Blomfeldt
014ae2ad04 Avoid duplicate setPen() in PDF when reusing QPrinter
The simplePen property was not reset when reusing the QPrinter,
thus we would output two identical setPen() commands in the PDF
making the autotest that compares the results fail.

Task-number: QTBUG-27171
Change-Id: I601042ec59e45ef72a56f230f6112a91a259b4a5
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-11 09:35:28 +02:00
Oswald Buddenhagen
0e78e50802 port qmake to qt creator's qmake language evaluator
this is a monster commit which does the following things:
- import the evaluator as-is from qt creator into qmake/library/
  - integrate it into qmake's makefiles
  - overwrite proitems.h with actual special types
- remove the parts of Option which are redundant with QMakeGlobals
- make QMakeProperty a singleton owned by Option::globals. the dynamic
  handling so far made no sense.
- make QMakeProject a subclass of QMakeEvaluator, with relatively few
  extensions

the changes to existing qmake code outside project.* and option.* are
minor. implementing the changes gradually would mean changing a lot of
code which will be just replaced in the next commit, so i'm not wasting
my time on it.

Change-Id: I9746650423b8c5b3fbd8c3979a73228982a46195
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-11 00:13:01 +02:00
Sergio Ahumada
faaa866961 test: Remove QSKIP from tst_uic::stdOut()
This test actually passes on Windows, so removing the QSKIP

Task-number: QTBUG-26730
Change-Id: Ife1b5bd0ffa20c433070a1875dde8b6a226c331a
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-09-10 23:58:46 +02:00
Sergio Ahumada
6c3ee80589 test: Remove QSKIP from tst_QLocale::windowsDefaultLocale()
This test actually passes on Windows, so removing the QSKIP

Task-number: QTBUG-24543
Change-Id: Ic2666665f2882392aec92a665f51d6c5dd3355f8
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-09-10 19:20:52 +02:00
Simon Hausmann
0c0c04b405 Fix semantics of the src dir in the include search paths with MinGW
This issue originates from https://bugs.webkit.org/show_bug.cgi?id=95736

Suppose we have
    main.cpp
    somedirectory/someheader.h -- which has #include "anotherheader.h"
    anotherheader.h

With unix generator, the directory where main.cpp is located is included,
unless no_include_pwd is set. Hence the look-up of anotherheader.h from
within someheader.h will work.

With MSVC this works because MSVC looks "in the directories of any
previously opened include files in the reverse order in which they were
opened." (from http://msdn.microsoft.com/en-us/library/36k2cdd4.aspx)

Unfortunately the build breaks with MinGW, because it lacks support for
including the source directory in the include search path just like the
unix generator does.

This patch adds the same functionality to the MinGW generator as well as
an auto-test.

Change-Id: Iea8bb06e34862c51b8fd4eca2ee26668e24a319a
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-09-10 14:09:45 +02:00
Kevin Funk
e78e7d325b Fix build of tests/ on Windows CE
Remove some subprojects that have missing dependencies or use API that is
non-available on Windows CE.

Change-Id: Iad7118b95a691a433c3f798d56a6a069e5e41917
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-09-10 14:09:45 +02:00
Leonard Lee
b41bd2b08d Remove old troll test servers' references.
Replaced with qt-project.org test domain.
The connectToMultiIP auto test is still disabled due to lack of test infrastructure.

Task-number: QTBUG-23294

Change-Id: Icf01aabb0ae503291abdda4e8f773f8e0a08931a
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-10 09:37:59 +02:00
Marc Mutz
ecf7f0d954 Use QStringList::join(QChar) overload where applicable [QtDBus]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: I807b0e88ac71a0cb367fb4170cca8f2cb0ad43f3
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-09-10 00:27:13 +02:00
Sergio Ahumada
4d3a53305f test: QFtp tests require `private_tests' set
Also fixing some includes and re-enabling the test

Change-Id: I4a061e106c2e55db39b8000729737a93e3d7714a
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-09 08:51:05 +02:00
Marc Mutz
1f8d570d5f Use QStringList::join(QChar) overload where applicable [QtNetwork]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: I5b75877ba192fa1357e67fee70dff7c0475991e8
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-07 18:41:22 +02:00
Marc Mutz
781b642671 Use QStringList::join(QChar) overload where applicable [QtWidgets]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: Ia30048e0c40967dc86a4e4ad26ac02ab67519096
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-07 18:41:22 +02:00
Julien Brianceau
5b1bc864a9 QtNetwork: bypass proxy for local connections
According to Qt doc, "Network proxy is not used if the address used in
connectToHost(), bind() or listen() is equivalent to
QHostAddress::LocalHost or QHostAddress::LocalHostIPv6. This is not the
case in current implementation.

Change-Id: I6b8a40c1e8bd8aad9504d8f939b87eda6e93337c
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-07 15:44:31 +02:00
Caroline Chao
72ea9e1e94 Test: Replace QSKIP by XFAIL
For tst_QtConcurrentThreadEngine::threadCount

Change-Id: I14b904a26900a01d5d04245ad60d9752f5645e68
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-07 15:39:31 +02:00
Caroline Chao
f9b9a71c99 Test: Remove QSKIP for tst_QXmlSimpleReader::inputFromSocket
The test is now passing. Tested with intel compiler and vs2008.

Task-number: QTBUG-22285

Change-Id: I728919833d9bcbf71bef68c06baef92667ff074b
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-09-07 15:39:31 +02:00
Sean Harmer
51d40d7e9b Make gui/math3d classes use float rather than qreal
This corrects the mismatch between using floats for internal storage
and qreal in the API of QVector*D which leads to lots of implicit
casts between double and float.

This change also stops users from being surprised by the loss of
precision when using these classes on desktop platforms and removes
the need for the private constructors taking a dummy int as the final
argument.

The QMatrix4x4 and QQuaternion classes have been changed to use float
for their internal storage since these are meant to be used in
conjunction with the QVector*D classes. This is to prevent unexpected
loss of precision and to improve performance.

The on-disk format has also been changed from double to float thereby
reducing the storage required when streaming vectors and matrices. This
is potentially a large saving when working with complex 3D meshes etc.

This also has a significant performance improvement when passing
matrices to QOpenGLShaderProgram (and QGLShaderProgram) as we no
longer have to iterate and convert the data to floats. This is
an operation that could easily be needed many times per frame.

This change also opens the door for further optimisations of these
classes to be implemented by using SIMD intrinsics.

This needs to be applied in conjunction with

https://codereview.qt-project.org/#change,33548

Task-number: QTBUG-21035
Task-number: QTBUG-20661
Change-Id: I9321b06040ffb93ae1cbd72fd2013267ac901b2e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-07 13:27:38 +02:00
Friedemann Kleint
20563c1334 Stabilize test of QSpinBox.
The test shows spurious failures in editingFinished() on some Mac
platforms (QTest::qWaitForWindowActive(testFocusWidget)).
This is apparently caused by the widget testFocusWidget (member
variable) interfering with the other tests widgets.
As it is used in one test only, instantiate it on the stack there.

Change-Id: I688cd21a2668d072660658302cf59197abe0b4d8
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-07 12:01:47 +02:00
Friedemann Kleint
75cd2dec71 Revert "Implement automatic mouse grabbing on mouse button press."
This reverts commit 6b5bbc531b.

Autograbbing mouse shouldn't be done in crossplatform code, as
X11 does this automatically. Windows needs platform specific
solution.

Task-number: QTBUG-26962
Task-number: QTBUG-27039
Task-number: QTBUG-23699

Change-Id: I911df92c4a34deb50b729f50681497046657948b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-09-07 12:01:38 +02:00
Mitch Curtis
9039031479 Fix QDateEdit displaying day as a number for short and long day formats
When 2 (February) is entered as the month for (e.g.) 31/Jan/2000 (which
is following the format: "dd/MMM/yyyy"), the day is corrected to 29 but
displayed as its numerical value instead of its short (or long) name.

Task-number: QTBUG-27036 QTBUG-19091
Change-Id: I558ee13b224707d22b26c2ec2c045f96118bd5a1
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: aavit <qt_aavit@ovi.com>
2012-09-05 21:06:51 +02:00
Mitch Curtis
2b562b7564 Fix 3 digit day being displayed by QDateEdit.
When a QDateEdit has its display format set to "yyyy/MM/dd", its day
set to 31 and its month set to 2, it will display 291 as the day until
the cursor is moved or the focus changed. This is because
QDateTimeParser::parse calls sectionSize() for the day section, which
will sometimes return an incorrect size. There are also other display
formats affected by this bug (e.g. long day names).

For example, (in the context of sectionSize()) when text is
"2000/01/31" and displayText() is "2000/2/31", there is a difference
between displayText() and text - text is the previous value and
displayText() is the new value. The size difference is always due to
leading zeroes.

This patch makes QDateTimeParser keep track of the quantity of zeroes
added to each section and then factors this value into the result of
sectionSize() if there is a size difference between text and
displayText().

Task-number: QTBUG-26847
Change-Id: I3823cc41167ec920f742cb6a20d39fc5f433c915
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Reviewed-by: aavit <qt_aavit@ovi.com>
2012-09-05 21:06:39 +02:00
Sergio Ahumada
56d5c909af Use true and false in preference to TRUE and FALSE
The TRUE and FALSE macros are obsolete and should be replaced with
true and false (all lower case) respectively.

Change-Id: Iee352e8173500683e6319be0abbf5bacf29016e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-05 03:03:05 +02:00
Sergio Ahumada
10ed50002c test: Check for null string comparison
Do not compare a QString to QString(). Instead use the .isEmpty() method.

Change-Id: I8bb5e64563bf173abe7288bb9e35375bee1fe445
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-05 03:03:02 +02:00
Rafael Roquetto
3d4fc578bd Auto test for 'qmake -project' use case.
Change-Id: Ifb6d64828ba1cb42fd64299438b7eec302112edf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-09-04 10:30:33 +02:00
Stephen Kelly
5a1fa8860c Generate includes for Qt containers used as auto-metatypes.
Otherwise the containers might be forward declared in the moc file,
and when the moc file is compiled in a standalone translation unit,
the full definition of it would not be available. This results in
odd compile errors, so instead generate the includes if required.

Change-Id: Ie01c5a5d45314daad0b00dec03b3e1e18cdbae64
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-03 20:05:04 +02:00
Marc Mutz
cb8424b381 Use QStringList::join(QChar) overload where applicable [QtSql]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: Ie395d82d17710683968d006d22de313ef49dc6e5
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-09-03 19:35:25 +02:00
Marc Mutz
68e04c3ac1 QStringList::join: add an overload taking a single QChar
This overload avoids the needless heap allocation that the traditional
overload incurs due to the implicit QChar -> QString conversion
involved there.

In order to share the implementation between the two overloads,
QStringList_join now takes the separator as a (Char*,int) tuple
instead of as a QString.

Change-Id: I92961f13a3f19099de2a6e2df9f4789a12fc83a0
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-03 13:41:55 +02:00
Stephen Kelly
dcf4d152b5 Change SChar to metatype id 40.
This fills the gap left by QWidgetStar, making the sequence
between FirstCoreType and LastCoreType contiguous, which some
benchmarks assume to be true anyway.

Change-Id: I2d5d202b6246a9065fdf77f325a4a04279dbe4b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-03 11:05:49 +02:00
Volker Krause
8c1cb66712 Fix moc generating invalid code for slots with reference types as argument.
We can't have T& declared/registered as a metatype (wont compile), but
using it as type for a slot argument is possible. With the recent
introduction of metatype auto-registration we have to make sure that moc
doesn't attempt to auto-register those. Simple types are handled correctly
already, this fixes containers and smart pointers.

Change-Id: Id96857c57d6ebf158a67e9d527c89dc195473b1b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-02 23:41:42 +02:00
J-P Nurmi
60783291ff auto tests: updated for new QStyle pure virtuals
QStyle::standardIconImplementation() & layoutSpacingImplementation()
are removed, and standardIcon() & layoutSpacing() made pure virtual.

Change-Id: If8ab6cfef0b639b7973be22dd630ba3e6f39a225
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-31 18:56:35 +02:00
Sergio Ahumada
531b96f42e test: Mark tst_QFile::writeLargeDataBlock() unstable failure as XFAIL
The test has one unstable failure on Windows, so mark this with QEXPECT_FAIL

Task-number: QTBUG-26906
Change-Id: I2f6c63ddefecacd224d93f83e6951e961a02a051
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-08-31 18:56:35 +02:00
Jeremy Lainé
28881c0c91 Make QGraphicsView respect scrollbar policies
When calculating the maximum height / width which a QGraphicsView can display,
make sure we only take the scrollbars' dimensions into account if their policy
is set to Qt::ScrollBarAsNeeded:

- if the policy is set to Qt::ScrollBarAlwaysOff, the scrollbar will not be
  displayed at all

- if the policy is set to Qt::ScrollBarAlwaysOn, the scrollbar's dimensions
have already been substracted from the available space by
QAbstractScrollArea::maximumViewportSize()

Task-number: QTBUG-14711
Change-Id: If5d24b41dbe7b089abca2bf61ccbd370d4de79a1
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-08-31 16:29:43 +02:00
Friedemann Kleint
1e34d3525f Fix updating of drag icons.
Try to find a target widget that accepts drops; ignore the event
if none can be found. Split the handleDrag*() functions
to reduce indentation.

Add an autotest.

Task-number: QTBUG-22987
Change-Id: I516ac5f0c002caaf83c52ac16f821246e565230f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-31 16:10:25 +02:00
João Abecasis
ed4939eaac Improve performance of QArrayData::Grow autotest
Doing element-wise insertions for the full range of the test made
testing under valgrind extremely slow. When a reallocation is detected
we now resize() the container close to capacity(), while verifying this
doesn't unnecessarily re-allocate either.

Change-Id: Idf7015cf390e366fe444e7ca14c904a2d54ff48b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-30 13:51:22 +02:00
Mark Brand
c194b7f345 QSqlQueryModel: fix nested beginResetModel/endResetModel
Follow-up to 83c9ebbd66.

Consider the case where calls to the reset methods on the same object
are nested as in the following sequence:

  1. beginResetModel()
  2. beginResetModel()
  3. endResetModel()
  4. endResetModel()

In such cases, only the outermost calls, i.e., 1) and 4), should emit
signals.

After 83c9ebbd66, 1) and 3) emitted the
signals, which is wrong. This is corrected by keeping track of the
nesting level.

Such sequences can come about when a base class calls the begin/end
methods between the calls made by the subclass.
QSqlTableModel::select() is an example of this.

Test included.

Change-Id: Ia62b45cb1abaab00a32bb8357de4a958bcff83e5
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-30 13:51:22 +02:00
Titta Heikkala
1cebd906af Ensure that printer orientation is preserved
After setting the printer name the initialization is no longer done for
a printer with a name. Instead doReinit() method is called to preserve
the orientation (set with setOrientation() method before calling
setPrinterName()). Before the orientation was changed back to default
when setPrinterName() method was called ignoring the orientation set.

Updated also the autotest because the case:
taskQTBUG4497_reusePrinterOnDifferentFiles() is no longer expected to
fail on Windows.

Task-number: QTBUG-26008
Change-Id: Ia6bc9ae14d79a646e61bfc97652f9f5af90738b3
Reviewed-by: Andy Shaw
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-30 08:54:59 +02:00
Kevin Funk
7cea395d1f Make tests/auto/corelib compile on Windows CE
Change-Id: I71987d40ae69d95f645c4c7d26d50add4c799327
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-30 06:22:34 +02:00
Marc Mutz
6276427438 QString::append: add (const QChar*, int len) overload
Both insert and replace have this overload, so one reason to add it
to append(), too, is consistency. But I can also make good use of
this overload in the the new QStringList::join(QChar) overload, so
it's actually useful in its own right.

Change-Id: Iccd48f9cb84831399e4db7e3e78eba25c0ced30d
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-30 02:28:30 +02:00
Thierry Bastian
1e97dbaf6c Fixed the QTreeView expansion/collpasing when animated
If you had a QTreeView with expandable items, if you tried to expand and while
the animation was still running you'd try to collpase the node,
the display would be completely broken: the items below that items would
not be visible any more except for a fraction of a second when expanding
or collapsing it again.
The problem is in the fact that when starting an animation the QTreeView
stores the state before animating. And it does that even if an animation
is already running. So the stateBeforeAnimation becomes AnimatingState and
when the animation finishes, AnimatingState is the state that is restored
breaking the painting.
Unit test is included.

Change-Id: I015212c1ed8962e6df705655099a5660f195caf3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-29 20:40:17 +02:00
Samuel Rødal
c1e5f600ab Made QImage::fill(uint pixel) for RGB888 accept QRgb values.
Previously QImage::fill() for Format_RGB888 expected a BGR value
instead of the RGB order defined by QRgb, making it counter intuitive to
use related to the 32-bit formats.

Fixed the QPixelLayout data for RGB888 and changed the byte order of
quint24 based on what the optimized image conversion routines expect.

Change-Id: I72926debbc6f5b5cb10b8aa0b2a2a916a04db946
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
2012-08-29 16:53:00 +02:00
Brendan Long
860f95946b Add support for explicit TLS 1.1 and 1.2
Add SslProtocol enums TlsV1_1 and TlsV1_2 and use the appropriate OpenSSL
methods when they're selected (TLSv1_1_client_method, TLSv1_2_client_method,
TLSv1_1_server_method and TLSv1_2_server_method). This allows us to
explicitly use TLS 1.1 or 1.2.

Task-number: QTBUG-26866
Change-Id: I159da548546fa746c20e9e96bc0e5b785e4e761b
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-08-29 14:22:54 +02:00
Sergio Ahumada
b6a4e66ffb test: Mark tst_qtextboundaryfinder::generateDataFromFile() with internal build
This function only makes sense on a developer build. In non
developer-builds you get:

  tst_qtextboundaryfinder.cpp:116:13:
    warning: ‘void generateDataFromFile(const QString&)’
    defined but not used [-Wunused-function]

Change-Id: Id1bda2d27b00048f7401606959b566a59c05b38d
Reviewed-by: Toby Tomkins <tjtomkins@gmail.com>
2012-08-29 14:12:03 +02:00
Giuseppe D'Angelo
20993adffd QSharedPointer: make QT_SHAREDPOINTER_TRACK_POINTERS work with QObjects
If setQObjectShared crashes because a QObject is tracked by two
different QSharedPointers, we lose the debug feature offered by #defining
QT_SHAREDPOINTER_TRACK_POINTERS, as the check done by this define
happens after the setQObjectShared call.

Therefore, move setQObjectShared after the internalSafetyCheckAdd call.

This is actually a noop change in 5.0, as setQObjectShared does nothing.
However it prevents a bug in case the Qt 4 behaviour is brought back
in some later version.

Change-Id: I71340d0f878828354537762d01c46d441efc918c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-28 21:18:17 +02:00
Stephen Kelly
0680627d7f Don't attempt to test DBus on QNX.
It is not expected to be there currently.

Change-Id: I9e0ece35b8064ecb7cb24e55604ea78c9e6ab242
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-08-28 21:17:48 +02:00
Stephen Kelly
a912b14c75 Add automatic metatype registration for invokable methods.
This works similarly to the automatic registration for Q_PROPERTY types,
but in this case it mostly affects the need for users to
call qRegisterMetaType<T>() before using queued connections
with methods using non-built-in metatypes, or before using invokeMethod
manually.

Change-Id: Ib17d0606b77b0130624b6a88b57c36d26e97d12d
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-08-28 18:30:39 +02:00
Stephen Kelly
62c2061a50 Add automatic metatype registration for Q_PROPERTY types.
In Qt 4, the user needs to call qRegisterMetaType if the property
could otherwise be read before the type is registered with the metatype
system. This patch makes that unnecessary and automatic by registering
it when the first read indicates that it is not yet registered instead
or when QMetaProperty::userType is called before it is registered.

The types which are automatically registered exclude the built-in
types, which do not need to be registered, and include metatypes which
are automatically declared, such as pointers to QObject derived types
and containers of existing metatypes.

Change-Id: I0a06d8efdcb64121618e2378366d0142fa0771f5
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-08-28 18:30:32 +02:00
Mitch Curtis
f29896840c Handle invalid dates properly for QDataStream versions < 5.
In Qt 5, when streaming an invalid QDate using a QDataStream version
earlier than Qt_5_0, QDate.jd is written and read as 0, which is an
invalid julian day for Qt versions earlier than 5.0. For Qt 5.0
however, 0 is a valid julian day, so when comparing a deserialised
invalid date (read using a QDataStream version < Qt_5_0) against a
default-constructed invalid date, they won't compare equal when they
should.

Task-number: QTBUG-26989

Change-Id: Ia76df493471f3b068c7d7187be20e3178eff2cc7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-28 18:23:06 +02:00
Friedemann Kleint
37320e36cd Fix some warnings in tests.
- Unused variables
- Signed/Unsigned comparisons.

Change-Id: I0f4cc92a8366ad501d703d19c3358ac24db47270
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-08-28 17:07:15 +02:00
Eskil Abrahamsen Blomfeldt
4712d88c0e Make letter spacing APIs in QTextFormat more consistent
Change d060b6f04f introduced some
new properties to QTextFormat which were unfinished and did not
match the documentation in the same change. I've updated the API
and docs to use the regular QFont enum for letter spacing type
instead of introducing bools (which inhibits expansions later)
or mutually exclusive properties in the text format.

Change-Id: Ife44993b6746c413e421fdaf92ebaaab6ba95977
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-27 10:58:03 +02:00
Jani Honkonen
547a1bea49 Fix limitting shortcuts to keypad only
The Qt::KeypadModifier modifier is internally masked away from all
shortcuts. So it is not possible to set a keypad only shortcut.
Changed the implementation so that first a full keysequence match is
searched. Then if no match is found the same sequence is tried
without the keypad modifer.

Added a autotest for this also to cover the basic use cases relating
to this.

Task-number: QTBUG-20191

Change-Id: Ibe7740c705fd0ab1eece4809b9a0b48882172933
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-27 10:27:30 +02:00
Marc Mutz
bd1a7ed26b moc: test slots marked final/override in various ways
While writing the test, I found that moc doesn't yet support
volatile slots. I left the tests in, commented, for a time
when it does.

Change-Id: Ib5fa00b25600618aedcc66739630054f3c879b99
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-26 14:29:52 +02:00
Marc Mutz
80694dd614 moc: parse classes that use Q_DECL_FINAL|final|sealed
This only works with the C++11 contextual keyword
directly, the MSVC equivalent 'sealed', or the Qt
define for it.

While this isn't a problem for syncqt, being an
internal tool, moc should eventually be able to parse
user code using local C++11-final-wrapping macros.
For this, I guess moc would have to be taught to
expand macros in code and not just test #if clauses,
potentially driven by something like
  #pragma qt-moc expand-this
  #define MY_FINAL_CLASS final
but that's something for someone more intimately
familiar with moc's source than I am.

Change-Id: Id6aec961a881e8d5a9b76a7fc8e1c02c71913f64
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-26 14:29:52 +02:00
David Faure
ac2b452616 QUrl: port thread-safety autotest from Qt4.
This detected the same missing detach()s in QUrl::resolve.
Everything else works, no need for a mutex in Qt5's QUrl.

Change-Id: I0da51b7b0c6b810d314a26d4b638383cd17de12b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-26 11:08:42 +02:00
Markku Heikkila
70758cbf15 Fix infinite recursion while dragging toolbar of QMainWindow.
Prevent recursion in QMainWindowLayout::endSeparatorMove().

Manually cherry-picked from Qt 4.8 change
90b71dc0ff4ec9bb150a0de9933d6eb06d995a34

Task-number: QTBUG-21378

Change-Id: I901ebfd96be0bdc6ab03dd8c3335d2622db843db
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-25 19:04:56 +02:00
Olivier Goffart
4d5f3cf627 Test for quadratic behaviour when rendering long line in QTextEdit
QTextEdit showing long lines using lots of text format (for example
with a syntax highlighter) used to expose a quadratic behaviour which
make it impossible to edit files with long lines.

It was fiexed in the few previous commit

Task-number: QTBUG-8389
Change-Id: Ib7203497a7699a85ae1dfb70fe65d5fb36884b58
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-23 23:31:10 +02:00
Thiago Macieira
8e0bac89d4 tst_QMutex: add markers to the tryLock tests
Just to make it clear which two sections go together.

Change-Id: If3724d1c84172a61bdd7931cc567f4b7140d4f8a
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-08-23 11:20:37 +02:00
Pekka Vuorela
2292bf0669 Remove remaining bits of deprecated QInputPanel
Introduced during Qt5 development and renamed to QInputMethod.

Change-Id: If6744648dc98b779e65c449ae32626db574181df
Reviewed-by: Joona Petrell <joona.petrell@gmail.com>
2012-08-23 11:20:37 +02:00
Thomas McGuire
b6f92043e0 Remove unused inotify includes in the filesystem watcher test
Change-Id: I346ef6ccf7b09390bef6d35c82ecee6dee1711fc
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-23 11:20:37 +02:00
Kai Koehne
e177a35dfe ICU: Fix crash in codecForMib(2107)
availableMibs() unconditionally adds 2107 to the list of mibs. The patch
ensures that codecForMib() also knows about this special TSCII codec.

(Note that the autotest only really checks this code path if only this
test case is run. The other tests already fill the internal codec cache
otherwise).

Change-Id: Id987d7cecd5f5700cca75e9b85b37011f8e5c622
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-23 11:20:37 +02:00
Shawn Rutledge
41ca2b4453 A few more random documentation fixes
@p replaced by \a, \QD replaced by {Qt Designer}, couple of enums etc.

Change-Id: I315510690bf52e42db519292b4122fa24c73bbc9
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-08-23 02:55:17 +02:00
Marc Mutz
70d8e363df tst_QTreeView: fix unused variable warning
Change-Id: Idf18e4615754d3b7b8a09d6fdec91344a7408c18
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-23 02:55:17 +02:00
Pekka Vuorela
2a1700f7e2 Fix accessibility unit test compilation
Change-Id: I72c931e0704175b6b48d66a6df54784bcec6860c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-08-23 02:55:17 +02:00
Marc Mutz
ebaddb62bc tst_QColumnView: fix unused variable warning
Change-Id: I41a71faa64a20cebab058cf69181104eceea2339
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-22 21:51:48 +02:00
Stephen Kelly
1839151992 Make keyboard search work in the current column, not only the first.
Task-number: QTBUG-26540
Change-Id: I1c365aeb013f5ddedd0589aa4c4844be759a3882
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-22 18:40:17 +02:00
Stephen Kelly
0c955b4976 Fix indexAbove and indexBelow to return indexes in the correct column.
They used to always return indexes in column 0.

Change-Id: I2cf4239e0a975b37548de00a1deb916fcd88b4c7
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-22 18:40:17 +02:00
Morten Johan Sorvig
6c1670d8c2 Add hint for touch -> mouse event synthesizing
Commit 7808ec79 changes QApplication to synthesize
mouse events from (unhandled) touch events.

On Mac OS X this creates a conflict for two-finger
scroll swipes, which generates both touch events and
mouse wheel events: scrolling in QTextEdit will also
select the text.

Add a SynthesizeMouseFromTouchEvents platform style
hint that enables the event synthesising. Set to true
by default and false in Cocoa.

Change-Id: I1ffa5a141476aa38b81ce92a87eff676c7ec2276
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-08-22 07:01:17 +02:00
Mitch Curtis
09dd19df5c Do not consider sign in qIsNull.
The current implementation of qIsNull only returns true if the value is
positive zero. This behaviour is not useful for use cases like
QPointF::isNull, where QPointF(-0, -0).isNull() will return false.
There doesn't seem to be a reason why the function exhibits this
behaviour (-0.0 is not accounted for in the unit tests), and for the
case of QSizeF::scale it causes a bug: qIsNull is used to check for
division by 0.0 before it proceeds, which fails in the case of -0.0.

Task-number: QTBUG-7303
Change-Id: I767e5280bd26614e8e78ae62b274eb9bc4ade385
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-08-22 04:04:57 +02:00
Friedemann Kleint
82860b133c Propagate initial size constraints to QWidgetWindow.
Size constraints set on a widget before the creation of
the QWidgetWindow were lost (for example, Qt Creator's
preference page).

Task-number: QTBUG-26745
Change-Id: I7c2f5aed9c8817795603e5ad3c24418d66627bab
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: hjk <qthjk@ovi.com>
2012-08-21 16:13:38 +02:00
Mitch Curtis
3a7b6a74a8 Disregard milliseconds in QTime::secsTo().
"The documentation states that "secsTo() does not take into account any
milliseconds", however, this is not the case. Given times 12:30:01.500
and 12:30:02.400 secsTo returns 0. If milliseconds are not taken into
account, I would expect this to return 1 (i.e. interprets the times as
12:30:01 and 12:30:02 thus truncating the milliseconds)."

Note that tests were also written for QDateTime::secsTo(), as it uses
QTime::secsTo internally. This addresses Javier's issue in the
comments of QTBUG-9304.

Task-number: QTBUG-9304
Change-Id: I9efe0c8f710db859c1d086d67ba3e5b349a56c4e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-21 11:05:20 +02:00
Mitch Curtis
718a2251be Serialise QDateTime as UTC and timeSpec() instead of private spec.
QDateTime currently serialises its private Spec enum. If a user was to
deserialise the individual components of a QDateTime separately, the
resulting timeSpec may be invalid when cast to the Qt::TimeSpec enum.

E.g.:

QDateTime dateTime(QDate(2012, 8, 14), QTime(8, 0, 0), Qt::UTC);
// ... serialise
// ... deserialise date, time, spec separately.
// spec == 2, the value of QDateTimePrivate::UTC.
// spec != UTC, will be set to LocalUnknown.
QDateTime deserialised(date, time, spec);

This patch serialises QDateTime objects in UTC and the value of
timeSpec() as opposed to QDateTimePrivate's spec. This changes the
serialisation behaviour of QDateTime for version 13 of QDataStream.

Task-number: QTBUG-4057
Change-Id: If650e7960dca7b6ab44b8233410a6369c41df73a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-21 11:05:20 +02:00
Thiago Macieira
ce9b010ec6 Fix decoding of QByteArray in the deprecated "encoded" setters in QUrl
The asymmetry is intentional: the getters can use toLatin1() because the
called functions, with a QUrl::FullyEncoded parameter, return ASCII
only. This gives a small performance improvement over the need to run
the UTF-8 encoder.

However, the data passed to setters could contain non-ASCII binary data,
in addition to the percent-encoded data. We can't use fromUtf8 because
it's binary and we can't use toPercentEncoded because it already encoded.

Change-Id: I5ecdb49be5af51ac86fd9764eb3a6aa96385f512
Reviewed-by: David Faure <faure@kde.org>
2012-08-20 21:59:32 +02:00
Thiago Macieira
60818231d8 tst_qurlinternal: use qurl_p.h instead of declaring the functions
Just in case someone (like me) changes the function signatures or adds
new functions.

Change-Id: I1025fea012d95ffe89acaf799aa58fd2b0babc80
Reviewed-by: David Faure <faure@kde.org>
2012-08-20 21:59:28 +02:00
Andreas Holzammer
f2fabf77f9 Fix freetype font rendering for Windows CE
Windows CE does not have support for GetGlyphOutline.
So addGlyphToPath will not work. QML uses it for their
distance field rendering. One option to bypass this issue
is to use freetype as rendering backend.

Change-Id: I965254344945cbdad771a5d505fb61c1cc2087df
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-20 12:25:03 +02:00
Stephen Kelly
799ceebad8 Take account of hidden items in QListView when using scrollTo.
Task-number: QTBUG-21804
Change-Id: I475166f3f60b1278089baa255ace4e18baeb568e
Reviewed-by: Jani Honkonen <jani.honkonen@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-20 11:24:55 +02:00
Andy Shaw
9ea9ec1cbb Ensure that all the children get the new stylesheet set on a parent
When a stylesheet was set on a parent widget then in some cases it would
not get applied to all the child widgets.  This was because the order of
the children list may have been modified while it was being set on
children.  By making a copy of the list we prevent this from being a
problem.

Task-number: QTBUG-26321

Change-Id: Iea6bf72c69a0c39746f7ef5e7893dda5a93ed7e5
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-20 10:28:51 +02:00
Jani Honkonen
d2bba5e553 Fix a QListViewItem width when spacing is set
The listitem width was calculated incorrectly because spacing was
not considered. This fixes the second part of the reported bug where
spacing is set. Added some tests to catch the issue relating to the
reported bug.

Also added a test to check spacing in general.

Task-number: QTBUG-21804
Change-Id: Icc6326bce914264d882a60a9fc0ebe7d2a08dbf6
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-19 08:52:09 +02:00
Jani Honkonen
d4385e48b8 Fix QListWidget scrolling with keys when there are hidden items
If the selected item is scrolled with keyboard keys the selected item
will go outside the visible area. The scrolling did not take hidden
items into account when calculating the amount to be scrolled.

Task-number: QTBUG-21804
Change-Id: I63da0248cec43be464898f9dc8167e739f00ccd0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-19 08:51:57 +02:00
Thiago Macieira
c9bfd34fa0 Enable QAtomicInteger for char16_t and char32_t
Those are regular, integer types, of 16- and 32-bit width,
respectively. C++11's std::atomic supports them, so we should too.

C++11 also supports wchar_t, but since that type's size can change, I
don't feel like support for it in Qt is pressing.

Change-Id: I945b641c91a8a98be82715f878c382dee58ac98b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-18 18:35:50 +02:00
Thiago Macieira
2b00f97ab0 Add Q_DECL_CONSTEXPR to the isXXX functions in the new atomics.
This allows one to write code that depends on these values at
compile-time.

Change-Id: I7d78524ed9c70d4141360496d1d764dcbfa92e62
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-18 18:35:36 +02:00
J-P Nurmi
fd234c2fc6 Auto test for passing QTextEdit as QSyntaxHighlighter parent
Change-Id: Ia225723de5b0b2085a72a2af26e2a563b65955d8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-18 10:58:46 +02:00
Stephen Kelly
d3a8b7db50 Exclude the qplatformdefs CMake test on Windows.
The fix for this failing test is not yet agreed to. Disable it to
allow progress with the CI system while the fix is decided.

Task-number: QTBUG-26869
Change-Id: Ia8089b8e66d750353e7c1c69597916af0d042856
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-08-18 10:55:47 +02:00
Stephen Kelly
4d9d88af6f Remove QWidgetStar.
This allows us to remove the odd hacks to get the static metaobject
for the QWidget* metatype.

The QWidget* is still an automatic metatype thanks to the QObject
partial template specialization. It is registered as a metatype
at runtime automatically in qwidgetsvariant.cpp.

Change-Id: Ie01b69eadf2cbe87af1a86c3284550f60dcf9e94
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-18 10:55:47 +02:00
Stephen Kelly
2ef3ac72fc Emit layoutChange signals when changing QPersistentModelIndexes.
This is necessary whenever QPersistentModelIndexes are changed. Omitting
it means that views are not able to react to the change, such as QTreeView
clearing its (manually held) QModelIndex cache, and the QItemSelectionModel
clearing the item from its storage.

It is necessary to change a QSortFilterProxyModel test which assumed setItem
does not have any such effect. That test is ported to setData instead.

Task-number: QTBUG-18539
Change-Id: Id7a602f18b9773ba4d11019418de886860d26d3e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-18 08:34:53 +02:00
Sergio Ahumada
64d22311d8 Doc: Fix spelling errors
Change-Id: Ibae8d10183f6b15a16b1499daa2df8802dbb014e
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
2012-08-17 22:45:27 +02:00
Rafael Roquetto
555e4e05f4 Fix tst_qbytearray on QNX
qUncompressCorruptedData() no longer hangs on QNX 650 and Blackberry OS
sytems.

Change-Id: Id131f9f1c6dcd358c152675c7e29ab937052c1d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-15 15:19:55 +02:00
Stephen Kelly
da64a50792 Only emit headerDataChanged for valid proxy intervals.
Modeltest asserts before the patch, and passes afterward.

Task-number: QTBUG-26515

Change-Id: I08a89cd5c9c59613badcddbd056a3d0b8fbbca13
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-15 15:04:11 +02:00
Marc Mutz
fb07ce50ae tst_QUdpSocket: Remove unneeded ./ in application name printing
Reported-by: Shane Kearns <shane.kearns@accenture.com>

Change-Id: I12f2a23b98c3b0161a2961a9117c196cd7d72a6d
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-08-15 15:01:07 +02:00
Marc Mutz
9e96c4a315 Fix "might be used uninit'ed" warning
GCC 4.8 warns:

  main.cpp:165:60: warning: ‘type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                               app.arguments().at(3).toInt());
                                                            ^

Change-Id: Ib0f6847031437b588e14c6708fdddea5fd474b58
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-08-15 15:01:01 +02:00
Stephen Kelly
351904be50 Emit the highlighted signal if the model changes.
The bug is that the connection to emit that signal can be made
obsolete if the connection is made too early and the model is replaced.
In the bug report, the connection is made by calling view() early (thereby
causing the creation of a view and a QItemSelectionModel which operates on
the built-in QItemSelectionModel, and then connecting to that
QItemSelectionModel), and then when QComboBox::setModel() is called later
the built-in view creates a new QItemSelectionModel for it. The bug was
that that new QItemSelectionModel is not connected to. This patch fixes that
bug.

Task-number: QTBUG-4454
Change-Id: Ibbdb8731f16ab071008b4a19dc2cc7ae03cebc84
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-15 13:58:29 +02:00
Jani Honkonen
121062d884 Fix undo and redo in QLineEdit when in password mode
There are some security issues with undo/redo. User should not be
able to get the erased password back in any situation. Therefore
redo must be disabled completely and undo is limited only for erasing
previously entered text.

Task-number: QTBUG-14226
Change-Id: I2b38aca84adbad1c14db76b56ad6303d56b35b4d
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-15 11:38:37 +02:00
Stephen Kelly
d19589b90a Make selectAll() do nothing if the mode is NoSelection.
Task-number: QTBUG-26687

Change-Id: Iaa0197efe64c61505e22e4a63a1f5c012af0bc78
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-15 11:38:37 +02:00
Marc Mutz
4564103d53 tst_QToolBar: fix "might be used uninit'ed" warnings
GCC 4.8 warns:

  src/testlib/qtestmouse.h:219:67: warning: ‘popupMenu’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     { mouseEvent(MouseClick, widget, button, stateKey, pos, delay); }
  tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp:862:12: note: ‘popupMenu’ was declared here

Change-Id: I19cfd1790fbd948e97bf740d4412ccf3bb98a330
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-08-14 08:53:29 +02:00
Rafael Roquetto
0fa52909fd Remove relic QT_VERSION from qmake test
Change-Id: Ic9095e3e924543d4f3e6d0f7c3a7b27f842cd300
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-14 03:56:55 +02:00
Jan-Arve Saether
2cb9ded6ec Implemented QAccessibleTextWidget
A new class called QAccessibleTextWidget was added.
This class should implement all methods of QAccessibleTextInterface and
QAccessibleEditableTextInterface which only need a QTextCursor, and it
defines two pure virtual methods, to obtain and set the text cursor, so
accessible implementations of widgets which use a text cursor can implement
these two methods.

QAccessibleTextEdit is now a subclass of QAccessibleTextWidget and most of
its methods were moved to QAccessibleTextWidget.

This is a forward port of ba5d7d608cc31fc63354fd74d85a1bad7780fc45 from
Qt 4.8, and is a prerequisite for forward-porting QPlainTextEdit

Change-Id: I6093c4fa7e0a77b84de779479c6074db006efec1
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-08-14 03:56:55 +02:00
Frederik Gladhorn
8e1ff45e74 Add Linux Accessibility Bridge
This is a plugin that bridges the QAccessible world
to AT-SPI 2 on Linux.

Change-Id: I7af22621ee6a3cefc723b137b7f227a611cf6641
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-08-14 01:40:06 +02:00
Thiago Macieira
b1fd9a93b9 Speed up tst_QGraphicsView::mapToScene test
This test is doing a brute-force mapping. Coupled with changes to
QCOMPARE last year, this now allocates and deallocates a lot of memory
per iteration. On my Sandybridge, it takes two minutes to run:

     111136.781153 task-clock                #    0.999 CPUs utilized
   371,692,633,238 cycles                    #    3.344 GHz
   182,641,818,708 stalled-cycles-frontend   #   49.14% frontend cycles idle
    57,951,552,830 stalled-cycles-backend    #   15.59% backend  cycles idle
   477,216,332,971 instructions              #    1.28  insns per cycle
                                             #    0.38  stalled cycles per insn
    86,959,637,669 branches                  #  782.456 M/sec
       309,185,237 branch-misses             #    0.36% of all branches

     111.264868818 seconds time elapsed

Changing the iteration step from 1 to 5 reduces the runtime to about 5
seconds.

Change-Id: I9cad6f85f535f472319da7cd6c4aa28e12ddf1b7
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-13 09:32:21 +02:00
Stephen Kelly
4b73950cc8 Use POSITION_INDEPENDENT_CODE for these tests.
These projects are expected to fail, but we need to make sure they fail
for the right reason.

Change-Id: I8a7caaa663060712c5c7113ef3b054feba2e2287
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-08-13 09:31:16 +02:00
Stephen Kelly
7bfb10b498 Add hints for where to find packages for projects expected to fail.
In the CI system, an environment variable is used to convey
the CMAKE_PREFIX_PATH, but that can not be relied upon.

Change-Id: Ie4fbacaac6ae18f95a3b4d1e796a4b4c91a418c4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-08-13 09:31:16 +02:00
Stephen Kelly
4ff51dd8b2 Add the minimum CMake version to projects built standalone.
Change-Id: If9d2a464d94faee0dccd77bc54946d91dd117db3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-08-13 09:31:16 +02:00
Rohan McGovern
4ef1ddc641 tst_qgraphicsview: increase test timeout further
This test has recently timed out in CI, but appeared to be making
progress. Give it more time to complete.

Change-Id: Ied0fb7aad35ed6d5889dd585a7545687617e5e19
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-08-13 07:14:40 +02:00
Stephen Kelly
c1df856d6b Make rowIntersectsSelection take account of the parent argument.
Task-number: QTBUG-22370

Change-Id: I497194793eab624b760deea93dac0df767850330
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-10 22:02:11 +02:00
Stephen Kelly
146b7a9c8b Take scroll position into account when painting drag pixmap.
Task-number: QTBUG-26793

Change-Id: Ic19cb6581cd5838d26713998e152772a5d12da4f
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-10 21:59:47 +02:00
Stephen Kelly
79a7e6f23b Require CMake 2.8.9 for the qt5_use_modules function.
The newer CMake version has the POSITION_INDEPENDENT_CODE property which is
what we need here. The CMake 2.8.8 implementation uses awkward and incomplete
string manipulation which I don't want to maintain for any amount of time
when Qt 5.0 is released.

Change-Id: If7ace9c6925ccdbf800f1863fa2368e55fa44d7f
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-10 21:57:47 +02:00
Marc Mutz
fa08b143f3 QtGlobal: (new) qEnvironmentVariableIs{Set,Empty}()
These functions are a faster version of {,!}qgetenv().is{Null,Empty}(),
a common pattern in Qt code.

Their main advantage is that they don't need to allocate memory, so
they can be used in noexcept functions, or dynamic initialisation of
namespace-scope statics, because throwing in these contexts invokes
std::terminate().

Change-Id: I651c5bd72f450b5d7df76590f8791572fe992af5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-09 21:27:09 +02:00
David Faure
a23da5fd6b Add bool QStandardPaths::isTestModeEnabled()
Library code might need to know this, e.g. when calling an external
process, to give it the right configuration. (For instance when
ksycoca code calls kbuildsycoca to recreate the DB at the right place).

Change-Id: I343ddefff816586f9d391973c08ff1e1ad86bf0e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-09 13:48:13 +02:00
Janne Anttila
5410299d94 Fix qlayout autotest build for WinCE.
SRCDIR was not defined for WinCE but it should no longer be used.
Fixed test case to use QFINDTESTDATA instead.

Change-Id: I07cbf7d42790d33e2d205d1682ec10e7577a92bd
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
2012-08-09 13:18:08 +02:00
Kent Hansen
8efcfda41f statemachine: Really fix signal transition handling in multi-threaded setup
Commit f9a17d7f0f fixed it for the case
where the sender object is in a different thread at transition setup
time. However, it still didn't work if either the sender object or the
state machine was moved to a different thread at some later time,
before the machine was started.

Therefore: Bite the sour grape and traverse all the machine's
transitions when the machine is being started, registering those
signal transitions whose sender objects are in other threads.

This will increase the machine's startup time (proportional to the
number of transitions), but at least it works in all known scenarios,
meaning we don't have to document weird restrictions regarding the
order in which the user's operations have to be done.

Task-number: QTBUG-19789
Change-Id: I5f1dd1321994e49635f52be65cf56d2678ed1253
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-08-08 14:13:53 +02:00
Thiago Macieira
6820f1716e Remove more -Werror from any test other than headersclean.
As was done in dc56fb18a7, but which
didn't catch all cases.

Change-Id: I9417a8d13339dd8fc95030dd5bad70f2c6f69756
Reviewed-by: hjk <qthjk@ovi.com>
2012-08-07 23:27:17 +02:00
Stephen Kelly
c5d7ea5bad Only emit the clicked() signal from views if the left button is used.
This is consistent with QAbstractButton, QCalendarWidget,
QDialogButtonBox and QGroupBox (ie, all other widgets with
a clicked signal)

Task-number: QTBUG-26105

Change-Id: Ieafe988b5c03216796b69a7cd70ac1a03fc12b0a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-07 16:40:07 +02:00
Stephen Kelly
2ade633c0a Ensure that we return an invalid QTableWidgetItem when none is available.
Task-number: QTBUG-26195

Change-Id: Iede4f51770bd8c8eab3558137aaf7b1721f25a87
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-07 16:40:07 +02:00
Stephen Kelly
b84e180263 Avoid crashes when invalidating a proxy model filter.
Task-number: QTBUG-26107
Change-Id: I2df7ae6402136570c8469d3251edae6ca8290f1f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-07 11:15:55 +02:00
Kent Hansen
9a0b7348b3 Make QSignalSpy copy QVariant parameters directly
Previously, a QVariant parameter would be wrapped inside a new
QVariant, and you would have to cast the QSignalSpy's QVariant to
a QVariant to get the actual value. This behavior was unintuitive
and undocumented.

Check if the parameter type is QVariant, and copy it directly if it
is. This makes the QSignalSpy's QVariant directly usable (no need to
"unwrap" the value in user code).

Existing tests that use QSignalSpy together with QVariant parameters
(such as tst_QPropertyAnimation::valueChanged()) and do cast the
QVariant parameter to a QVariant, continue to work after this change;
this is because qvariant_cast<QVariant>() returns its input value
(unchanged) when the type is not QMetaType::QVariant.

Task-number: QTBUG-21645
Change-Id: Ibfb171edd60c0d3f7ca1d5419e5c5f3d0380d5b3
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-08-07 11:15:55 +02:00
Stephen Kelly
dbe4b45f9b Remove some dead code wrapped in Q_WS_QWS.
Change-Id: Ie1ee8c4af603b924abe40145041357981d174445
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2012-08-03 11:24:28 +02:00
Paul Olav Tvete
3d0af143ca Revert "Move QWindowSystemInterface out of qpa."
This reverts commit 784a877d3c.

Conflicts:

	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/testlib/qtestkeyboard.h
	src/testlib/qtestmouse.h
	src/testlib/qtesttouch.h

Change-Id: Iebfed179b3eb7f30e4c95edcae5a8ad6fd50330e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-03 00:38:09 +02:00
Lars Knoll
328550ff00 Remove the obsolete scene argument for constructors of graphics items
The argument has been obsoleted and not documented since 2007. Get rid
of it now before Qt 5.0

Task-number: QTBUG-25089
Change-Id: I91a5508a5e1606f5b5c289501295c67be4abe6a0
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-08-03 00:37:59 +02:00
Friedemann Kleint
95bba3802b uic-Autotest: Remove SRCDIR-define, add stdout-test.
- Replace SRCDIR define by QFINDTESTDATA, simplify code.
- Introduce a test for stdout mode that verifies the newline
  convention.
- Use a temporary directory as not to clobber the
  test directory and introduce an environment variable
  UIC_KEEP_GENERATED_FILES to keep them for error
  analysis.

Task-number: QTBUG-26730
Change-Id: I22e3bb5a9ca92a1977c29b165ea605f1017baa02
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-02 20:38:54 +02:00
Paul Olav Tvete
5ac4a1304b Make tests compile without gui-private
Add new qt_handleXXX functions that forward to the QWindowSystemInterface
functions, and use those in the testlib inline functions. Remove use of
struct QWindowSystemInterface::TouchPoint from the testlib header files
(requiring some slight increase in ugliness in the two tests that use
that struct).

Also remove the qmake hack that adds private headers to all tests

Change-Id: Iec23537e55a44802f6e9cd463f7a0f82007c5250
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2012-08-02 17:25:37 +02:00
Martin Petersson
b8453b6fe3 QtNetwork: Handle FD_CLOSE on Windows
We need to handle FD_CLOSE separately on Windows as this will be sent
only once. When we get FD_CLOSE we need to check if there is more data
available for reading. It there is this might indicate that there is
another FD_READ that we need to handle after the FD_CLOSE. So in this
case we will manually create another close event.

Task-number: QTBUG-19409
Task-number: QTBUG-25386
Change-Id: Ie19906bc3f64fb6a85a508a5ab12caac5d70ccdb
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-08-01 18:12:34 +02:00
Thiago Macieira
672b5b7ab6 Set the Qt API level to compatibility mode in all tests.
Qt 5.0 beta requires changing the default to the 5.0 API, disabling
the deprecated code. However, tests should test (and often do) the
compatibility API too, so turn it back on.

Task-number: QTBUG-25053
Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-01 15:37:46 +02:00
Kent Hansen
3a2bc9530e statemachine: Make states exit order spec-compliant
The SCXML spec states that entry order should be equivalent to
"document order" and exit order should be "reverse document order".
Since QStateMachine uses child order for the entry order, the exit
order should be reverse child order.

Change-Id: Ia7b05fdd5c9261ccf202f64f8d23f5c88b20a8c3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-08-01 15:37:46 +02:00
Friedemann Kleint
305cdc7355 Remove usage of deprecated qWaitForWindowShown(QWidget *) method.
Change-Id: I445d24a09dbb7abb62a37bd9914284f21a4f08f1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-08-01 13:26:03 +02:00
Thiago Macieira
0838ac541d Make sure that the parsing mode reaches QUrlPrivate::setHost
Ensure that the parsing mode is cascaded down from setAuthority and
setUrl so that the hostname parsing does not attempt to decode
percent-encoded hostnames when it shouldn't.

Take the opportunity to also remove the "Boolean Trap" from
QUrlPrivate::setHost.

Change-Id: Ia64754c4a4900182700b7af1382aea8410abc7e9
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-01 13:04:21 +02:00
Thiago Macieira
e1038794b1 Make QUrl::setScheme only parse in strict mode (no decoding)
The URI RFC defines schemes as containing only a very restricted set
of characters, none of which require encoding, so don't even
try. Testing this behaviour in some web browsers indicate that they do
not accept percent-encoded schemes either.

Change-Id: I692dd20e1aac7e8a1bcb276cb5113b5802393d38
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-01 13:04:18 +02:00
Thiago Macieira
f893d9ec41 Fix QUrl support for empty usernames and passwords
If the password is empty (but present), the userinfo component of the
URL should end in a colon (":"). QUrl already supported that and it
was tested (case "password-empty").

If the username is *also* empty but present, the userinfo component is
just the colon (":"). Fix support for that case by checking if we
stored the presence flag instead of checking the size of the
component.

Change-Id: Ie224493a997dbf76b2e44dd6d55fd9674ac83c1c
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-01 13:04:15 +02:00
Thiago Macieira
4d1f0ccbf3 Fix handling of encoded NULs (%00) in QUrl::fromPercentEncoding
QString::fromUtf8, without an explicit size, (currently) defaults to
stopping at the first NUL. That means we need to pass an explicit
size.

Also take the opportunity to test that QUrl::toPercentEncoding also
works with the same data.

Change-Id: I79362d67afda624b01ca07b0315b611c4aa3fdda
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
2012-08-01 13:04:12 +02:00
Joerg Bornemann
a992a12bec don't change a widget's active state in QWindowsWindow::setWindowState
QWindow::setWindowState is not supposed to set the window active.
The method requestActivateWindow() should be used for that.

When switching from and to fullscreen mode we're always passing
SWP_NOACTIVATE to SetWindowPos to not change the activation state
of the window. This is inverse to the old behaviour, which did not
have an effect.

Change-Id: I339337935cdad76b3ef252202e92177f37543038
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-01 02:26:52 +02:00
Lars Knoll
47c48ea87a Fix reloading of plugins
Unloading and reloading a plugin didn't work correctly,
because we didn't reset instance to 0 on unload.

Task-number: QTBUG-26098
Change-Id: Ic3e4497f359b1ca455be949dce9cafa9d67d8039
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-01 00:14:41 +02:00
Joerg Bornemann
0d8795fcb4 fix window activation in tst_qmdiArea::subWindowActivated2
QApplication::setActiveWindow doesn't activate the native window but
marks the widget as active inside Qt.
We need to use QWidget::activateWindow instead. See docs.

Also moved the activation call further down because on Windows a
minimized window cannot be activated using the activation-by-focus
fake we're currently using.

Change-Id: I752f6ada1f463931fa9cfb3c35f42dbec0207bfa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-31 20:25:59 +02:00
Friedemann Kleint
5b49793d80 Implement synchronous WS events by flushing.
Previously synchronous window system events were
implemented by bypassing the queue and processing
the event immediately. This is not ideal since the
event order is not preserved - there might be "happened
before" events waiting in the queue.

Add QWindowSystemInterface::flushWindowSystemEvents
and change all handleSynchronous* to 1) queue the
event 2) call flushWindowSystemEvents.

flushWindowSystemEvents is almost identical to the
already existing sendWindowSystemEvents with the
exception that it does not call QApp::sendPostedEvents.
Move the common implementation to a new private function.

Task-number: QTBUG-20778

Change-Id: Ie98a83875bc0a14e335e36bed0dd9e0ed4a1dea0
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-31 20:25:36 +02:00
Friedemann Kleint
58ab483cdb Stabilize the QHeaderView test.
The test has a member QWidget *topLevel which it recreates
and shows in init() without waiting for it to be exposed
although it is not used in every test case. This apparently
interferes with some tests that create separate top levels.
Do not show in init(), delete the topLevel.
Add wait to the cases where the topLevel is shown.

Change-Id: Ib428020b36dc82991d41e68478fd583bdfb004c7
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-07-31 11:57:21 +02:00
Joerg Bornemann
12a40a7cbb tst_qwidget task reference fixed
Change-Id: I8d65f5912bfc2daa1e35be33a3c4d986508eebeb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-31 11:51:51 +02:00
Friedemann Kleint
be4f8393e4 Stabilize QWidget-test alienwidgets on XCB.
Use QTRY_VERIFY for the mappped attribute check.

Change-Id: I3cbde9122405bf7067f3702193e80636edc8c5c6
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-31 11:13:35 +02:00
Lars Knoll
1ee272568b Fixes to the qdom autotest
Don't rely on a black list of codecs for the serialization
test. This breaks badly when new codecs get added to Qt
(e.g. through ICU). Instead use a white list of known
codecs that can encode/decode the test data.

Change-Id: I1dc55a25e852198bb935f070a4a21e8369f56268
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-31 11:13:15 +02:00
Lars Knoll
88d2e92b39 ICU code page conversion support
Use ICU to do code page conversion instead of the
builtin text codecs. With this QTextCodec simply
becomes a wrapper around ICU's ucnv_* methods.

We only keep our own codecs for UTF-*, ISO-8859-1,
ISO-8859-15 for performance reasons, and for TSCII
and iscii-* because they aren't supported by ICU.

Change-Id: I4fc49eba55cf772b9772c6dac606a47a44346a60
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-31 11:12:28 +02:00
Thiago Macieira
920dcb0158 Ensure that QAtomicPointer of forward-declared classes works
This is working, but let's just be sure by adding a testcase.

Change-Id: I8c6b5ded0c7b6c90645dbf70a7ce6c1ba447a284
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-07-30 10:43:50 +02:00
Rohan McGovern
6a5dc7eb3f tests: fixed check for QtOpenGL
contains(QT_CONFIG,opengl) tells whether Qt itself is able to use
OpenGL, which is not the same thing as whether the QtOpenGL API is
available. Make the check correct; fixes compilation when Qt is
configured with -no-widgets (which also disables QtOpenGL).

Change-Id: Iaa296c2b10650971ef4846f8bc6f44761fadcf7c
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-07-30 06:06:12 +02:00
Rohan McGovern
3f5f692630 tests: disable qstandarditemmodel test when building without QtWidgets
This test uses QTreeView.

Change-Id: I6ba56ad6ec3687a5b90d516be10d6f88e248d53d
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-07-30 06:06:10 +02:00
Rohan McGovern
8b6f8d66ec tests: removed QtWidgets dependency from tst_qsignalmapper
This test was using some QSpinBox instances to generate signals for
testing. Use our own QtTestObject to generate the signals instead.

Change-Id: I3714955ae040d541c3b613a478945c38a18be18d
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-07-30 06:06:05 +02:00
Oswald Buddenhagen
e07372ff50 fix host vs. makefile directory separator mess
the system path separator and shell are bound to the host system
(system() will use cmd even on mingw with sh.exe in path).
the makefiles otoh may depend on what the qmakespec defines.

consequently, add $$system_path() and $$system_quote() (for use with
system() & $$system()). $$native_path() is renamed to $$shell_path() and
should be used with $$shell_quote() to produce command lines in
makefiles.
$$QMAKE_DIR_SEP needs to be applied to Option::dir_sep right after
parsing the spec, so it is available to $$shell_{path,quote}().

Change-Id: If3db4849e7f96068cf03a32348a24f3a72d6292c
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-07-28 00:09:45 +02:00
Friedemann Kleint
2f587ee689 Work on the QWidget-autotest.
- Introduce smart pointers to delete widgets and resources
  to ensure tests are not affected by left-over widgets
  also in case of failure.
- Replace deprecated QTest::qWaitForWindowShown() by
  QTest::qWaitForWindowExposed() and use QVERIFY,
  remove some hard-coded timeouts.
- Set some titles and object names.
- Add verbose debug output of event lists in tests
  childEvents.
- Set minimum sizes on widgets to avoid Windows warnings.
- Stabilize GDIWidget, trigger on first event only.

Change-Id: I64119a2e7113e4a9f0156d00c72ce0935d03bb81
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-28 00:09:45 +02:00
David Faure
8cf7cf0cb9 QDebug: Add getter/setter for auto-insert-spaces.
This is useful for inserting a string without space-handling, given that
dbg.nospace() followed by dbg.space() inserts a space.

It's also useful for QDebug operators for custom types, so that they
can disable space handling and then restore to whatever it was before
(rather than forcing it to space() mode).

Change-Id: I9d72e9ffbcbc581ed093168752c29af924405b33
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-27 22:05:26 +02:00
Volker Krause
ef403ba46a Fix crash in QVariant::canConvert().
When containing a QObject (or sub-class) pointer and trying to convert
to a QObject pointer canConvert() did dereference the pointer without
checking for it being null.

Change-Id: Ie274e54f2f817f2b6c5df64504f8af6359b8f38d
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-27 12:23:43 +02:00
Stephen Kelly
9784dd8d06 Implement implicit constructors for built-in classes.
Change-Id: I6b0b104bc1da3252d014615c50b81830de42e722
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-27 03:27:23 +02:00
Andrew den Exter
281d4995ec Fix position of mouse events generated from touch events.
In touch event terminology the global position is the screenPos,
scenePos is the windowPos.

Fixes a tst_qdeclarativepincharea test failure in qtquick1.

Change-Id: Ie98fe12be8cbedc9b019913b066e7c4bce75278d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
2012-07-26 15:13:24 +02:00
Friedemann Kleint
e3ccc032f0 Stabilize tst_QMenu::tearOff().
Introduce QTRY_VERIFY for frequently failing test.

Change-Id: I38a6420574c4dde20fd7fa484681514543bd70cb
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-26 15:13:03 +02:00
Friedemann Kleint
65fa00b6be Stabilize tst_QCompleter::QTBUG_14292_filesystem.
Make sure the test subdirectories are actually visible
in the file model before the tests start.

Change-Id: If640456bba4362b19d7ad9d9184736c2eb8d3bde
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-26 15:12:55 +02:00
Friedemann Kleint
db83f2d73d Base 'FileSystem' test helper class on QTemporaryDir.
This avoids test instabilities and prevents test directories
from being cluttered with temporary files. Change tests
accordingly. Remove unused createLink() method.

Change-Id: I843c28ab81c8a476c71c5211a7479b22d3d9fc93
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-07-26 15:12:50 +02:00
Marc Mutz
e083d25395 QMetaTypeId2::IsBuiltIn: (new) template meta-function to check for built-in types
This allows to check whether QMetaTypeId2::MetaType exists, and can help
turn run-time into compile-time expressions, even without constexpr support,
or in situations where constexpr can't be used (because you can't overload
on it). This was designed for the QMetaType::registerConversion feature,
but it's much more widely applicable.

Change-Id: Iafa04add04bcb531b3f7fe3e751c7e91ee6a3bc0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-07-26 15:01:04 +02:00
Marc Mutz
79b742b7e0 QtNetwork: use nullary version of qRegisterMetaType<T>("T")
Using the nullary version has the advantage that multiple calls
during a program run are much more efficient, since an inlined
atomic is used to store the result. It also ensures that
Q_DECLARE_METATYPE(T) has been used, whereas qRegisterMetaType<T>("T")
will happily register anything. So I've added the macro where it
was missing, or moved it to a central place when it existed
hidden.

In tst_qnetworkreply, this became a bit tricky, because a private
header is conditionally included, so moved the Q_DECLARE_METATYPE()
into a conditional section, too.

Change-Id: I71484523e4277f4697b7d4b2ddc3505375162727
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-25 19:32:41 +02:00
Friedemann Kleint
aaaf60aeab Remove usage of deprecated qWaitForWindowShown(QWidget *) method.
Remove usages from autotests with the exception of
widgets/kernel, widgets/widgets and widgets/graphicsview.

Change-Id: I917b2857ed0cd07a6b3dbcd69244f558086c6586
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-25 17:32:21 +02:00
Marc Mutz
ff453fa757 tst_qmetatype: fix two more unused typedefs (GCC 4.8 warning)
Also check the return value of
DefaultValueFactory<QMetaType::Void>::create(), the same way it's
done in testCreateHelper<QMetaType::Void>().

Change-Id: I3e6d7fca4ea74dbe65009f2eb2c64a1b3a370d68
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-25 17:32:21 +02:00
Marc Mutz
0e8279b7bc QObject: add a macro for conveniently setting the object name
This is a simplified port of KDTools' KDAB_SET_OBJECT_NAME.
It simply assigns the variable name as the objectName of
a QObject, uic-style. It uses a small helper function so
that it works on references as well as pointer variables.

  QLabel label;
  QLabel *pLabel = new QLabel();
  Q_SET_OBJECT_NAME(label);
  Q_SET_OBJECT_NAME(pLabel);

Change-Id: I25fec0c90f33249a3ea5d2dd622ab708019fd101
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-07-25 14:57:08 +02:00
Marc Mutz
5fd8dd19ea QtWidgets: use nullary version of qRegisterMetaType<T>("T")
Using qRegisterMetaType<T>() has the advantage that multiple calls
during a program run are much more efficient, since an inlined
atomic is used to store the result. It also ensures that
Q_DECLARE_METATYPE(T) has been used, whereas qRegisterMetaType<T>("T")
will happily register anything.

Had to add Q_DECLARE_METATYPE to QFileInfo, for
QList<QPair<QString,QFileInfo>> of QFileSystemModel to work with
the partial specialisations of Q_DECLARE_METATYPE for QList, QPair.

In order to synchronize this change with other modules that did
their own Q_DECLARE_METATYPE(QFileInfo), a sync macro is defined
that can be tested in other modules, and will later be removed again.

Change-Id: I3004664e07e64cd885d5a03a57ff4e4379804aec
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-25 13:33:05 +02:00
David Faure
790aca0ea1 Add QSignalSpy::wait() method.
Change-Id: I1f3b49e3dee19bf0b1d2933c6e6ad7972186e0d0
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-07-25 13:31:14 +02:00
Friedemann Kleint
4677cf3d01 Deprecate the qWaitForWindowShown(QWindow *) method.
While the qWaitForWindowShown(QWidget *) is inherited
from Qt 4.8, the qWaitForWindowShown(QWindow *) was introduced
in Qt 5. As it is identical to qWaitForWindowExposed()
and removed already, it can be deprecated in Qt 5.

Remove its usages in qtbase.

Change-Id: I28788d120ad687a49f02b2b44de6b38a2832fe5c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-07-25 07:24:49 +02:00
Stephen Kelly
b3694d1295 Split the QGuiVariant test from the Core one.
This makes development on the meta type system easier because only
QtCore must be re-built to run most of the tests. The existing
QGuiVariant test needs to be run before pushing anyway, but not
so frequently.

Change-Id: I1fa66edbd790c957e1a232226847dd550227a477
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-07-25 00:48:33 +02:00
Stephen Kelly
80cd5d2017 Use a large core type for the QVariant::setValue test.
The type needs to be large enough that
QVariantIntegrator<T>::CanUseInternalSpace is true.

Change-Id: I311c44bedfebd946e41639975df206c27b6d55ca
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-07-25 00:48:24 +02:00
Stephen Kelly
dec9666dd4 Make qRegisterMetaType constexpr for built-in types.
For consistency with qMetaTypeId, and because we can.

Change-Id: I6882a16ef3c0d84539048c9f2c201c4a2b2ca7ad
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-07-25 00:48:20 +02:00
Stephen Kelly
94c2745074 Remove obsolete or commented use of Q_DECLARE_METATYPE.
Change-Id: I15bc845801b9f84a9252a0092fbd69f0e1b3f4ea
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-24 10:46:24 +02:00
Kevin Ottens
7808ec795c Propagate synthesized mouse events in parallel (lock-step) with touch
This patch implement the equivalent of
468626e99a90d6ac21cb311cde05c658ccb3b781 in qtdeclarative but for
QtWidgets.

If a widget doesn't accept a touch event, then QApplication gives it
another try by synthesizing a corresponding mouse event. This way
QtQuick and QtWidget behave in a similar way, removing the need for
platform backends to try to emulate a mouse event from a touch event
unconditionally.

Also add relevant unit tests and adjust old QApplication ones.

Change-Id: Iddbf6d756c4b52931a9d1c314b50d7a31dbcdee9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-24 10:46:24 +02:00
Stephen Kelly
349f16b03c Replace old typedefs with their built-in equivalents.
Change-Id: I3ecb75ace431b92a13de67aa6426cf570398587f
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-07-24 10:46:24 +02:00
Stephen Kelly
86992d6adb Fix typo pallete -> palette.
Change-Id: I17b71bfed22c3692b027556ef2e5d6ece4f3f77e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-07-24 10:46:24 +02:00
Marc Mutz
c76a641a27 QAbstractItemView: don't qRegisterMetaType<QModelIndex>
QModelIndex is a build-in type nowadays and doesn't
need to be registered anymore.

Also remove them from the tests.

Change-Id: I47029972651c045c880cee86fb292116a29493d5
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-24 10:46:24 +02:00
Stephen Kelly
45cb8be4f9 Add tests of the various testlib definition possibilities.
The behavior of QTEST_MAIN depends on whether QT_GUI_LIB or QT_WIDGETS_LIB
is defined. It could create a QGuiApplication or QApplication which
could cause linking issues if the corresponding library is not linked to.

The failure cases are also tested.

Change-Id: I61ed0bc760564ef42ce1dbd86c83c06348c860ff
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-24 08:44:27 +02:00
Laszlo Papp
4eb6482751 Remove the unnecessary qdebug.h includes in the QPoint(F) tests
Change-Id: I5c45af9d498e20b46d6faf8c96de87586eca7b4a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-24 06:31:26 +02:00
Friedemann Kleint
607c37befb Remove usage of deprecated qWaitForWindowShown in dialog tests.
Change-Id: Id3ebe202d65ee682e8e2e3ae107808e9abb6cc15
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-24 00:08:28 +02:00
Friedemann Kleint
bcb5e564ff WindowSystemInterface::sendWindowSystemEvents(): Remove unused parameter.
No need to pass the dispatcher. Get rid of Windows logic to maintain
a stack of dispatcher associated with flags.

Change-Id: Ic2daad4b6762a46fac3274937effc188af436c9a
Reviewed-by: David Faure <faure@kde.org>
2012-07-23 19:57:07 +02:00
Stephen Kelly
cb43dec31e Split QWidgetsVariant tests into a separate testcase.
This allows building the QVariant tests without the QtWidgets module.

Change-Id: I7cd7e78a60c7bc7614ec16df1abe1e93e45d4923
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-23 17:47:51 +02:00
Stephen Kelly
01d69e37f4 Exclude the delayed resource file test on Windows.
The feature does not work there.

Change-Id: I4c19577d3882b5ea01d20f4a67a512c1e6bc803e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-23 07:02:37 +02:00
Stephen Kelly
450d9ce4ba Add a test for all QtBase modules.
Change-Id: Ib87e56f063603d474e232a137246ab6a60f63a23
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-23 07:00:04 +02:00
Stephen Kelly
761e4876f6 Fix typo: delyed -> delayed
Change-Id: I1e9c17a85a52f15f252392426fa0b30c101c7c30
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-07-20 20:44:06 +02:00
David Faure
1603ba2365 Provide public API for native event filtering, moved up from QPA.
The previous API was hard to use (global function, no type safety,
manual chaining), and confusing (app vs dispatcher split only made
sense on Windows). Installing and removing out of order would have
the risk of setting back a dangling pointer (crash). Meanwhile QPA
added type safety, and this new API models the QObject::installEventFilter
API for ease of use. The virtual method is in a new interface,
QAbstractNativeEventFilter.

QPA was even calling the dispatcher event filter with QPA-private event
classes, which made no sense (refactoring leftover from when the code
was in the dispatcher). Now the QPA plugins trigger the qcoreapp event
filters with the actual native events directly.

Change-Id: Ie35e47c59c862383bcaf857b28d54f7c72547882
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-07-20 18:34:08 +02:00
Friedemann Kleint
6ae168f8ce Tests: Replace deprecated QPixmap::grabWidget() by QWidget::grab().
Change-Id: I5018cf5dd51c1781e7f17c7d205f3f60de7945be
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-07-20 16:47:11 +02:00
Friedemann Kleint
fa896f03c2 Activate native window tests of QMdiArea.
Change-Id: Ic272b5e28256e454a3186d4407d009c9331b292b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
2012-07-20 11:43:34 +02:00
Friedemann Kleint
8761840397 Implement waitForWindowExposed and friends for widget windows.
- Implement waitForWindowExposed() for toplevel windows.
- Implement waitForWindowShown(QWidget *) and mark as
  deprecated in line with waitForWindowShown(QWindow*).
- Use in tests.
- Simplify tests (collapse waitForExposed, setActive
  into setActiveWindow, waitForActive), remove most
  hard-coded timeouts.
- Stabilize graphicsview tests by using waitForWindowActive.

Change-Id: Ic7c061e2745b36f71a715ee4e47c0346b11a91e8
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-07-20 09:27:28 +02:00
Joerg Bornemann
af8e318b35 QWidget/Win: fix restoreGeometry() from fullscreen mode
When turning off fullscreen mode and restoring the widget's geometry
we must inform the QWindow about the geometry change synchronously.
Otherwise QWidget::geometry() will return the old value.

Using the same technique for the state transition to fullscreen mode
without sending a separate resize event.

Autotest: tst_QWidget::saveRestoreGeometry
Task-number: QTBUG-26421

Change-Id: I869e36cd302d9a94e398f48949ab3cb7ee9cdf51
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-19 15:28:18 +02:00
Friedemann Kleint
dcf12533b7 Remove the test tst_qdialog::throwInExec().
QtWidgets and QtGui are currently compiled without exceptions,
which causes a crash with gcc 4.6.3.

Change-Id: I8f872f3bec6266444adf08d51a6678150c5fae8e
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-19 12:58:12 +02:00
Stephen Kelly
301538cf01 Add another directory to the private INCLUDE_DIRS list.
It should be possible to include both:

* <QtGui/private/qfoo.h>
* <private/qfoo.h>

Change-Id: I83ed5bba633b4a6b9bd38e315c987d78beecfb1b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-19 12:03:27 +02:00
Stephen Kelly
873f04481e Dereference so we can be sure the type is not forward declared.
Change-Id: I4d67a08dc645649e767153f3aa0dc57b15d50a84
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-19 12:03:21 +02:00
Miikka Heikkinen
150284198b Fix rendering glitches when using native widgets in MDI subwindows
When mixing native and regular widgets in same QMdiArea, some
subwindows didn't properly get set native. This was because
when a native parentless widget was given a parent, it wouldn't
enforce native window on the new parent and its ancestors.
This happened because window flags were adjusted too late in
relation to createWinId() call in setParent_sys().
Fixed by moving the createWinId() call to its proper place.

Also removed some old Q_WS_* ifdeffing in QWidget::setParent() that
masked some native enforcement code.

Additionally removed few QEXPECT_FAILs from QWidget autotest now
that those cases work correctly.

Task-number: QTBUG-26424
Change-Id: Ib6f9d0531e5c7299e2c307734d49c81f1ffa9713
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-18 15:07:32 +02:00
Friedemann Kleint
fe4adec894 Windows: Do not return short path names for QDir::tempPath().
WinAPI GetTempPath() sometimes returns short names
for C:/Users/<user>/AppData/Local/Temp.

Change-Id: I33f991acc06e652ccd484d36a5a384eb776f8395
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-17 15:56:15 +02:00
Thiago A. Correa
b8b79a0f37 Fix error when inserting to tables with datetime fields with QODBC
SQL Server 10 introduced stricter rules for TIMESTAMP validation,
making it necessary to specify the decimal digits.
Other databases might do the same as well, so this patch introduces
a check for the TIMESTAMP column size and adjusts the decimal digits
parameter as needed.

Task-number: QTBUG-2192

Change-Id: If6d798c6c928ebda75bc474e49a07fbbfbe5816c
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-07-16 23:48:10 +02:00
Friedemann Kleint
a89c7e4020 Replace Q_WS_ in tests by Q_OS_ or check platform names.
Change-Id: Ica445cf1e83bfaab870ac344d6c02766f047a5cc
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-16 16:30:55 +02:00
Joerg Bornemann
887607e956 tst_qwidget: check widget geometry in fullscreen mode
Change-Id: Idc45c6d18decf3c71c6736742434ad9d0cccd2d2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-16 16:30:55 +02:00
Friedemann Kleint
7a2aafcbbf Remove #ifdef Q_WS_ / include / #endif conditionals.
Change-Id: I734490ddcb5501e620370e50ef06180ab5e23393
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-16 16:30:55 +02:00
David Faure
199741d026 Fix applicationName() being empty in QApplication.
A virtual method was reimplemented to return an always-empty string,
probably a leftover from a refactoring.

This fix showed that tst_qwidget_window was buggy: between Qt4 and Qt5,
a "Before" became "After", which made "Before" unused, and was masking
the fact that the app name was empty by default. In addition, the
earlier Qt5 change that made the app name default to argv[0] now requires
updating this test, now that it's actually working.

Change-Id: I5360026821a9b95bedd0ff09dba3d51a22e542b7
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2012-07-16 16:30:55 +02:00
Kent Hansen
cd1351401f statemachine: Move RestorePolicy enum to QState class
This makes it possible to add API for setting the restore policy
per state, or even per property assignment (QTBUG-17861).

This change is fully source compatible with Qt4.

Change-Id: I53628546b070f6fc84891f86e7ad7bd8ef5ba285
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-16 10:08:28 +02:00
Kent Hansen
0b66f723f0 Add QStateMachine constructor that takes a ChildMode
Back when QStateMachine was changed to inherit QState, this
constructor was conveniently left out because setting the state
machine (root state) to be a parallel state group didn't actually
work. But as of commit d281aa6936,
it does work, so add the missing constructor.

Task-number: QTBUG-15430
Change-Id: I68c599baa0ef1bfc869195140cf5daf645e75b8b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-16 10:06:54 +02:00
Oswald Buddenhagen
4499a911c4 fix object file name clash
under extremely rare circumstances this would have actually failed

Change-Id: I4132d0f82e9f924e92e9e96f6d34451c94a67201
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-16 01:06:32 +02:00
Stephen Kelly
adfb66d02a Test QVariant copy with a user type instead of a QtNetwork type.
Change-Id: I78acc8a843eb12a2606f491d1a29e1bcd408d60f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-15 01:23:25 +02:00
Stephen Kelly
79dddcf089 Run QIcon related crash test with the other QtGui types.
Change-Id: I475cfc5a91a046951feecb425f8235ad37f1ba44
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-14 13:25:11 +02:00
Stephen Kelly
55d90b3240 Don't declare built-in metatypes as metatypes again.
Change-Id: Iba9804299e8f6e2db10965fdc719ee26f197758e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-14 13:25:03 +02:00
Stephen Kelly
6f540691c4 Add some tests to note that private signals can't be overloads.
This is just for completeness of the understanding of the limitations
of private signals. There are no private signals in Qt which have
overloads.

Change-Id: Ic34c555aea360ee34beec796e597657888573da9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-13 19:21:55 +02:00
Jan-Arve Saether
d45bc23cd5 Relax the reqirement in which order events are delivered.
When the pushbutton is shown, it will generate both a ShowEvent and
a StateChange with active=1 (because it is a top level window).

This patch relaxes the reqirement in which order events are delivered.

Ideally the order should also relied on, but I'm not sure if that
is feasible due to differences among window managers across all
platforms.

This got provoked by codereview.qt-project.org/#change,26014

Change-Id: I96159fbb1b64f0ca8d13833d8a4c6799c655afc2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-07-13 14:18:51 +02:00
Kent Hansen
95b6826ed4 statemachine: Make signal transition registration thread-safe
Since Qt's connections are thread-safe, QStateMachine's plumbing
around them should be thread-safe too.

Change-Id: I8ae91c2edc2d32ca4ed4258b71e5da22de30ed91
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-13 12:09:42 +02:00
Kent Hansen
f9a17d7f0f statemachine: Fix signal transition handling in multi-threaded setup
By default, QStateMachine lazily registers signal transitions (i.e.,
connects to the signal) when the transition's source state is
entered. The connections are established in Qt::AutoConnection mode,
which means that if the sender object lives in a different thread,
the signal processing will be queued.

But if a sender object's signal is used in an out-going transition
of the target state of the queued transition, it's possible that a
second signal emission on the sender object's thread will be
"missed" by the state machine; before the machine gets around to
processing the first queued emission (and registering the
transitions of the new state), a sender object on the other thread
could have emitted a new signal.

The solution employed here is to eagerly register any signal
transition whose sender object is on a different thread; that is,
register it regardless of whether the transition's source state is
active.

Conversely, when a machine's transitions are unregistered (i.e.,
because the machine finished), signal transitions with sender
objects on other threads should be left as-is, in case the machine
will be run again.

This doesn't solve the case where the sender object is moved to a
different thread _after_ the transition has been initialized.
Theoretically, we could catch that by installing an event filter
on every sender object and handle the ThreadChange events, but
that would be very expensive, and likely useless in most cases.
So let's just say that that case isn't supported for now.

Task-number: QTBUG-19789
Change-Id: Ibc87bfbf2ed83217ac61ae9401fe4f179ef26c24
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-13 12:09:42 +02:00
Kent Hansen
22c7a1fd9b statemachine: Fix dynamic transition registration edge cases
Some of the transition constructors didn't call the maybeRegister()
function, causing the transitions to be ignored if they were created
when the state machine was running and the transition's source state
was active.

Added tests that cover all possible cases.

Change-Id: If1b593b127bd719e3be4e5a2e6949a780c4e97c3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-13 12:09:42 +02:00
Kent Hansen
0d56dac3bc statemachine: Set correct signal index when signal is non-normalized
The originalSignalIndex member was not set if the signature had to be
normalized. This caused the SignalEvent passed to onTransition() to
report a signal index of -1.

Improve the signal transition tests so they check both the event
passed to eventTest() and onTransition().

Change-Id: I5331fd1944d53310b6d11eb2fd8713b80faa53a1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-13 12:09:42 +02:00
Stephen Kelly
f108fceb2c Make it possible to connect to QAbstract{State,Transtion} private signals.
Use the same trick as used for private signals in the models.

Change-Id: I4235788490cae0e3d554565621d145652dc5b0ca
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-13 01:51:47 +02:00
Stephen Kelly
536ec793b6 Make it possible to use new syntax to connect to model signals.
The private signals can not be used as function pointers, as
required by the new syntax, so we introduce a parameter which
can only be created privately.

Change-Id: I3d7bb8a163e764d685e8007cba831fb77e3c6855
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-13 01:51:44 +02:00
Stephen Kelly
0efa445141 Create a way to inform moc about private signals.
Moc checks for the use of the QPrivateSignal struct, which is part of
the Q_OBJECT macro and is private to each class that uses it. Moc then
generates a name of the signal which does not include the private
struct, and generates code to invoke such signals with an instance of
the private struct.

This way we can mark private signals as such and prevent them from
being emitted from subclasses or from outside of the class entirely.

The drawback to this is that it only works if the private
signal has no default arguments. However, at least in Qt, there are
no such signals.

Change-Id: Id16eadaa8d3c36a2c3b265077877f3e1d8304c84
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-13 01:51:42 +02:00
Jędrzej Nowacki
197f34bcff Test for QMetaType binary breakage.
Type traits can not be changed durring Qt5 life time.

Change-Id: If69f65ff2113c901580afee91b11ae1b11c13a4f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-13 01:51:38 +02:00
Marc Mutz
ea6946318f tst_QMimeDatabase: use QFutureSynchronizer
Replace a list of QFuture<void>s and a loop that calls waitForFinished()
on each of them with a QFutureSynchronizer<void>, which does exactly that.

Change-Id: I1f2e90169a5b2949bd8cb9d1009a5a7af1500139
Reviewed-by: David Faure <faure@kde.org>
2012-07-13 01:51:33 +02:00
Kent Hansen
c4cef6fae9 statemachine: Fix state entry bug for parallel state groups
The SCXML spec had a bug that would cause the initial state of a
compound state within a parallel state group to be entered even if
the transition specified another (non-initial) state of the compound
state as its target. This only happened if the transition had
multiple target states.

The bug has been fixed in recent revisions of the SCXML spec. This
commit implements the fix, which is to walk the ancestors of the
transition's target states only after all the target states
themselves have been added, so that the default initial states are
correctly overridden/ignored.

Task-number: QTBUG-25958
Change-Id: Iac532047678c483a4a3996e24dacf30e00f6bbe0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-12 20:38:02 +02:00
Thiago Macieira
d693a8914c Fix small problems with tst_QProcess
Remember to register the metatype where we use it, so we don't depend
on another test being run previously.

And skip the setWorkingDirectory test completely on Unix. I don't know
why it needs to be skipped, but if we're not going to verify anything,
don't even try to do anything. This saves us one memory leak at least.

Change-Id: I22e151cc3fa7b4e976972aca8978b88b263d9bee
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-12 18:34:56 +02:00
Jan-Arve Saether
f235ca4079 Enable modularization of translation files.
This is accomplished by introducing dependencies to catalogs.

This requires one API change:
QTranslator::load(const uchar *, int);
  changes to
QTranslator::load(const uchar*, int len,
                  const QString &directory = QString());

Since now, even the load from memory might need a directory if
the memory block contains a qm file with dependencies.

Change-Id: I781f333d07f53bb431d0a7b5fa1abe282dc4d338
Task-number: QTBUG-26138
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-12 18:30:35 +02:00
Eskil Abrahamsen Blomfeldt
f94d0ea1dc Fix crash when column is inserted before rowspanned cell
When you're inserting a column in front of a rowspanned cell
and this cell is not the first in the rowspan, we would get
the wrong logical index of the new cell (putting it in
front of the initial cell with the rowspan). If the cell
does not span all rows, the table will get into a broken state
and trigger asserts in update(). To fix this, we search for
the first cell after the insertion point which has a logical
index higher than the cell directly before the insertion point.

Change-Id: I42e91a20d77b2ba9c5607f6cab23f51ed888cbd3
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
2012-07-12 18:29:25 +02:00
Oswald Buddenhagen
2a973c031a test behavior of $${absolute,relative}_path() with empty 1st argument
Change-Id: I76c0853a9d397979f2ae5eb780374d2380c989f1
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-12 17:19:09 +02:00
Friedemann Kleint
46c62433e8 Implement qWaitForWindowShown using qWaitForWindowExposed.
Deprecate qWaitForWindowShown for Qt 6 as it is just a wrapper.

Change-Id: I0f8195679679120bd402e273fed4d331dc926708
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-07-12 14:22:48 +02:00
Friedemann Kleint
2d5caa0b79 Tests: Fix printsupport profiles.
Fix reversed conditions, breakage introduced by
32db7de207.

Change-Id: I6fca399376cd1fa9bffea0a686b56c4d5ec26605
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-12 11:15:58 +02:00
Mitch Curtis
282d81e4e5 Write qHash functions for QDate, QTime and QDateTime.
These functions didn't exist - this patch implements them.

Task-number: QTBUG-23079
Change-Id: I9eb6e238531d5cda878f5f2cdd27bab30aa60669
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-12 01:46:38 +02:00
Mitch Curtis
623bfe2093 Add unary operator+ to QPoint and QPointF.
As requested by Winfried Schenke:

"QPoint should have an unary operator+ (the unary operator- exists).
Classes with arithmetic operators should provide a complete set of
operators, because some template code relies on it."

Task-number: QTBUG-22913
Change-Id: Ib0c5105975f56c15f00bb48d83c8d911f5a204ac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-07-12 01:46:20 +02:00
Sergio Ahumada
59339941e0 Fix some spelling errors
Change-Id: I19d3b2e9a5180b13deb828b55195404ef20be295
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2012-07-11 14:52:37 +02:00
Mitch Curtis
376135c403 Improve QPoint and QPointF auto tests.
Improve test coverage for QPoint and QPointF.
Separate QPointF tests into their own project.

Change-Id: Id28dc5b85aba9fc179d87b2bca1d99854f27a5ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-11 14:52:17 +02:00
Stephen Kelly
78203ccf80 Fix unit tests when CMAKE_PREFIX_PATH env var is not set.
Tests which are expected to not build need to get a way to find the
Qt 5 config packages. Because they use try_compile, there is no way
to pass the contents to it.

Work around that by generating a file containing the prefix which
the tests will include.

Change-Id: If43080c241539e4af5fe1c183e7da72066278b73
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-11 12:46:15 +02:00
Kent Hansen
d281aa6936 statemachine: Support parallel root state
QStateMachine inherits from QState, so it should be possible to set
its childMode to ParallelStates, and it should behave as expected
(the machine should emit the finished() signal when all its child
states are in final states).

Task-number: QTBUG-22931
Change-Id: Ic436351be0be69e3b01ae9984561132cd9839fa7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-11 08:42:45 +02:00
Kent Hansen
28e9a602cb statemachine: Emit finished() signal when the initial state is final
It's legal to set a QFinalState as the initial state. The state
machine should correctly emit the finished() signal upon entering
such a state in the initial transition, and don't do any further
processing.

Change-Id: Ica8d3fadbbde604512ea1136624af54eb3b13b11
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-11 08:42:40 +02:00
Kent Hansen
035c933eaa statemachine: Revamp property assignments implementation
In the old implementation, property assignments
(QState::assignProperty()) were "second-class citizens".
Assignments were not really integrated into the state machine
algorithm, but rather done as a separate step
(QStateMachinePrivate::applyProperties()). While that was
convenient for SCXML spec transcription purposes, it resulted
in some pretty poor semantics on the user side:

* Properties were not assigned until _after_ both the
QAbstractState::onEntry() function had been called and the
QState::entered() signal had been emitted.

* Automatic property restoration (QStateMachine::RestoreProperties)
did not play nice with nested states (and parallel states, in
particular).

The proper fix is to refactor the implementation to make
property assignments first-class in the core state machine
algorithm (QStateMachinePrivate::microstep()).

In practice, this meant splitting some steps. Instead of calling
exitStates() straight away, we now first only compute the states
to exit (without actually exiting them), and use the resulting set
to compute which properties are candidates for restoration.
Similarly, instead of calling enterStates(), we first only compute
the states to enter (without actually entering them), and use the
resulting set to compute which properties are assigned by the
entered states.

With that in place, the rest was a matter of moving the various
chunks of the old applyProperties() logic to the place where they
belong in the per-state entry/exit.

All existing autotests pass. Added several tests that verify the
desired semantics in more detail.

Task-number: QTBUG-20362
Change-Id: I7d8c7253b66cae87bb0d09aa504303218e230c65
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-11 05:17:10 +02:00
Jan-Arve Saether
159b28d972 Remove clipboard operations from QAccessibleEditableTextInterface
Also, remove its subclass QAccessibleSimpleEditableTextInterface

Instead of having the subclass that implements this conveniently,
we move this behaviour over to the bridge. The bridge should
check if role() == EditableText is set, and then it should try to
support the IAccessibleEditableText interface (i.e.
it should accept the calls to replaceText(), deleteText() and
insertText()) and change the text with the following operations:
1. Query the text using QAccessibleTextInterface::text() or by
   using QAccessibleInterface::text(QAccessible::Value) as a fallback
2. Do the requested delete/insert/replace manipulation
3. Update the text with setText(QAccessible::Value, newText);

Change-Id: Iee5e41faf14351951e2bfca8c9eac970a113e878
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-07-11 02:47:34 +02:00
Sergio Ahumada
c15e80f6ac test: subtract qurlinternal.pro when private_tests are not enabled
This test used requires(contains(QT_CONFIG,private_tests)) in its
.pro file, but did not subtract itself from its parent project
SUBDIRS when private_tests weren't enabled.

Change-Id: Idcd0893c4804a8217e4dd33ba9838ff67e996f58
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-10 14:16:13 +02:00
Kent Hansen
d219ea1ebc statemachine: Don't assign properties for transitions with no targets
If the transition has no target states, that means the current state
won't change; hence, property assignments should not be performed.
In particular, properties should not be restored to the values they
had before the state was entered.

Change-Id: I237bbb541f939c272777e70c5f26c886ec457a17
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 06:21:01 +02:00
Kent Hansen
2f18e72762 statemachine: Purge restorable properties when they are restored
Previously, a registered restorable property would only be
unregistered if the property was animated (see
QStateMachinePrivate::_q_animationFinished()).
But if a property is set directly, it should also be unregistered;
otherwise, the state machine would use the previously saved (stale)
value the next time that property should be restored.

Change-Id: I5d246aa5355ddd0ba5f81b0186a9f0e4f3bbaa3f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 06:20:31 +02:00
Kent Hansen
bc5a4d28af Set compound state's initial state to 0 if it is removed/deleted
Change-Id: I45b7c15a9b3d5a1860cb9a7da8836f9eaaa0326d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 06:20:23 +02:00
Kent Hansen
ba87568655 statemachine: Don't crash if property assignment target is deleted
Do like QPropertyAnimation and store the QObject in a QPointer.
Purge the assignments list upon state entry and property restore.

Change-Id: I54a56885a2905178ab6aa5cf292b3d25c86b7a97
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 06:20:07 +02:00
Alexey Chernov
2d5d6c8fbc Color transparency support in html import/export
Export of color transparency component is added for cases where color
is exported to html. New static function colorValue() is added to
prepare CSS string representation of QColor. When the color is opaque,
it falls down to QColor::name() method which was used previously,
otherwise it returns 'rgba()' CSS statement or 'transparent' keyword in
case transparency is 0.
6-digit precision is used for alpha value as it's maximum which can be
processed properly by Gecko and Webkit engines
(http://lists.w3.org/Archives/Public/www-style/2009Dec/0295.html).

Import part for rgba() statement was also added to QCssParser. It
supports rgba() color values as stated in CSS Color Module Level 3
(http://www.w3.org/TR/css3-color/#rgba-color).

Import of undocumented statement 'rgba(int,int,int,int);' was also
added to preserve regression test success and to provide compatibility
with previous code relying on this behaviour.

Test cases added to QCssParser autotest for rgba(int,int,int,float)
statement and to QTextDocument autotest for rgba(int,int,int,float)
and 'transparent' statements for certain 'color', 'background-color'
and 'bgcolor' properties.

Change-Id: Id341c4e800249820d52edef8003e50f9a74d062b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 03:24:56 +02:00
Marc Mutz
7e0562c5ff fix compilation with conforming compilers (e.g. GCC >= 4.7)
In qdbus_cast(), qMetaTypeId<QDBusArgument> as well as
qvariant_cast<QDBusArgument> are used. They don't depend
on any template argument of qdbus_cast(), so their
definitions need to be available at function template
definition instead of instantiation time.

But the necessary Q_DECLARE_METATYPE(QDBusArgument)
was at the end of the header, after the defintion of
qdbus_cast(), which is too late for conformin compilers.

Fixed by moving it up just after the QDBusArgument
definition.

Similarly, in tst_qdatetime and tst_qvector, the
Q_DECLARE_METATYPE() for Qt::DateFormat and QVector<int>,
and with it the specialisation of QMetaTypeId<>, were
issued after the first use of meta typing; too late for
conforming compilers.

Change-Id: I25ca0b06e68d5184597a22708404a8f2040b2de1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-10 03:24:15 +02:00
Stephen Kelly
bcf6333c6f Update the moc no-keywords test for the signals replacement.
Change-Id: I5c544e71615b00ff8fd337579fcd185e4b8e24af
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-09 15:55:15 +02:00
Thorbjørn Lund Martsum
43850e5295 QItemDelegate - add a more comprehensive test
This is a bigger test after this change:
c3e1abad4e

Beside the test of behavior it has the class
FastEditItemView which could be useful in the future.

QTestEventLoop::instance().enterLoop(1) does not perform well.
(IE it makes CI slower). My class could be used to extensions.
(or maybe even to remove a few of these calls)

Change-Id: I4f1460873cd07ddc482d5cfe462b59c47ebb189f
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-09 12:07:48 +02:00
Joerg Bornemann
5b0273fc7a remove QEXPECT_FAILS from tst_qwidget
Task-number: QTBUG-26420

Change-Id: Ic4cb725cda418bfb427e7d834c0e07c2543d408d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-09 10:50:34 +02:00
David Faure
2c55847e9e QMimeType: document preferredSuffix()/suffixes() better
Change-Id: Icf4aab3516cd622d9932e32cb0bd819bef22ce9b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
2012-07-08 10:37:24 +02:00
David Faure
b069158ed3 Fix QMimeType::operator== to only compare mimetype names.
The name is the unique identifier. Code such as
if (oldItem.mimeType() == newItem.mimeType())
really wants to detect whether the item has a new mimetype (name),
not compare static mimetype data such as comments and icons.

Change-Id: I5fe56443295c91e1024c066ad6e7f93d842ae507
Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
2012-07-08 10:36:51 +02:00
Bjoern Breitmeyer
32db7de207 fixed unittest builds for wince
removed printsupport tests for wince as there
is no print support on wince and removed the special
handling for wince from 4.8 on some tests as the dependent
modules are not part of qt base anymore

Change-Id: I4ffb22da11f98beee1013f775cb5ce4b936d3211
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-06 21:14:09 +02:00
Joerg Bornemann
822c2c9457 make tst_qwidget significant again on Windows and Linux
To let this test pass, a bunch of test cases had to be disabled.

Task-number: QTBUG-25300

Change-Id: I26bc08f366c43fb2bf3ba42a5fcbeb3888ed02c0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-06 16:08:02 +02:00
Kim Motoyoshi Kalland
d13e3441a9 Fix division by zero in triangulating stroker.
Task-number: QTBUG-15621

Change-Id: I10e0e39e57078507a01e1c2edb59fa52fd932f6c
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-07-06 13:58:34 +02:00
Mitch Curtis
b6e26b5b19 Improve QDate, QTime, QDateTime auto tests.
Add more test data, merging operator!= tests in with operator==
to take advantage of added data.

Change-Id: If0426a3d01b8800cb7363385dbf3bcb21af5ed8f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-06 13:10:24 +02:00
Martin Petersson
3101f9d92c tst_qudpsocket: Interface fix for Windows Xp
On Windows Xp we can not connect to the pseudo interfaces used for
Teredo, so do not add these to the tests.

Change-Id: I4e20c880fa2d18f266ffcef2f640d8b2e6d0cd21
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-07-06 03:54:35 +02:00
Martin Petersson
7a0b8d580d tst_QTcpServer::linkLocal fix for Windows Xp
Do not try to connect to the Terdo Tunneling Pseudo-Interface as
this will fail for Windows Xp.

Change-Id: I6dcd8369ba1e8642224cd4ac53f4032ed46d050d
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-07-05 13:13:58 +02:00
Thorbjørn Lund Martsum
5dc9036e18 QHeaderView - adding an auto test with saveState and restoreState
This test is nice to have regardless though the main reason for it
is a refactor of hiddenSections in QHeaderView.

Change-Id: Id41a1d5edda2ef75bf432a78cdb3e952303eae92
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-05 13:13:58 +02:00
Toby Tomkins
a2fc6e1e2a Replace insignificant test with QEXPECT_FAIL.
Task-number: QTBUG-26430

Change-Id: I647388701b7e6a71bb011f7714ff3b96c833a837
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-07-05 05:39:12 +02:00
Thorbjørn Lund Martsum
524c3e05e8 QHeaderView - prevent negative default+minimum section sizes
In 96f1fe8855 we agreed that sections
with negative sizes did not make sense. Of the same reason default
section sizes and minimum section sizes should be not negative.

Change-Id: I6a770e7f510d8e2bb90bfd8f38b4fa0566fc137b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-04 18:00:41 +02:00
Stephen Kelly
6bd4be9436 Uppercase the CONFIG for verbatim mode.
Change-Id: Iec883e0218af80fc329d866affb2b95db72c54d3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-04 15:52:00 +02:00
Stephen Kelly
648d5964ee Add a Q_PROPERTY for the sourceModel of a proxy model.
Now that Q_PROPERTY with a QObject derived type is more powerful.

This property can be used in QML so that wrappers for proxy models
do not need to be created, such as in the example
at https://codereview.qt-project.org/#change,13007

Change-Id: I6ba676549d2135585d429a28e214fef0b2a6b1f9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-04 15:51:50 +02:00
Joerg Bornemann
2bd0737303 tst_qwidget: remove QEXPECT_FAIL for QTBUG-8911
QTBUG-8911 has been fixed some time ago.

Change-Id: I19dae0571b1829f6b3b797f7e0ec5c24a4241db8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-07-04 15:00:02 +02:00
Toby Tomkins
6a96daa3bb Replace insignificant test with QEXPECT_FAIL.
Task-number: QTBUG-26403

Change-Id: Id933665a35be056f2b2a6fa2152f324810a7f057
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-07-04 02:46:27 +02:00
Rohan McGovern
bcf20e122a Avoid load(testcase) for installing test helper apps
Make test projects declare TEST_HELPER_INSTALLS rather than calling a
function exported by testcase.prf.  load(testcase) may be unsafe, as
testcase.prf should be processed after default_post.prf.

Fixes silent disabling of various autotests.

Change-Id: I56b35ffd653a637ad5ab18d64dd1a1edadfac59f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
2012-07-04 02:46:27 +02:00
Matthew Vogt
10edf63174 Revert "Allow moc to handle symbols that have been redefined."
This reverts commit 5bb1408927.

The temporary measure used to support redefinition of QtDeclarative
class names during the transition period is no longer required.

Task-number: QTBUG-24517
Change-Id: Ib90f08fcdfb02e004e594ac72b698eaa0325d98d
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-04 00:48:44 +02:00
Friedemann Kleint
6136bfffce Fix QWidget/widgetAt() test.
Prevent a crash by giving the widget some time to show up.

Task-number: QTBUG-22326
Change-Id: Idaa23b21121e7c4f7098e8d51efd313bcc467e9a
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-03 20:59:36 +02:00
Friedemann Kleint
c9c3875fd0 Remove Unicode escape sequence, which MSVC does not support.
Task-number: QTBUG-25924

Change-Id: I352bb5c674d90891df4103849bf5b5ac5778a2ee
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-03 20:57:23 +02:00
Christoph Schleifenbaum
f4dd0828dc Platform-plugin support for QSystemTrayIcon.
Implement QPlatformSystemTrayIcon providing QPA-plugin-support for
system tray icons. Make QSystemTrayIcon use this as new backend.

Ported over qsystemtrayicon_mac.mm to qcocoasystemtrayicon.mm to provide
Cocoa support for the new interface. It had to be changed to match the
interface, especially for icon and menu handling.

This interface is made to not use QStyle or QMenu which are related
classes of QSystemTrayIcon. It's therefore not introducing QtWidget
dependency into the platform plugin.

Task-number: QTBUG-20978

Change-Id: I0d0a73835698b3b4f97219d4f5bbcfa2af57dbe2
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-03 16:48:33 +02:00
Miikka Heikkinen
8368557b9c Fix focus handling when the application has QAxWidgets.
Removed old defunct platform specific code from
QWidget::isActiveWindow() and added call to
QPlatformWindow::isActive() instead. This is done because
the embedded native windows inside QAxWidgets can have
focus but are not part of the parent application's Qt
window hierarchy, so native methods are required to determine
if they are part of the active window or not.

QWidgetPrivate::setFocus_sys() was implemented to activate
the window of the focused widget if the focus was elsewhere.
This is required because embedded native windows can steal the
focus from the main application window.

Focus event handling in Windows platform adaptation plugin was
fixed to correctly identify the active window in cases where
the are embedded native widgets that can have focus.

Also fixed three test cases that were affected by these changes.

Task-number: QTBUG-25852
Task-number: QTBUG-23699
Change-Id: I817e0ce4317e88955bb49b034eacd630a876ccf0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-03 14:50:34 +02:00
Martin Petersson
5c8d5b3dee tst_QTcpServer::clientServerLoop fix for Windows Xp
When we do not have dual stack the listen on QHostAddress::Any will
result in a serverAddress that is AnyIPv4.

Change-Id: I3c2c21c9412cd46a57e3ed7ce1c1bd2ef42d4bd9
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-07-03 14:39:39 +02:00
Konstantin Ritt
ee4f50b2e7 Add QChar::SoftHyphen enum value
Just like for the QChar::ByteOrderMark, `ch == QChar::SoftHyphen`
is much more readable than `ch == 0x00ad // (soft-hyphen)`, etc.

Change-Id: I9c85f14cfd979037d35103c3259a435fd729b869
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-03 14:39:02 +02:00
Joerg Bornemann
9d88743b7d removed ancient left-over test from tst_qwidget
The part of tst_qwidget::reparent() that "makes sense only on Windows"
is antiquated at least since the introduction of alien widgets.
It basically tests if QWidget::winId() returns a valid window handle
(has been replaced with winHandleOf here in the meantime).
This is always successful, because winId() creates a valid window handle.

Change-Id: I52c370e26fd9b34861bd4d52c12dded243382d43
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-03 14:25:36 +02:00
Joerg Bornemann
0f3528a7f6 tst_QWidget::gdiPainting fixed
We cannot use QWidget::grab for widgets that have WA_PaintOnScreen set.
QScreen::grabWindow copies the real screen contents for us.

Change-Id: If1f6233ec48bcb2b941ea683c56ce71a39642e67
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-03 13:32:04 +02:00
Kurt Korbatits
28f30aa543 Fixed warnings in qnetworkreply unit test
On windows without ssl there was a disconnect on sslError signal
that was not wrapped in ifdef.

Change-Id: I9b1327adfa853d4dc8f1d8a0120f8f0ed7c13e9e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-07-03 04:03:12 +02:00
João Abecasis
deb8d178fe Add erase operation to QArrayDataOps
Change-Id: I37d3ac465f5beddb5038e22e9cda32acb16c78fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-03 01:55:39 +02:00
Martin Petersson
6c59cdecee QSslCertificate::fromPath fix wildcard handling
The reqExp used to handle wildcards in the path was broken. So we
always searched the working directory and not the specified path.
Autotest where passing because of a hack used for Windows paths
where we removed the first two chars in the path string.

This fix will not use nativeSeparators thus removing the Windows hack
and fix the regExp to match wildcard chars.

Task-number: QTBUG-23573
Change-Id: I56fadbb67f25b8ce9c0f17cb6232e0bdb9148b1c
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-07-03 01:09:33 +02:00