Commit Graph

14802 Commits

Author SHA1 Message Date
Stephen Kelly
f69ace7341 QVariant: Make it possible to extract a QObject* from a wrapper without conversion.
Change-Id: I3a054d87d12e08d72dd4c77b6d467dc63f9a2231
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-05 13:01:46 +02:00
Stephen Kelly
d1a8623ecb QVariant: Don't crash when doing user-defined conversion to QObject*
The destructor of the ConverterFunctor calls unregisterConverter. If
the instance is static (as it is in qmetatype.h), then this method
can be called after the QGlobalStatic has already been destroyed.

Change-Id: I33b70734cbe09dfa888e887280c349e43ad1b855
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-05 13:01:39 +02:00
Stephen Kelly
cc594d2064 QVariant::canConvert: Use the old type when checking for QObject* conversion.
Change-Id: I8450c74ecfdeee96e73b82438c5ef83c3acf4444
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-05 13:01:33 +02:00
Stephen Kelly
e9a69c3ba9 Simplify the smart pointer metatype template
Don't use ## concatenation to create an identifier. That won't
work for types in namespaces:

 Q_DECLARE_SMART_POINTER_METATYPE(QtPrivate::FutureSmartPointer)

Change-Id: I876ea93d817724005efc28413f09c01623c2a7a1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-05 13:01:27 +02:00
Jerome Pasion
3062cea229 Doc: Get QDoc to list the QT variable for namespaces.
Task-number: QTBUG-32172
Change-Id: Id774b5d5036661a6f6b56b9c68f089031288eacc
Reviewed-by: Martin Smith <martin.smith@digia.com>
2013-09-05 11:18:59 +02:00
Oswald Buddenhagen
40925fe74a fix warnings - qprocess needs a qcoreapp instance
Change-Id: Icf36c2e76595d8f2ed470da13e78c465cfa962f9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-05 11:18:59 +02:00
Oswald Buddenhagen
78d6c9c002 remove redundant forwardedChannels() test
forwardedChannelsOutput() actually tests forwarding. also having the
older test only eats CPU cycles.
rename the new test to the old name for clarity.

Change-Id: I16a326c8692bb594d7df7897bc53d31b23c66d90
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-05 11:18:59 +02:00
Oswald Buddenhagen
4028f54213 make error reporting in forwardedChannelsOutput test more useful
Change-Id: I0350ddfd6740d2a2cd3e0f49220cdaa83b854abf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-05 11:18:59 +02:00
Oswald Buddenhagen
60f8b2f4d0 micro-optimization/-clarification
close stdin and let the process finish right away instead of first
waiting for a reaction (which is not supposed to come) and then
finishing.

Change-Id: Ifcf200eead5ed95217843e105f9d2dbb5398d646
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-05 11:18:59 +02:00
Oswald Buddenhagen
60faa0f70b remove redundant condition
ForwardedChannels implies that both stdoutReader and stderrReader are null.

Change-Id: I9d5f02d3a1eac62316a6016b90c612d716ecaafc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-05 11:18:59 +02:00
Gunnar Sletta
0cf79e47da Remove undesired pixel padding of glyphs on windows.
The excessive padding has serious performance implications throughout
Qt and need to go. The original reason for having them was to fix
issues with GL text rendering and issues with unspecified OpenType
fonts. There have been several other changes to the glyph cache
since then and neither of the issues can be reproduced today.

Change-Id: I6de67598a079c296daf48be07cc5c2d67768c384
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-09-05 09:48:22 +02:00
Gunnar Sletta
35bc3dc45a Rely solely on alphaMapBoundingBox in QTextureGlyphCache
We're currently adding a lot of transparent pixels to the cache,
wasting both memory and cpu cycles while drawing. AlphaMapBoundingBox
was introduced to return the exact same bounds as the alphaMapForGlyph
function so we should only rely on this instead of adding arbitrary
padding and margins all over the place.

Windows still has an arbitrary +4 in the its drawGDIGlyph() which
means batching will not work on windows, but at least now
other platforms do not need to suffer.

Change-Id: I714903fa195004400c09c3bf6570e46179775f09
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-09-05 09:48:22 +02:00
Richard Moe Gustavsen
0b481f28d1 qimagereader: fix build on iOS
Change-Id: Ia928e449ecec49988e0af69da0a7aded5bf36871
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-09-05 09:48:22 +02:00
Richard Moe Gustavsen
acdf946e63 qpluginloader: fix static build (on iOS)
Since the function locatePlugin is unused when
building Qt statically, the build fails on
iOS. This patch will ensure that we only define it
for shared builds.

Change-Id: Idf3c3246d3cac94a3c001cc261f326e9a396aa31
Reviewed-by: David Faure <david.faure@kdab.com>
2013-09-05 09:48:22 +02:00
Giuseppe D'Angelo
9fc2c729b4 Make tst_qalgorithms compliant with the Standard
§24.4.1 [iterator.traits] of N3337 makes it *mandatory* to define the
various types

    std::iterator_traits<Iterator>::{value,pointer,...}

for any given iterator.

§24.4.1.2 makes it enough to define them within our iterator class.

Change-Id: I1305c8392d224889b09395e30ecc77b194020a15
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-05 09:48:22 +02:00
hjk
c0df6cbe86 Compile fix in qxcbwindow
There was a error: narrowing conversion of 'Myns::XEMBED_VERSION'
from 'unsigned int' to 'long int' inside { } [-Werror=narrowing]

Change-Id: I1e155870b0b632bfe5ffa9deac69c4f151f5aa23
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-05 09:48:22 +02:00
Thiago Macieira
6b7a841cb4 Fix Clang 3.3 warning on using an undefined inline function
Clang doesn't like forward-declared inline functions.

 qmetatype.h:70:29: error: inline function
      'qMetaTypeId<QtMetaTypePrivate::QPairVariantInterfaceImpl>' is not defined [-Werror,-Wundefined-inline]
 inline Q_DECL_CONSTEXPR int qMetaTypeId();
                            ^
 qmetatype.h:1463:30: note: used here
            const int toId = qMetaTypeId<QtMetaTypePrivate::QPairVariantInterfaceImpl>();
                             ^

Change-Id: I1454af5cce56512f0b3d63cfaf51a536207fc511
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-05 09:48:22 +02:00
Stephen Kelly
3f6ed5566f Revert "Implement move-ctor and move-assignment-op for QScopedPointer"
This reverts commit 5b9006bbdb.

Also revert "Doc: Enable documentation for QScopedPointer's rvalue ref functions"

This reverts commit 5f8416ec65.

Adding a move contructor to QScopedPointer makes no sense, because moving
means 'escaping the scope', which breaks the fundamental point of
QScopedPointer.

Change-Id: I4ac1b108bf199af6e436fa1629aa2d3b93c27724
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-05 08:20:19 +02:00
Corentin Jabot
5a02d30a78 Add an advisory interruption mechanism to QThread.
To ease interruption of long running tasks, a new method
QThread::setInterruptionRequested() can be called.
The task can check QThread::isInterruptionRequested()
and act upon it by stopping itself.

These methods are designed to replace the use of a global variable
and other hacky ways to stop a task running in another thread.

Change-Id: I17622dd60d2262078210e7e4294ad6c53a6dc179
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-05 08:20:18 +02:00
Thiago Macieira
34195aa6cb ICC supports __builtin_unreachable(), so use it
__assume(0) is not strong enough in some cases.

Change-Id: Ifac42a58af891d636e3e0b2fa476da787bd0d1ce
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
2013-09-05 06:29:35 +02:00
Tor Arne Vestbø
eb614cf7e7 Don't assume processEvents(WaitForMoreEvents) will process timers
The WaitForMoreEvents flag only guarantees that we will process _some_
events -- either if they are in the event queue already, or by sleeping
and then waking up to process an event. This event might be a system
event, not the timer firing, so a single call to processEvents() is
not enough to guarantee that the timer has fired. Instead we do a
Q_COMPARE with a timeout, where we continiously process events until
we see that the timer fired.

Change-Id: I5dc04377f04190f3505be22e877af73d11b7547d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-05 02:32:57 +02:00
Richard Moe Gustavsen
78f3f35a8b qdatetime: fix build on iOS
Change-Id: I7c6225c54a863f29aa747caf2f57303b2bf6c398
Reviewed-by: John Layt <jlayt@kde.org>
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-05 00:50:12 +02:00
Giuseppe D'Angelo
b4567a7bf2 Remove qFill usages from the generic unix theme
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I23719468e22e256caad977fce6c908059d4073ca
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-09-05 00:49:24 +02:00
Giuseppe D'Angelo
182bfb21b7 Remove qFind usages from QLinkedList
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I00f5a2bf96e969b85d63479bab6497d6e1bd17b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-04 22:37:00 +02:00
Giuseppe D'Angelo
5700071ac3 Remove qCopy from QVarLengthArray
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I854f64ebd6d83718b1bcb3c70a1697e38243296c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-04 22:36:39 +02:00
Martin Gräßlin
47d79be39a Enable XSync extension also for KWin
KWin supports the XSync extension. Since the check got added the XSync
implementation in KWin got reworked (release KDE SC 4.8).

Change-Id: I15c37fe4dd5501ca107b90a07ae8d70295ffaeda
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-09-04 20:18:53 +02:00
J-P Nurmi
7e7d1f5a79 Introduce QAbstractTextDocumentLayout::unregisterHandler()
Required for QQuickText & friends to implement image resource handling
in a clean way - to get rid of QQuickTextDocumentWithImageResources and
eventually make QQuickTextEdit's document interchangeable.

Change-Id: I12305b68065a5990997ca4a47821fd29e0e17476
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-04 18:52:29 +02:00
Giuseppe D'Angelo
770532d058 Remove qSort usage from QIODevice
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: If9fbcaf714f10659a3571f9e55ab913a85538038
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-04 18:52:29 +02:00
Giuseppe D'Angelo
38b92f5cba Get rid of qSort usages in QDir
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I951a2b9b16fce9d6d29cca0012cdeb06cad79fce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-04 18:52:29 +02:00
Jerome Pasion
b51b3e63a6 Doc: Fixed QDoc's HTML generator to avoid creating blank pages.
-The qdb->findModule() call creates a module node even if the module
 name is empty. This creates the extra module.html pages in some
 doc projects.
-The fix is to create a condition for calling findModule()

Task-number: QTBUG-32990
Change-Id: I6c1d1c53f3814ea483df2cd05b8d39dc14b0fb7b
Reviewed-by: Martin Smith <martin.smith@digia.com>
2013-09-04 18:52:29 +02:00
Jerome Pasion
096499f69a Doc: Fixed information about the default modules when using qmake.
-Qt GUI and Qt Core are included by default
-Added entry about disabling "gui" in the .pro file
-Information placed in snippet files

Change-Id: I1c70dcac9ca2d443e9f658e2a27727d24a25cae1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-09-04 18:52:29 +02:00
Milian Wolff
63b5082ea8 Unhide QObject::parent() from QAbstract{Table,List}model.
Both overwrite QAbstractItemModel's parent taking a QModelIndex which
hides the QObject::parent() method. This must be explicitly forwarded
like e.g. QAbstractItemModel is doing.

Change-Id: I6149ae365cd8467248f4ca79a3cb898e62068b10
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-04 18:52:29 +02:00
J-P Nurmi
dc7972b261 Fix qt_pixmapToWinHICON() not to return invalid HICON for null pixmaps
Change-Id: Ieda923bf27514a3daa8a5de7836511ab32346260
Reviewed-by: Ivan Vizir <define-true-false@yandex.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-04 17:24:51 +02:00
Paul Olav Tvete
b855e57804 Fix layouts with expanding items with maximum size
Layout items with a Preferred size policy would be treated as fixed
size if they were in the same layout as an Expanding item (or one with
a stretch factor).

This occurred e.g. if a layout was configured similar to this:
1. One item with ExpandFlag/stretch but with a maximumSize set,
   e.g. (100x100).
2. Another item with 'just' GrowFlag, and a maximum size bigger than
   its  size hint.

If the above layout was resized to e.g. (200x50) it would cause the
expanding item to correctly get the size (100x50), but the 'growing'
item would not stretch beyond its size hint.
Instead, it would distribute space around both items, behaving as if
the 'growing' item was fixed'.

The expected behavior is to continue to grow the 'growing' item after
the expanding item has reached its size limit.

Task-number: QTBUG-33104

Change-Id: Ie410653d905f7ca4d702528dafb269f30a0e4f61
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-09-04 15:09:47 +02:00
Richard Moe Gustavsen
8b7a8efe66 QPluginLoader: add 'staticPlugins' function
Currently there is no API to extract the meta data
from static plugins. This is needed in e.g QtDeclarative
for loading static module plugins.

This patch moves the 'staticPlugins' function from
QLibraryPrivate into QPluginLoader, and makes it public.
As such, we now also export QStaticPlugin.
Since an application developer cannot do much with raw
metadata, we add a new function
QStaticPlugin::metaData() that returns the QJsonObject
for the plugin. The old metaData function is
renamed 'rawMetaData'.

Change-Id: Idb0bf9ad8ebb13340565512e1998b26e762a357e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-04 09:38:35 +02:00
Robin Burchell
500deb9a08 eglfs: Check for a valid window handle before attempting to retrieve resources.
In the case of a window that is not yet shown, or destroyed, there
will not be a native handle, and this would crash.

Change-Id: Ib8c1a4490d82654d04073dac240eaa1275cbc1b0
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2013-09-04 09:38:35 +02:00
Caroline Chao
afce2b528c Fix QSpinBox size calculation problem with stylesheets
Problem caused by change a317ee0a6f

Task-number: QTBUG-31602

Change-Id: Ie8948445a58f51946f21d567ba91f9f10b848f8b
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2013-09-04 08:01:11 +02:00
Thiago Macieira
7012db159b Enable -Werror for all of qtbase
This change applies to all qtbase modules, tools and applications. It
does not apply to examples or unit tests.

This change complements the changes done to mkspecs/qt_common.prf
(especially 043b809197 and
ebfd85a499). It enables -Werror checking
in qtbase for GCC 4.6-4.8, Apple clang 4.0-4.2 and ICC 13.0-14.0.

Change-Id: I6d29a7a1b3716960a149409f551363385991714c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-09-04 01:50:10 +02:00
Thiago Macieira
7ac6ce2133 Fix ICC warnings about functions declared but not used
Added Q_DECL_UNUSED for the function used in Q_ASSERT; removed the
functions that really weren't used and added the #ifdef for the
function that was only used under #ifdef.

qmetaobjectbuilder.cpp(93): warning #177: function "priv" was declared but never referenced
qobject.cpp(2349): warning #177: function "check_and_warn_compat" was declared but never referenced
qpathsimplifier.cpp(141): error #177: function "<unnamed>::Rational::isValid" was declared but never referenced
qtextengine.cpp(2584): error #177: function "<unnamed>::QScriptItemComparator::operator()(const QScriptItem &, const QScriptItem &)" was declared but never referenced

Change-Id: I89a140d59211f10ecd88d751f0bcc0ea2fedff7f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-04 00:05:12 +02:00
Thiago Macieira
f62b05ccf1 Fix -Wno-error=deprecated for GCC and Clang
Commit a7ba0ad93e introduced the -Wno-
language. The warning about deprecated functions, variables or types is
-Wdeprecated-declarations.

Change-Id: I6d269851afefc6a3fc3bf6599c3c702eb164245e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-09-04 00:05:12 +02:00
Samuel Gaist
85fc95f346 Add QPA session manager
The QSessionManager doesn't allow customization in platform independent
way. The new QPlatformSessionManager aims to change that. Now the
QSessionManagerPrivate has a new QPlatformSessionManager member to
forward all the calls to QSessionManager's functions. If no platform
manager is present, the current behavior is used.
QPlatformSessionManager mimics the current QSessionManager behavior.

A new factory function has been added to QPlatformIntegration to return
a QPlatformSessionManager

Task-number: QTBUG-28228
Change-Id: Ida7ac16a8f5303df5014fcb67878170ebdb37203
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-09-04 00:05:12 +02:00
Rafael Roquetto
a871f224f8 Fix compilation on BlackBerry Playbook
Implement pps_decoder_is_integer() function, which is not present on Playbook
by default.

Change-Id: Iff0974f3f178bf9c39aa05b4e1be87b2b7a9344e
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
2013-09-03 22:21:49 +02:00
Giuseppe D'Angelo
10e690506e Remove qSort usage from rcc
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I09dc82b7f9509f73c7b8b9c16a08fefb8ca0b8a5
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-03 22:21:02 +02:00
Thiago Macieira
e82c7a8abf Give QWindowsNativeFileDialogEventHandler a virtual destructor
GCC complains about this class having virtuals and no virtual destructor.

C:/Qt/qt5/qtbase/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp:750:20: warning: deleting object of polymorphic class type 'QWindowsNativeFileDialogEventHandler' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]

Change-Id: I7494fce4bb71ed65954226259fa65fdc507ca403
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-09-03 17:29:20 +02:00
Andrew Knight
5bf16380d2 QColorDialog: wrap setCursor calls in #ifndef QT_NO_CURSOR
QColorDialog mistakenly assumes setCursor will work everywhere.

Change-Id: Ia5e513f6825c931ce42276ea2eb581e049c5b41a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-03 14:31:06 +02:00
John Layt
5ec1c7727b QDateTime - Add api for Time Zone Abbreviation
Add a new method to return the time zone abbreviation for the current
time spec.  For LocalTime this is the abbreviation returned by mktime.

This new method will later be used in changes to the date formatter
and QTimeZone.

Note this change does not implement WinCE support.

[ChangeLog][QtCore][QDateTime] Add method timeZoneAbbreviation() to
return effective time zone abbreviation.

Change-Id: I265a5e96c72eb7236974f80f053f1fb341e3c816
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-03 14:31:06 +02:00
Sergio Ahumada
89ee4a50b0 iOS: Skip qtserialport module
This module doesn't build for iOS yet

Change-Id: I625b27a39637c0b816a9136d3eabfe2c0073f108
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-03 14:31:06 +02:00
Friedemann Kleint
835a7bc0a0 Skip tst_QGraphicsProxyWidget::popup_subwidget on Windows.
Task-number: QTBUG-33213
Change-Id: I1c8daa3a859f9d0d760054f1d8934abd84f62f0d
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2013-09-03 12:48:03 +02:00
Andrew Knight
a2643e2b17 Fix test compilation when QT_NO_CURSOR is defined
The implicitConstruction() test case will fail to compile if QCursor is
unavailable.

Change-Id: If26743995505a48da648a2fa2a498debec91c933
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-03 12:05:59 +02:00
Andrew Knight
cd582f8410 Add QT_NO_PROCESS guards in tests where they are missing
A handful of tests lack QT_NO_PROCESS guards, making them non-compilable
on Qt builds with no QProcess support. This commit does not change
QProcess-specific tests, which should be left out of the build using the
.pro file mechanism.

Change-Id: Iac8562428abc1f59ccbb23bf5c3a919785e41f12
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-03 08:42:24 +02:00