Commit Graph

11778 Commits

Author SHA1 Message Date
Sergio Martins
00b0dff93f QNX: Don't crash because the window hasn't been initialized yet.
Don't call window->handle() inside the backingstore ctor, because
we might still have the window ctor in the call stack
( ex: a QWindow sub-class that creates a backingstore inside it's
ctor).

Crash can be reproduced by running examples/gui/analogclock.

Change-Id: I4622ceaeb05696c5ae0181a528f58e5d102dcb22
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-01-03 18:19:28 +01:00
Peter Kümmel
8e3d4f5e87 Don't read from deleted member variable
QNetworkProxy::setApplicationProxy deletes factory set by
QNetworkProxyFactory::setApplicationProxyFactory.

Change-Id: Iaafd62d1cdb2045d69c7359cacc513056216826c
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-01-03 18:19:28 +01:00
Andreas Holzammer
0cac0796a0 WINCE: Follow new library naming schema
Change-Id: Iad85e64bf504053e21cad809d2435c1ca239201b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-03 16:15:37 +01:00
Stephen Kelly
4184892665 Fix copy-pasto in QMetaObject::methodCount docs.
Copy-pasto'ed from the propertyCount docs.

Change-Id: Iddb4ce9c9559ca274a80deb0785424df108af762
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-01-03 16:15:37 +01:00
Eskil Abrahamsen Blomfeldt
248ccb2889 Fix possible crash in QTextDocument
With trailing spaces in some cases, we would not get the
"no justification at end of paragraph" special case, and continue
in the code, getting the unexpected case where line_length becomes
< 0 which would lead to memory corruption because we were writing
outside our buffers. I added an assert to catch this type of bug
earlier, and I added the trailing spaces to the test for the end
of the paragraph.

The test case added is one example which would crash.

Task-number: QTBUG-27354
Change-Id: Id720a6fa55dbc709ce04dd5321e55687bf960d75
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-03 16:15:37 +01:00
Stephen Kelly
4319f698c8 Remove metatype registration of built-in types.
As they are built-in, they are effectively registered at compile-time
already.

Change-Id: I7ae6ba16088eab5d19213fa7b07c2a7760988a86
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-03 16:15:37 +01:00
Thiago Macieira
0fd0f8dfa0 Declare the QMetaType::WasDeclaredAsMetaType enum as private
Omit its value in the documentation.

Change-Id: I474faefde23b0e2e0a77a9e6391fd556a6523128
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-03 14:18:08 +01:00
Thiago Macieira
77924a0276 Remove some dead code from qtriangulator.cpp
The CompareEdges functor class is never used anywhere. Clang saw it
through to the static function that never got used:

qtriangulator.cpp:227:12: error: unused function 'comparePoints'
      [-Werror,-Wunused-function]
static int comparePoints(const QPodPoint &u, const QPodPoint &v)
           ^

Change-Id: I67d821e454daf82bd8107bf20f787aff9496e878
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-03 14:18:06 +01:00
Thiago Macieira
ddf8ebb014 Fix warnings found by GCC 4.7 in the XCB platform plugin
qxcbnativeinterface.cpp:246:8: error: unused parameter 'context' [-Werror=unused-parameter]
qxcbcursor.cpp:550:85: error: 'root' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Change-Id: I5fa4e717c86d0e8198e501e6c799e0ceb9264708
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-03 14:18:03 +01:00
Sergio Ahumada
83188c6499 test: Change trolltech.com:443 to qt-project.org:443
trolltech.com seems to be shut down already

Change-Id: Ic90ce01aeb51b6f154b9bbf4762c365a398c9e3d
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-03 11:32:17 +01:00
Stephen Kelly
1342f5da38 Move the Q_DECLARE_METATYPE for QList<QSslError> to qsslerror.h
Otherwise it is possible to assert if

 qRegisterMetaType<QList<QSslError> >("QList<QSslError>")

is called in a TU which does not include the Q_DECLARE_METATYPE
invocation.

Change-Id: Ice1ffbb0f8d0a745d2bffc8b4e13ca31621e8ca4
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-03 11:32:05 +01:00
Thiago Macieira
2f365ae7ec Fix GCC warning about parentheses in QtPlatformSupport
atspiadaptor.cpp:2140:12: error: suggest explicit braces to avoid ambiguous 'else' [-Werror=parentheses]

Change-Id: Ib21308f9c1b3bf813fed803228d8adbcc3ce7e9f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-02 17:34:44 +01:00
Thiago Macieira
ebcc41ed72 Make qtestaccessible.h compile with QT_NO_KEYWORDS
Change-Id: I2065be84d69db62cdae1ad6ac66a09fc5f3454eb
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-02 17:33:49 +01:00
Thorbjørn Lund Martsum
28a21d98ef QAbstractItemView - allow deselect in single selection mode.
This patch allows single selection to be cleared with the normal
control modifier. This affects e.g QTreeView and QListView.

Task-number: QTBUG-8836
Change-Id: I7fd50b987acc3552b36657409568192763257536
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-02 16:09:14 +01:00
Thiago Macieira
0f014fcde8 Mark several template functions as static.
There is no reason those function shouldn't be static. This produces
no change in code, except that the functions may be better optimised.

Change-Id: Ia60b81d4e29a36190a453e8c7c8102c8f547e1a9
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-02 13:58:39 +01:00
Jon Severinsson
e2fb3f94e8 qdbusxml2cpp: Check string length before checking for \r\n.
Change-Id: I5370bae258933536ecf9785da95a9006fafc1a62
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-02 13:53:15 +01:00
Konstantin Ritt
1b9fdb9b31 Skip FcCharSetHasChar() call
...if writing system is already known to be supported

Change-Id: Id7ea11e92507a283b2fba2ad944dd0a9772e484d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-01-02 10:27:22 +01:00
Konstantin Ritt
cc378774b8 Move ForceIntegerMetrics testing out of the loop
Change-Id: I5732999dee63568eb83e5186cf5bf8c63709724e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-01-02 10:21:51 +01:00
Thiago Macieira
afa57146cb Fix warning about unused variable
qeglfshooks.h:77:21: error: 'hooks' defined but not used [-Werror=unused-variable]

Defining a static variable in a header file is a terrible idea. But if
I remove it, other code breaks and I don't have the time to fix them
all.

Change-Id: I4f94cbc7f0790df91853662749701e8fb11c2347
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-02 08:04:32 +01:00
Sean Harmer
aa90f78a34 Fix bug in multisampling handling when converting from surface format
Task-number: QTBUG-28875

Change-Id: If72ce0669de8f344603d2da53eeb5644bd5c4f82
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-02 08:02:33 +01:00
Morten Johan Sorvig
db25efe78b Make QImage::mirrored() propagate devicePixelRatio
Change-Id: I2dfeacc941cb411a7ec6752f745fed9d6345ed8a
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-02 07:49:05 +01:00
Morten Johan Sorvig
818c544d6b Cache accessibility plugins.
Profiling shows that the cost of QAcccessible::
queryAccessibleInterface is dominated by plugin loading.
(json parsing etc.)

Cache QAccessiblePlugin per class. Also cache the fact
that no plugin is found for a certain class. This speeds
up the average queryAccessibleInterface call by a factor
of 10X

Change-Id: Iab6d052dec499a2203d1dcc4672a8a543b279239
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-02 07:47:46 +01:00
Thiago Macieira
2119c8f291 Make these headers includable directly, on all systems
For qwineventnotifier.h, just wrap the code around #ifdef Q_OS_WIN. This
has the added benefit of fixing the current qt_no_master_include problem
(that is, even if you #include <QtCore> on Windows, you wouldn't get
it).

For qtypetraits.h, it requires qglobal.h first.

Change-Id: If1ba09a0a29de429a5b87e9878c8ac6a62a443c4
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-01 23:50:00 +01:00
Stephen Kelly
3f374afaae Get the default flags from the direct-base, not the indirect.
QStringListModel inherits QAbstractListModel.

Change-Id: I942321b2e5949f54041e11089f4131a646618b9e
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-01 18:11:28 +01:00
Thiago Macieira
d443953e6a Fix warning found by clang:
kernel/qwidgetsfunctions_wince.h:61:34: error: no newline at end of file [-Werror,-Wnewline-eof]

Change-Id: Icbc35227946652db53fc8454d1d42043aa7c15b9
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-12-31 13:04:23 +01:00
hjk
03a666760c Speed up and fix QByteArray::setNum()
Going through QLocale and QString is not really needed.

This also makes the result of the conversion of negative numbers
in bases other than 10 independent of the architecture and
implements the documented behavior of treating them as
unsigned types.

Change-Id: Ibc231dc5241deb5cbadd9796484a8b5f79c29410
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-30 10:44:44 +01:00
Thiago Macieira
8094c8fe18 Remove unused function _q_qgraphicsItemSetFlag
Clang reports:
graphicsview/qgraphicsitem.cpp:1779:13: error: function '_q_qgraphicsItemSetFlag' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
static void _q_qgraphicsItemSetFlag(QGraphicsItem *item, QGraphicsItem::GraphicsItemFlag flag,
            ^

According to the public Git history, in Qt 4.5.1 this function was
already unused. The only reason it wasn't caught so far is that it is
recursive: it calls itself. So it is used... by itself.

Change-Id: I6fc6b33cb314b845525dc9315d0ad742e113d5cd
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-29 22:38:48 +01:00
Thiago Macieira
fbfe420aeb Fix warnings reported by Clang in QtWidget
qwizard.cpp:919:24: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
    if ((info.wizStyle == QWizard::AeroStyle)
         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

Change-Id: I477cc4e331633682b79df3cb0113558e9019280c
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-29 22:38:46 +01:00
Thiago Macieira
b5de3baa6f Add qtest_widget.h to the list of testlib headers
It was missing.

Change-Id: I356f6ccddf4fc56e76858fdeaa8ef116e3b680af
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2012-12-28 23:29:11 +01:00
Thiago Macieira
19d8a77040 Fix warnings in the SQL drivers found by GCC 4.7
qsql_psql.cpp:774:12: error: enumeration value 'CancelQuery' not handled in switch [-Werror=switch]
qsql_mysql.cpp:1163:12: error: enumeration value 'CancelQuery' not handled in switch [-Werror=switch]
qsql_sqlite.cpp:527:12: error: enumeration value 'CancelQuery' not handled in switch [-Werror=switch]
qsql_odbc.cpp:88:97: error: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Werror=format]
qsql_odbc.cpp:706:76: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Change-Id: I79965283057e92a44a0c8375530cfb30107c891c
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-12-28 23:28:31 +01:00
Thiago Macieira
a891ef6920 Don't use MPProcessorsScheduled on Mac OS X
It's deprecated and it's not available on iOS anyway. The recommended
way of getting the number of processors online is via sysctl or
sysconf (both of which are just slightly below).

qthread_unix.cpp:397:13: error: 'MPProcessorsScheduled' is deprecated: first deprecated in Mac OS X 10.7 [-Werror,-Wdeprecated-declarations]

Change-Id: I4bf60985fbde155b78b840f3de3ff0a142b78b19
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2012-12-28 23:28:05 +01:00
Thiago Macieira
7b54571ec2 Suppress warning in valgrind headers: variable set but not used
qbenchmarkvalgrind.cpp:229:5: error: variable '_qzz_res' set but not used [-Werror=unused-but-set-variable]

Change-Id: I3c5896659105650d6d824b10ff3beffbdf494e24
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2012-12-28 23:27:58 +01:00
hjk
0136252cb2 Polish code of some opengl examples
Change-Id: If24ae1845176fc525cf6a239a5079f4802f8df3f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-12-28 20:44:55 +01:00
hjk
4eac2c4728 Add test for QByteArray::setNum
Change-Id: I66f3954433bf50fb23fdaeef804838d993e965b5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-12-28 15:09:19 +01:00
Thorbjørn Lindeijer
a1cdc17be9 Removed an unnecessary forward declaration
qstringlist.h is already being included.

Change-Id: I1790cd560b934b6697702bd11f78f39cddc3389f
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
2012-12-28 13:23:48 +01:00
Thorbjørn Lindeijer
1d09c5623b Fixed typo 'collasping' in QTreeView documentation
Change-Id: Ib49c3500c4b3a40a7eaf17404cecc2c38de90530
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-12-28 11:24:27 +01:00
Gabriel de Dietrich
3262ba8de6 Cocoa: Re-enable per class palette on QPA plugin
Task-number: QTBUG-28443
Change-Id: If66604e8d002be6cf4c308378199c96be7422e06
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-12-24 12:44:34 +01:00
Gabriel de Dietrich
f59163e79b Mac: Bring back proper layout in QMessageBox
Resolved by s/Q_WS_MAC/Q_OS_MAC where appropriate.

Task-number: QTBUG-28738
Change-Id: I8f1239839bffb092387d527af78e9dbe1628ef67
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-12-24 09:37:03 +01:00
Thiago Macieira
3adbcb58d5 Fix QMutex::tryLock with negative values
The Linux futex implementation had a Q_ASSERT for positive values, but
the documentation says that negative values should be interpreted as
infinite (equal to lock()).

Test that too.

Change-Id: I2f96a502d672732781e88e49797756ca9a809121
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-23 20:34:46 +01:00
Thiago Macieira
96d06124a1 Fix standalone header compilation
qtconcurrentfunctionwrappers.h:277:22: error: 'QStringList' was not declared in this scope

Change-Id: I54c48386d90146c872679672a1d8cc3675d49c39
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-23 17:53:57 +01:00
Thiago Macieira
9ea5754291 Fix Clang warning about memcpy a class with vtables
Change-Id: I7966014a49cdf4c6c82f012d8b1d16ba8ddc3fcc
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-23 17:53:40 +01:00
Thiago Macieira
96b48ee0cb Fix warning about unused variable in qdoc
codeparser.cpp:245:18: error: unused variable ‘dn’ [-Werror=unused-variable]

Change-Id: Id271b3829ba3278e80d4e79746db7aabfabd751a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-23 17:53:07 +01:00
Thiago Macieira
7ee9551b62 Add support for multiple arguments to QSharedPointer::create()
Requires C++11 rvalue references and variadic templates so we can
implement perfect forwarding.

Change-Id: I62e47d1ffd0c61e8386f9f246aa79031b7430b46
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-23 17:51:45 +01:00
David Faure
8b2728ec38 QUrl::fromUserInput: fix for urls without a host.
QUrl::fromUserInput("http://") was invalid, which doesn't make sense
since QUrl("http://") is valid. Same for "smb:" which is actually
even more a valid URL from a user's point of view.

Change-Id: I371ac393d61b49499edf5adbbc2a90b426fe9e5d
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-23 10:50:28 +01:00
Andy Shaw
69627730ea Fix QSqlQuery test in relation to PSQL support
Some things needed to be corrected for testing with PSQL, this was
checked against the the PostgreSQL documentation to confirm that the
exepected behaviour is correct.

Change-Id: I45a6b343e9eb920fcae2a62910ecc956abcac0f0
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-12-22 14:43:28 +01:00
Thiago Macieira
2ebb714686 Fix warning about unused variable in QtPlatformSupport
GCC was complaining:
qevdevtouch.cpp:475:13: error: 'maxId' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Which got me scratching my head: maxId was unconditionally initialised. How
could GCC be complaining about it being uninitialised? Well, turns out that
bestId could be uninitialised and the code does:

            if (bestId > maxId)
                maxId = bestId;

Of course, if bestId was uninitialised, the warning should have been in the
"if" line first.

Change-Id: I5e174ab2957d76ad040c14fa6ef8535129b6dce3
Reviewed-by: Laszlo Agocs <lagocs83@gmail.com>
2012-12-22 09:55:51 +01:00
Sergio Ahumada
7426102c73 Bump Qt version to 5.0.1
Change-Id: Ie8f437b8dfe8a67c7b34321439dd988a02612437
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-21 22:49:02 +01:00
Thiago Macieira
a2f63dfd7a Use the new QUrlPrivate::validateComponent validator in the main parser
The code was copied from the main parser there, so remove the
duplication.

Change-Id: I85748f6f76b3097ff22958d9de67cfa27061a72b
Reviewed-by: David Faure (KDE) <faure@kde.org>
2012-12-21 20:54:51 +01:00
Thiago Macieira
e1a1e80d46 Make sure that the strict parser is also operating on setXxx
These cases weren't handled before.

The validateComponent function is copied from QUrlPrivate::parse, with
the added modification that it now needs to check the gen-delims for
the userinfo.

Change-Id: I055167b977199fa86b56a3a7259a7445585129c6
Reviewed-by: David Faure (KDE) <faure@kde.org>
2012-12-21 20:54:51 +01:00
Thiago Macieira
f4b4b4414e Add QDBusArgument template overloads for QPair
Change-Id: Ic7c199b20f9b3f34ae8a16b6062b3a3d8722f063
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2012-12-21 19:36:49 +01:00