Commit Graph

9248 Commits

Author SHA1 Message Date
Marc Mutz
c2f10f915f 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>
2012-08-30 02:28:51 +02:00
Marc Mutz
6276427438 QString::append: add (const QChar*, int len) overload
Both insert and replace have this overload, so one reason to add it
to append(), too, is consistency. But I can also make good use of
this overload in the the new QStringList::join(QChar) overload, so
it's actually useful in its own right.

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

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

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

Change-Id: I72926debbc6f5b5cb10b8aa0b2a2a916a04db946
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
2012-08-29 16:53:00 +02:00
Samuel Rødal
f3b45ffa61 Added OpenGL example and documentation.
Change-Id: I2d9d4e52caf0a39fef9648d8a9e83a0c1328f650
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2012-08-29 16:53:00 +02:00
Andy Shaw
49c251e054 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>
2012-08-29 16:53:00 +02:00
Jason Barron
48955161b4 Document obsolete functions in QImage to silence qdoc errors.
Change-Id: I78f3335e5c088641c56d5e682425c7e4b26b7d3e
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-08-29 16:53:00 +02:00
Jason Barron
a39e78710d 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>
2012-08-29 16:53:00 +02:00
Brendan Long
860f95946b Add support for explicit TLS 1.1 and 1.2
Add SslProtocol enums TlsV1_1 and TlsV1_2 and use the appropriate OpenSSL
methods when they're selected (TLSv1_1_client_method, TLSv1_2_client_method,
TLSv1_1_server_method and TLSv1_2_server_method). This allows us to
explicitly use TLS 1.1 or 1.2.

Task-number: QTBUG-26866
Change-Id: I159da548546fa746c20e9e96bc0e5b785e4e761b
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-08-29 14:22:54 +02:00
Thomas McGuire
a135d87a0f 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>
2012-08-29 14:18:48 +02:00
Marc Mutz
7e21ba6845 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>
2012-08-29 14:16:45 +02:00
Marc Mutz
e8963749a7 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>
2012-08-29 14:15:58 +02:00
Marc Mutz
b2edd830b1 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>
2012-08-29 14:14:46 +02:00
Marc Mutz
462a266edf 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>
2012-08-29 14:14:17 +02:00
Frederik Gladhorn
e0d3874525 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>
2012-08-29 14:12:06 +02:00
Sergio Ahumada
b6a4e66ffb test: Mark tst_qtextboundaryfinder::generateDataFromFile() with internal build
This function only makes sense on a developer build. In non
developer-builds you get:

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

Change-Id: Id1bda2d27b00048f7401606959b566a59c05b38d
Reviewed-by: Toby Tomkins <tjtomkins@gmail.com>
2012-08-29 14:12:03 +02:00
Frederik Gladhorn
3d13156025 Let qdoc respect excludedirs for examples.
Change-Id: I01063b38122aea3615801ff013c8c4a1589327fc
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-08-29 14:12:00 +02:00
João Abecasis
b856c2f8b4 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>
2012-08-29 14:11:59 +02:00
João Abecasis
1cd85c541f 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>
2012-08-29 14:11:11 +02:00
Jon Trulson
5b9edbf037 Revert "Fix transformation in eglfs backingstore"
This reverts commit 12491f35bb.

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>
2012-08-29 14:09:13 +02:00
Jing Bai
6210b2018a 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>
2012-08-29 14:07:39 +02:00
Mark Brand
4692432b61 documentation: grammar nitpick
Change-Id: Ibf16731f04f2c53adeff1b8b1fcc6f1555e3613d
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Bill King <bill.king@nokia.com>
2012-08-29 14:04:09 +02:00
Christoph Schleifenbaum
e1f617128c 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>
2012-08-29 12:48:10 +02:00
Thiago Macieira
c0a43591dc 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>
2012-08-29 12:37:41 +02:00
Lukas Geyer
819d0203e6 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>
2012-08-29 07:57:01 +02:00
Konstantin Ritt
9f561f8a41 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>
2012-08-29 07:56:50 +02:00
Lukas Geyer
f61d02deea 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>
2012-08-29 07:56:40 +02:00
Denis Dzyubenko
32efe589a3 Removed extra detach calls from QJsonArray::takeAt
Change-Id: I5711ec6b03e3979eca61f62004a7c6f0eaae79e0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-29 07:56:01 +02:00
James Turner
d2864ffcc0 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>
2012-08-28 23:34:25 +02:00
Frederik Gladhorn
823da2d308 Fix warning when compliling with -Wconversion.
Change-Id: I90bf9f9a1860cabb67bc92599e7ccce94496d134
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-28 23:34:25 +02:00
Frederik Gladhorn
21c2e780b1 Fix doc errors.
Change-Id: I38d01d3b5d2b9b15edd389ea17142bd75f00e135
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
2012-08-28 23:34:25 +02:00
Frederik Gladhorn
9a13bffa29 Move address book example images to proper location.
Change-Id: Ib106445c7a68fb1a1fd2d2c6d568681d83b712c9
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-08-28 23:34:25 +02:00
Frederik Gladhorn
58e4239bb2 Add missing examples from doc repo.
Change-Id: I145ae05a5e7348740f858bd2bdcb8d21d7a90d22
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-08-28 23:34:25 +02:00
Frederik Gladhorn
64dd7a6bfe doc: fix links
Change-Id: Ifb6363e35c5317b6b1d9fd5e53079b30753f0666
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
2012-08-28 23:34:25 +02:00
Frederik Gladhorn
b51efc3297 Fix qdoc link.
Change-Id: I65e58351737b5628ac8c5dfe36a14b898076d690
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
2012-08-28 23:34:25 +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
f92f5f3ff0 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>
2012-08-28 21:17:20 +02:00
Frederik Gladhorn
e7dfdb1211 Find example images for widget docs.
Change-Id: I958031b3ececa953c73d7792900f271f4a19803e
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-08-28 21:07:56 +02:00
Frederik Gladhorn
6321b5847a 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>
2012-08-28 21:07:51 +02:00
Frederik Gladhorn
a92c254c45 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>
2012-08-28 21:07:46 +02:00
Frederik Gladhorn
76420e2123 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>
2012-08-28 21:07:40 +02:00
Oswald Buddenhagen
3db9344f04 beautify string operations
Change-Id: I895a1ae26ee0c884c404bf585261d1a7e8a8242c
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-08-28 20:48:13 +02:00
Oswald Buddenhagen
996bbcd78b micro-optimize: use POD-initializable lists of variable names
Change-Id: I3732fef509b358949ef90002dbfc1960360afef8
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-08-28 20:48:07 +02:00
Oswald Buddenhagen
7251683085 remove unused checkMultipleDefinition()
Change-Id: I533c2091333942f145063ad04f4420b7a2de0a37
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-08-28 20:48:03 +02:00
Oswald Buddenhagen
7033560e54 remove dead variable assignments
Change-Id: I032e9116ca1b7250497f56ea26103f2173f0fc09
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-28 20:47:55 +02:00
Oswald Buddenhagen
8a879a6148 de-duplicate code
Change-Id: Ic3f2bfeb5a16da86b1cd471b55dfc79f12dfadee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-28 20:47:11 +02:00
Peter Kümmel
5408225286 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>
2012-08-28 19:55:03 +02:00
Stephen Kelly
a861e7ea14 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>
2012-08-28 18:30:57 +02:00