This makes the WinVersion and MacVersion enums accessible in platform
indepedent code to avoid the need to use #ifdef Q_OS_* chains in
user code, leading to fewer platform-dependent code paths and better
maintainability.
To indicate "this is not a Windows based OS" a enum value
QSysInfo::WV_None (with value 0x0000) in QSysInfo::WinVersion
is introduced. This keeps the WV_*_based masks usable.
To indicate "this is not a Darwin based OS" a enum values
QSysInfo::MV_None (with value 0xffff) in QSysInfo::MacVersion
is introduced. 0x0000 might have been preferable for (not so
important "consitency" with QSysInfo::WV_None), but is already
taken by QSysInfo::MV_Unknown with a different meaning.
Change-Id: Ib395e0efba58558f31f4e0806f7333165aa90aa5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We had code duplication all over the place between QItemDelegate
and QStyledItemDelegate. Refactor that code in QAbstractItemDelegatePrivate,
so that both can use it and we'll have one place to fix instead of two.
Change-Id: I0c5decdfac7b0dc6e001c8c970491080f7b2e75f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: David Faure <david.faure@kdab.com>
The new default compler is gcc 4.9, it is needed to compile
64 architectures.
Change-Id: I7ccbac7615b6dc20f5b0441908590de7d4a2e8cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
[ChangeLog][QtGui][QPlatformSurfaceEvent] Added event class
QPlatformSurfaceEvent, which is sent to QWindow and QOffscreenSurface
when native surface is created or about to be destroyed.
Task-number: QTBUG-42476
Task-number: QTBUG-42483
Change-Id: If62e2c2a1f2a94fd310bbf7cf22b94c70125ba7a
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
These synchronously delivered events allow applications to correctly
and conveniently handle native platform surfaces being destroyed. This
is particularly useful when doing rendering on a non-gui thread as it
allows to shutdown rendering before the native surface gets destroyed
from under us.
Task-number: QTBUG-42476
Task-number: QTBUG-42483
Change-Id: I63f41bbdb32f281d0f3b8ec2537eb2b0361f3bb3
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Create and Delete wrappers are not necessary, because they can be
easily simulated with Construct and Destruct. This change removes
redundant function wrappers and a bit of over-optimized code. Gain is
quite big:
Before:
text data bss dec hex filename
5366008 47460 14904 5428372 52d494 libQt5Core.so.5.5.0
505578 7060 2124 514762 7daca libQt5DBus.so.5.5.0
5591079 134656 6728 5732463 57786f libQt5Gui.so.5.5.0
1398785 31676 2576 1433037 15ddcd libQt5Network.so.5.5.0
6642431 220952 2536 6865919 68c3ff libQt5Widgets.so.5.5.0
After:
text data bss dec hex filename
5342559 47460 14904 5404923 5278fb libQt5Core.so.5.5.0
496025 7068 2124 505217 7b581 libQt5DBus.so.5.5.0
5579291 134272 6728 5720291 5748e3 libQt5Gui.so.5.5.0
1389461 31676 2576 1423713 15b961 libQt5Network.so.5.5.0
6637139 220952 2536 6860627 68af53 libQt5Widgets.so.5.5.0
Cost of the change, is moved to CPU while calling QMetaType create()
and destroy(), these two functions became a bit slower. The cost should
not be visible, because they call operator new anyway.
Change-Id: I34fd410343377d9c29925675d7da8172bfda9ce6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This is required so we can take a QVariant and detect that it contains a
Q_GADGET and then use method like QMetaType::metaObject and QMetaProperty::write
with the QVariant::data
Change-Id: I3603692e4e84426e10bf59949e3def3ea4947bec
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix a comment and move another out of a ifdef.
Change-Id: Ib1bc2efba34bd37aa8525621e430d7f6094238ae
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Multisample textures may be supported without multisample texture
storage (e.g. from GL 3.2 to 4.2). And, immutable storage may be present,
but not supporting multisample textures (GL 4.3 - 4.4).
Thus, we must properly check if we can allocate immutable multisample storage,
falling back to mutable multisample storage if we're lacking the feature.
Task-number: QTBUG-42643
Change-Id: I1f3d5a9b4296626e40b69a06710331e49c2d1a33
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
OpenGL ES may be way more pedantic than OpenGL desktop, in that it
supports precise combinations of internal format, pixel format and
pixel type. Fix the switches inside the code to reflect this.
Task-number: QTBUG-41822
Change-Id: Ic0ed025f48a5903f334d56ce8a224dff44821c5c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
The right function to call is allocateStorage(), not allocate().
Change-Id: Ia26817dbec710d49e511cab2ae3ca5c1fda20722
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
OpenGL 4.3 and OpenGL ES 3.0 have support for these formats
out of the box.
See http://en.wikipedia.org/wiki/Ericsson_Texture_Compression
Change-Id: I661f05b9872f3aa128e39cec64df094a79736555
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
In Qt3D we need to be able to send a QSurface * through a QVariant which would
allow us to be as generic as possible.
Change-Id: I2ca2760f9b985c8dc1db822048fa41e13774d52c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Only the data for the first file could be reached with the mimetype
application/x-qt-windows-mime;value="FileContents"
To get the data for the other files, setting the lindex field of
the FORMATETC struct is necessary. Provide support for that by
appending ;index=N to the mimetype string.
The Windows API provides no generic way to find out how many of these
are available (the app has to find out by looking into the FILEGROUPDESCRIPTORW
structure, for this particular use case), so these additional mimetypes
are not listed in QMimeData::formats(). However this patch extends
the documentation to mention the feature.
[ChangeLog][Platform Specific Changes][Windows][QMimeData] Add support
for handling dropping of multiple mail attachments, adding ;index=N to
the mimetype string application/x-qt-windows-mime;value="FileContents"
Task-number: QTBUG-17373
Change-Id: I031e477d2357b4e5135d2dcd3e3cf991025715a5
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Storage allocation was quite wrong in the general case.
1) We can't pass unsized texture formats to immutable storage
allocations, so we need to check for that.
2) Second, when allocating mutable storage on GLES, apparently
the driver is allowed to peek at the external pixel type. The
texture can then only get data in the pixel type passed
at storage allocation time.
(I guess that, for the sake of simplicity, the drivers are allowed
not to perform any pixel conversions.)
I'm still not convinced about the wording in the GLES2/3
specifications, but apparently ANGLE behaves this way, so we need
to fix this kind of allocation. Unfortunately the only way
is to ask, at storage allocation time, what's the external
pixel format/type, so we need to introduce an allocateStorage
overload taking those as arguments and using them for the
glTexImage* calls.
Task-number: QTBUG-41822
Task-number: QTBUG-42623
Change-Id: Idf745d549f01c5db3e56e86cf9b1f53a77cfccc6
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
It makes more sense to put them all together, and actually
the next patches will require the enums to be moved anyhow.
Change-Id: Ieb897e9ea2bfef66426c72f935504a92323e2a00
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
OpenGL ES 3 adds lots of useful stuff in there, so we should
start using it. Since we're there, properly reorganize the other
feature checks.
Note that by starting using immutable storage on GLES2, we may
work around the issue reported in QTBUG-41822 (we're still
not 100% sure if it's an ANGLE bug or a Qt bug).
Task-number: QTBUG-41822
Change-Id: Id8cdbaaf93bc263e663db06b6fd2fee012cb29ad
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Each entry in the link-to-link tables and in the
broken-links table now includes the source file
path of the file where the link or broken link
appears and the line number in that file. The
line number often refers to where the comment
that contains the link begins, so sometimes
the link or broken link appears further down in
that comment.
Change-Id: I692bfc173c8711bf26c9c59ad9771930c27e24a8
Task-number: QTBUG-41850
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Although it is not recommended, it is allowed to have a carriage
return in a qdoc command parameter that is enclosed in curly
braces. qdoc is supposed to use QString::simplified() to sanitize the
string so that all whitespace is replaced by a single ' '. But in at
least one case, this didn't work, and the carriage return was left in
the string, which caused qdoc to report that it couldn't find links
that have the carriage return in them. The problem has been fixed by
replacing the carriage return with a ' ' right when and where it is
detected.
Change-Id: I31c31f19a1e4150b2e27613ecbac260c46a7109b
Task-number: QTBUG-42449
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
The cross-module link report now contains an entry
for the links to broken links subpage. It is the
last entry in the links-to-links table on the QA
page.
Change-Id: I9e0b3ba5f2efe76055902467348db878dbed9991
Task-number: QTBUG-41850
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
qdoc no longer tries to autolink symbols that begin
with two underscores. There may be other cases where
qdoc should not try to autolink. They should be
handled in this same place.
Change-Id: I5a39ea2bb0edec2289b8a4b1a9af1f33534093a1
Task-number: QTBUG-42441
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Currently, qdoc processes \keyword and \target the same way. The
negative effect of this is that when either command appears at the top
of a qdoc comment, the anchor it generates in the html file is just
above the details section on the html page. This is usually wrong,
especially for \keyword commands, where the anchor generated should
always be at the top of the page/text where the \keyword appears. This
update implements that. \target anchors are meant to be used when the
anchor should appear somewhere in the middle of the page/text, exactly
where the \target command appears.
Change-Id: Ibbbf1087562a977ff74ccd98febfe9310ecba8f0
Task-number: QTBUG-42290
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
(it led to printing out garbage, when enabling QMIME_DEBUG)
Change-Id: Iaacd9139ac09e7637930317535631be8132fe0a4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The cross-module link report is modified so that each module
listed in the table is a link to a subpage on which all the
links from the current module to that module are listed. To
check that these links go to the correct place, click on one
to be taken to the actual link. The actual link is marked
with red asterisks. Click on that link to check that the link
goes to the correct page. Repeat this process for all the
links in the table.
Change-Id: Ifddf7108ed7ef090c4063909fdbd10dac1f2566b
Task-number: QTBUG-41850
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
This update fixes a bug introduced in the original update for this
task. The bug caused some links to be generated incorrectly. If the
name of the file containing the target began with the module name,
then a test that asks if the link already begins with the module name
fails, and the link is generated incorrectly. The test now checks for
the module name followed by a slash, which it should have done in the
first place.
Change-Id: Iebac228ac969cef875678b15a248a2a1198ace05
Task-number: QTBUG-41705
Reviewed-by: Martin Smith <martin.smith@digia.com>
When tokenizing, after macro expansion, moc needs to concatenate
subsequent string literals, because parser do not check for such
expressions.
Change-Id: Icc4f01395a5a7b67368eb8341a45ee74ade7d7f5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
- upstreaming the implementation of a BlackBerry 10 specific widget style
- modfied to be integrated as a style plugin being a part of the QtBase
- according docs are provided in QtDocs in another commit
- attributing the excellent work at KDAB who was the original developer
Change-Id: I57c548f6ec4cf02f125ee216f1ce1b764f29e8bb
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
If a context menu contains a menu item which will open a dialog, the
context menu will never get the leave event, which might leave the menu
in an invalid state.
Synthetic leave events are sent to windows, but not to popups that are
blocked by modal dialogs. Hovever, a popup is removed from the popup
stack in QApplication before it receives the leave event. Therefore
always give popups events, even when they are not visible.
Task-number: QTBUG-38021
Change-Id: I63f6febed44f1e7c8f29e7a09af07f32b4ddbc82
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Default to android-21 when a 64-bit target is chosen, as this is
the lowest API level supported for 64-bit targets.
Change-Id: If4ece23911c3e9e45558906d970ef85a3b18b0bb
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This is present in QList already and its lack is a nuisance when
switching from QList based code to QVector (which makes sense e.g.
if the item size exceeds sizeof(void*))
Also, albeit operator+=() and operator<<() exist, some people
simply prefer functions with real function names.
[ChangeLog][QtCore][QVector] Added QVector::append(const QVector &) overload
Change-Id: I9aae8223b086765625f2f3071fab5da0780f8a43
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This crashed because on Android we called
QWindowSystemInterface::handleKeyEvent() with QWindow argument set to 0
This is a regression and started to crash after commit d7ca800a8
(it added the call to tryHandleShortcutEvent() without checking the
window pointer).
Change-Id: Iefd5fe782a0f7f1e1569580ed4fcb2ef60eed2d2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
forkfd is a tool that I designed to facilitate spawning
sub-processes. It's implemented in C, not C++, so that it could be
used by other libraries as well.
To work in all platforms Qt supports and with all compilers Qt is
known to work with, we'll need to replace the generic GCC atomics that
are provided here.
Change-Id: I0a6f86cc220a7c52c8d4284bb7140c56d5cf836a
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
For some reason lost in time QFrame was missing that method. Of course
that led to duplicated code and to subtle sizing miscalculations.
Task-number: QTBUG-29330
Change-Id: I81163f5def6661e01cb2ecc49c1169449a3e3758
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This test shows a behavior change of setFrameStyle(QFrame::WinPanel)
between 4.4 and 4.5.
Turns out that 4.4 defaulted to "Raised" only via a side effect of the
code, while 4.5 defaults to "Plain" which makes more sense since Plain
is the default anyway. So there is no actual bug to fix (the app code
really meant QFrame::WinPanel|QFrame::Raised anyway), but the unittest
is still good to have for the future.
Done-with: David Faure
Change-Id: Icf16382504b18357256bc601b1e865abac9f2b2a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The recent NDKs have included the 4.9 version of the gcc toolchain,
so we default to that instead of 4.8. This is also required for building
for 64-bit targets, since the other toolchains do not support that.
Change-Id: Id6908eb41c8e7cf003a9b134607ab2e55cb489e9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Follow the same convention as other functions using the QMetaTypeSwitcher
It was not a problem since none of the built-ins type in QtWidgets
or QtGui were pointer and could not have a QMetaObject. But since
we want to register the metaobject for Q_GADGET, it would fail compilation
as types like QFont are not defined in QtCore.
Change-Id: I6307bf6f25439ed48355ef7ecfa60575de318a25
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
When sending a second request with implied credentials the connection
used may be cached as a connection without credentials, and thereby
incorrectly reused later for other connections with different implied
credentials.
This patch updates the credentials a cached http-connection is using
before sending a request on it.
Task-number: QTBUG-39456
Change-Id: I1609234136a89c32e00432a67720cd62a73a488a
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
This makes the GLSL compiler issue correct line numbers on errors
even in the presence of the other preprocessor lines inserted by
QOpenGLShaderProgram/QGLShaderProgram.
Change-Id: Ief4fc1dd1e94bb2b3a1ad13fbaf62186910a4994
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Of the const overloads that return a QString or a QByteArray, this is
one that gains the most benefit. It happens often in constructs like:
QByteArray s = x.readLine().trimmed();
After this change, 41 out of 103 calls to trimmed become rvalue in Qt
and 272 out of 441 in Qt Creator. For simplified, the numbers are 27 out
of 69 in Qt and 10 out of 19 in Qt Creator.
Other candidates are left, right, and mid, but there are exactly zero
uses of left, right and mid on an xvalue QString or QByteArray in Qt.
I'm being lazy and using qstring_compat.cpp to store the QByteArray
compat methods.
Change-Id: I4e410fc1adc4c761bb07cc3d43b348a65befa9f6
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>