Commit Graph

4121 Commits

Author SHA1 Message Date
Jan Arve Saether
4684f2179b Change return type of imagePosition to QPoint
QAccessibleImageInterface already has an API to return the
size of the image.

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

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

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

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

Task-number: QTBUG-33981

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

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

Task-number: QTBUG-33972

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

In addition the buttons on the toolbar are now labelled.

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

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

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

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

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

Task-number: QTBUG-28770

Change-Id: I30be3ec141b2cd8d6e0db8a92669aed34da93b33
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-10-11 12:05:59 +02:00
Oswald Buddenhagen
d3ba95f5c1 don't unnecessarily use qtgui
Change-Id: Ia4162d75ef6ebf87f36d40163d5ffc89eae64dc6
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-10-08 20:39:03 +02:00
Sebastian Schuberth
ac5f4a8e76 Allow to use short names for Windows Registry root keys
Change-Id: I58b7681bb49e93b7577bc559d754c81d3c6f007b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-10-07 19:09:37 +02:00
hjk
32f27b4367 Replace QLoggingCategory::isEnabled by non-template functions
This yields the same results as previously and is more in line
with existing interfaces.

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

Change-Id: Icc966559be3c2cde3416193b8a1ddab7e0323ade
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-04 01:19:38 +02:00
Friedemann Kleint
cdf0c5905b Fix temporary file leak in tst_qfiledialog2.
Change-Id: I5a1e601e3aa6e84300efa09bfbd9232fecab903e
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2013-10-03 21:43:56 +02:00
Frederik Gladhorn
04acfea2d2 Fix QStandardPath test on some linuxes
On one suse box I have both /usr/bin/sh and /bin/sh which means that the
test should prefer the one first in the path instead of random order.

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

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

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

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

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

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

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

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

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

Task-number: QTBUG-25057

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

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

Change-Id: I25514884c11f43a4f82b1f818f822dc3d79f69a3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-09-26 18:45:16 +02:00
Tor Arne Vestbø
d4ec6331bb tst_QNetworkReply: Don't remove file if never created
If we end up QSKIP'ing the test 'wronlyFileName' is never created.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Change-Id: I0ae162a5db5ef29f24cd1d32285a1870fdd24b9b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-20 23:45:06 +02:00