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>
With the side-effect that variables and functions in the argument are
now "used". This means we don't need to #ifndef functions only used in
assertions: the compiler will eliminate them by dead code elimination.
Due to the mandatory short-circuiting of the condition, no functions
will ever be called and this expands to no more code than before.
On the negative side, because we won't get warnings for unused variables
initialized outside the Q_ASSERT, non-inlineable calls will not be
elminated by dead code elimination, so they will remain in release code
without warnings.
Because of the expanded code now in Q_ASSERT, the Intel compiler's
optimizer gets thrown: it complains that the non-void function is
failing to return anything, so I had to add two return statements.
Change-Id: I1bb79c9637a2771ef1ec093f901b8d2443788bd6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
For some reasons lost in history, those methods simply ignore
the list of items passed to them, and always return NULL.
Of course, that's totally broken. Fix that by doing the same thing
that the respective (hidden) models did when calling mimeData().
Surprisingly enough, QTreeWidget has a proper implementation.
Task-number: QTBUG-25900
Change-Id: I99ca7b4d4f87f096fd9ff0b0cb4e58282aa9c26e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
QMetaType::type(const char *) requires that the string argument is
0-terminated. This new overload makes it possible to query the type
of a string with an explicit length.
In particular, QByteArrays constructed by QByteArray::fromRawData(),
for example from a substring of a normalized method signature (the
"int" part of "mySlot(int"), can now be queried without making a copy
of the string.
Also, Qt5 meta-objects represent type names as QByteArray literals,
which can be fed directly to this new QMetaType::type() overload (no
need to call strlen).
Change-Id: I60d35aa6bdc0f77e0997f98b0e30e12fd3d5e100
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If we're called out of bounds, sourceModel()->index() will take care of
returning an invalid model index anyway. So calling rowCount+columnCount
every time index() is called can be avoided. These calls can be particularly
slow when sitting on top of a stack of proxymodels. And index() itself is called
very often, i.e. when a proxymodel on top of us is used by a delegate
which calls data() for many different roles.
Change-Id: I45ad6249ea6c6c719a28d25a03b6e5003f4e49ee
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
The change reduces heap allocations by using file mapping instead of
reading a whole file into memory just to create a slightly modified
copy of it.
For this small test case:
moc <<EOF
class X : public QObject { Q_OBJECT Q_PROPERTY(int x) };
EOF
massif shows improvement from:
peak cost: "26,8 KB" heap "2,1 KB" heap extra "0 B" stacks
to:
peak cost: "11,3 KB" heap "2,2 KB" heap extra "0 B" stacks
In general, depending on source file high peak memory usage is reduced
from few to few hundreds KB, especially that the allocation used to
happen for each include file too.
Change-Id: I9c1c848be848444156af25a991b67161fb9d8b29
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Methods can be invoked with QMetaMethod::invokeOnGadget
Change-Id: Id734868bb530b02587daf0f62bce01798ade2ac2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Adds automatic conversion from QVariants with a QVariantHash to
QJsonValue and explicit methods for conversion between QVariantHash
and QJsonObject.
[ChangeLog][QtCore][QJsonObject] Added conversion to and from QVariantHash
Change-Id: I140ef881463acabaab2648e28209487d8ad18e0d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Instead of sending the event from random places, send it from
QWindowSystemInterface. This allows to send override events on OS X to
menus before doing other key processing and reduces the number of
ShortcutOverride events on all platforms to exactly one per key press
event.
Additional test by Friedemann Kleint.
Task-number: QTBUG-38986
Change-Id: I6981bb776aba586ebc7c3daa5fd7a0d84c25bc3e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>