Commit Graph

19164 Commits

Author SHA1 Message Date
BogDan Vatra
6302d6eef7 Export QStateMachine running property.
It is needed to control a QStateMachine object from QML.

Change-Id: I19271d97718af2d688c477647d6341f70fdef3ea
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-06-26 09:32:15 +02:00
Martin Smith
d8062f117b qdoc: Give documenter more control of linking
This update enables using the module name as the parameter
in square brackets for the \l command. You will use this
when your link goes to the wrong page. e.g. Suppose this
link command went to a page in QtGui instead of the page
where it is meant to go in QtQuick:

\l { mytarget } { the text for my link }

When a link goes to a page in the wrong module, it means
the target exists in more than one module and because qdoc
searches the modules in sequence and stops when it finds a
match, it might match the wrong target. This would be a
collision in the single tree version of qdoc, but now qdoc
builds a separate tree for each module. Since you know
which module you want your link to go to, put the module
name in square brackets as the first parameter, like this:

\l [QtQuick] { mytarget } { the text for my link }

Now qdoc will only search for mytarget in the tree for
the QtQuick module.

The \target command can now be used anywhere. It has not
been tested in all possible locations, but it works in
the places where people have asked why it doesn't work there.

There will be a further update to complete this task for
implementing the other types of parameters that can be in
the square brackets.

Task-number: QTBUG-39221
Change-Id: I2db4fdd0319ff272ec1d2fa9dc396f14599d80f9
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-06-26 08:33:53 +02:00
Oliver Wolff
4108bfb47c WinRT: no read-only paths in QStandardpaths::writableLocation
As FontsLocation, HomeLocation and RuntimeLocation are read-
only on WinRT WritableLocation should return empty strings
in these cases. In addition all the other options were
added to the switch statement in writableLocation.

Task-number: QTBUG-38581
Change-Id: Iab994556844e713c6fa02028a0ec824ecb5ee82b
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-06-26 08:32:22 +02:00
Allan Sandfeld Jensen
b6ba4ac00d Unduplicate the implementations of next power of two
Qtbase contains four identical implementations of next power of two,
these should be shared and the implementation made available to other
qt modules, as it is also used many places outside of qtbase.

[ChangeLog][QtCore][QtMath] Introduced qNextPowerOfTwo methods.

Change-Id: Id23fbe5ad6bae647b30d5a4212c0330e48a50278
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-06-26 00:47:51 +02:00
Thiago Macieira
329efea47e Fix compilation on Windows without precompiled headers
qnetworkinterface_win_p.h needs to include at least one Qt header before
it can use QT_BEGIN_NAMESPACE. That header is the first header in
qnetworkinterface_win.cpp.

Found when trying to compile Qt with ICC.

Change-Id: Iaa312ff54243b6fb3beb107f0eda74f92c6e3ebb
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-06-25 20:21:43 +02:00
Dyami Caliri
3f42e1a171 QWin32PrintEnginePrivate check for NULL pDevMode and hdc.
The MSDN documentation states that the pDevMode member of
PPRINTER_INFO_2 may be NULL. Also, CreateDC may fail and return
a NULL. Rework release() to release resources even if hdc was null.

Task-number: QTBUG-39373
Change-Id: Ia08da61bf6ab99f02f0c7a09c608a5d3db34ef65
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-06-25 20:20:52 +02:00
Kai Koehne
ef077750ce QDebug: Remove handling of FORCE_UREF define
This is the only place in Qt source code we use FORCE_UREF, and can
be traced back to the very first qt.git commit. In any case, it's
broken: It returns a reference to a local variable, since the debug
argument is _not_ a reference.

Using a reference both for the argument and the return value would
be actually the canonical solution, but that breaks with

QDebug << operator(QDebug, const QVariant &),

exported in QtCore. The C++ lookup rules apparently prefer this
overload then to be used for outputting containers ...

Change-Id: Iaf5e5dd89d4f3ebe6454eba219046b4f25b0d717
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-06-25 17:45:54 +02:00
Jerome Pasion
b7f8e7664a qdoc: Improve <title> element contents in HTML pages.
-applied logic to projects that set (or not set):
    -landing page
    -home page
    -version
-change would remove duplicate information and proper module names
 instead of "Title | QtModule 5.4", it would be "Title | Qt Module 5.4"
-tested on various projects:
    -Digia projects
    -Qt 5
    -Qt Creator

Change-Id: Ica7d5203d293910c98306f947bfee8454b9225d0
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-06-25 17:12:53 +02:00
Thiago Macieira
7ab6f24ac1 Update MSVC compiler features according to testing
Looks like a few extra features have been supported for a while and we
had never noticed. That includes the C++98 template friends, C++11
extern templates and C++11 nullptr. They've been supported since at
least MSVC 2010, possibly even earlier, but I don't have MSVC 2008 to
test with.

Testing also indicates that MSVC 2012 and 2013 have a bug in their
support for the range for construct. The following code fails to
compile:

    for (int i : l)
        do { (void)0; } while (0);

    test.cpp(2) : error C2059: syntax error : '}'

Reported as https://connect.microsoft.com/VisualStudio/feedback/details/903999/c-11-range-for-construct-fails-to-compile-when-body-is-a-do-while-block

Change-Id: I5d0156f4c847c45fa1f6f5b9ee4ddbdacb8ab59b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-06-25 16:52:10 +02:00
Thiago Macieira
53262b9b5b Only define the MSVC C++11 feature macros in C++
Don't define them if qcompilerdetection.h was compiled in C mode.

Change-Id: I080b62ef7c68bb582e55e9e3a1dff4e6c1bb48bd
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-06-25 16:51:59 +02:00
Allan Sandfeld Jensen
a1fc11ca65 Introduce std::string conversion to QByteArray
Add conversion methods similar to those in QString to QByteArray. This
is often more useful than the QString version since std::string like
QByteArray are byte arrays.

[ChangeLog][QtCore][QByteArray] Added convenience methods to convert
directly to and from std::string.

Change-Id: I92c29d4bb1d9e06a667dd9cdd936970e2d272006
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-06-25 16:51:53 +02:00
Andrew Knight
273ed8e0fa winrt: Refactor timer callbacks
With the previous solution, a thread pool timer callback fired
in the same thread as the dispatcher. Now that timers can be called
from the base thread pool, callbacks can come from alternate threads and
so the associated event dispatcher must be tracked. This change refactors
how timer info objects are created and tracked so that they can be
properly created/destroyed/queued inside the timer callbacks.

All QTimer tests pass.

Change-Id: I18a5573df2a8fa32d1982c61e665d5df664b6db0
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-06-25 16:34:45 +02:00
Andrew Knight
b46e48f1b7 winrt: Use native threading
Instead of using std::thread, use the WinRT ThreadPool to manage
threads. This allows for setting the scheduling priority, and provides
a path to enable XAML integration (which requires Qt run on a background
thread).

QThread::terminate() is still unsupported, and only the winmain thread
can be adopted due to the behavior of the thread pool when creating
tasks from the GUI thread. The associated tests are now skipped, and
all other QThread tests pass.

Task-number: QTBUG-31397
Change-Id: Ib512a328412e1dffecdc836bc39de3ccd37afa13
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-06-25 16:34:39 +02:00
Andrew Knight
50001dc801 winrt: Clean up QWinRTScreen
- Remove WP8.0 code paths
- Remove WinRT types from header as much as possible
- Use ComPtr where appropriate
- Use COM convenience methods

Task-number: QTBUG-38115
Change-Id: Ib241c3e5107add255a48340f86ee5885f895ff83
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-06-25 16:34:32 +02:00
Andrew Knight
b740e27e36 winrt: Clean up QWinRTServices
- Remove WinRT types from the header
- Use ComPtr everywhere
- Use convenience methods for HRESULT and async operations

Task-number: QTBUG-38115
Change-Id: I540a3349612b98c45545c92b2cb6d21a34918b8f
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-06-25 16:34:23 +02:00
Andrew Knight
5e32bfa3e2 winrt: Clean up QWinRTCursor
- Remove WinRT types from the header
- Remove WP8.0 code paths
- Use convenience methods for HRESULT handling

Task-number: QTBUG-38115
Change-Id: I05e77d75a7975a783d0f0714e6bab014231a406c
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-06-25 16:34:18 +02:00
Andrew Knight
6dd9146938 winrt: use ComPtr in network classes
This removes extra code and potential memory leaks by using smart
pointers instead of calling Release() directly.

Task-number: QTBUG-38115
Change-Id: If799d6948af8c3df3d0c1617742653b104087e3b
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-06-25 16:34:14 +02:00
Andrew Knight
164ae66ff7 winrt: Add convenience method for waiting on an async call
As most of the Windows Runtime API is asynchronous, we have used various
methods for blocking in the calling thread waiting for the operation to
complete. This introduces an inline method, QWinRTFunctions::await(),
which performs the wait in a consistent and safe manner.

Task-number: QTBUG-39407
Change-Id: I54cd0e178aa560891ab92bfc5e7a6553e60e01b2
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2014-06-25 16:34:09 +02:00
Andrew Knight
6d95ce1649 winrt: Add convenience macros for returning from HRESULT calls
Almost every native call in WinRT uses COM HRESULTS. Provide some
convenience macros for returning after failure.

Task-number: QTBUG-39407
Change-Id: Ia99b0acd771d53c52732f270e46dd6937538e131
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-06-25 16:34:02 +02:00
Andrew Knight
1ae61e95e4 winrt: Remove WP8.0 references from package manifest feature
Also, harmonize the qmake documentation.

Change-Id: I8722370f86982e33ccf97f631ae257c4c46cade2
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2014-06-25 16:33:55 +02:00
Andrew Knight
1aac2527c7 winrt: Return correct value from QSysInfo::windowsVersion()
Task-number: QTBUG-38439
Change-Id: I26303d040cc4b958e6af90ea63e5b0d821e2bb74
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-06-25 16:33:50 +02:00
Friedemann Kleint
bae7435f61 Propagate source/flags of QMouseEvent to QGraphicsSceneMouseEvent.
It is useful to be able to detect synthesized mouse events
in GraphicsView as well.

[ChangeLog][QtWidgets][QGraphicsSceneMouseEvent] Accessors
for Qt::MouseEventSource and Qt::MouseEventFlags were added to
QGraphicsSceneMouseEvent to enable detection of
synthesized mouse events.

Task-number: QTBUG-39814
Change-Id: Ib5835fef1f484005f9b0fc86518ed32ea79cd80f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-06-25 16:31:10 +02:00
Friedemann Kleint
4696e9dbaa QAbstractProxyModel: Forward drop-related API.
Forward canDropMimeData() and dropMimeData() to the source model.

[ChangeLog][QtCore][QAbstractProxyModel] QAbstractProxyModel now
forwards the drop-related API.

Task-number: QTBUG-39549
Change-Id: Ib81fcec862586e4ecfb99b9e0f4eb1a16eace762
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-06-25 16:31:03 +02:00
Jędrzej Nowacki
8ded0a324d Make VectorBoolElements static properties const.
The elements should not be changeable.

Change-Id: I108cb42b1237cd61c4d8f2fbe13305fbbf4ef311
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-06-25 16:28:25 +02:00
Jędrzej Nowacki
179fefe8d2 Remove an useless assert.
Change-Id: Icf6f6234d6f090fe4928830783620e7255362293
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-06-25 16:28:14 +02:00
Jędrzej Nowacki
e6f869c022 Remove unused private method from QSignalSpy.
Change-Id: I0b401b2f18aef573a63d77702dd78bd4469d9475
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-06-25 16:28:03 +02:00
Jędrzej Nowacki
35c7c3708f Avoid extensive string lookup in QSignalSpy.
Change-Id: Ie676ad36033e2f8d9832313956cfde9179967483
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-06-25 16:27:48 +02:00
BogDan Vatra
8429c6a5a2 Emit a notifications when defaultState and historyType are changed.
In order to properly use QHistoryState object in QML we need to know
when these properties are changed.

Change-Id: I28c783436410c84bc64a919ac18c183f7a5eb9ad
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-06-25 16:24:56 +02:00
BogDan Vatra
dd70e2cb0f Emit a notifications when childMode, initial and errorState are changed.
In order to properly use QState object in QML we need to know when these
properties are changed.

Change-Id: I37f8295e5201686a52d448cc42db331a8f8e792f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-06-25 16:24:47 +02:00
Laszlo Agocs
7fa584254c Support translucent windows on eglfs
Task-number: QTBUG-39834
Change-Id: I3f6b041c992365d611aa97a41bc37e80b764b78a
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-06-25 16:24:15 +02:00
Laszlo Agocs
33e9aeca7f Support framebuffer blit and msaa without extensions on GLES3
Call the standard functions directly in GLES 3.0+ builds.

The catch here, just like with the mapBuffer changes, is that we could,
in theory, dynamically load a GLES3 implementation on the !QT_OPENGL_ES_3
path too. However this is limited to Windows currently and we don't have
a full GLES3 stack there (yet), and even when we do get it, the ANGLE
extensions for blit and multisampling will still work. Therefore this
isn't really an issue for now.

Task-number: QTBUG-38168
Task-number: QTBUG-39187
Change-Id: I343a737218c9fe438ee1603b37e93f0400d952a5
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-06-25 16:23:56 +02:00
Laszlo Agocs
79bbef7588 Enhance msaa and blitframebuffer on ES with vendor extensions
The support already in place for ANGLE is now extended for NV.

On ES 2.0 the only way to get multisampled renderbuffers and blitframebuffer
is through vendor-specific extensions. QOpenGLFunctions is updated to resolve
the related functions for both ANGLE and NV, in addition to EXT.

Task-number: QTBUG-39187
Change-Id: I1aab805ced3d06dde3dc547221bbf833ff8e06c2
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-06-25 16:23:52 +02:00
Frederik Gladhorn
4b581414fa Merge "Merge remote-tracking branch 'origin/5.3.1' into 5.3" into refs/staging/5.3 2014-06-25 15:24:01 +02:00
Frederik Gladhorn
3921c825d8 Merge "Merge remote-tracking branch 'origin/stable' into 5.3" into refs/staging/5.3 2014-06-25 15:24:01 +02:00
Friedemann Kleint
7c83360140 QColorDialog: Do not update custom/standard color cells while picking.
Delay the updating of the custom/standard color cells to the mouse
release of the color pick. This makes it possible to pre-select
a custom color cell for assignment before the pick and prevents
that from changing when its color is crossed by accident.

Rename the existing method QColorDialogPrivate::setCurrentColor(QRgb)
to setCurrentRgbColor() and move QColor::setCurrentColor() to
QColorDialogPrivate, introducing an enumeration for specifying what to
set.

Task-number: QTBUG-39792
Change-Id: Ibfe96e345589346e8c72976a0335e901798f2766
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-06-25 14:09:37 +02:00
Thiago Macieira
4cf37985e4 Fix -Werror compilation on big-endian
qt_alphamapblit_rgba8888 is only used on little-endian systems, where
qAlpha() returns the correct value.

qdrawhelper.cpp:6256:13: error: 'void qt_alphamapblit_rgba8888(QRasterBuffer*, int, int, quint32, const uchar*, int, int, int, const QClipData*)' defined but not used [-Werror=unused-function]

Change-Id: Ibba6dd6914138f7ae5d53a8e354597f5fff65433
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-06-25 13:45:15 +02:00
Stephen Kelly
3cd70c11bc CMake: Allow modules to specify the location of tests.
Webkit has a different layout, so allow the tests to be found in
the appropriate location.

Change-Id: Iedbea6daada98a3c3efdbcfc1fe4df5d2c8cea6a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-25 13:38:13 +02:00
Kai Koehne
1e303a286e Mark behavior of QFileInfo::absoluteFilePath as undefined in corner cases
The current description was misleading, since e.g.

QFileInfo().absoluteFilePath()

will always return an empty string.

QFileInfo("").absoluteFilePath()

however will return the current working directory ...

Instead of documenting these small quirks we should rather mark the
exact behavior as undefined, like we already do for absolutePath().

Change-Id: I70358413528429c2c2dee37480ad018aae26e6cb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-06-25 13:34:07 +02:00
Gatis Paeglis
51d6df1d18 Translate Super/Hyper keys to MetaModifier
This is how it was done in Qt4. If users are interested
in an actual X11 keysym they can use QKeyEvent::nativeVirtualKey().

Change-Id: I710664e48c5db1633a357aa0a5d238f3453103ab
Task-number: QTBUG-38428
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Sebastian Kügler <sebas@kde.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-06-25 13:24:01 +02:00
Laszlo Agocs
ee88ed8fab Include the ES3 headers on iOS
The config test correctly recognizes if GLES 3.0 is
available, however qopengl.h still includes the ES2
headers. This causes issues for the new GLES3 support
patches.

Change-Id: Ia97f556cc207f7d828918f493fe1adab93cf31ec
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-06-25 12:39:30 +02:00
Laszlo Agocs
186354ee51 Add a way to access loadKeymap on eglfs
[ChangeLog][QtGui] Keymaps are now changeable at runtime when using eglfs

Task-number: QTBUG-39583
Change-Id: I93480da72c1d1d1db1914298fe624cae02b0b2d0
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Will Wagner <willw@carallon.com>
2014-06-25 12:39:14 +02:00
Laszlo Agocs
27dc07fa05 Support adapting an existing NSOpenGLContext in cocoa
Change-Id: I61b4055020c82dd5ac40850fe7def91d26ffb6fe
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-06-25 12:39:07 +02:00
J-P Nurmi
b69d537d7f QGuiApplication::layoutDirectionChanged(Qt::LayoutDirection) [signal]
This allows QQuickApplication to listen to layout direction changes
without installing an expensive event filter on the application object.

Change-Id: I2d7d8906acecbc092657c4bd918bbdc9aad9744c
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-06-25 12:37:13 +02:00
J-P Nurmi
61c3ab9967 Android: extract actionOverflowButtonStyle (button menu icon)
Task-number: QTBUG-39215
Change-Id: I6fdb5ab4a7469017505376421d17cf4367baf76f
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-06-25 12:37:07 +02:00
Frederik Gladhorn
36b798a8d1 Merge remote-tracking branch 'origin/5.3.1' into 5.3
Change-Id: I51fb88701b19ce4f7ea78e12a4049156f3ef9d7f
2014-06-25 10:25:36 +02:00
Frederik Gladhorn
bd20b30bf8 Merge remote-tracking branch 'origin/stable' into 5.3
Change-Id: I7462840d15583ead82e86fcf5c84659b909e8c4e
2014-06-25 10:22:20 +02:00
Frederik Gladhorn
1f3d9b12ab Fix logging file location docs
The location mentioned in the docs didn't work because it was wrong.

Change-Id: I80bbc16bfecc5662317f9963299981266b95bba8
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-25 10:08:55 +02:00
Stephen Kelly
c2c90b95bf CMake: Report an error if unit tests are not found for a module.
Change-Id: Ic1540cfb04bf975a14bf2b35f4402bd36046de67
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-25 01:11:52 +02:00
Alex Trotsenko
7cc893b216 Fix QRingBuffer::readPointerAtPosition()
Fix condition to allow return a valid pointer when head != 0.

Change-Id: I5215f7dfc44924016c2d9b67ab2d9935b5164d7a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-24 18:48:33 +02:00
Thiago Macieira
00dce1cc00 Make the fetchAndAddRelaxed function a member template
This way, no compiler can instantiate it at class instantiation time. We
don't want them to do it for T that are function pointers (sizeof
functions is meaningless).

Change-Id: I6d5044bd5d9ffd0d347f1f38ab33c64213730788
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-06-24 18:41:45 +02:00