Commit Graph

18710 Commits

Author SHA1 Message Date
Friedemann Kleint
b08b63f652 QIcon: Prefer high-quality images of Windows .ico files.
Refactor the code QPixmapIconEngine::addFile() using a convenience
class for reading all images.
Special-case .ico-files: Read images into a list and replace by
higher-quality ones.

Task-number: QTBUG-39287
Change-Id: I32ab6c77a276dc5d4d9a8f7b216c81149b8772b8
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2014-06-22 09:42:12 +02:00
Friedemann Kleint
37312d2950 tst_qicon: Resolve all files using QFINDTESTDATA().
The local files in availableSizes() were not resolved.
Introduce member variables for the file names, resolve them
in the constructor and add initTestCase() to verify.

Task-number: QTBUG-39287
Change-Id: If841e904700fe76b6c9265124ccba7764911fdc9
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2014-06-22 09:41:06 +02:00
Thiago Macieira
8e6c8964db Fix warnings from MSVC 2013
qhosaddress.h(88) : warning C4224: nonstandard extension used : formal parameter 'sockaddr' was previously defined as a type

Change-Id: I38ee9dcb0d81d5ec4f71c2b50dc4f331eb61e7de
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-06-21 20:47:26 +02:00
Thiago Macieira
4a83ce611d Move most of the QLibraryPrivate initialization to its constructor
This commit moves the setting of the loadHints to inside the constructor
or to QLibraryStore::findOrCreate (which is under a mutex). This avoids
data race conditions with two threads asking for the same plugin at the
same time, with different load hints.

This also opportunistically moves the setting of the error message for
empty file names.

Task-number: QTBUG-39642
Change-Id: I497a41781d10e407d6420116a0b05fdfe2b548de
Reviewed-by: David Faure <david.faure@kdab.com>
2014-06-21 20:47:19 +02:00
Liang Qi
6b15a5a869 QComboBox: update focus policy when setting a new line edit
On OS X, the focus policy of QComboBox is different when editable or
not.

Task-number: QTBUG-39650
Change-Id: I394564f8a1a6d462e86d2497fe8874e6107a8a58
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2014-06-21 20:46:47 +02:00
Liang Qi
ebc729b3c3 Cocoa: fix Option + any key in key event
Unmodified key code should be used.

Task-number: QTBUG-33200
Change-Id: I9cf91030e80336772c05a40efae52f3b8734cbdb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-06-21 15:22:15 +02:00
Andy Shaw
fbac55fe59 When filling the path it should use the painter's pen not the state's
The state should already be updated when fillPath() is called, so it
should use the painter's pen to fill the path with instead as this will
have been updated already.

Task-number: QTBUG-39303
Change-Id: I1cc9922d4183bd44076c26210db06ad825ebf25b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-06-21 10:39:32 +02:00
David Faure
884b381576 Fix data race on QLoggingCategory when using qDebug from multiple threads
setEnabled() would race with isEnabled()/isDebugEnabled()/etc.

Change-Id: I2004cba81d5417a634b97f5c2f98d3a4ab71770d
Reviewed-by: David Faure <david.faure@kdab.com>
2014-06-20 21:54:04 +02:00
Oswald Buddenhagen
d98004cd2f fix QT_SUPPORTS macro with msvc2008
Change-Id: I70ffba51d2672574d7cefc3cb44724341cd86f22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-06-20 21:21:43 +02:00
Thiago Macieira
443f06a2ec Remove the use of QT_STATIC_CONST in QtSql
There doesn't seem to be any reason why the macro is actually
necessary. My guess is that someone wrote the code on Windows without
"const", then it failed to compile everywhere else. Instead of fixing
the code by adding the "const", the developer must have added this
macro.

Microsoft Visual Studio mangles the constness of the variable, so we
can't remove it now from existing compilers. But we can for the new
version.

This is also required to compile QtSql with the MSVC option
/Zc:strictStrings, which is enabled in Qt 5.4.

Change-Id: Ibf2c2cb7287a4332d69aa81080a37aab4327677d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-06-20 21:21:43 +02:00
Thiago Macieira
173412f047 Fix compilation with /Zc:strictStrings
You can't assign a wide-character literal to a non-const wchar_t*.

Change-Id: I3ec8d4064f8e901bb1c6ff14cdf41550b04c593d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-06-20 21:20:47 +02:00
Dyami Caliri
3226a71a89 QWindowsPrintDevice check for NULL pDevMode from PPRINTER_INFO_2
The MSDN documentation states that the pDevMode member of
PPRINTER_INFO_2 may be NULL.

Task-number: QTBUG-39764
Change-Id: I9c3a4bb565115415dbf45544f3d2391107356610
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-06-20 17:29:32 +02:00
Allan Sandfeld Jensen
70dd563046 Correct QImage::fill(uint) on RGBA8888 formats
QImage::fill(uint) was incorrectly performing ARGB->RGBA conversion when
called on RGBA8888 formated images.

This patch moves the color conversion to QImage::fill(QColor) where it
belongs so that fill(uint) can behave consistent with documentation and
how it treats other formats.

The fill(uint) method had no automated tests, and this patch adds one.

[ChangeLog][QtGui][QImage] QImage::fill(uint) now fills the given pixel
value unconverted when used on RGBA8888 image, making it consistent with
the documentation and treatment of all other image formats.

Change-Id: I00a9d810c61d350dbdd7c4b9ad09e5ce11896b6d
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-06-20 16:08:28 +02:00
Joni Poikelin
e98c461d43 XCB: Fix leak with touch devices
Task-number: QTBUG-39596
Change-Id: I4225d5a1ab4939280640b35d30c283f056a56519
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-06-20 15:56:08 +02:00
Oswald Buddenhagen
11161bbfad pass a pointer instead of a reference to initFrom()
msvc thinks that it's impossible to create a null reference (because
some language lawyer said so) and thus complains about our assert that
checks the reference's validity. work around by not dereferencing the
pointers we already have.

Change-Id: Ife2288d4187860105de12fdebc0e671e0159ace3
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-06-20 11:47:19 +02:00
Martin Gräßlin
473ed1c1aa Properly check which OpenGL features are supported
QOpenGLShaderProgram::hasOpenGLShaderPrograms tests whether
QOpenGLFunctions::Shaders is provided for the given context. As the
initialization code assumed OpenGL 2 this always was true. But
unfortunately we still cannot assume that OpenGL 2 is universally
supported. E.g. indirect rendering (no matter how bad that idea is)
does not support OpenGL 2 on all hardware and the Shader related
extensions are not available.

This change makes sure that only when OpenGL 2 is available the
features provided by OpenGL 2 are enabled. If OpenGL 2 is not
available the extensions are tested. The checks are slightly
reordered to not do the extension tests at all if OpenGL 2 is
available.

Task-number: QTBUG-39730
Change-Id: Ic775163e0dcc519925b1287f3c4ca5e8ebf101d5
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-06-20 11:25:40 +02:00
Martin Gräßlin
075c36e39b Do not overwrite existing event mask of root window
QXcbScreen installs its own event mask on the screen's root window.
This overwrites any existing event mask already set and by that
breaks applications when a new screen is added.

By first fetching the existing event mask and adding it to the newly
installed event mask, Qt does no longer break applications also
installing an event mask on the root window.

Task-number: QTBUG-39648
Change-Id: I8686dd6ae49d0e807c6fe1ea4a231ff728bfcf25
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
2014-06-20 11:25:24 +02:00
Andy Shaw
47b3ecf3f4 Remove the widget from the stylesheet cache before polishing
If the widget exists in the style rules cache before it polishes for the
first time then it should be removed from styleSheetCache too so that the
latest set stylesheet is used for the polishing.

Task-number: QTBUG-39427
Change-Id: Ic1e7988afe530f16ea9996bae56543ed554d6be9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-06-20 07:10:21 +02:00
Jędrzej Nowacki
7e62b10cc1 Remove unused define XCB_USE_IBUS.
Change-Id: Ife95a822ed24b29e9bff0612cd0dc265192c49d8
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-06-19 17:25:22 +02:00
Jędrzej Nowacki
1a034ac218 Attempt to fix intel compiler build error.
qtbase/include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h(625): error #68: integer conversion resulted in a change of sign

Task-number: QTBUG-39678
Change-Id: Ifb175bdcad820aa58cc0a1bcf6985a164376baf5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-06-19 17:25:12 +02:00
Friedemann Kleint
3fd184b663 Use QModelIndex to get the data from underlying model
Change-Id: Ibeb70079afd566c78289168540296b926f36d1af
Initial-patch-by: Irfan Omair <irfan.omair@gmail.com>
Task-number: QTBUG-27597
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-06-19 17:23:30 +02:00
Friedemann Kleint
5af8a46bc1 QGuiApplication: Document -plugin command line argument.
Task-number: QTBUG-38972
Change-Id: Ie4dd6d70e60822a5a3626b10cd90d081897d646d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-06-19 17:23:24 +02:00
Friedemann Kleint
feda990ae8 QEventDispatcherWin32: Use a shared class name for the message window.
Introduce a global-static struct storing atom and class name for
the message window to be shared between threads. This prevents
RegisterWindow()/UnregisterWindow() of different threads (using exec())
from interfering and silently failing.

Task-number: QTBUG-39471
Change-Id: I9bc1106a41f64749c55825a96973921bb831458f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-06-19 17:23:16 +02:00
Friedemann Kleint
54a2206bba Windows: Mark only mouse events synthesized by touch as such.
Pass on mouse events from pen.

Task-number: QTBUG-39353
Change-Id: I96c4e023ddb1c853d5228d00aa9604941556abb4
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-06-19 17:22:52 +02:00
Thiago Macieira
d88b976858 Fix compilation in under -no-c++11 mode
IndexSetter can't be passed to QObject::connect() since C++98 templates
require global types (they can't be function-local).

Change-Id: I099322f835661d4679140b7810b50dbeb0e4b9e0
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-06-19 17:14:05 +02:00
Thiago Macieira
2de8ef2e49 Fix compilation with the Intel compiler on certain systems
We require the intrinsics from immintrin.h, so include it
unconditioanlly with that compiler.

Change-Id: I4a17676631f9d89e2d22e486f40c9b177ca06c1e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-06-19 17:08:29 +02:00
Bjoern Breitmeyer
863a8bfab5 Fixes QFontDataBase addApplicationFont on WEC.
AddFontResourceExW was not implemented yet.

Change-Id: Iffa3e49bdbb0176c10324ede6161fcf8b2a63902
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-06-19 17:02:34 +02:00
Oswald Buddenhagen
000d98d826 Bump version
Change-Id: I867c3b4aecc82095e65bd7f820e7fe6d14005705
2014-06-18 00:27:55 +02:00
Sergio Ahumada
cf7805d364 Merge "Merge remote-tracking branch 'origin/stable' into 5.3" into refs/staging/5.3 2014-06-17 19:09:21 +02:00
Kai Koehne
bdd60463da Fix animations in static builds
Make sure qRegisterGuiGetInterpolator is called even for static builds.

Task-number: QTBUG-37341
Change-Id: I65735a558d5bbfaa02fa4ec47d55ddf33ca1991a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-06-17 15:59:29 +02:00
Sergio Ahumada
753be5af04 Merge remote-tracking branch 'origin/stable' into 5.3
Change-Id: Ibf1b8a03c5153895ec03af5844c0b6addc4a0aa0
2014-06-17 13:34:43 +02:00
Martin Pley
c92ece4518 QRasterPlatformPixmap::createPixmapForImage(): Avoid crash when QImage conversion failes
Added some checks to QRasterPlatformPixmap::createPixmapForImage() to avoid
crashes when QImage::convertToFormat() returns a null image.

Change-Id: I573505a1aff7931d9a2fb452d0a83ae93d8de7db
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-06-16 14:29:13 +02:00
Shawn Rutledge
4038f21dd0 xcb: touch device mode is either Dependent or Direct, not Rel or Abs
Change-Id: Ic0091007c95c4c307485bc2d5d3e1e967b44323e
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-06-16 14:13:24 +02:00
Lucile Quirion
59d6871ae3 directfb: fix QThread destroyed while running
Commit cf092abdfc introduces a virtual
"void initialize()" in QPlatformIntegration class.

"void initialize()" was already implemented in QDirectFbIntegration
since commit 6534898cc6 allowing
initialization steps to be overridden by QDirectFbIntegrationEGL.

Therefore the QScopePointer "m_input" handling a QThread is reset twice.
The QThread firstly created is forcibly terminated. The application
displays the error message "QThread: Destroyed while thread is still
running" and sometimes crash with a SIGSEGV.

This commit rename QDirectFbIntegration::initialize() into
QDirectFbIntegration::connectToDirectFb() to fix this issue.

Task-number: QTBUG-38710
Change-Id: I3ca07c373af7c47abf08da2b45bbcf7a6cf573ad
Reviewed-by: Holger Freyther <holger+qt@freyther.de>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-06-16 13:25:53 +02:00
Oswald Buddenhagen
ad9ca60522 install .lib files for static libs again
the no_dll switch has questionable semantics: it pro-actively breaks
non-dll builds. therefore its usage needs to be limited to dll build.

Task-number: QTBUG-39594
Change-Id: I98328e502693df835af565b5ec25ada2c1c168ad
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-06-16 12:42:25 +02:00
Martin Gräßlin
a461bb1ff5 Flush xcb connection before EventDispatcher is going to block
The non-threaded QXcbEventReader invokes processXcbEvents when the
EventDispatcher is about to block. This method ensures that the xcb
connection is going to flush. Applications can use low level xcb code
in that case without having to ensure to flush the connection before
going to block again.

With the threaded QXcbEventReader this didn't work and applications
which for example changed a window property and waited for the matching
property notify event were stalled.

This change ensures that also in the threaded case the connection gets
flushed when the EventDispatcher is going to block.

Change-Id: If1dc5eb96e2f1bde10b7a40af550b0608c62f70c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-06-16 09:31:46 +02:00
Thiago Macieira
acd0dae3f4 Fix data race in accessing QDBusConnectionPrivate::serviceNames
The trick of creating a copy is not thread-safe. I'd known this since
the moment I wrote that code, but thought "what could go wrong?".

Task-number: QTBUG-39285
Change-Id: If521d4a649c06e6a34926687e85623aa25cb4c35
Reviewed-by: David Faure <david.faure@kdab.com>
2014-06-15 23:04:28 +02:00
BogDan Vatra
66bd87e5c6 Android: REG: Fix crash.
Test if the window has a handle before using it.

Change-Id: I728a129722f8ecd021998d483530a8d1687e5fe3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-06-15 05:54:11 +02:00
Sergio Ahumada
5721c0811a Merge remote-tracking branch 'origin/stable' into 5.3
Change-Id: Icd073d40ce10ab4733b997036815795dd3fbaac1
2014-06-14 18:11:52 +02:00
Jan Arve Saether
16b90bb683 QFontComboBox sometimes became too wide because of wrong fixed size
The fixed width should not be set on QFontComboBox itself, but on the
popup.

This regressed with commit bfb25c0352,
and caused assistants preferences dialog to become wider than the
desktop.

Change-Id: I2059794fc12d34837cdb7dfded80df57d102a6f0
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-06-14 11:59:16 +02:00
Eskil Abrahamsen Blomfeldt
fb3f47b638 Android: Report something sensible for screen geometry
We can't get the actual screen geometry on Android, but in Qt 5.3.0
we would always return the screen geometry minus the size of the
status bar. After the available geometry was initialized to 0x0
instead of this arbitrary value, some applications that depended
on this as a constant value would break if they collected the
information before the window surface had been initialized and they
forgot to listen to QScreen::geometryChanged().

To reduce the risk of regressions, this patch makes sure we return
the same thing as before for the screen geometry and that this is
not linked directly to the available screen geometry.

Task-number: QTBUG-39464
Change-Id: Ie63337b3b10d2eb5130e4fece6c5b144e8230164
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-06-13 21:54:02 +02:00
Friedemann Kleint
9c80a3be4b Revert "Suppress move/resize events if they are the result of call to move()/resize()."
This reverts commit a1c5198387.

The idea of detecting non-spontaneous events by comparing
against the widget's crect has problems when sequences
of programmatic resizes occur. In  addition, QWindowSystemInterface's
queueing of events is problematic for this.

Task-number: QTBUG-39611
Task-number: QTBUG-32590
Change-Id: I4674d8d5d5d432d938f7226b5790543335665c1f
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-06-13 13:32:45 +02:00
Friedemann Kleint
5da108a4a7 Revert "Revert "Fixed duplicate QMoveEvent generated for each QWidget::move call""
This reverts commit c3e416296a.

The idea of detecting non-spontaneous events by comparing
against the widget's crect has problems when sequences
of programmatic resizes occur. In  addition, QWindowSystemInterface's
queueing of events is problematic for this.

Task-number: QTBUG-39611
Task-number: QTBUG-32590
Change-Id: I9ff8049add147be23e064a513e8645ae04577c6c
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-06-13 13:31:59 +02:00
Thiago Macieira
3ccfc351fd QProcess: Handle spurious socket notifications for stdout and stderr
On Unix systems where the GUI event dispatcher uses a notification
system for socket notifiers that is out of band compared to select(),
it's possible for the QSocketNotifier to activate after the pipe has
been read from. When that happened, the ioctl(2) call with FIONREAD
might return 0 bytes available, which we interpreted to mean EOF.

Instead of doing that, always try to read at least one byte and examine
the returned byte count from read(2). If it returns 0, that's a real
EOF; if it returns -1 EWOULDBLOCK, we simply ignore the situation.

That's the case on OS X: the Cocoa event dispatcher uses CFSocket to get
notifications and those use kevent (and, apparently, an auxiliary
thread) instead of an in-thread select() or poll(). That means the event
loop would activate the QSocketNotifier even though there is nothing to
be read.

Task-number: QTBUG-39488
Change-Id: I1a58b5b1db7a47034fb36a78a005ebff96290efb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-12 17:54:11 +02:00
Thiago Macieira
6ca3ab626a Don't try to read from invalid file descriptors in QProcess
strace reveals that we do ioctl(-1, FIONREAD) and get EBADF. The only
case where this could happen is inside _q_processDied, which calls the
read functions without checking if the pipe is still open.

Change-Id: I67637fc4267be73fc03d40c444fdfea89e1ef715
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-12 17:54:11 +02:00
Thiago Macieira
25ef58fe18 QProcessPrivate: merge the functions dealing with stdout and stderr
Simplifies the code.

Change-Id: I4b3a6e725eb245d3531d1d11d959fb3b85862778
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-12 17:54:11 +02:00
Thiago Macieira
0f6b3a01e4 Rename QProcessPrivate::destroyChannel to closeChannel
The QProcessPrivate::Channel object contains some structures that may
survive the closing of the pipe, so calling this function "destroy" is
incorrect. Let it be just the closing.

For symmetry, the createChannel() function is renamed to openChannel().

Change-Id: I2899214c6e4c25835390b10ccf3931315a91589e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-12 17:54:11 +02:00
Thiago Macieira
15a0a6e8c5 Move the QProcessPrivate Windows objects into QProcessPrivate::Channel
Similar to the previous commit, this simplifies the code.

Change-Id: Ia02b9b5174b4bc6fd04ec2534231b7db5fc914fa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-12 17:54:11 +02:00
Thiago Macieira
29f92d112a Move the QProcessPrivate channel buffers into QProcessPrivate::Channel
Simplifies the code.

Change-Id: I70b26af69332f364d856042f114c37a70504d66f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-12 17:54:11 +02:00
Allan Sandfeld Jensen
da5dea807f Support hotplugging of input devices with XInput2
Since we only scan for XInput2 devices on application start, we will
currently miss any devices plugged in while the application is running.

This patch makes QXcbConnection listen for XInput2 hierachyChanged
events and use them to trigger a rescan of XInput2 devices.

This fixes a regression in Qt 5.3, where the scroll wheel on hot-
plugged mice does not work until the Qt application is restarted.

Change-Id: I2cdc7ca24d3ab00716cedc4b22355b6e4935b184
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-06-12 14:35:23 +02:00