profile/ivi/qtbase.git
11 years agoHeader contains `signals' - use `Q_SIGNALS' instead!
Sergio Ahumada [Wed, 29 Aug 2012 16:47:39 +0000 (18:47 +0200)]
Header contains `signals' - use `Q_SIGNALS' instead!

Change-Id: I5ee1bfd0ce9c98d64b50cc727d414037fafb91c5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
11 years agoDocument the purpose of QDateTimeParser::cachedDay.
Mitch Curtis [Thu, 30 Aug 2012 14:58:47 +0000 (16:58 +0200)]
Document the purpose of QDateTimeParser::cachedDay.

It's useful to know what this member variable is used for, since there
is very little documentation for QDateTimeParser, which makes
maintenance yucky.

Change-Id: I9ecf5aa5ef0b5d778ceb858c323e3bab1ebaa7dc
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
11 years agoDoc: Simplify qtbase qdocconfs.
Casper van Donderen [Thu, 30 Aug 2012 15:51:30 +0000 (17:51 +0200)]
Doc: Simplify qtbase qdocconfs.

We should be using the global qdocconf for the common variables. This
change also allows you to just specify -installdir without using a
templatedir.

Change-Id: I207d279d9b5199212e896fc5ccab5c212b1896c6
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
11 years agoDoc: Fix various errors
aavit [Thu, 30 Aug 2012 12:25:17 +0000 (14:25 +0200)]
Doc: Fix various errors

Change-Id: I07503dd379779148b674ab0f806f6eeac5d7d4b7
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
11 years agoFix QScreen::grabWindow() on Windows
aavit [Tue, 28 Aug 2012 13:57:47 +0000 (15:57 +0200)]
Fix QScreen::grabWindow() on Windows

Finish up 94ac17c2ccbe3b3f3671848afda9430be214f8d5

Task-number: QTBUG-26963

Change-Id: I13f52f0a6cf460d525b53338738aecd4b3cf313c
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoFix MinGW-w64 TDM64-GCC 4.6.1 compilation
Jonathan Liu [Wed, 29 Aug 2012 12:09:47 +0000 (22:09 +1000)]
Fix MinGW-w64 TDM64-GCC 4.6.1 compilation

This fixes a regression introduced by
f58390e0f495e229d9f2f1301c3a9dec978af9c2 because __MINGW64_VERSION_MAJOR
is the same in older releases of shobjidl.h that do not declare the
IFileDialogEvents interface.

Task-number: QTBUG-24699
Change-Id: I000a5b9baf52363dfdedff2fb29bbe7ab24df5ca
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoMSVC/OpenGL: Fix warnings about macro redefinition..
Friedemann Kleint [Mon, 27 Aug 2012 09:47:01 +0000 (11:47 +0200)]
MSVC/OpenGL: Fix warnings about macro redefinition..

Introduced by fc41ee4c92ce703f3e4374bf493505a1d847a657 .

Change-Id: I4c924b0b0a38401ab02c3cc4edb7d78dbd9ef356
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoDoc: Fix misc. documentation errors
aavit [Thu, 30 Aug 2012 11:30:51 +0000 (13:30 +0200)]
Doc: Fix misc. documentation errors

Change-Id: I9481ed452922ed5ecd159a8f60d7fbcb3683cec1
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
11 years agoImprove performance of QArrayData::Grow autotest
João Abecasis [Sun, 29 Jul 2012 22:33:18 +0000 (00:33 +0200)]
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>
11 years agoMake plugintest util work on Windows.
Jason Barron [Wed, 29 Aug 2012 09:10:13 +0000 (11:10 +0200)]
Make plugintest util work on Windows.

Command line apps that use stdout need the CONSOLE subsystem.

Change-Id: Ic220f45119ea70372e27b4a364f7264cc649726d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
11 years agoAvoid a warning from the QNX QPA plugin.
James Turner [Thu, 30 Aug 2012 10:02:25 +0000 (11:02 +0100)]
Avoid a warning from the QNX QPA plugin.

The HDMI display on the Playbook is listed, but (normally) unattached,
and hence generates an error if we attempt to register for events. This
patch avoids the warning; a future change will actually watch for screens
being attached / detached and update the QPlatformScreens and event
registration correctly.

Change-Id: I5a9cc773648d50f657fe1b3611fd42495ca7e836
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
11 years agoQSqlQueryModel: suppress insert and remove signals while resetting
Mark Brand [Wed, 29 Aug 2012 08:14:08 +0000 (10:14 +0200)]
QSqlQueryModel: suppress insert and remove signals while resetting

There is no need to emit signals for inserting and removing rows
and columns while resetting the model. Suppress these signals in
such a way that subclasses can benefit without worrying about it.

Change-Id: I04447c87173be54a7323b97608cdd40ae245b80b
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoQSqlQueryModel: fix nested beginResetModel/endResetModel
Mark Brand [Wed, 29 Aug 2012 07:34:41 +0000 (09:34 +0200)]
QSqlQueryModel: fix nested beginResetModel/endResetModel

Follow-up to 83c9ebbd6692cde99ee692e6549c591100f12545.

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 83c9ebbd6692cde99ee692e6549c591100f12545, 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>
11 years agodocs: remove \reimp from non-virtual methods
Mark Brand [Wed, 29 Aug 2012 10:05:06 +0000 (12:05 +0200)]
docs: remove \reimp from non-virtual methods

It seems we need \internal in this case.

Change-Id: I3f290bb0d22f9f3b5d04d27b13a7ef8961b2dd6c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoFix static plugins for classes in namespaces.
Friedemann Kleint [Thu, 30 Aug 2012 09:27:36 +0000 (11:27 +0200)]
Fix static plugins for classes in namespaces.

Breakage introduced by 819d0203e6fd9d27dc4c22e8c3cb8b437998f62a .

Extend QT_MOC_EXPORT to take the unqualified class name
as well for the function names.

Change-Id: I736097b564caa37c522d723780663d03341f9032
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Lukas Geyer <lgeyer@gmx.at>
11 years agoEnsure that printer orientation is preserved
Titta Heikkala [Thu, 9 Aug 2012 07:54:09 +0000 (10:54 +0300)]
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>
11 years agoLogging: Remove mutex for OutputDebugString
Kai Koehne [Tue, 28 Aug 2012 07:22:06 +0000 (09:22 +0200)]
Logging: Remove mutex for OutputDebugString

OutputDebugString seems indeed to be thread safe, at least according
to http://www.unixwiz.net/techtips/outputdebugstring.html . I also didn't
manage to run into any deadlocks on Windows 7 ...

The comment + code was already there (in qcoreapplication_win.cpp) in
the first git commit that imported Qt.

Change-Id: I442e22575558958ef21ab8c6b4cc8b03aee906b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoMake tests/auto/corelib compile on Windows CE
Kevin Funk [Tue, 28 Aug 2012 15:13:42 +0000 (17:13 +0200)]
Make tests/auto/corelib compile on Windows CE

Change-Id: I71987d40ae69d95f645c4c7d26d50add4c799327
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoTemporarily mark ctest testcases as insignificant on Windows
Rohan McGovern [Wed, 29 Aug 2012 06:56:56 +0000 (16:56 +1000)]
Temporarily mark ctest testcases as insignificant on Windows

The deployment of cmake onto Windows test machines caused test failures
with no changes to the code under test.  Mark all the ctest tests as
insignificant until the failures can be fixed.

Change-Id: If0cd4001ae6ec49fd38b9e0f97dd5326fddae433
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
11 years agodist/changes-5.0.0: note that QtConcurrent is a separate library these days
Marc Mutz [Mon, 27 Aug 2012 10:59:22 +0000 (12:59 +0200)]
dist/changes-5.0.0: note that QtConcurrent is a separate library these days

Change-Id: Ib8ab6e40d9827697d1061a1b369e150f33d63be9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoFixes possible memory leak in QContiguousCache
Fabian Bumberger [Mon, 27 Aug 2012 21:29:18 +0000 (17:29 -0400)]
Fixes possible memory leak in QContiguousCache

When inserting an item on a position that is already occupied, the destructor of the old item was never invoked.

Change-Id: I01dc4ec9f2da5027284eba94e1a9ad36b062a50d
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoQVarLengthArray: C++11-ify insert/erase signatures
Marc Mutz [Thu, 24 May 2012 06:26:46 +0000 (08:26 +0200)]
QVarLengthArray: C++11-ify insert/erase signatures

In C++11, container insert and erase operations take const_iterators
instead of iterators. This is a bug fix compared to C++98, where the
mere lookup step of a lookup-or-insert operation had to be done using
(mutable) iterators, which is particularly worrisome for Qt containers
that are implicitly shared, because of the unneeded detach in the positive
case.

QVarLengthArray is not implicitly shared, but for consistency, the signatures
should be changed here, too. The reason this commit contains only the change
to QVarLengthArray is that this is by far the easiest container. The
implictly shared containers are harder, because detaching invalidates other
iterators (more than the sister STL container would).

Change-Id: Ib3d98360bfe376b782b9d1283c5fa3555e8a719e
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoQString::append: add (const QChar*, int len) overload
Marc Mutz [Fri, 18 May 2012 16:58:29 +0000 (18:58 +0200)]
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>
11 years agoDocument how to remove a QGraphicsEffect.
Richard Moore [Sun, 26 Aug 2012 12:34:15 +0000 (13:34 +0100)]
Document how to remove a QGraphicsEffect.

You can remove an effect by setting 0, but this wasn't documented.

Change-Id: I2d86875d8554cb26b4d88b8ce04b4daa9792c5d5
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agoFixed the QTreeView expansion/collpasing when animated
Thierry Bastian [Wed, 29 Aug 2012 12:24:40 +0000 (14:24 +0200)]
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>
11 years agoMade QImage::fill(uint pixel) for RGB888 accept QRgb values.
Samuel Rødal [Tue, 24 Jul 2012 13:23:49 +0000 (15:23 +0200)]
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>
11 years agoAdded OpenGL example and documentation.
Samuel Rødal [Tue, 5 Jun 2012 11:21:55 +0000 (13:21 +0200)]
Added OpenGL example and documentation.

Change-Id: I2d9d4e52caf0a39fef9648d8a9e83a0c1328f650
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
11 years agoEnsure child items are updated even if the parent item has no content
Andy Shaw [Tue, 14 Aug 2012 06:52:08 +0000 (08:52 +0200)]
Ensure child items are updated even if the parent item has no content

When a parent item had its visiblity toggled, then the child item would
not update if the parent item had ItemHasNoContents and
ItemClipsChildrenToShape set. This is a common use case in declarative as
the root item has ItemHasNoContents set.

Task-number: QTBUG-26846

Change-Id: Id6592ebc4ba2caa4331a4a71f7247e40993131b6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoDocument obsolete functions in QImage to silence qdoc errors.
Jason Barron [Tue, 21 Aug 2012 13:24:28 +0000 (15:24 +0200)]
Document obsolete functions in QImage to silence qdoc errors.

Change-Id: I78f3335e5c088641c56d5e682425c7e4b26b7d3e
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
11 years agoFix mistake in docs. Return type should be QSurfaceFormat
Jason Barron [Tue, 21 Aug 2012 08:34:18 +0000 (10:34 +0200)]
Fix mistake in docs. Return type should be QSurfaceFormat

Change-Id: I4f4bf2542bb89b28ee84773507d4a121b134e730
Reviewed-by: Shawn Rutledge <shawn.rutledge@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
11 years agoAdd support for explicit TLS 1.1 and 1.2
Brendan Long [Thu, 16 Aug 2012 23:14:04 +0000 (17:14 -0600)]
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>
11 years agoBlackberry: Fix QFileSystemEngine::tempPath()
Thomas McGuire [Tue, 28 Aug 2012 12:05:33 +0000 (14:05 +0200)]
Blackberry: Fix QFileSystemEngine::tempPath()

Apparently it depends on the user and/or firmware version on whether
TMPDIR or TEMP is set, so try both.
Additionally, fall back to /tmp if neither is set, as that seems to be
present on all devices.

Change-Id: Ia49499729df525276e145d2e35e94559eac45c98
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
11 years agoSSL: remove unneeded volatile qualifications
Marc Mutz [Fri, 24 Aug 2012 07:30:23 +0000 (09:30 +0200)]
SSL: remove unneeded volatile qualifications

These two variables are only ever accessed under mutex protection,
and don't otherwise look like they could be changed by the hardware,
so remove the volatile qualifier.

Change-Id: I714451bb3e80778b971a901d53fe13e1b01dd84f
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoQNativeWifiEnginePlugin: replace a volatile bool with an atomic int
Marc Mutz [Fri, 24 Aug 2012 07:47:55 +0000 (09:47 +0200)]
QNativeWifiEnginePlugin: replace a volatile bool with an atomic int

Since there is non-atomic data that is protected by 'triedResolve',
the (outer) read from triedResolve needs to have acquire, and the
store needs to have release semantics. The release implied by the
mutex unlock is not good enough because it only synchronises-with
the locking of the same mutex, which not all threads execute.

Change-Id: I90b62c4c0213472ecf2b95a1674a1c6c79dc3786
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
11 years agoQDnsLookupRunnable: replace a volatile bool with an atomic int
Marc Mutz [Fri, 24 Aug 2012 07:47:55 +0000 (09:47 +0200)]
QDnsLookupRunnable: replace a volatile bool with an atomic int

Since there is non-atomic data that is protected by 'triedResolve',
the (outer) read from triedResolve needs to have acquire, and the
store needs to have release semantics. The release implied by the
mutex unlock is not good enough because it only synchronises-with
the locking of the same mutex, which not all threads execute.

Change-Id: If46b3ea6ccfdd66ca41ce44d4f45bef2c2c30f72
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
11 years agoQHostInfo: replace a volatile bool with an atomic int
Marc Mutz [Fri, 24 Aug 2012 07:47:55 +0000 (09:47 +0200)]
QHostInfo: replace a volatile bool with an atomic int

A volatile bool read/store is documented on MSVC to have acquire/release
semantics, respectively, but that doesn't need to be true for MinGW, so
use explicit memory ordering.

Apply the same fix to the Unix implementation, too.

Change-Id: Ica466cec50beed830aafa4e3384d82f02e1a47e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
11 years agoExclude the examples/widgets/doc dir for all but widgets.
Frederik Gladhorn [Wed, 29 Aug 2012 07:33:48 +0000 (09:33 +0200)]
Exclude the examples/widgets/doc dir for all but widgets.

There are too many references to the QWidget lib documentation
in there. On the other hand this keeps snippets working.

Change-Id: I7dd63b7fba1758accea2663f7b427940a8857e32
Reviewed-by: Martin Smith <martin.smith@nokia.com>
11 years agotest: Mark tst_qtextboundaryfinder::generateDataFromFile() with internal build
Sergio Ahumada [Wed, 29 Aug 2012 11:53:27 +0000 (13:53 +0200)]
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>
11 years agoLet qdoc respect excludedirs for examples.
Frederik Gladhorn [Wed, 29 Aug 2012 07:04:54 +0000 (09:04 +0200)]
Let qdoc respect excludedirs for examples.

Change-Id: I01063b38122aea3615801ff013c8c4a1589327fc
Reviewed-by: Martin Smith <martin.smith@nokia.com>
11 years agoDon't do path conversions on isEmpty()
João Abecasis [Tue, 21 Aug 2012 07:32:24 +0000 (09:32 +0200)]
Don't do path conversions on isEmpty()

Change-Id: I4b5eefe74c6f741d1d0870d502798a5e3d0e7a2a
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
11 years agoUse QString for user-visible strings
João Abecasis [Wed, 22 Aug 2012 11:32:52 +0000 (13:32 +0200)]
Use QString for user-visible strings

dirPath is kept as the "user visible" path string and is used to
construct paths during directory iteration. In QFileSystemEntry (and in
Qt, more generally) these are represented with QString.

While on Windows QFileSystemEntry::NativePath and QString are one and
the same, dirPath does not represent a native path. So, basically, don't
do that.

Change-Id: I987477cb41b37018634ac43aeda004d254181dc5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
11 years agoRevert "Fix transformation in eglfs backingstore"
Jon Trulson [Tue, 28 Aug 2012 17:54:05 +0000 (11:54 -0600)]
Revert "Fix transformation in eglfs backingstore"

This reverts commit 12491f35bbea7008b15fb0ba0ee7ea5bf6eb6b6c.

This change is not needed on eglfs.  It causes widget based apps to be
rendered with Y inverted.

Change-Id: Idb23fa22c438442b81882b64bf84d6aa0662d27b
Reviewed-by: Laszlo Agocs <lagocs83@gmail.com>
11 years agowrap the implementation with NO_SETTINGS macro
Jing Bai [Tue, 28 Aug 2012 14:02:28 +0000 (16:02 +0200)]
wrap the implementation with NO_SETTINGS macro

To fix a compile issue where the header is wrapped but the
implementation is not.

Change-Id: I9d4e30a251e9f5de71710eb6bf784fb2eb396698
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agodocumentation: grammar nitpick
Mark Brand [Wed, 29 Aug 2012 09:00:13 +0000 (11:00 +0200)]
documentation: grammar nitpick

Change-Id: Ibf16731f04f2c53adeff1b8b1fcc6f1555e3613d
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Bill King <bill.king@nokia.com>
11 years agoDrawing fix for overlay scrollbars on Mac.
Christoph Schleifenbaum [Thu, 23 Aug 2012 16:36:57 +0000 (18:36 +0200)]
Drawing fix for overlay scrollbars on Mac.

A wrong check lead to a scrollbar with value 0 never been draw. This is
the fix for it. Instead is has to be checked for a length of 0.

Change-Id: I0c4e2f7e0014074e3c22554bcbea0ebfc3122952
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
11 years agoqplatformclipboard.h does not need qplatformdefs.h, so remove
Thiago Macieira [Tue, 28 Aug 2012 10:58:50 +0000 (12:58 +0200)]
qplatformclipboard.h does not need qplatformdefs.h, so remove

It's not using anything from the qplatformdefs.h header in the public
API (and it shouldn't, since qplatformdefs.h can change) nor in inline
functions, so there's no need to include it here.

Include qglobal.h, which includes qconfig.h, which is where the
QT_NO_CLIPBOARD define will be, if anywhere.

Change-Id: I913db9aface297e75f91b6346c0dc48439d7d1f6
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
11 years agoUse qualified name for QT_MOC_EXPORT_PLUGIN()
Lukas Geyer [Tue, 28 Aug 2012 09:45:08 +0000 (11:45 +0200)]
Use qualified name for QT_MOC_EXPORT_PLUGIN()

Using non-qualified name for QT_MOC_EXPORT_PLUGIN() breaks template
instatiation for QPointer<T>::operator=(T*) in qt_plugin_instance()
when the class is embedded a namespace with the same name.

namespace Test {

class Test : public QObject
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "Test")

public:
    Test(QObject *parent = 0) : QObject(parent) {}
};

} // namespace Test

In function 'QObject* qt_plugin_instance()':
 error: expected type-specifier before 'Test'
 error: no match for 'operator=' in
        '_instance = (int*)operator new(4u)'
 note: candidates are:
 In file included from qtbase\include\QtCore/qpointer.h:1:0,
                  from qtbase\include\QtCore/QtCore:68,
                  from test.cpp:1:
  qtbase/src/corelib/kernel/qpointer.h:87:25:
   note: QPointer<T>& QPointer<T>::operator=(T*) [with T = QObject]
  qtbase/src/corelib/kernel/qpointer.h:87:25:
   note:   no known conversion for argument 1
           from 'int*' to 'QObject*'
  qtbase/src/corelib/kernel/qpointer.h:79:7:
   note: QPointer<QObject>&
         QPointer<QObject>::operator=(const QPointer<QObject>&)
  qtbase/src/corelib/kernel/qpointer.h:79:7:
   note:   no known conversion for argument 1
           from 'int*' to 'const QPointer<QObject>&'
 error: expected ';' before 'Test'

Change-Id: Idd3e57ab1c888352ad2a8e8f6efca75d858089df
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoHarfbuzz: fix build with NO_OPENTYPE macro defined
Konstantin Ritt [Sat, 25 Aug 2012 21:24:54 +0000 (00:24 +0300)]
Harfbuzz: fix build with NO_OPENTYPE macro defined

Remove `DEFINES += QT_NO_OPENTYPE` since there are no QT_NO_OPENTYPE guards
and I'm not sure defining NO_OPENTYPE won't break some things.

Change-Id: I7b36d3f200408aee99db73c56baa9b4a21cb54f9
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoPlugin metadata is now updated in setFileName(), not load().
Lukas Geyer [Fri, 24 Aug 2012 23:06:39 +0000 (01:06 +0200)]
Plugin metadata is now updated in setFileName(), not load().

Plugin metadata has been updated in load(), with the
side-effect of metadata not beeing available until
plugin has been loaded - and which the new metadata
system tries to prevent in the first place. The
metadata is now updated (and avaiable) as soon as
a valid filename is set.

Change-Id: Ia5aedc67d8115e71c2ecbcbcadf786ba1c2893d8
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoRemoved extra detach calls from QJsonArray::takeAt
Denis Dzyubenko [Wed, 6 Jun 2012 09:43:26 +0000 (11:43 +0200)]
Removed extra detach calls from QJsonArray::takeAt

Change-Id: I5711ec6b03e3979eca61f62004a7c6f0eaae79e0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoFix missing cleanup of native Cocoa menus.
James Turner [Tue, 28 Aug 2012 11:42:42 +0000 (12:42 +0100)]
Fix missing cleanup of native Cocoa menus.

QCocoaMenu was missing a destructor to release various native resources,
and this causes issues with pop-up menus when the Qt peers are recycled on successive shows of the same menu.

Task-number: QTBUG-27022
Change-Id: I3cdf979804358ce10fe8a87c9e2c90419c6e0b48
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoFix warning when compliling with -Wconversion.
Frederik Gladhorn [Mon, 27 Aug 2012 13:36:04 +0000 (15:36 +0200)]
Fix warning when compliling with -Wconversion.

Change-Id: I90bf9f9a1860cabb67bc92599e7ccce94496d134
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoFix doc errors.
Frederik Gladhorn [Mon, 27 Aug 2012 11:43:12 +0000 (13:43 +0200)]
Fix doc errors.

Change-Id: I38d01d3b5d2b9b15edd389ea17142bd75f00e135
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
11 years agoMove address book example images to proper location.
Frederik Gladhorn [Fri, 24 Aug 2012 22:49:21 +0000 (00:49 +0200)]
Move address book example images to proper location.

Change-Id: Ib106445c7a68fb1a1fd2d2c6d568681d83b712c9
Reviewed-by: Martin Smith <martin.smith@nokia.com>
11 years agoAdd missing examples from doc repo.
Frederik Gladhorn [Fri, 24 Aug 2012 22:43:49 +0000 (00:43 +0200)]
Add missing examples from doc repo.

Change-Id: I145ae05a5e7348740f858bd2bdcb8d21d7a90d22
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agodoc: fix links
Frederik Gladhorn [Fri, 24 Aug 2012 22:35:48 +0000 (00:35 +0200)]
doc: fix links

Change-Id: Ifb6363e35c5317b6b1d9fd5e53079b30753f0666
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
11 years agoFix qdoc link.
Frederik Gladhorn [Fri, 24 Aug 2012 22:11:28 +0000 (00:11 +0200)]
Fix qdoc link.

Change-Id: I65e58351737b5628ac8c5dfe36a14b898076d690
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
11 years agoQSharedPointer: make QT_SHAREDPOINTER_TRACK_POINTERS work with QObjects
Giuseppe D'Angelo [Thu, 16 Aug 2012 15:49:38 +0000 (16:49 +0100)]
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>
11 years agoDon't attempt to test DBus on QNX.
Stephen Kelly [Tue, 28 Aug 2012 08:14:58 +0000 (10:14 +0200)]
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>
11 years agoForward the CMAKE_TOOLCHAIN_FILE to tests.
Stephen Kelly [Tue, 28 Aug 2012 08:13:09 +0000 (10:13 +0200)]
Forward the CMAKE_TOOLCHAIN_FILE to tests.

A Toolchain file must be supplied to cmake to cross compile. Forward
that to tests so that they can be built too.

Change-Id: Ie15190ff1d1f554ce436b7cb4d37a177a7e17e56
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
11 years agoFind example images for widget docs.
Frederik Gladhorn [Fri, 24 Aug 2012 21:33:41 +0000 (23:33 +0200)]
Find example images for widget docs.

Change-Id: I958031b3ececa953c73d7792900f271f4a19803e
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agodoc: remove links to Qt Designer
Frederik Gladhorn [Fri, 24 Aug 2012 21:17:13 +0000 (23:17 +0200)]
doc: remove links to Qt Designer

Designer is in the tools repo, we cannot link there.
Mentioning the name should be good enough.

Change-Id: I55193aa31e60ae266a8890f706c332a63ed3610d
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agoAdd graphicsview documentation overview.
Frederik Gladhorn [Fri, 24 Aug 2012 21:04:26 +0000 (23:04 +0200)]
Add graphicsview documentation overview.

This was removed from the docs repo and not re-added in qtbase.
(change id for removal: Id1a65f07f4687465499fc5666bb1ad710914fabd)

Change-Id: Ifb403757884114c00e64d713f65af5178dcb5d4b
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
11 years agoFix qdoc errors in PrinterInfo.
Frederik Gladhorn [Fri, 17 Aug 2012 13:15:07 +0000 (15:15 +0200)]
Fix qdoc errors in PrinterInfo.

Document parameter and associate comment with function by removing newline.

Change-Id: Ib4bb07c325144ef3501aea81d9e49e09b007387d
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
11 years agobeautify string operations
Oswald Buddenhagen [Mon, 20 Aug 2012 12:33:08 +0000 (14:33 +0200)]
beautify string operations

Change-Id: I895a1ae26ee0c884c404bf585261d1a7e8a8242c
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
11 years agomicro-optimize: use POD-initializable lists of variable names
Oswald Buddenhagen [Mon, 20 Aug 2012 11:04:39 +0000 (13:04 +0200)]
micro-optimize: use POD-initializable lists of variable names

Change-Id: I3732fef509b358949ef90002dbfc1960360afef8
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
11 years agoremove unused checkMultipleDefinition()
Oswald Buddenhagen [Fri, 17 Aug 2012 09:11:48 +0000 (11:11 +0200)]
remove unused checkMultipleDefinition()

Change-Id: I533c2091333942f145063ad04f4420b7a2de0a37
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
11 years agoremove dead variable assignments
Oswald Buddenhagen [Mon, 20 Aug 2012 14:08:09 +0000 (16:08 +0200)]
remove dead variable assignments

Change-Id: I032e9116ca1b7250497f56ea26103f2173f0fc09
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agode-duplicate code
Oswald Buddenhagen [Mon, 27 Aug 2012 06:44:39 +0000 (08:44 +0200)]
de-duplicate code

Change-Id: Ic3f2bfeb5a16da86b1cd471b55dfc79f12dfadee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agocmake: use .exe suffix only on Windows
Peter Kümmel [Mon, 27 Aug 2012 17:56:04 +0000 (19:56 +0200)]
cmake: use .exe suffix only on Windows

Change-Id: I36ba61bd4690de0bfe4a44e579eb554c82b53bb4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoFix CMake file INSTALLS with debug_and_release configurations.
Stephen Kelly [Mon, 27 Aug 2012 17:56:04 +0000 (19:56 +0200)]
Fix CMake file INSTALLS with debug_and_release configurations.

Change-Id: Iad0161969e3632862102703fcc239358387e2181
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Peter Kümmel <syntheticpp@gmx.net>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
11 years agoAdd automatic metatype registration for invokable methods.
Stephen Kelly [Sat, 18 Aug 2012 11:05:16 +0000 (13:05 +0200)]
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>
11 years agoAdd automatic metatype registration for Q_PROPERTY types.
Stephen Kelly [Thu, 16 Aug 2012 00:19:56 +0000 (02:19 +0200)]
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>
11 years agoHandle invalid dates properly for QDataStream versions < 5.
Mitch Curtis [Tue, 28 Aug 2012 16:00:24 +0000 (18:00 +0200)]
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>
11 years agoFix some warnings in tests.
Friedemann Kleint [Mon, 27 Aug 2012 07:27:04 +0000 (09:27 +0200)]
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>
11 years agoRemove automatic drive letter lowercasing from Option::fixString() v5.0.0-beta1
Miikka Heikkinen [Fri, 24 Aug 2012 11:24:12 +0000 (14:24 +0300)]
Remove automatic drive letter lowercasing from Option::fixString()

This enforced lowercasing causes subtle errors, like changing the
drive letter case when doing $$files(), which makes it difficult
to do any string matching against the result later.

Task-number: QTBUG-26985
Change-Id: I4973e3ac3e851e24af944295edf290cc98f02fb6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoDeprecate qWaitForWindowShown QWidget* overload since 5.0.
Stephen Kelly [Wed, 22 Aug 2012 09:53:26 +0000 (11:53 +0200)]
Deprecate qWaitForWindowShown QWidget* overload since 5.0.

It is already documented as deprecated in 5.0, so marking it as deprecated
since 6.0 is silly.

Change-Id: If72cc81bdad18c907022c48b9aa8e7d87eb88e59
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoMake it possible to use static builds of Qt with CMake.
Stephen Kelly [Tue, 21 Aug 2012 11:12:57 +0000 (13:12 +0200)]
Make it possible to use static builds of Qt with CMake.

Parse the prl files generated by qmake to get the link dependencies. They
contain all the information we need, and they are the only location with
all the right information.

Change-Id: Id9dcc988f20a744297502eff008de085326cdbcf
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
11 years agocmake: define QT_NO_DEBUG in client release builds
Peter Kümmel [Mon, 27 Aug 2012 10:54:34 +0000 (12:54 +0200)]
cmake: define QT_NO_DEBUG in client release builds

Change-Id: Ife224bf908c5e9bc1e62a830a3750de88a082eb7
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
11 years agoAdd some error checking to the qt5_use_modules function.
Stephen Kelly [Mon, 27 Aug 2012 12:02:12 +0000 (14:02 +0200)]
Add some error checking to the qt5_use_modules function.

Change-Id: I8fa2f10edbee1080646324c0689b23eda44aa75d
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
11 years agoFix plugin docs regarding location of json files.
Stephen Kelly [Mon, 27 Aug 2012 12:09:02 +0000 (14:09 +0200)]
Fix plugin docs regarding location of json files.

The commit 2ef52ca12416baa96feb64e02186aae04f883a12 introduced
an error regarding where the json file must reside.

Change-Id: I296c93abebb3e9f8c9e7e29a4a433201064969f0
Reviewed-by: Peter Kümmel <syntheticpp@gmx.net>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agodoc: key -> uicontrol
Frederik Gladhorn [Fri, 24 Aug 2012 22:35:00 +0000 (00:35 +0200)]
doc: key -> uicontrol

Change-Id: I42e5e2dc2d7cf7030ee9bc7dfa97ddaa66958370
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agoqcompilerdetection.h: set Q_DECL_OVERRIDE/Q_DECL_FINAL for 2005 <= MSVC <= 2010
Marc Mutz [Tue, 10 Jul 2012 12:52:20 +0000 (14:52 +0200)]
qcompilerdetection.h: set Q_DECL_OVERRIDE/Q_DECL_FINAL for 2005 <= MSVC <= 2010

This enables Q_DECL_FINAL and Q_DECL_OVERRIDE backed by VC's
non-standard extensions from VC 2005 on. VC 2012 will support
the standard-compliant version, so use that there.

Change-Id: I96874fe3d36fcaa283d2d1f53d5eb6825e55f259
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoMake letter spacing APIs in QTextFormat more consistent
Eskil Abrahamsen Blomfeldt [Fri, 24 Aug 2012 08:39:37 +0000 (10:39 +0200)]
Make letter spacing APIs in QTextFormat more consistent

Change d060b6f04f956ab3a6358f826dc6928b3353f5f7 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>
11 years agoQNX: Enable pre-compiled header support for QNX
Sean Harmer [Fri, 24 Aug 2012 14:14:20 +0000 (15:14 +0100)]
QNX: Enable pre-compiled header support for QNX

Change-Id: I6af69965b19c5d0d7a46de8000433bc5f1f2abcb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoEnable symbol visibility support on QNX
Sean Harmer [Fri, 24 Aug 2012 13:31:20 +0000 (14:31 +0100)]
Enable symbol visibility support on QNX

Change-Id: Ie6015f87976cf16e0474dfa66da885ef24738f6c
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoRemove mentioning of Phonon.
Frederik Gladhorn [Fri, 24 Aug 2012 21:23:28 +0000 (23:23 +0200)]
Remove mentioning of Phonon.

Change-Id: I78ce6d42ee043a35b520bf8567a1874cf8e2e43e
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
11 years agodoc: clean up model view overview links
Frederik Gladhorn [Fri, 24 Aug 2012 22:12:11 +0000 (00:12 +0200)]
doc: clean up model view overview links

Change-Id: I4aaf0cb254ffa4c7369e51b35af0226c98ec293c
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
11 years agoFix limitting shortcuts to keypad only
Jani Honkonen [Mon, 6 Aug 2012 09:02:51 +0000 (12:02 +0300)]
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>
11 years agoUpdate Q_PLUGIN_METADATA docu.
Peter Kümmel [Sun, 26 Aug 2012 18:37:28 +0000 (20:37 +0200)]
Update Q_PLUGIN_METADATA docu.

Change-Id: I7e451a15de392552609ef549118600684429e0ea
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoQMetaTypeId: optimize qt_metatype_id() in special cases
Marc Mutz [Fri, 24 Aug 2012 10:40:20 +0000 (12:40 +0200)]
QMetaTypeId: optimize qt_metatype_id() in special cases

Same change as for Q_DECLARE_METATYPE, but in the container and
smart pointer specialisations of it.

Change-Id: If9390ccc43eb3b07122f5ea5b8094139b5e1ded0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoQMetaTypeId: optimize qt_metatype_id()
Marc Mutz [Fri, 24 Aug 2012 10:40:20 +0000 (12:40 +0200)]
QMetaTypeId: optimize qt_metatype_id()

The old code resulted in one memory fetch for the test plus another one
for the return value (at the assembler level). The new code reuses the
already-loaded value:

-       movl    _ZZN11QMetaTypeIdI12QDBusMessageE14qt_metatype_idEvE11metatype_id(%rip), %edx
-       testl   %edx, %edx
-       je      .L158
        movl    _ZZN11QMetaTypeIdI12QDBusMessageE14qt_metatype_idEvE11metatype_id(%rip), %eax
-       ret
+       testl   %eax, %eax
+       je      .L160
+       rep; ret

It also saves one load in the not-yet-initialised case:

-.L158:
+.L160:
        leaq    .LC7(%rip), %rdi
        subq    , %rsp
        .cfi_def_cfa_offset 16
        movq    himBH1, %rsi
        call    _Z17qRegisterMetaTypeI12QDBusMessageEiPKcPT_
        movl    %eax, _ZZN11QMetaTypeIdI12QDBusMessageE14qt_metatype_idEvE11metatype_id(%rip)
-       movl    _ZZN11QMetaTypeIdI12QDBusMessageE14qt_metatype_idEvE11metatype_id(%rip), %eax
        addq    , %rsp
        .cfi_def_cfa_offset 8
        ret

Change-Id: I769950449822f2b1587680e05518be0a4f3120a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoQSlotObjectBase: make 'impl' and 'ref' private
Marc Mutz [Mon, 20 Aug 2012 13:52:19 +0000 (15:52 +0200)]
QSlotObjectBase: make 'impl' and 'ref' private

This allows to fold the deref() and the destroy() operations into one,
destroyIfLastRef().

The member variables were renamed since there's now a member function
of the same name (ref()).

Change-Id: Ib94416d9e658065bbf5d3711ecafaf0eb063af17
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoQSlotObjectBase: make Operation enum protected
Marc Mutz [Fri, 17 Aug 2012 14:13:19 +0000 (16:13 +0200)]
QSlotObjectBase: make Operation enum protected

We don't want people to go and call through the function pointer
directly.

Change-Id: I386645239974f008d513eaa62593c1141b294b60
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoQSlotObjectBase: remove misleading comment
Marc Mutz [Mon, 20 Aug 2012 13:17:54 +0000 (15:17 +0200)]
QSlotObjectBase: remove misleading comment

These constructors might not benefit from being constexpr (as the objects are
only created on the heap), so don't suggest so. There's no disadvantage of them
begin constexpr, but their constexpr'ability depends on whether QAtomic has
a constexpr constructor, and the added complexity of finding that out isn't
worth it.

Change-Id: I089a29dcb98ba935c339dce09d71f283522a9afd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agomoc: test slots marked final/override in various ways
Marc Mutz [Tue, 10 Jul 2012 16:08:18 +0000 (18:08 +0200)]
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>
11 years agomoc: parse classes that use Q_DECL_FINAL|final|sealed
Marc Mutz [Mon, 5 Mar 2012 16:55:59 +0000 (17:55 +0100)]
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>
11 years agosyncqt: parse classes that use Q_DECL_FINAL|final|sealed
Marc Mutz [Sun, 26 Feb 2012 08:34:36 +0000 (09:34 +0100)]
syncqt: parse classes that use Q_DECL_FINAL|final|sealed

I've introduced a variable $post_kw (post-class-keywords) that
contains the patterns which are expected after a class name.
This variable is used both for a negative look-ahead assertion
in the class-name capture (so the regex doesn't parse the
keywords as the class-name), as well as to carry the parser
over the keywords into the subclass clauses.

Change-Id: Ia534ca01a511e1c773d007f1b0b4f448e8d009d0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoQtGlobal: document Q_DECL_FINAL and Q_DECL_OVERRIDE
Marc Mutz [Tue, 10 Jul 2012 13:30:06 +0000 (15:30 +0200)]
QtGlobal: document Q_DECL_FINAL and Q_DECL_OVERRIDE

Change-Id: I9b292ae3319c30ad878aade4416fb88155465a54
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoQtGlobal: remove Q_DECL_FINAL_CLASS
Marc Mutz [Tue, 10 Jul 2012 13:29:22 +0000 (15:29 +0200)]
QtGlobal: remove Q_DECL_FINAL_CLASS

Now that qvariant_p.h's HasIsNullMethod check is fixed
so that it doesn't require Q_COMPILER_DECLTYPE anymore
to be able to deal with final classes, there's no point
in distinguishing Q_DECL_FINAL and Q_DECL_FINAL_CLASS
anymore, so remove the latter.

Change-Id: I31de5b63e7d2e44171a13e928997c946d93e05c9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>