Commit Graph

2772 Commits

Author SHA1 Message Date
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
Robin Burchell
b9ef4a9c30 Speed up sorting of dir entries when sorted by date
QDateTime will attempt to convert unknown types of date to UTC time, which isn't
exactly a fast process. As we don't care about local timezones in the process of
sorting (as this is purely for ordering, not display to the end user), we can
force the dates to use UTC time, avoiding the unnecessary local timezone lookup.

This also adds a benchmark covering this case.

Benchmark results, Qt 5:
 - before: 11, 489ms
 - after: 273ms

Qt 4.8:
 - before: 20, 848ms
 - after: 278ms

Change-Id: I87fa6260e820b5b172d3306ff395dafe767c33ff
Reported-by: Thomas Perl <m@thp.io>
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 16:02:03 +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
Rohan McGovern
efdc35b680 lancelot: detect and handle Jenkins CI environment
Make the test behave in Jenkins similarly as it behaves in Pulse:

  - a test run in Jenkins is not an ad-hoc run

  - the JENKINS_HOME environment variable implies we are running in
    Jenkins

  - the GIT_BRANCH environment variable, set by the Jenkins git plugin,
    is equivalent to PULSE_GIT_BRANCH

  - there is no equivalent to PULSE_TESTR_BRANCH, since testr is no
    longer used

Change-Id: I89ffeec659b4adaab309d8b93ad793ce640029c7
Reviewed-by: aavit <qt_aavit@ovi.com>
2012-08-06 16:04:22 +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
Andreas Holzammer
a0be8ef271 Add command line options to windowgeometry test
Add -widgetminimized, -widgetmaximized, -widgetfullscreen,
-windowminimized, -windowmaximized, -windowfullscreen
as command line option to test creation of windows in
these modes

Change-Id: If192c131c8996d3b67648427e5784da47ffee971
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-01 00:14:41 +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
650cdb62bd Make benchmarks compile without QtWidgets
Ensure benchmarks which need QtWidgets are gracefully disabled when
that module is unavailable.

Fixed one unnecessary usage of "QT+=widgets".

Change-Id: I8031b5dca585749f0f4d22e0637adc3f57f4e418
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@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