Commit Graph

15715 Commits

Author SHA1 Message Date
Friedemann Kleint
943ae8bb70 Add overload of QTest::ignoreMessage() taking a QRegularExpression.
Make it possible to match messages by a pattern.

Change-Id: I713312e86db5471755459f1ecc43e8f1ac7a95fb
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2013-11-17 19:10:22 +01:00
Andrew Knight
331bc16afd ANGLE: Enable D3D11 for feature level 9 cards
Enable use of ANGLE on lower-end hardware, such as Surface RT and
Windows Phone 8.

Based on https://codereview.appspot.com/12917046/

Change-Id: Ice536802e4eedc1d264abd0dd65960638fce59e4
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-11-17 12:13:15 +01:00
Alex Blasche
ae4e905993 Add C++11 constexpr to 3D vector classes
This turns QVector2D(1,1) into compile-time expressions when using
a C++11 compiler.

Change-Id: Ifea2d1cdfd5481300f9a5a0c7bbe8bfe9115c636
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-11-15 19:03:40 +01:00
Olivier Goffart
3d2691ae77 Benchmark for QWaitCondition
Change-Id: I89fc0819324c12030bc23ba080b21f3d8d5c9852
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-11-15 15:42:35 +01:00
Uli Schlachter
7e468353c3 xcb: Only create listener window when needed
The xcb QPA plugin uses a separate thread for getting events from the
X11 server in a race-free manner. This thread has to be stopped when
shutting down.  This is done by causing the X11 server to send a special
event that causes the thread to exit when it sees it. (Also, the thread
exits if the xcb connection goes into an error state, but that does not
matter here)

So this event listener window is only needed when Qt is sending events
to itself. This means that it does not have to be kept around and
instead can be created only when needed.

Since this window does not stay around for long, it does not need a
name. However, it does need the list of screens to find the correct root
window, so destroy screens later.

Change-Id: Ib4104cbc3f372fa5d1391bcf5a633a158409862f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-11-15 08:11:56 +01:00
Maurice Kalinowski
88609e6da4 Make console a no-op for WinRT
Compared to other platforms there is no concept of a console
application in WinRT. Hence all applications need to be UI
applications and use winmain.
Furthermore winmain takes care of launch arguments to be
properly converted to arguments passed to user's main().

There is a chicken and egg problem with config.tests as
compilation needs to have an existing entry point which is not
available at configure time.
Hence hardcode the entry point to main for configuring to WinRT.
Those tests are pure compile tests, so the logic of the test
does not change.

Change-Id: I4d3186691a8440845c24b2529cc9646e86dfd8da
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-11-14 18:53:48 +01:00
Bjoern Breitmeyer
c5eba649b6 Fixed CE build of sqlite3
The updated sqlite3 lacks a forward declaration of localtime.
Depending on the CE version that forward declaration
was sometimes available.

Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
(forward-ported from commit fb1649d30b)

Change-Id: Ief6d8ed1cad51fa92a333a20c5dfe781d19761eb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
(forward-ported from commit ea70ec8711)
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-11-14 01:08:32 +01:00
Mark Brand
06d1c149c7 update bundled sqlite to 3.8.1
Change-Id: Id75bf901c9014419eddbe2d0e5a75ee274b17914
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Fatih Aşıcı <fatih.asici@gmail.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-11-14 01:08:22 +01:00
Allan Sandfeld Jensen
34ff885bff Make drawing to and from RGBA8888 images faster
After profiling drawing with RGBA8888 images most of the time appears
to be spend in converting to and from ARGB32PM.

This patch adds four small converters that are 3-4 times faster than the
generic converter.

Change-Id: I3c7498756f440ca3ea9c1417b26dd8e1953b9d06
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-11-13 15:21:06 +01:00
Laszlo Agocs
5dd94b75e3 Add swapInterval to QSurfaceFormat
Implement swap interval support for EGL, GLX and WGL.

The environment variable QT_QPA_EGLFS_SWAPINTERVAL is renamed to
QT_QPA_EGL_SWAPINTERVAL and can be used to override the applications'
setting of the swap interval.

Task-number: QTBUG-31939

Change-Id: I644325d5d3306b7604bffd7efccda3c00ed37d36
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-11-13 09:47:34 +01:00
Maurice Kalinowski
c784ec00fa WinRT: implement QStandardPaths
need to leave some items out like media folder access, as this is not
available by default and also requires certain capabilities to use
those.

Furthermore updated the tests for sandboxing as well as skip cmd.exe
related tests as that does not exist on WinRT.

Change-Id: I992b1e195b79615bea0be4f84f56cfb8f0d902bf
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-11-12 12:46:37 +01:00
Maurice Kalinowski
7ea584f830 fix directory separators for WinRT
internally we always use forward slashes

Change-Id: I0573d63b993bb76bc5798ee060fe9bdfb7304658
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-11-12 12:46:37 +01:00
Maurice Kalinowski
f7f9126ed7 change to basic file info on WinRT
FILE_FULL_DIR_INFO failed under certain circumstances on WinRT and
provides far more information than required. Hence prefer the basic
version in every case and standard for files with size description.

Change-Id: I63f1365f83cdd5d69f81278411f822dbd361fa92
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-11-12 10:39:54 +01:00
Maurice Kalinowski
0de8370531 Enable qfile tests for platforms without network
Currently network is only required to gather the host info for one
test case. That does not justify to disable all other tests, which can
provide useful information on the state when doing a port. Hence
disable that testcase if no network is available.

Change-Id: I202ef49b3e07ae69ec85ee0432ae0a771a90e816
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-11-11 20:13:12 +01:00
Stephen Kelly
459fb11481 uic: Accept an -include argument to generate a #include.
Change-Id: I2854619ab995b4ba3c820fec58e998ad04ac9858
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-11-11 15:56:52 +01:00
Marc Mutz
a4446c299a QComboBox: use QSignalBlocker
Change-Id: If805652d05007de9206951f09499acf931990df2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-11-09 15:43:57 +01:00
Olivier Goffart
9fda89f97d Make use of the internal space for enum in QVariant
Enums are movable even if they have not been tagged as such, and
therefore can safely make use of the internal storage.

Change-Id: I3bec8556bfeb4a07cb30d918f8d1dd2565d6d94a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-11-08 16:22:46 +01:00
Marc Mutz
4fb04b0bd7 QSocks5SocketEngine: use QSignalBlocker
Change-Id: Ib30daf8d716401cf3e2c562dc3ab7924b026189d
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-11-08 14:28:15 +01:00
Maurice Kalinowski
05345f2a55 Disable error message box on WinRT
While exception handling methods are not available on WinRT, the debug
mode ones are. This way we can suppress error dialogs from popping up
like on desktop windows.

Change-Id: Id6e9666af9274d373e7d46e3f9e44892a2bd0dbc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-11-08 11:02:27 +01:00
Giuseppe D'Angelo
560d33ad04 Introduce proper QSurfaceFormat's setters/testers for format options
Fixes several things

* setOption(options) has the wrong name (singular)
* setOption(options) doesn't set the current options to the argument, but
ORs the current options with the argument and sets the result
* testOption(options) has the wrong name

The old methods get deprecated, and new methods and overloads get
introduced here. Old code behavior is thereby preserved.

Change-Id: I51bba49f22810c80e6b4980892600d616503af6b
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-11-07 18:00:28 +01:00
Maurice Kalinowski
18bb8d6b16 compile fix if no QFileSystemWatcher is available
Change-Id: I22d0cd90da96e6b6f651768955c7f445dfbcf6bc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-11-07 11:16:12 +01:00
Mandeep Sandhu
60dc35e428 Examples: Add support for custom nameserver to dnslookup
Updated dnslookup example to take an optional nameserver argument
for doing DNS lookup against a specific nameserver.

Task-number: QTBUG-30166
Change-Id: I9f46f9f766b56f770d2c8372e3bfad5c71023c73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-11-07 09:44:44 +01:00
Maurice Kalinowski
1de459a6dd use apartment threading for CoInitializeEx
otherwise we are risking a lock by freeing resources from other
threads when calling CoUnitialized()

Change-Id: I1fe09d7d3b1674a00b44ababfc90da79580278b3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-11-05 15:51:09 +01:00
David Faure
3604280b41 QStandardPaths: Add GenericConfigLocation to the documentation
The actual feature comes from a merge from the stable branch.

Change-Id: Id067fb2b26cb3c6b78c7705b77bd741e3bd8f090
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-11-05 09:45:27 +01:00
Maurice Kalinowski
2ff0746e97 Refactor plugin loading for WinRT
Specify the root directory to be the package root. Only plugins
inside the root can be opened (actually also only files). Furthermore
current defaults to the package root now, which in most cases is
identical to previous behavior.

When attempting to load a plugin the path can either be specified in
host format "C:/..." or as plugin absolute "/platforms/...". Check for
both, with preference of latter case, like when qt.conf is used with
/ being used as plugin path.

Change-Id: I7e3da293362488b62a3357c4882ebf5e048dcf95
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-11-05 08:17:35 +01:00
Andrew Knight
af0409d336 WinRT compatibility functions: properly return ERANGE from getenv
...when the buffer's size is smaller than the value size.

Change-Id: Id345982c9fc4ceed6505d0c192680c47c554fcb4
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-11-04 13:39:04 +01:00
Andrew Knight
fac56f3866 WinRT: Remove Windows metadata flags from common mkspec
Winmd is not used, so there is no reason to embed it.

Change-Id: I0820256aecd9c3c71b0b0c8afa53941b03f97363
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-11-04 11:16:41 +01:00
Andrew Knight
04d1da1c1b Fix QTimeZone test compilation on WinRT
WinRT doesn't use the Windows Timezone backend, so don't build the
Windows test.

Change-Id: I32620546de3ad1f19402cc1359f8038200c915ec
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-11-04 11:16:34 +01:00
Andrew Knight
8120083436 Replace use of putenv in test case
This should be using qputenv; putenv is deprecated on MSVC.

Change-Id: I7c27cf5f7955624fa3553b7a34ab11c6fae462b8
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-11-04 11:16:16 +01:00
Maurice Kalinowski
4058b28494 Ignore debugger arguments on WinRT
Visual Studio debuggers send an argument to specify the debugger port.
This argument needs to be skipped while parsing and not to be interpreted
as an option or test function.

Change-Id: I24efb52fbd668a7bc3388c876f5ea0d950de1d5b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-11-01 08:44:47 +01:00
Maurice Kalinowski
4f563f6bee Avoid adding empty arguments
QByteArray split does create one item even if the string is empty.
Hence check if the launch arguments string needs to be parsed at all.

Change-Id: I0a355212aaa7254fe0f417c61a59c30223311915
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-11-01 08:44:40 +01:00
David Faure
a9b6a78e54 QThreadPool: fix race at time of thread expiry.
The current synchronization mechanism was racy: decrementing waitingThreads
and then hoping that the wakeOne will wake a thread before its expiry
timeout happens. In other words, on timeout, a just-assigned task would
never run. And then no other task would run, if maxThreadCount is reached.

Fixed by using a queue of waiting threads (rather than just a count), and by
moving the wait condition into the thread itself, so we know precisely
which one we're waking up, and we can remove it from the set of waiting threads
before waking it up, and therefore it can determine on wakeup whether it
has work to do (caller removed it from the queue) or it expired (it's still
in the queue). This is reliable, whereas the return value from QWaitCondition::wait
isn't reliable, when the main thread has already decided that this thread
has work to do.

Task-number: QTBUG-3786
Change-Id: I1eac5d6c309daed7f483ac7a8074297bfda6ee32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-10-31 17:45:58 +01:00
Marc Mutz
94fd108ea4 QPlainTextEdit: use QSignalBlocker
Change-Id: I581e60c4efd985fb909614459229806185f9501c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:58:44 +01:00
Marc Mutz
a6f0f07782 QMenu: use QSignalBlocker
Change-Id: I41006d2b6f1454382b8c0bede20999d882b66f26
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:58:38 +01:00
Marc Mutz
6861fb2577 QFontComboBox: use QSignalBlocker
Change-Id: I6a9eab39088275427e4282ee590fda439b2f2901
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:58:34 +01:00
Marc Mutz
180e28ef50 QTreeWidget: use QSignalBlocker
Change-Id: I0b69cd5680dfae6349bd4a952f358fe0b4acb2ff
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:58:30 +01:00
Marc Mutz
694e822080 QInputDialog: use QSignalBlocker
Change-Id: I711dbc0c35bc51ad3149e3d7b41e716bc9ab94b5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:58:25 +01:00
Marc Mutz
64050fe92e QPrintPreviewWidget: use QSignalBlocker
Change-Id: Ic2d48c8e2c9c3c6f06e67ebf7e12bd4899b421aa
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:58:20 +01:00
Marc Mutz
abbffdd4be QTabWidget: use QSignalBlocker
Change-Id: I4621e6b504c531903210242cf0f1cf12e7538784
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:58:15 +01:00
Marc Mutz
91c682e719 QMdiArea: use QSignalBlocker
Change-Id: I54bb64531b1b9639bec163a96baae67b9cabd16b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:58:11 +01:00
Marc Mutz
b5a4be09aa QDockAreaLayout: use QSignalBlocker
This change changes the point where signals are unblocked again in
QDockAreaLayoutInfo::updateTabBar() to include the final tabBar->count()
call. This should not be a problem, as count() is a const function and
thus shouldn't emit any signals.

Change-Id: I6f3dc5696a9c31db51fbe4cdee4b9d83ddeaf61f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:58:06 +01:00
Marc Mutz
b2d3d6365e QDateTimeEdit: use QSignalBlocker
Change-Id: I4983e96a51220f40644d202d76e92a889ae9431a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:57:59 +01:00
Marc Mutz
48894cc75b QAbstractSpinBox: use QSignalBlocker
This change changes the point where signals are unblocked again in
QAbstractSpinBoxPrivate::updateEdit() to include the final update()
call. This should not be a problem, as update() merely posts an
event and shouldn't emit any signals.

Change-Id: I4b2ae109f057792b573ad6ea168ca77c18c773d0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:57:47 +01:00
Marc Mutz
8d7b0a8c3e QFontDialog: use QSignalBlocker
Change-Id: I7be3ac4a7e6988d768e1db68f10a6920aa825a76
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:57:26 +01:00
Marc Mutz
4003d44ca2 QFileDialog: use QSignalBlocker
Change-Id: I32a631493138a777458557232da084f497adc526
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:57:22 +01:00
Marc Mutz
3549dfe8b8 QColorDialog: use QSignalBlocker
Change-Id: Id680d9b934760cdd6a20579518199bd388b56e5d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:57:19 +01:00
Marc Mutz
0326c036d6 QItemSelectionModel: use QSignalBlocker
Change-Id: Ib88db7516fd7dd8f10a86444c506f3294948e79b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:57:14 +01:00
Marc Mutz
ed827acc27 QSignalBlocker: (new) RAII class for QObject::blockSignals()
I don't think I ever worked on a project of non-trivial
size that didn't at some point add a QSignalBlocker.

This commit adds code, tests and documentation. Later
commits will convert naked blockSignals() calls to use
QSignalBlocker.

The implementation is purely inline to avoid the heavy
overhead of cross-dll function calls for this miniscule
task. This should not be a problem because QSignalBlocker
only uses public API and a pattern that we anyway need
to keep working until Qt 6, at least, so even changing
the implementation later will be no problem as the old
implementation lurking in non-recompiled code will be
acceptable, too.

This implementation is an evolution from KDTools'
KDSignalBlocker, with the following changes:
- Implements unblock() and reblock()
- Uses the return value of blockSignals() instead of a
  separate signalsBlocked() call.

Change-Id: I1933dfd72a0f5190324be377cfca3c54cf3d6828
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-10-30 12:56:44 +01:00
Thiago Macieira
bf6a345baa Doc: update the documentation of QStandardPaths to be more thorough
Specifically, note what paths can be empty and which ones can't (modulo
system mis-configuration, like an empty $HOME var) and describe what
implications there are for application-specific paths and for global
(user) paths.

Change-Id: If6c11aab466ba50f3a9685dce52dd51b86426f27
Reviewed-by: David Faure <david.faure@kdab.com>
2013-10-29 16:11:46 +01:00
Oto Magaldadze
e913972d52 added QAbstractSpinBox::setGroupSeparatorShown function.
[ChangeLog][QtWidgets][QAbstractSpinBox] QTBUG-5142 - This will
allow a group (thousand) separator to be shown in QSpinBox
and QDoubleSpinBox widgets.

Task-number: QTBUG-5142

Change-Id: I2e23f5f83c93bb092a2dbd784e06d17d40d42909
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-10-29 12:12:16 +01:00