profile/ivi/qtbase.git
11 years agoMake QSignalSpy copy QVariant parameters directly
Kent Hansen [Mon, 18 Jun 2012 07:46:35 +0000 (09:46 +0200)]
Make QSignalSpy copy QVariant parameters directly

Previously, a QVariant parameter would be wrapped inside a new
QVariant, and you would have to cast the QSignalSpy's QVariant to
a QVariant to get the actual value. This behavior was unintuitive
and undocumented.

Check if the parameter type is QVariant, and copy it directly if it
is. This makes the QSignalSpy's QVariant directly usable (no need to
"unwrap" the value in user code).

Existing tests that use QSignalSpy together with QVariant parameters
(such as tst_QPropertyAnimation::valueChanged()) and do cast the
QVariant parameter to a QVariant, continue to work after this change;
this is because qvariant_cast<QVariant>() returns its input value
(unchanged) when the type is not QMetaType::QVariant.

Task-number: QTBUG-21645
Change-Id: Ibfb171edd60c0d3f7ca1d5419e5c5f3d0380d5b3
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
11 years agoQWindowSystemInterface: fix mem leak and race
Marc Mutz [Mon, 6 Aug 2012 14:07:38 +0000 (16:07 +0200)]
QWindowSystemInterface: fix mem leak and race

There was a race where QGuiApplicationPrivate::processMouseEvent accessed
QWindowSystemInterfacePrivate::windowSystemEventQueue without holding
QWindowSystemInterfacePrivate::queueMutex.

There was a memory leak where QWindowSystemInterfacePrivate::windowSystemEventQueue
would not delete events contained in it when it was destroyed.

Fix both of these by properly encapsulating the QList/QMutex pair
in a small class, WindowSystemEventList, that allows only properly protected access
to the internal QList and calls qDeleteAll() in its dtor.

Change-Id: Ifaa9968c9272096df2f7109a7a6cf1c8e5fa736c
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
11 years agoUse == for button flag test instead of &
Stephen Kelly [Mon, 6 Aug 2012 15:20:35 +0000 (17:20 +0200)]
Use == for button flag test instead of &

QMouseEvent::button() returns Qt::MouseButton, not Qt::MouseButtons.

Change-Id: Ib5dc5b3998ed8f442c72e26d1aff62bc4ebcff71
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoRemove extra Q_COMPILER_xxx defines from the MSVC section.
Thiago Macieira [Thu, 2 Aug 2012 20:43:02 +0000 (22:43 +0200)]
Remove extra Q_COMPILER_xxx defines from the MSVC section.

Those are defined below, after the list that describes the macros and
the papers.

Change-Id: I1f2df0e33c84eb17ebbb0147662f560defed182c
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
11 years agoMSVC's throw() behaviour matches the C++11 noexcept, so use it
Thiago Macieira [Thu, 2 Aug 2012 20:17:27 +0000 (22:17 +0200)]
MSVC's throw() behaviour matches the C++11 noexcept, so use it

This allows code using methods marked Q_DECL_NOEXCEPT to benefit from
optimisations before MSVC supports the C++11 keyword. Even MSVC 2012
doesn't have it yet.

Using throw() in other compilers is not a good idea because they might
actually be implementing the C++ standard -- which is broken.

Change-Id: Id07ab4fe40a641583d5285d5abb536998bc419ba
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
11 years agoOptimise QMutexLocker a little: don't call relock() in the constructor
Thiago Macieira [Wed, 1 Aug 2012 15:54:32 +0000 (17:54 +0200)]
Optimise QMutexLocker a little: don't call relock() in the constructor

QMutexLocker does not support being passed already-locked mutexes,
unless they are recursive mutexes. But in that case, it behaves as if
the mutex weren't locked in the first place.

Since that's the case, there's no point in testing the low bit to see if
it's set or not. It's never going to be.

Change-Id: Ie4b81f7e2cca16e6db36f3cb51a5377dbdfc157d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoOpenGL: Add finer-grained functionality checks for NPOT textures
Sean Harmer [Mon, 6 Aug 2012 09:55:53 +0000 (10:55 +0100)]
OpenGL: Add finer-grained functionality checks for NPOT textures

The GL_IMG_texture_npot extension only provides partial support for
npot textures in that it allows use of npot textures but it does not
support the GL_REPEAT texture mode (needed for tiling fill modes in the
QQ2 image element).

Adding this new finer-grained feature check allows QQ2 to still use npot
textures where GL_REPEAT is not needed with only the IMG extension
present.

A follow-up commit will make a check for this in qtdeclarative.

Change-Id: Iff3dbdb955fb334d9e32f3abd49e90ff0ed9836c
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
11 years agoMake sure codecForLocale returns a valid codec in bootstrap mode
Jan-Arve Saether [Mon, 6 Aug 2012 07:50:50 +0000 (09:50 +0200)]
Make sure codecForLocale returns a valid codec in bootstrap mode

This was a regression caused by acbfb4d777474aadd2813614108,
causing for instance qdoc to crash.

Change-Id: Id8daa19d467c4f1729e5a5a203a388f16ec4a6de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoDoc: Adding a landing page for Qt SQL.
Jerome Pasion [Mon, 6 Aug 2012 10:21:48 +0000 (12:21 +0200)]
Doc: Adding a landing page for Qt SQL.

-Simple landing page which contains a link to the SQL guide and API.
-Gave a new title to C++ API page.

Change-Id: I54eca4f6933bafa0affd5825e7fe2e1a2522dad0
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
11 years agolancelot: detect and handle Jenkins CI environment
Rohan McGovern [Mon, 6 Aug 2012 04:19:25 +0000 (14:19 +1000)]
lancelot: detect and handle Jenkins CI environment

Make the test behave in Jenkins similarly as it behaves in Pulse:

  - a test run in Jenkins is not an ad-hoc run

  - the JENKINS_HOME environment variable implies we are running in
    Jenkins

  - the GIT_BRANCH environment variable, set by the Jenkins git plugin,
    is equivalent to PULSE_GIT_BRANCH

  - there is no equivalent to PULSE_TESTR_BRANCH, since testr is no
    longer used

Change-Id: I89ffeec659b4adaab309d8b93ad793ce640029c7
Reviewed-by: aavit <qt_aavit@ovi.com>
11 years agofix maximize -> fullscreen -> maximize on Windows
Joerg Bornemann [Mon, 6 Aug 2012 08:20:48 +0000 (10:20 +0200)]
fix maximize -> fullscreen -> maximize on Windows

Using a reference changes the value of oldState within this function,
which is undesired.

Change-Id: I9fb66e488015d6b3e586ffa2f0b05a40c095e16b
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
11 years agoFix builds with sysroot: a space is necessary before ] in scripts
Thiago Macieira [Fri, 3 Aug 2012 17:56:23 +0000 (19:56 +0200)]
Fix builds with sysroot: a space is necessary before ] in scripts

When using [ ] for tests in shell scripts, the ending ] must be a
separate parameter. Otherwise, it won't work. configure was reporting:

  configure:5918: ']' expected

Change-Id: I38a843356ee0feb97edb8692a828306821045c77
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoAdd missing const qualifier to snippet in QIdentityProxyModel doc.
Mitch Curtis [Mon, 6 Aug 2012 10:41:56 +0000 (12:41 +0200)]
Add missing const qualifier to snippet in QIdentityProxyModel doc.

Task-number: QTBUG-26751
Change-Id: Icb1f25dd015bcc62ec7c4c2b26c897649f1bbabb
Reviewed-by: Michalina Ziemba <michalina.ziemba@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
11 years agoFix some documentation inconsistency in QtNetwork.
Stephen Kelly [Tue, 31 Jul 2012 15:55:27 +0000 (17:55 +0200)]
Fix some documentation inconsistency in QtNetwork.

Change-Id: Id3e25480d4a8529813e02dc3d19f553a9263a363
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoqdoc: Removed "../" from paths to images
Martin Smith [Mon, 6 Aug 2012 10:42:58 +0000 (12:42 +0200)]
qdoc: Removed "../" from paths to images

qdoc was mistakenly assuming that the output
was going into subdirectories. The base dir
variable was not being tested.

Task nr: QTBUG-26638

Change-Id: I9b331926f8954b58102f75fad3f233eaebb2bb4d
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
11 years agoFix qmake -project
Rafael Roquetto [Fri, 3 Aug 2012 17:35:54 +0000 (19:35 +0200)]
Fix qmake -project

qmake -project was always outputting a project with subdirs template, because
Option::h_moc_mod was not being properly read, causing addFile() to misbehave.

Change-Id: I2c07aea132f9885eabf188de993b0fabfb352886
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoFix typos in qdatetime.cpp.
Mitch Curtis [Mon, 6 Aug 2012 13:31:33 +0000 (15:31 +0200)]
Fix typos in qdatetime.cpp.

Change-Id: I1c2e3dafcca69590cd7a18fdf65e2c9083ba91b9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agointroduce -fully-process configure option, change behavior of -process
Oswald Buddenhagen [Thu, 2 Aug 2012 13:37:50 +0000 (15:37 +0200)]
introduce -fully-process configure option, change behavior of -process

configure will now run qmake without -recursive, as on modern systems
one can get a lot more out of parallelization done by make, which qmake
cannot do.
use -fully-process to get back the old behavior. -dont-process is
unchanged.

Change-Id: I2874321a963175463ae8992f3ab2b01bc13c9922
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
11 years agoremove phonon vestiges
Oswald Buddenhagen [Thu, 2 Aug 2012 12:58:02 +0000 (14:58 +0200)]
remove phonon vestiges

Change-Id: Ifae2c631ddaae95ad9fc92e1f768fd910b254292
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
11 years agoremove -dsp & -vcp vestiges
Oswald Buddenhagen [Thu, 2 Aug 2012 13:23:15 +0000 (15:23 +0200)]
remove -dsp & -vcp vestiges

only -vcproj is meaningful at this point

Change-Id: If727c96a9628e37a5a00a19a6eabede261c9c4b2
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
11 years agoremove references to dead variables
Oswald Buddenhagen [Thu, 2 Aug 2012 13:24:56 +0000 (15:24 +0200)]
remove references to dead variables

Change-Id: I2603ebabbec5011fa0bf3e858401655a9a822768
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
11 years agoremove stray message
Oswald Buddenhagen [Thu, 2 Aug 2012 13:33:35 +0000 (15:33 +0200)]
remove stray message

i think this was a vestige from the old wince build proces

Change-Id: I13305de627c65fc1c93ba6d2383557ff5ea7a147
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
11 years agoremove stale messages about using setcepaths
Oswald Buddenhagen [Wed, 1 Aug 2012 12:43:42 +0000 (14:43 +0200)]
remove stale messages about using setcepaths

Change-Id: I9c0a61254aa50e57b18718aa44935007fd25bd74
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
11 years agoDo not call markDirty() for hidden widgets.
Samuel Rødal [Fri, 3 Aug 2012 12:55:39 +0000 (14:55 +0200)]
Do not call markDirty() for hidden widgets.

Fixed crash when resizing a scroll area with a native viewport
(typically a QGLWidget) causes the scroll bars to get hidden, while
there are still expose events in the queue for the scroll bar widget.

Task-number: QTBUG-26746
Change-Id: Ia77c8eb32a6730670333120af3f9a772c64807f1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoFixed popups getting blocked by modal windows.
Samuel Rødal [Thu, 2 Aug 2012 13:18:57 +0000 (15:18 +0200)]
Fixed popups getting blocked by modal windows.

In the case of a file dialog with a completer, the completion list view
is a popup that is not a transient child of the file dialog. Thus it
ends up getting its blockedByModal flag set due to the file dialog
window being a modal window.

To prevent this we make sure popups don't get blocked by modal windows,
as they were special cased and processed before modal windows in Qt 4.x.

Change-Id: Id5688cfb1534541cd1678b1e53d75e34a68f9b8e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoqdoc: No longer prints namespace qualifier twice
Martin Smith [Fri, 3 Aug 2012 10:29:40 +0000 (12:29 +0200)]
qdoc: No longer prints namespace qualifier twice

enum values in the Qt namespace were being printed
as. e.g.: Qt::Qt::AlignLeft. This was due to the
presence of a collision node that was not handled
properly.

Task nr: QTBUG-26628

Change-Id: I54adaba72410b2838f0922f181846bb7e76b61d4
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
11 years agoLogging: mark qEmergencyOut() noexcept
Marc Mutz [Fri, 3 Aug 2012 08:28:49 +0000 (10:28 +0200)]
Logging: mark qEmergencyOut() noexcept

This function is called in OOM situations and when other exceptions
are still in flight, so it really shouldn't throw, indeed.

Change-Id: I50cda699ffd74f3710c3bafd15af356ff410bc47
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoFix intended assignment to customSet variable.
Frank Osterfeld [Thu, 2 Aug 2012 20:06:22 +0000 (22:06 +0200)]
Fix intended assignment to customSet variable.

The naming suggests that this variable should be set to true here (instead of leaving the expression result unused). Also, the variable isn't written to anywhere else.

Change-Id: I8aae904f6e4456ce0bdd053ce89c2721168dccd3
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoqdatetime: micro optimization in fmtDateTime
hjk [Wed, 27 Jun 2012 11:15:07 +0000 (13:15 +0200)]
qdatetime: micro optimization in fmtDateTime

The function showed up in the profiler when doing
heavy logging involving timestamps in Qt Creator.

Change-Id: I81c4e22981a5de91df3da6a0f1df2a08552fa71a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
11 years agouse QMAKE_LIBDIR for passing LSB library path
Oswald Buddenhagen [Thu, 2 Aug 2012 13:56:46 +0000 (15:56 +0200)]
use QMAKE_LIBDIR for passing LSB library path

-L in QMAKE_LFLAGS is just wrong

Change-Id: I05eae0bb5e5e3dc8f8234616cb2ccdfba1d517fb
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
11 years agoremove the option summaries from the configures' help messages
Oswald Buddenhagen [Thu, 2 Aug 2012 12:54:26 +0000 (14:54 +0200)]
remove the option summaries from the configures' help messages

they are an unreadable and unmaintainable mess. the options are properly
documented below.

Change-Id: If2ec683fb7c3740b19798979f8a1f9cd8d84f457
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agos/QT_PRIVATE/QT_FOR_PRIVATE/
Oswald Buddenhagen [Thu, 2 Aug 2012 12:01:40 +0000 (14:01 +0200)]
s/QT_PRIVATE/QT_FOR_PRIVATE/

QT_PRIVATE is meant to be for something different.

only jsondb uses that so far. as it has little activity, i feel free to
break it temporarily.

Change-Id: Ifaa054af7234594ee534120c99506b76aebbf59f
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agofindLibraries(): don't remove -L options for system paths
Oswald Buddenhagen [Thu, 2 Aug 2012 10:11:13 +0000 (12:11 +0200)]
findLibraries(): don't remove -L options for system paths

the paths may be explicitly added before some other paths, so it would
be wrong to remove them.

Change-Id: I68ae93fd307afe14a07a0f24de952783950b5bea
Reviewed-by: Holger Freyther <holger+qt@freyther.de>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
11 years agoXCB: Correction to OpenGL version check for profile support
Sean Harmer [Fri, 3 Aug 2012 13:08:59 +0000 (14:08 +0100)]
XCB: Correction to OpenGL version check for profile support

Change-Id: I2f2bf877b1e2e628806f22fe66180b05090f4b3e
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
11 years agointroduce ability to selectively pass options to qdbusxml2cpp
Oswald Buddenhagen [Thu, 2 Aug 2012 19:37:18 +0000 (21:37 +0200)]
introduce ability to selectively pass options to qdbusxml2cpp

DBUS_{INTERFACES,ADAPTORS} now also accepts "structures":

DBUS_INTERFACES += foo
foo.files = foo.xml bar.xml
foo.header_flags = -i qfoobar.h
foo.source_flags = ..

Change-Id: I98d757c8d3a3c6f79cedca7b90b533289114c102
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
11 years agoadd ability to pass command line options to qdbusxml2cpp
Oswald Buddenhagen [Thu, 2 Aug 2012 19:31:36 +0000 (21:31 +0200)]
add ability to pass command line options to qdbusxml2cpp

QDBUSXML2CPP_{INTERFACES,ADAPTORS}_{HEADER,SOURCE}_FLAGS are now
understood.

Change-Id: I26492cec5ecb7ff4a6b83755ee8a0c17859b2a68
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
11 years agode-duplicate dbusadaptors.prf vs. dbusinterfaces.prf
Oswald Buddenhagen [Thu, 2 Aug 2012 17:15:45 +0000 (19:15 +0200)]
de-duplicate dbusadaptors.prf vs. dbusinterfaces.prf

it's two times the same code, once with "adaptor" (and an -a option) and
once with "interface" (and a -p option).

the de-duplicated code looks a bit nasty, as qmake cannot deal with
braces on the LHS yet.

Change-Id: I199a07947661ab9abe7a736b56c437f3f6dc4fa4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
11 years agoICU: lock the mutex before calling an Unlocked function
Thiago Macieira [Fri, 3 Aug 2012 10:27:28 +0000 (12:27 +0200)]
ICU: lock the mutex before calling an Unlocked function

The QIcuCodec::defaultCodecUnlocked function is not thread-safe
because it calls codecForNameUnlocked. In turn, that one accesses and
even modifies a QHash stored in the QCoreGlobalData singleton, which
is what makes it non-threadsafe.

In order to call the Unlocked function, we need to lock the mutex
first.

Change-Id: I915570110229f4c0929986aa26731244317ef6ab
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoICU: Mark which functions are threadsafe and which ones aren't
Thiago Macieira [Fri, 3 Aug 2012 09:40:35 +0000 (11:40 +0200)]
ICU: Mark which functions are threadsafe and which ones aren't

Mark the thread-safe functions with the \threadsafe doc marker. This
includes public API, which should be thread-safe anyway.

The thread-unsafe functions are marked "\nonreentrant" already. In
addition, I renamed the functions that must be called with locked
mutexes to Unlocked, following the convention in other libraries like
libdbus-1.

Change-Id: Ibd93d1266149767f546c8e82959b73c138008469
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoQNX: Ensure that m_requestedBufferSize is properly initialised
Sean Harmer [Thu, 2 Aug 2012 12:17:16 +0000 (13:17 +0100)]
QNX: Ensure that m_requestedBufferSize is properly initialised

This solves a new corner case resulting from the recent refactoring of
QQnxWindow::setGeometry() that occurs when using a plain OpenGL backed
window in a single threaded environment and the user code calls
QOpenGLContext::makeCurrent(this) in the QWindow subclass ctor.

Change-Id: Iaf07fbff1cb2743f5706020a8d657a82cb9f2255
Reviewed-by: Kevin Ottens <kevin.ottens.qnx@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
11 years agoFix order of QT_END_NAMESPACE and QT_END_HEADER macros
Sergio Ahumada [Fri, 3 Aug 2012 13:15:01 +0000 (15:15 +0200)]
Fix order of QT_END_NAMESPACE and QT_END_HEADER macros

Change-Id: I798311bdacaac341210626489410740c130f8724
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoRemove some dead code wrapped in Q_WS_QWS.
Stephen Kelly [Thu, 26 Jul 2012 07:44:05 +0000 (09:44 +0200)]
Remove some dead code wrapped in Q_WS_QWS.

Change-Id: Ie1ee8c4af603b924abe40145041357981d174445
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
11 years agoRemove unused Q_WS_QPA define.
Stephen Kelly [Thu, 26 Jul 2012 07:51:15 +0000 (09:51 +0200)]
Remove unused Q_WS_QPA define.

Change-Id: Ie77526000cf93ad6901e28abe2558d254ccf8f1a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
11 years agoRemove some dead QWS code from configure.
Stephen Kelly [Thu, 26 Jul 2012 07:48:15 +0000 (09:48 +0200)]
Remove some dead QWS code from configure.

Change-Id: Ic1b47533e3f04cebaac83ca632068c2e791a846c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoFix FullScreen for Windows CE
Andreas Holzammer [Thu, 2 Aug 2012 07:57:15 +0000 (09:57 +0200)]
Fix FullScreen for Windows CE

For Windows CE the taskbar needs to be hidden
manually.

Change-Id: Ife69a2a91457ba0c162e4e1be88f87ad22c61190
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
11 years agoRevert "Move QWindowSystemInterface out of qpa."
Paul Olav Tvete [Thu, 26 Jul 2012 11:23:28 +0000 (13:23 +0200)]
Revert "Move QWindowSystemInterface out of qpa."

This reverts commit 784a877d3cd9a1a75aca9c83146389503a966071.

Conflicts:

src/plugins/platforms/cocoa/qcocoawindow.mm
src/testlib/qtestkeyboard.h
src/testlib/qtestmouse.h
src/testlib/qtesttouch.h

Change-Id: Iebfed179b3eb7f30e4c95edcae5a8ad6fd50330e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoRemove the obsolete scene argument for constructors of graphics items
Lars Knoll [Mon, 30 Jul 2012 21:36:59 +0000 (23:36 +0200)]
Remove the obsolete scene argument for constructors of graphics items

The argument has been obsoleted and not documented since 2007. Get rid
of it now before Qt 5.0

Task-number: QTBUG-25089
Change-Id: I91a5508a5e1606f5b5c289501295c67be4abe6a0
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
11 years agoUse glFlush() if swapBehavior is single-buffered
Jan-Arve Saether [Mon, 30 Jul 2012 12:21:15 +0000 (14:21 +0200)]
Use glFlush() if swapBehavior is single-buffered

Otherwise, use swapBuffers()

This fixes an issue where swapbuffers() did not swap the
"back buffer" to the "front buffer" if we had single-buffered swap
behavior.
This was an issue on Windows 7 with an NVIDIA graphics card that
by default was using single-buffered mode.

Change-Id: If53f54146e4633305be3ad5158565752b6516b59
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
11 years agoFix default font for X11.
Friedemann Kleint [Thu, 2 Aug 2012 12:14:15 +0000 (14:14 +0200)]
Fix default font for X11.

Qt 5 X11 applications currently have differing fonts since they
no longer read ~/.config/Trolltech.conf.
Set the default font value 4.8 would return for
XRender/FontConfig in the theme classes.

Change-Id: Ie0a77e6781a47a68fd67895821ab1773c25e0470
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
11 years agoFix mimedata updating and signal emision issues in xcb clipboard.
Gatis Paeglis [Mon, 30 Jul 2012 10:12:08 +0000 (12:12 +0200)]
Fix mimedata updating and signal emision issues in xcb clipboard.

Clipboard should reacquire the clipboard whenever the content or metadata
(e.g the list of supported targets) changes. Patch enables us to monitor
changes to the clipboard through help of XFixes extension.

Cleanup xlib xa_* naming conventions

Task-number: QTBUG-26709
Change-Id: I9d47766ad9859b5628b0358b1c47e8af8fecef73
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
11 years agoFix badAtom issues introduced by behavior changes between Xlib and xcb.
Gatis Paeglis [Mon, 30 Jul 2012 09:31:54 +0000 (11:31 +0200)]
Fix badAtom issues introduced by behavior changes between Xlib and xcb.

In Xlib, the 'length' variable gets updated with the the actual number
of 8-bit, 16-bit, or 32-bit items stored in the returned data, but xcb
returns the actual number of bytes read through xcb_get_property_value_length,
therefore the logic of calculating offset was broken.

Task-number: QTBUG-26709
Change-Id: I04de3b5c5631cfaf9b3c2c3d4513be73c569f61f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
11 years agouic-Autotest: Remove SRCDIR-define, add stdout-test.
Friedemann Kleint [Thu, 2 Aug 2012 09:02:24 +0000 (11:02 +0200)]
uic-Autotest: Remove SRCDIR-define, add stdout-test.

- Replace SRCDIR define by QFINDTESTDATA, simplify code.
- Introduce a test for stdout mode that verifies the newline
  convention.
- Use a temporary directory as not to clobber the
  test directory and introduce an environment variable
  UIC_KEEP_GENERATED_FILES to keep them for error
  analysis.

Task-number: QTBUG-26730
Change-Id: I22e3bb5a9ca92a1977c29b165ea605f1017baa02
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoqdoc: Ignore property functions of obsolete properties
Martin Smith [Thu, 2 Aug 2012 11:25:55 +0000 (13:25 +0200)]
qdoc: Ignore property functions of obsolete properties

Property setter and getter functions are no longer
included in the output when the property itself has
been marked \obsolete.

Task nr: QTBUG-26425

Change-Id: Iac315445d1916467b12be03989bd4513a03a2397
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agoFix a typo in the qdoc manual (QChra -> QChar)
Laszlo Papp [Thu, 2 Aug 2012 06:22:37 +0000 (07:22 +0100)]
Fix a typo in the qdoc manual (QChra -> QChar)

Change-Id: I331765f42f8dd46bf312223754ade3c5d156e6dc
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agoQDoc: Set HTML Doctype to XHTML 1.0 Transitional.
Casper van Donderen [Thu, 2 Aug 2012 06:19:44 +0000 (08:19 +0200)]
QDoc: Set HTML Doctype to XHTML 1.0 Transitional.

Previously QDoc HTML output was marked as XHTML 1.0 Strict, but did not pass validation.
As XHTML 1.0 Transitional the W3C validation passes.

Change-Id: Iced8c02b2602a82b94ee394e580bfb92023a517b
Reviewed-by: Martin Smith <martin.smith@nokia.com>
11 years agoQDoc: Set the default output encoding for HTML to UTF-8.
Casper van Donderen [Wed, 1 Aug 2012 17:41:20 +0000 (19:41 +0200)]
QDoc: Set the default output encoding for HTML to UTF-8.

Change-Id: Ic6d8efae967514e143f224aed4c761a4c01eb434
Reviewed-by: Martin Smith <martin.smith@nokia.com>
11 years agoQDoc: Add extra tags when no HTML.endheader is specified.
Casper van Donderen [Wed, 1 Aug 2012 17:10:47 +0000 (19:10 +0200)]
QDoc: Add extra tags when no HTML.endheader is specified.

The default Qt template inserts </head><body> with some arguments in the header of the HTML document.
When you don't specify the HTML.endheader qdocconf variable those tags will not be generated and the
QTextBrowser-based view in Qt Assistant will not be able to render the documentation.

Change-Id: Ieee231f300e1dc71d6b6343771d2682b3de96d73
Reviewed-by: Pierre Rossi <pierre.rossi@nokia.com>
11 years agoMake tests compile without gui-private
Paul Olav Tvete [Thu, 26 Jul 2012 16:48:56 +0000 (18:48 +0200)]
Make tests compile without gui-private

Add new qt_handleXXX functions that forward to the QWindowSystemInterface
functions, and use those in the testlib inline functions. Remove use of
struct QWindowSystemInterface::TouchPoint from the testlib header files
(requiring some slight increase in ugliness in the two tests that use
that struct).

Also remove the qmake hack that adds private headers to all tests

Change-Id: Iec23537e55a44802f6e9cd463f7a0f82007c5250
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
11 years agostring.h is needed for memcpy()
Oswald Buddenhagen [Thu, 2 Aug 2012 11:55:36 +0000 (13:55 +0200)]
string.h is needed for memcpy()

... which is used by some template code. apparently, the glibc on my
rather recent system removed some implicit includes again.

Change-Id: I9f85362e54a42cccc1e743f2b27bcdb6a90162e3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoMove QPlatformWindowPrivate into its own header
Laszlo Agocs [Thu, 2 Aug 2012 08:37:34 +0000 (11:37 +0300)]
Move QPlatformWindowPrivate into its own header

Most other qplatform* classes have the same setup and more
importantly this allows QPlatformWindow subclasses to utilize
the d-pointer.

Change-Id: I52afeaaf35bba8ef42d59ff3107f7d7bcf931e5e
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
11 years agoMention setFont() in QPainter::drawText() functions
Simon A. Eugster [Mon, 11 Jun 2012 07:45:01 +0000 (09:45 +0200)]
Mention setFont() in QPainter::drawText() functions

Change-Id: Id0d06d27f3aeb6a6e7e1a415da78591ae5eae91c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agoFix some typos in static assert message.
Stephen Kelly [Wed, 1 Aug 2012 15:00:51 +0000 (17:00 +0200)]
Fix some typos in static assert message.

Change-Id: I1abc79d86a4b101e6f32d37a58ac3c7d8cc16237
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoQtNetwork: Handle FD_CLOSE on Windows
Martin Petersson [Wed, 11 Jul 2012 10:31:29 +0000 (12:31 +0200)]
QtNetwork: Handle FD_CLOSE on Windows

We need to handle FD_CLOSE separately on Windows as this will be sent
only once. When we get FD_CLOSE we need to check if there is more data
available for reading. It there is this might indicate that there is
another FD_READ that we need to handle after the FD_CLOSE. So in this
case we will manually create another close event.

Task-number: QTBUG-19409
Task-number: QTBUG-25386
Change-Id: Ie19906bc3f64fb6a85a508a5ab12caac5d70ccdb
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
11 years agoqdoc: Added support for modularized example doc
Martin Smith [Tue, 31 Jul 2012 11:57:20 +0000 (13:57 +0200)]
qdoc: Added support for modularized example doc

qdoc now searches for .qdoc files in the directories
listed in the exampledirs variable. These files are
added to the list of sources to be parsed.

Task nr: QTBUG-26708

Change-Id: I6dfd7cd7b41e0bdf847f88b6d61ac0272902d4e1
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agofix a few qdoc command typos
Jeremy Katz [Wed, 1 Aug 2012 12:51:35 +0000 (14:51 +0200)]
fix a few qdoc command typos

Change-Id: I5eb3a6d2bb7939f001f1fcb836660dd46a47c350
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agochange \img to \image in docs
Jeremy Katz [Wed, 1 Aug 2012 12:44:51 +0000 (14:44 +0200)]
change \img to \image in docs

\img was a macro defined in macros.qdocconf. This collection
of macros is being phased out. Use the full command instead.

Change-Id: Ia55212f87bb46349d61359d40568e0aa33882596
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agoreplace \key and \gui qdoc commands with \uicontrol
Jeremy Katz [Wed, 1 Aug 2012 12:36:13 +0000 (14:36 +0200)]
replace \key and \gui qdoc commands with \uicontrol

Change-Id: I0753305d4fe1ea20417f451766101da1247dfeeb
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agoqdoc: Removed useless qdoc warnings
Martin Smith [Wed, 1 Aug 2012 11:53:02 +0000 (13:53 +0200)]
qdoc: Removed useless qdoc warnings

qdoc was printing warning messages when a QML type
was not given a minor version number in its
\inqmlmodule command. The minor version number is
not used for anything, so the warning messages are
no longer printed.

Change-Id: I5586b4d860fcc8e392de3d388c3327ed0029e266
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
11 years agoOpenGL: Fix typo in extension name
Sean Harmer [Fri, 27 Jul 2012 17:42:13 +0000 (18:42 +0100)]
OpenGL: Fix typo in extension name

Change-Id: Ibb65b832290085bd565388982594eb889e950aaa
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
11 years agoSet the Qt API level to compatibility mode in all tests.
Thiago Macieira [Wed, 1 Aug 2012 11:19:40 +0000 (13:19 +0200)]
Set the Qt API level to compatibility mode in all tests.

Qt 5.0 beta requires changing the default to the 5.0 API, disabling
the deprecated code. However, tests should test (and often do) the
compatibility API too, so turn it back on.

Task-number: QTBUG-25053
Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
11 years agoFix crash in uic
Andreas Holzammer [Wed, 1 Aug 2012 11:53:10 +0000 (13:53 +0200)]
Fix crash in uic

Compiling Qt5 uic with Microsoft Visual Studio 2008
with SP1 will lead into a assertion in the copy
constructor of qstring.

This is apparently a compiler Bug.

Change-Id: Ia3353434d00b2e87800b937d891eabef86293751
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoAdded default argument for color profile to QImage constructors.
Alexandros Dermenakis [Mon, 23 Jul 2012 14:27:10 +0000 (16:27 +0200)]
Added default argument for color profile to QImage constructors.

Added default argument for color profile to QImage constructor
initializing QImages from pixel maps. This is to be used in future Qt
versions where color profile support will be added.

Change-Id: I815c3db4ef52f8383b48dad844b5f188aa3a3eee
Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
11 years agoSkip doc subfolders when checking includes.
Lars Knoll [Tue, 31 Jul 2012 18:40:25 +0000 (20:40 +0200)]
Skip doc subfolders when checking includes.

This removes the bogus warnings when running
syncqt from configure about snippets in the doc/
folders.

Change-Id: I8e3d258238c1cd1e763ce63b895d58b68bbc06f3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoQNX: Do not send geometry change events to Qt too early
Sean Harmer [Tue, 31 Jul 2012 14:27:37 +0000 (15:27 +0100)]
QNX: Do not send geometry change events to Qt too early

We explicitly do not send geometry change events to Qt from QQnxWindow
from the constructor. This prevents us from ending up in resizeEvent()
reimplementations from the QWindow ctor.

Change-Id: I045b35aa7eb23890772fe131c3d19314252f6a5a
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Kevin Ottens <kevin.ottens.qnx@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
11 years agoQNX: Ensure that the QQnxWindow has a valid size for EGL surfaces
Sean Harmer [Tue, 31 Jul 2012 13:09:15 +0000 (14:09 +0100)]
QNX: Ensure that the QQnxWindow has a valid size for EGL surfaces

If QWindow::create() gets called before resize() or setGeometry() then
the rect argument passed into QQnxWindow::setGeometry() by the ctor
is null.

This could potentially result in 0 sized buffers and EGL surface
creation being attempted. We bail out in this case and tell
user how to fix their application.

Change-Id: Ia709dba617fa266bd66b61409bdb1c980acfb1a2
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Kevin Ottens <kevin.ottens.qnx@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
11 years agoQNX: Remove dependency on QtWidgets from QNX QPA plugin
Sean Harmer [Tue, 31 Jul 2012 17:12:18 +0000 (18:12 +0100)]
QNX: Remove dependency on QtWidgets from QNX QPA plugin

Change-Id: I52027752630beee81a97644983dbccf973c0c2c2
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Kevin Ottens <kevin.ottens.qnx@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
11 years agostatemachine: Make states exit order spec-compliant
Kent Hansen [Wed, 1 Aug 2012 08:28:10 +0000 (10:28 +0200)]
statemachine: Make states exit order spec-compliant

The SCXML spec states that entry order should be equivalent to
"document order" and exit order should be "reverse document order".
Since QStateMachine uses child order for the entry order, the exit
order should be reverse child order.

Change-Id: Ia7b05fdd5c9261ccf202f64f8d23f5c88b20a8c3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
11 years agoRemove usage of deprecated qWaitForWindowShown(QWidget *) method.
Friedemann Kleint [Mon, 30 Jul 2012 10:36:02 +0000 (12:36 +0200)]
Remove usage of deprecated qWaitForWindowShown(QWidget *) method.

Change-Id: I445d24a09dbb7abb62a37bd9914284f21a4f08f1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
11 years agoMake sure that the parsing mode reaches QUrlPrivate::setHost
Thiago Macieira [Tue, 31 Jul 2012 13:19:30 +0000 (15:19 +0200)]
Make sure that the parsing mode reaches QUrlPrivate::setHost

Ensure that the parsing mode is cascaded down from setAuthority and
setUrl so that the hostname parsing does not attempt to decode
percent-encoded hostnames when it shouldn't.

Take the opportunity to also remove the "Boolean Trap" from
QUrlPrivate::setHost.

Change-Id: Ia64754c4a4900182700b7af1382aea8410abc7e9
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoMake QUrl::setScheme only parse in strict mode (no decoding)
Thiago Macieira [Tue, 31 Jul 2012 12:28:48 +0000 (14:28 +0200)]
Make QUrl::setScheme only parse in strict mode (no decoding)

The URI RFC defines schemes as containing only a very restricted set
of characters, none of which require encoding, so don't even
try. Testing this behaviour in some web browsers indicate that they do
not accept percent-encoded schemes either.

Change-Id: I692dd20e1aac7e8a1bcb276cb5113b5802393d38
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoFix QUrl support for empty usernames and passwords
Thiago Macieira [Tue, 31 Jul 2012 12:06:10 +0000 (14:06 +0200)]
Fix QUrl support for empty usernames and passwords

If the password is empty (but present), the userinfo component of the
URL should end in a colon (":"). QUrl already supported that and it
was tested (case "password-empty").

If the username is *also* empty but present, the userinfo component is
just the colon (":"). Fix support for that case by checking if we
stored the presence flag instead of checking the size of the
component.

Change-Id: Ie224493a997dbf76b2e44dd6d55fd9674ac83c1c
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoFix handling of encoded NULs (%00) in QUrl::fromPercentEncoding
Thiago Macieira [Tue, 31 Jul 2012 11:10:54 +0000 (13:10 +0200)]
Fix handling of encoded NULs (%00) in QUrl::fromPercentEncoding

QString::fromUtf8, without an explicit size, (currently) defaults to
stopping at the first NUL. That means we need to pass an explicit
size.

Also take the opportunity to test that QUrl::toPercentEncoding also
works with the same data.

Change-Id: I79362d67afda624b01ca07b0315b611c4aa3fdda
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
11 years agoRemove references to Borland and bmake
Andy Shaw [Wed, 25 Apr 2012 15:12:53 +0000 (17:12 +0200)]
Remove references to Borland and bmake

Remove references to an old compiler that has not been
supported for a long time.  Also remove Borland specific
configuration flags which have no meaning elsewhere.

Change-Id: I3634a52b78f737ea972073e14c2b6669dcd0ae63
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agodon't change a widget's active state in QWindowsWindow::setWindowState
Joerg Bornemann [Mon, 2 Jul 2012 10:36:18 +0000 (12:36 +0200)]
don't change a widget's active state in QWindowsWindow::setWindowState

QWindow::setWindowState is not supposed to set the window active.
The method requestActivateWindow() should be used for that.

When switching from and to fullscreen mode we're always passing
SWP_NOACTIVATE to SetWindowPos to not change the activation state
of the window. This is inverse to the old behaviour, which did not
have an effect.

Change-Id: I339337935cdad76b3ef252202e92177f37543038
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoDoc: QVarLengthArray::length is new in 5.0
Christian Kamm [Tue, 31 Jul 2012 08:57:59 +0000 (10:57 +0200)]
Doc: QVarLengthArray::length is new in 5.0

Change-Id: I796e67d677309460d79a7a64a6890dfbcfbace69
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoAdding configure option: -no-gcc-sysroot
Thomas Senyk [Thu, 12 Jul 2012 11:03:16 +0000 (13:03 +0200)]
Adding configure option: -no-gcc-sysroot

This option is important if you want to use configure's
and qmake's -sysroot (e.g. PKG_CONFIG settings, device-files),
but the toolchain (in combination with the rootfs)
is not able to handle gcc's --sysroot.
One known case is freescale's ltib setup where the toolchain
itself comes with all the essential files (e.g. crt1.o),
while the rootfs has none of those files, so gcc's
--sysroot can't be used. The rootfs on the other hand contains
all kinds of "less important" files/packages (e.g. libdbus).
For those "less important" files/packages Qt needs pkg-config
to be able to include/link properly. Therefore one needs
configures -sysroot without gcc's --sysroot.

Change-Id: Iaec9b07012f2945f3ecb3ced0ed95176721b5ecd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoAdd a .prf file for SIMD qmake variables.
Michael Goddard [Tue, 24 Jul 2012 02:49:14 +0000 (12:49 +1000)]
Add a .prf file for SIMD qmake variables.

So you can get AVX/NEON etc source compiled by assigning to the
corresponding variable (e.g. AVX_SOURCES).

This was previously used in just the gui module, but other
external modules might like it too.

Change-Id: I51aa64760c469c7dc4c71e6f089c2ddef4f509c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
11 years agoUse QtCore instead of QtGui for the standardpaths comments to be correct
Laszlo Papp [Mon, 30 Jul 2012 18:18:52 +0000 (19:18 +0100)]
Use QtCore instead of QtGui for the standardpaths comments to be correct

Change-Id: I98004fed565ac9653947ec70a3197b0372abcf2b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
11 years agoLazy initialize library paths
Harald Fernengel [Fri, 27 Jul 2012 09:53:46 +0000 (11:53 +0200)]
Lazy initialize library paths

For a lot of command line tools, library loading is not required, so
don't waste a lot of time computing them. According to callgrind, this
makes the QCoreApplication constructor factor 6 faster, and also removes
a lot of stat() calls and other file system access.

Change-Id: I0211f5303712fa0dcfc4168cce7025283c63c9d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoAvoid qobject_cast
Kent Hansen [Tue, 31 Jul 2012 09:57:08 +0000 (11:57 +0200)]
Avoid qobject_cast

This is slightly faster, and also avoids accessing the object's meta
object that would cause any lazily created meta objects (e.g., for
QML) from being built.

This is just a port of commit a5972f8ec32631e70578c64e9d6c063b3c47f0f5
(which fixed QGuiApplication, but not QApplication).

Change-Id: I0d5080495aa4fd4486db297968c4d06bbfacf89b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
11 years agoAdd command line options to windowgeometry test
Andreas Holzammer [Tue, 31 Jul 2012 12:00:11 +0000 (14:00 +0200)]
Add command line options to windowgeometry test

Add -widgetminimized, -widgetmaximized, -widgetfullscreen,
-windowminimized, -windowmaximized, -windowfullscreen
as command line option to test creation of windows in
these modes

Change-Id: If192c131c8996d3b67648427e5784da47ffee971
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoFix compilation: Move qHash(const T &t, uint seed) up.
Friedemann Kleint [Mon, 30 Jul 2012 13:25:25 +0000 (15:25 +0200)]
Fix compilation: Move qHash(const T &t, uint seed) up.

It needs to be visible from
qHash(const QPair<T1, T2> &key, uint seed).

Change-Id: Ibb63ce6da1e655bfb841c5e580e184ef66c5b766
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoFix reloading of plugins
Lars Knoll [Mon, 30 Jul 2012 10:30:58 +0000 (12:30 +0200)]
Fix reloading of plugins

Unloading and reloading a plugin didn't work correctly,
because we didn't reset instance to 0 on unload.

Task-number: QTBUG-26098
Change-Id: Ic3e4497f359b1ca455be949dce9cafa9d67d8039
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoFix some syncqt warnings.
Lars Knoll [Tue, 31 Jul 2012 18:50:18 +0000 (20:50 +0200)]
Fix some syncqt warnings.

Change-Id: I6f432ee991f4bde217fa27d4004ef318f1d480e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
11 years agoFix showFullScreen for QWindow
Andreas Holzammer [Tue, 31 Jul 2012 14:12:18 +0000 (16:12 +0200)]
Fix showFullScreen for QWindow

If the setWindowState is called in a early stage,
where the window is not yet shown, the fullscreen
flag is cached in the QWindow. Then in the call to
setVisible(true) the window gets generated, but the
fullscreen is not handled there. So set the state
while window is generated.

Change-Id: I0ea53ed8a2465da6a9973d84fb4579381543e89b
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agofix QWidget::activateWindow for child widgets
Joerg Bornemann [Tue, 31 Jul 2012 09:43:15 +0000 (11:43 +0200)]
fix QWidget::activateWindow for child widgets

For child widgets we must use the windowHandle of the toplevel widget.

Change-Id: If7bad8ed4bba694806a2c8b77bae3d25cc200b8b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agofix window activation in tst_qmdiArea::subWindowActivated2
Joerg Bornemann [Tue, 31 Jul 2012 11:14:49 +0000 (13:14 +0200)]
fix window activation in tst_qmdiArea::subWindowActivated2

QApplication::setActiveWindow doesn't activate the native window but
marks the widget as active inside Qt.
We need to use QWidget::activateWindow instead. See docs.

Also moved the activation call further down because on Windows a
minimized window cannot be activated using the activation-by-focus
fake we're currently using.

Change-Id: I752f6ada1f463931fa9cfb3c35f42dbec0207bfa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoImplement synchronous WS events by flushing.
Friedemann Kleint [Tue, 24 Jul 2012 07:40:20 +0000 (09:40 +0200)]
Implement synchronous WS events by flushing.

Previously synchronous window system events were
implemented by bypassing the queue and processing
the event immediately. This is not ideal since the
event order is not preserved - there might be "happened
before" events waiting in the queue.

Add QWindowSystemInterface::flushWindowSystemEvents
and change all handleSynchronous* to 1) queue the
event 2) call flushWindowSystemEvents.

flushWindowSystemEvents is almost identical to the
already existing sendWindowSystemEvents with the
exception that it does not call QApp::sendPostedEvents.
Move the common implementation to a new private function.

Task-number: QTBUG-20778

Change-Id: Ie98a83875bc0a14e335e36bed0dd9e0ed4a1dea0
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
11 years agoAdding missing QT_BEGIN_HEADER/QT_END_HEADER
Sergio Ahumada [Mon, 30 Jul 2012 13:31:52 +0000 (15:31 +0200)]
Adding missing QT_BEGIN_HEADER/QT_END_HEADER

Change-Id: I1144497ec8376ec41c714b7a55c05637b6feee66
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
11 years agoMac: Don't crash if language preferences can't be retrieved.
Eike Ziller [Tue, 17 Jul 2012 09:19:02 +0000 (11:19 +0200)]
Mac: Don't crash if language preferences can't be retrieved.

That can happen when e.g. running an application with sudo.

Task-number: QTBUG-26547
Change-Id: Ib16ef7798ebcd1c9b8d661dd2e3ce3aadc393489
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>