Commit Graph

14771 Commits

Author SHA1 Message Date
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
David Faure
5bd6a4b71a Fix typo in qwaitcondition_unix.cpp
Change-Id: Ifc1fdaaa05275b6f68a868a2fc8ccc332e5355ce
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-02 23:13:59 +02:00
J-P Nurmi
75823d9c0b Fix QAbstractTextDocumentLayout::registerHandler() argument name
Use the same argument name than in the header and docs -> no longer
need for the \fn command in the docs either.

Change-Id: Id84cb9298e0cb1b61df704603590d86f25323f2d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-09-02 19:39:26 +02:00
Oswald Buddenhagen
cd74325998 don't install non-framework headers in addition to frameworks, take 2
the redundancy is entirely unnecessary at this point.
the cmake problem that prompted the revert has been fixed long since by
commit 4f5f9331d9.

This reverts commit 215f137e29,
thus restoring 6d61dfdbb74a2055438b999c6962f89cc3388eea..

Change-Id: I94749dc18d924163e9c9add500078d88ccd00ffc
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-02 17:58:28 +02:00
J-P Nurmi
eee062b1b9 Fix typo in QTextDocument::contentsChange() arguments
Change-Id: I2a9a130e77d87041a6551fea1056f3480d45e548
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-09-02 17:58:28 +02:00
Andy Shaw
74a0cb417f Make sure QPrinter::Folio maps to the right paper size on Windows
Since there are two different Folio specifications (Adobe and Microsoft)
then we need to ensure we consistently use the same one across all
platforms. Therefore we change the one on Windows to match the
corresponding standard paper and add a note explaining how to get the
DMPAPER_FOLIO size.

Change-Id: I0f20ba5598ef8f680125fcd33dbc6924bd521d75
Reviewed-by: John Layt <jlayt@kde.org>
2013-09-02 16:26:21 +02:00
Yoann Lopes
040fa04882 Added applicationState() to QGuiApplication.
We only had the QApplicationStateChangeEvent to know about the
application state. Added a function and a signal to offer a more
convenient way to query the current state.

Change-Id: I926aac0b3b53bd285df5825aff5b4c37ae863d03
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-09-02 16:26:21 +02:00
Alex Blasche
e040a27331 Add qdoc ignore tag for new QtPositioning API.
Change-Id: If725ac4e523d56a8dc274f8d6b53c0c34064ca06
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-02 16:26:21 +02:00
Thorbjørn Martsum
0bcfa3d5d9 QHeaderView - add maximum section size
When we auto resize it is handy to be able to limit the maximum
size (just like the minimum size).

[ChangeLog][QtWidgets][QHeaderView]A maximumSize for sections
has been introduced. The maximum section size is by default
the largest possible section size which in Qt 5.2 has been
limited to 1048575 pixels.

Task-number: QTBUG-4346

Change-Id: Ida9cbcc11bd5c4498e319df2e6379c69a7033c04
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-02 16:26:21 +02:00
David Faure
8f4b6f1cd1 item delegates: fix clicking on tristate checkboxes.
QCheckBox cycles through the 3 states, but item delegates didn't
do that.

Change-Id: Iad1e464341033ca357925fe8064f53bb584459f4
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-02 16:26:21 +02:00
Sergio Ahumada
0a3eb0fe44 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-09-02 16:26:21 +02:00
Tobias Hunger
cee7380c04 QStyleSheetStyle: Fix (!a != b)
The '!' binds to a, so the comparison is not what is expected.

Change-Id: I9192d16e901a9ba6dd13625be544cce6b2fd78c6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-02 16:26:21 +02:00
Tobias Hunger
275c940340 QDoc: Fix (!a == b) bug
This is (!a) == b which is not what is intended here.

This exact bug was fixed in a couple of other instances of the QmlJSParser
(in QtCreator and Qt itself) by now.

Change-Id: I46a50153d7c349f21e0a888e2e3b4c4fa65c27c0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-02 16:26:21 +02:00
Andrew Knight
3097129192 Fix remaining use of QTEST_NOOP_MAIN
QTEST_NOOP_MAIN was removed in Qt 5, but was still in the source of the
QProcessEnvironment auto test.

Change-Id: I0048c330c9d4e99c46192cc05ffd3b77d404fb6d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2013-09-02 14:59:02 +02:00
Andrew Knight
f6a7092309 Fix possible build failure in windowcontainer example
The windowcontainer example utilzes the openglwindow example, so it
must also check that OpenGL is available.

Change-Id: I7ecb372cfd533bb56effe7c61ebee9bd53de4c54
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-02 14:59:02 +02:00
Andrew Knight
a05a3f6550 Remove qguieventloop from auto tests if network is unavailable
This test relies on network support.

Change-Id: I8918a7fe2f411fcaa2e4300486b8a66c63898221
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-02 14:59:02 +02:00
Andrew Knight
2e75cd55db Remove qopengl auto test when Qt is not configured with OpenGL support
Change-Id: Id2fbf9308c5dbce5e7778f0d841cc8bda784a80f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-02 14:59:02 +02:00
Tobias Hunger
4b7cd57719 QDbus: Fix (!a == b) comparison
! binds to a, and that is wrong here.

Change-Id: I746d2b82bbd03635b3aa06abb0c5566f84a03128
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-02 13:07:44 +02:00
Morten Johan Sørvig
8fc97fdfc7 Revert Mac event loop changes.
"Make QGuiApplication::exec() run within NSApplicationMain()"
"Make Qt process native and timer events on Cocoa applications"
"Cocoa: Fix QFontDialog, QColorDialog auto-tests"

This reverts commits
1e14762b8d
e4b2a0b4ba
df7944e7d7

Change-Id: I80b65b5ee0297b090f807bd420664233dfc44f7b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-02 13:07:35 +02:00
Tobias Hunger
585758389c Graphicsview: Simplify code
order is either Ascending or Descending (0 or 1), so this comparison is
unnecessary.

Change-Id: Ieceacf18f1bf3c7a7555205a140b738daa92bd04
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-09-02 13:07:21 +02:00
Thiago Macieira
1b5848957b Fix last warning of qtbase with GCC.
qlistview.cpp:1836:6: error: unused parameter ‘step’ [-Werror=unused-parameter]

Change-Id: I8c2d16bd794204adafcf2dc049c04601506e7734
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-08-31 23:03:09 +02:00
Thiago Macieira
260a983052 Improve QBitArray's construction performance a little
Ask for an uninitialized byte array, since we're about to memset(3) it
anyway. And don't overwrite the initial byte either.

Change-Id: I2caa2ef395ad5684416e6cd336c0444de7787b5d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-08-31 23:03:03 +02:00
Thiago Macieira
e13e90fb55 Add a construction note on why QBitArray has a +1 everywhere
It took me several minutes reading the code to figure out why it was
there. It wasn't immediately obvious.

Change-Id: Ic36b3fd24ce84a1b08c73986d3b7ab8a5bfff133
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-08-31 23:02:59 +02:00
Thiago Macieira
873ae53d47 Fix corner-case counting of bits in QBitArray::count(bool)
This actually looks very wrong. First, it would try to read bits for
len == 0, which means it was actually reading the implicit NUL from
QByteArray (so valgrind would never catch the error).

Second, there was a corner case for testing the 8th bit (bit 7) in the
last byte. For len == 8 or 16 at the beginning of the last loop, it
would read bits[len / 8], which is again the implicit NUL from
QByteArray.

Compare to testBit (simplified):
    return d.constData()[1+(i>>3)] & (1 << (i & 7)) != 0;

Task-number: QTBUG-11625
Change-Id: Idb361163de596b629cab42f2367ddd09456c2a98
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
2013-08-31 23:02:54 +02:00
Thiago Macieira
b4de54fcef Remove workarounds to old GCC bugs we had encountered on IRIX
The check is bogus anyway. It was bogus when it was added. The bug is
not because of "GCC on IRIX", it's simply a GCC bug and was probably
tied to some GCC versions. It should have been reported and followed up.

I don't even remember what GCC versions we had on the IRIX machines
(plastkrakk, I can't remember the other two machine names). But I could
bet they were GCC 3.4 or 4.0.

Change-Id: I84ce4e1ad68bb0520b63c210f841e0c604dbd03a
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-08-31 23:02:38 +02:00
Tobias Hunger
0f8d8f4127 QPainter: Fix (!a == b) bug
The ! binds to a only, which is most likely wrong here.

Change-Id: I4aa09407a8acc68f97bef474781193774e4a7597
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
2013-08-31 14:18:59 +02:00
Oswald Buddenhagen
a1133b215a add QProcess::nullDevice()
Change-Id: I15273fa3f3ba323a835350153f2a20404f12420b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-30 21:16:55 +02:00
Thorbjørn Martsum
2c916d47ef QTreeView - fix next focus when there is no current index
Before we went through non hidden indexes, but we never considered
the visual order. This patch fixes that issue.

Though it was wrong before, it probably never was a big problem
since it was unlikely that the tree (on logical index 0) was
swapped or hidden, but

658e42e77a

makes it more likely that problems with wrong focus could occur.

Change-Id: Ic7b6cd2df1f8638be1a7c9e6df27f428685869fc
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-08-30 21:07:46 +02:00
Konstantin Ritt
427037c75d [2/2] Update bundled HarfBuzz-NG sources up to 0.9.20
Change-Id: Ia8ef11fce9326ed708bf2972514b46b9d105ad9e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-30 20:26:03 +02:00
Konstantin Ritt
029b68ce92 [1/2] Update bundled HarfBuzz-NG sources up to 0.9.20
Change-Id: I8649bbe608cb2f79c721c900c03fd0139a8c0cd1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-30 20:24:43 +02:00
Tobias Hunger
fc9c5ffc5f Fix warning about class/struct mismatch
Clang does not like this:-)

Change-Id: I9c65025d99d31b5ef1314dadf90eef02d23eacb0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-08-30 20:24:35 +02:00
Topi Reinio
5f8416ec65 Doc: Enable documentation for QScopedPointer's rvalue ref functions
Make the documented QScopedPointer functions that take rvalue
references visible in the documentation.

Task-number: QTBUG-32675
Change-Id: If65af91d9379a6c0486e43c33434cca8505fc5c3
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-08-30 09:22:25 +02:00