Commit Graph

6310 Commits

Author SHA1 Message Date
Kai Koehne
c0d249019b Allow qDebug output to be configured by qSetMessagePattern()
Add qSetMessagePattern() to configure the default
message pattern. This one can still be overwritten by setting the
QT_MESSAGE_PATTERN environment variable.

Without this method, there's actually no way to change the
default output programatically. Since QT_MESSAGE_PATTERN is
evaluated when the first message arrives, setting it via e.g. qputenv
might have no effect/be too late.

Change-Id: I115e0c30606f128fdbf5c169a951ffa2a6a48517
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-24 17:12:46 +02:00
João Abecasis
e92e5fda44 Migrate QString over to QArrayData
Change-Id: Ieadc60523a2bef61a088920576c65c720b11bfb9
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-24 13:51:37 +02:00
Thiago Macieira
f02e1d6d8e Move QGestureEventPrivate's content to the main class
QEvent now checks that the d pointer is unused.

Change-Id: Ib0aa97d1692ea55324c4c6f133ffdd5a221f1680
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-23 23:26:44 +02:00
Thiago Macieira
d631c31235 Make QStringLiteral and QByteArrayLiteral always return the real types
Up until now, the macros would return an internal type that contained
the pointer to the data. This breaks code that tried to use the macros
with operators, like QStringBuilder but also when writing:

     QStringList() << QStringLiteral("a") << QStringLiteral("b");

This change seems to work fine now and I can also verify that this
works:

     const auto str = QStringLiteral("Hello");

Even though it creates a QString, which is non-POD and non-constexpr.

Change-Id: Iaf82af9bea4245513a1128ea54f9d2d3d785fb09
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-23 23:26:28 +02:00
Thiago Macieira
33371c016e Add unit testing for the qdbusxml2cpp tool
I have not added tests for warnings or other failure to input. This
tests only proper output for the moment.

Change-Id: Ie01fd2a78adfa57c27bf288a08cd44ae82f51241
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-04-21 01:18:56 +02:00
Thiago Macieira
80ad5938ea Stop using QEventPrivate::d in QWindowStateChangeEvent
We can add a boolean and avoid using the d pointer (which QEvent now
checks to be unused).

Change-Id: I7367d5410d10ed06441fe9037cac0e3473d62498
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-20 10:50:28 +02:00
Kai Koehne
d9a1c2dff8 Logging: Change arguments of message handler to avoid conversions
Introduce a new QtMessageHandler that takes QString instead of
char *: This avoids converting to local8bit , only to convert it back
to utf16 for Windows.

The old QMessageHandler is kept for a transition period, but will
be removed before Qt 5.0.

Also fix qEmergencyOut (that is called in OOM situations) to not rely
on the default message handler.

Change-Id: Iee0ce5838f97175c98788b847964273dd22d4a37
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-20 08:37:06 +02:00
Thiago Macieira
a3f90fd44f Remove private classes in QEvent-derived classes.
QEventPrivate doesn't exist, so these classes were technically abusing
the d pointer.

Move the contents of the private classes into the main event classes.

Change-Id: If2e894c1fa05f468221a0b43f3ebdf90769298eb
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-19 23:42:26 +02:00
Thiago Macieira
275945f144 Add an assertion to deleteLater() before it modifies QEvent::d
The deferred deletion functionality stores the event loop level
nesting count in the QEvent d pointer. In Qt 4, this d pointer was
not usable because we forgot to add a proper copy constructor and
assignment operator to it, so the deleteLater() process stored the
count here safely.

Since Qt 5 now has non-implicit copy methods, the d pointer could be
used in the future. If QEvent uses it, this assertion will
trigger. Note that it doesn't apply to classes derived from QEvent,
though.

Change-Id: I8600c8e9379921e32aca166bc0a6c0b4c4ed799f
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-04-19 12:14:30 +02:00
Jędrzej Nowacki
ff55d64f67 Remove QVariant constructor taking Qt::GlobalColor.
The constructor is wrong, it creates instance of QVariant encapsulating
a QColor instance. QVariant should not implicitly convert data, never.

Change-Id: Idc794ecdecb42d8b53fee3f993bf51ddd43f595d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-19 10:09:39 +02:00
Girish Ramakrishnan
10c88faf79 api: remove QWindow::visible()
The correct api is QWindow::isVisible(). Removing the api
is safe since QWindow is not even released yet.

Only qtdeclarative needed to be fixed with
71c8fe296fe5aa7e79033dd8f5b539852d4276e0.

Change-Id: Ie571ed4802fe89132419e402acdb854446f4578f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-18 21:24:25 +02:00
Girish Ramakrishnan
21102a71ff api: QGuiApplication::inputMethod should be static
Pretty much all methods in QGuiApplication are static.

Also adds documentation.

Change-Id: I96808dd266922432b92fe3962292e4d5b6a8ab46
Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com>
2012-04-18 15:11:13 +02:00
Jędrzej Nowacki
9ecce11261 Remove redundant check in QMetaType::typeInfo
The check was introduced when void was not a fully defined type.

Change-Id: I4df8607999436f8db92be77fc8fd203fc66c2816
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-18 12:16:20 +02:00
Jędrzej Nowacki
ab0bcd0792 Remove redundant checks in QVariant.
QVariant and QMetaType have aligned type naming implementation.

Change-Id: I9eaae1045c492c148e3e9d23f4e04d48272f7ec2
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-18 12:16:09 +02:00
Jędrzej Nowacki
6f0065944d Hide QTypeModuleInfo in a private namespace.
The class is private and shouldn't pollute global namespace.

Change-Id: Ib44473fd72e5a70096eeff1662e88b29263d19c6
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-04-18 12:15:52 +02:00
Friedemann Kleint
7e0beba891 Skip tests toolbar-dialog/widget_window.
To enable merging the api_changes branch.

Task-number: QTBUG-25331
Change-Id: I90d32ca0bd96eed62bae5f01316d6360a3b435c8
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-04-17 10:38:28 +02:00
Sergio Ahumada
16b53b2f0e Merge "Merge remote-tracking branch 'origin/master' into api_changes" into refs/staging/api_changes 2012-04-17 10:38:24 +02:00
Girish Ramakrishnan
2c13dc7482 api: remove QWindow::move
QWindow::setPos is the correct api.

Change-Id: I5439338e9bc6933800d66331f20ce554b017c4fb
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-17 06:19:52 +02:00
Girish Ramakrishnan
f285356e88 api: Fix const correctness of api in QScreen
const was missing in many convenience functions.

grabWindow should not be const since it actually does something.

Change-Id: I0ffa718878d4251c4fb5c34789cf58ebb85cff37
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-17 06:19:49 +02:00
Girish Ramakrishnan
6094197294 api: Make QGuiApplication::styleHints() static
Practically all functions in QGuiApplication are static.

Change-Id: I5948620865c021029a3c04b31901b1110e6c0d27
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-17 06:19:47 +02:00
Jędrzej Nowacki
9b06be8646 Fix tst_qtracebench benchmark.
Default QDataStream version was changed in Qt5, but the test tried to
load an old dumped file.

Change-Id: I49c06c232ec8a27f33c9da345bae4e03cd0c56fb
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-17 06:19:42 +02:00
Stephen Kelly
da7880b0f0 Update parent indexes first with changePersistentIndex.
Otherwise, the order of updating of the indexes will cause
inconsistent results because it will rely on ordering within a
QHash (which is indeterminate).

Task-number: QTBUG-25325

Change-Id: I7d99578c8ee2954b8562dc5aff7dc32e74d41fb5
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-17 00:47:49 +02:00
João Abecasis
76d61af1e2 Make reallocData use QArrayData::AllocationOptions
Growth computations are deferred to QArrayData::allocate, except in the
case of realloc as that functionality is currently lacking in
QArrayData. Since that sits in library code, anyway, it can be changed
later to use a future QArrayData::reallocate.

As it is, reallocData is becoming a model for QArrayData::reallocate
and what it can offer to containers of POD/movable types.

Change-Id: I045483f729114be43e4818149d1be1b333bcbe13
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-16 15:51:20 +02:00
João Abecasis
3111e6d6fa Drop unnecessary assignment
In this branch, !IS_RAW_DATA has already established that offset is
sizeof(QByteArrayData) and realloc maintains the assumption.

Change-Id: Ic160e36d7781d4c4f64a3b2ebec98c9cb605b3eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-16 15:51:14 +02:00
Jędrzej Nowacki
d1f5a85e66 Migrate QByteArray over QArrayData.
For the time being QByteArrayData keeps its independent existence, for
the sake of other modules. Once they have been ported to use the new
initializer macros it can be changed to:

    struct QByteArrayData { QArrayData array; };

Extra braces can then be added to the macros.

With respect to source compatibility, the only concern is with other
modules, as QByteArrayData has already changed in incompatible ways with
Qt 4.x

Done-with: João Abecasis
Change-Id: I044e2a680317431777a098feec8839a90a3d3da3
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-16 15:51:06 +02:00
João Abecasis
78b780b9a1 Remove explicit checks for shared_null/empty
This eases porting to QArrayData and retains semantics. In append() and
prepend() a conditional was generalized so that no work is done if there
is nothing to add.

Done-with: Jędrzej Nowacki
Change-Id: Ib9e7bb572801b2434fa040cde2bf66dacf595f22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-16 15:50:59 +02:00
João Abecasis
2ac4c463af Make QByteArray and QString keep track of terminating null
In conceptual terms, this change increments the Data::alloc member by
one for all strings allocated and maintained by these classes. Instances
initialized with fromRawData retain 0 as the member value, so they are
treated as immutable.

This brings QByteArray and QString closer to QVector, making it possible
for them to reference and share the same data in memory, in the future.
It also brings them closer to QArrayData.

In practical terms all comparisons to the alloc member were changed to
take into account that it also tracks the terminating null character.

Aside from the increment in the alloc member, there should be no user
visible changes.

Change-Id: I618f49022a9b1845754500c8f8706c72a68b9c7d
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-16 15:50:53 +02:00
Lars Knoll
9bd0323551 Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
	configure
	src/corelib/io/qurl.cpp
	src/gui/kernel/qwindow.cpp
	src/tools/moc/generator.cpp
	src/widgets/kernel/qwidget_qpa.cpp
	src/widgets/styles/qstyle.h
	src/widgets/widgets/qtabbar.cpp
	tests/auto/corelib/codecs/utf8/tst_utf8.cpp

Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
2012-04-16 12:04:34 +02:00
Stephen Kelly
77fd8fd997 Show the type and address of QObjects in debug output.
Change-Id: I9f44ab80a6fb763adc9cbaf47de8e1b97212332d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-16 11:35:44 +02:00
Girish Ramakrishnan
41673c45dd qmenu.h includes private headers
qpa includes are considered private and should not be included
in public header files.

Change-Id: I26c744ec1d8ddef7b0c11c3d26b593be05f5aa54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-16 07:31:37 +02:00
Girish Ramakrishnan
d037d25c3d api: fix constness of QOpenGLContext::getProcAddress
Should be const just like Qt4's QGLContext::getProcAddress.

Change-Id: I273467d5cf852cd49f48cec3f335c4ddac795363
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-04-16 04:21:49 +02:00
Sean Harmer
f609035fc1 Adding support for obtaining an OpenGL Core Profile context on Mac OSX
Change-Id: I08048ecee9b243b122ee93fce316e498aa7e2d51
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-04-16 03:10:22 +02:00
Pasi Matilainen
b3670edba4 Fix incorrect state of show/hide menu items in Mac application menu
The "Hide <app>", "Hide Others" and "Show All" menu items in Mac
application menu are always enabled, and do not get disabled correctly.
Fix by turning on autoenable for the menu in qt_menu.nib, and by
implementing menu item validation in QCocoaMenuLoader.

Task-number: QTBUG-10705
Change-Id: Ic181dfa26a71acad0067f5269c72517b50b17362
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
(cherry picked from commit 8f23a6be1069455e609e8bea7527726c24bebb36)
2012-04-16 03:10:22 +02:00
Jason McDonald
73db181e83 Put bug numbers on same line as insignificant_test markers.
This makes it easier to find insignificant tests that have no associated
bug report.

Change-Id: Ia71d59da062818d3860b0365d063e044705267fd
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-04-16 03:10:22 +02:00
Olivier Goffart
d2090e19a9 moc: Fix parsing of the empty preprocessor command
When encountering a null preprocessing directive (which is supposed to
be ignored), the moc preprocessor will leave a PP_NEWLINE token in the
token stream. That will confuse the parser.
The PP_NEWLINE token need to be ignored in the preprocessing phase.

Task-number: QTBUG-22717
Change-Id: I1e502a7e5bc6fa8ce2f82109ba7199b95747ff0a
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-04-16 00:54:19 +02:00
Thiago Macieira
f18a6c5fb5 Update com.trolltech -> org.qtproject in the bootstrapped tools
The tools will now generate the new org.qtproject annotations only,
matching the XML generator in the library. They accept both types of
annotations as input though -- and will generate a warning about the
older one.

This commit should be backported to Qt 4, so XML files can start to be
ported.

Task-number: QTBUG-23274
Change-Id: If298c342ab4774cbca1be1898a01af8b46e80446
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
2012-04-16 00:08:13 +02:00
Thiago Macieira
e12c34b244 Introduce the new UnknownProperty and PropertyReadOnly errors
Those error codes have been standardised for years but we haven't used
them until now.

Task-number: QTBUG-23274
Change-Id: Iebc9ded949f363281a4d43fd9d29a284f2e2df08
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
2012-04-16 00:07:49 +02:00
Thiago Macieira
e02a144a3c Finish cleaning up com.trolltech -> org.qtproject in QtDBus
Lots of uses of the annotations and error names, plus a bunch of local
unit test names (including one file that had to be renamed).

The meta object generator is updated to support both the old and new
names. That means some references to com.trolltech *must* remain in the
source code.

Task-number: QTBUG-23274
Change-Id: Icc38ae040232f07c437e7546ee744a4703f41726
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
2012-04-16 00:07:39 +02:00
Thiago Macieira
65e75acd05 Update the error codes in QtDBus
Change the old com.trolltech ones to org.qtproject and introduce Use
the alternate domain name for the Qt Project because the dash
character is not valid in interface and error names.

Task-number: QTBUG-23274
Change-Id: Iac1699e70525d67f983c10560932acff6b2ecde6
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-04-16 00:07:25 +02:00
Giuseppe D'Angelo
51fecf80b7 Mark tst_qabstractitemmodel as insignificant after QHash randomization
The testChildrenLayoutsChanged fails randomly. This happens rarely,
f.i. wasn't spotted by CI when QHash randomization itself was merged;
but is indeed reproducible by running the test a few times in a row.

This is now blocking api_merges integration, and I have no idea
how to fix it.

This patch marks the test as insignificant for now (the bug
tracking this test failure is QTBUG-25325), and switches the failing
tests from QVERIFY(a == b) to a proper QCOMPARE (so that the
expected values do show up in the build logs).

Change-Id: I16f0e28bcbb06dbac2e7169f4676a19ccf626a92
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-15 21:00:52 +02:00
Holger Hans Peter Freyther
83fc52e3b4 widgets: Fix painting to a fully transparent top level widget
QWS used to have a line to change the composite mode from SourceOver
to Source for the top level widget. This wasn't used with QPA and I
removed the internal DontSetCompositionMode in qtbase. It turns out that
the QWS way is the most efficient one to initialize the background of
the widget.

The alternative is to have the QPlatformBackingStore::beginPaint
always clear the entire to be painted area and then paint the background
of the widget. The difference of painting each pixel once or twice is
noticable on embedded platforms and in the range of one to two fps.

Reproduce the issue with:
echo "QWidget {background: transparent}" > style.css
./examples/widgets/wiggly/wiggly -stylesheet style.css

Task-number: QTBUG-24526
Change-Id: Ica4c980bb3bf6eb87ddb5b510ac7493292d01543
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-04-15 06:14:00 +02:00
ABBAPOH
5cb2fbe088 Now QSplitter can have 0-pixel handle
Change-Id: Iad920ffcd5d7f4c01504d41d1740f130b7aa53dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-04-15 03:53:07 +02:00
Konstantin Ritt
73b24486ed UCD-5.0: apply Corrigendum #6
http://unicode.org/versions/corrigendum6.html:
> in Unicode 5.0, the list of characters with the Bidi_Mirrored property
> was made consistent for brackets and quotation marks, in preparation for
> new constraints on bidi mirroring. However, after publication of
> Unicode 5.0.0 it was discovered that this change adversely affected
> several quotation mark characters in deployed data.

Task-number: QTBUG-25169
Change-Id: Id49caf401af2d5a1e6dbcc32b2f350aa20b7f901
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-15 03:53:07 +02:00
Samuel Rødal
d357b74493 Fixed broken logic in evdev input plugins.
If we do multiple reads we need to accumulate the total amount of bytes
read, instead of just taking the last read amount into account.

Change-Id: Iaa9b90c269f3ed9d09dae67452ca816d9db6217f
Reviewed-by: Johannes Zellner <johannes.zellner@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-04-15 01:41:45 +02:00
Girish Ramakrishnan
a9a1bf3359 Fold qpaintdevice_qpa.cpp into qpaintdevice.cpp
Change-Id: I274508826b9be4eb00f67fccae5a18ecbdf41a36
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-15 01:39:54 +02:00
Girish Ramakrishnan
763de6965c Fix header inclusion guard
Change-Id: Icc537d5b52315b9563078da9fa69ddd67b567f76
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-15 01:39:33 +02:00
Girish Ramakrishnan
70cb9598af Fix tst_QMdiSubWindow::emittingOfSignals CI failures
The test fails consistently on the CI (but never fails on any
of the developer machines). This is possibly a timing issue.

Change-Id: Ie40d9c38c3128a93898b0e50bfde5a754bd2b7fb
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-14 23:27:20 +02:00
Girish Ramakrishnan
033eff02fe doc: QWindowSurface is dead
It goes by the name of QBackingStore these days.

Change-Id: Id46254e47ee0abf9e669862eec6c2205d9634368
Reviewed-by: Holger Freyther <holger+qt@freyther.de>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-14 19:46:32 +02:00
Casper van Donderen
48e092574a QDoc: add missing newline characters in qdoc -help.
Change-Id: Ibd50091693be393c6b479d6ca8927ba1ed578709
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-04-14 19:46:09 +02:00
Martin Smith
aabd54b8bb qdoc: Fixed bugs causing invalid DITA XML
Fixed a bug in qdoc that caused too many end elements to be generated.
Also fixed some doc errors that caused invalid DITA to be generated.

Task nr: QTBUG-25302

Change-Id: Ifbbf457d28c51c2691a252888447739da7713bc9
Reviewed-by: Martin Smith <martin.smith@nokia.com>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-04-14 19:46:00 +02:00