QWindowsWindow::setParent_sys() was checking if window was toplevel
using non-native method, which caused wrong result in some cases
involving native windows. Changed the toplevel check to utilize
native method instead.
Task-number: QTBUG-26826
Change-Id: I72ca17c53c1ed7611f141cee17b2edaaa80c6c17
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
DeleteObject parameter must be a handle, not a pointer to a handle.
Task-number: QTBUG-26835
Change-Id: Id5de2b0b067bd9fc45c1c8ead4f7d67f0162f070
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This class doesn't have an eventFilter method.
Change-Id: Ibd7b3b5b954dd2467c9b4dadd85d3613964d9f7c
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
When embedding manifests we modified the EXE/DLL after linking using
the manifest tool. This breaks the incremental linking feature of MSVC.
The MS way to embed a manifest without breaking incremental linking is:
- let the linker create the manifest file,
- create a resource that contains the manifest file,
- invoke the linker again to embed the resource.
The embed_manifest_{exe|dll}.prf files have been removed.
All manifest logic is now in qmake's nmake makefile generator.
With QMAKE_MANIFEST one can specify a custom manifest file that gets
embedded without disturbing incremental linking.
Task-number: QTBUG-22718
Change-Id: Idb9d2644a0577b2002cbdd2d62b695b9171b1bd5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Two of the three operations in impl() return void, among them the
most common one, call(). Having impl() return bool prevents tail-
call optimisations for these.
Fix by passing the bool return value for Compare as an out-parameter.
Results in a nice decrease in text size
(GCC 4.8-pre -O2 -std=c++11, stripped):
text data bss dec hex filename
507343 13984 48 521375 7f49f tst_qobject (old)
505551 13984 48 519583 7ed9f tst_qobject (new)
Reported-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I7538c5b3f0992970c089e44f07244e6b62794a1d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
In C++, the compiler creates extra functions and data for classes
with virtual functions. This can lead to "virtual function bloat":
http://www.boost.org/doc/libs/1_47_0/doc/html/function/misc.html#id1382504
This is especially true when the number of instances is of the same
order of magnitute as the number of derived classes, such as is
common with type erasure techniques.
One such case is the QSlotObjectBase hierarchy, which this patch
tackles.
The mechanics of this optimisation are simple: re-implement the
virtual function call mechanism by hand, with function pointers.
But we go one step further and collapse the vtable into a single
pointer to a function that implements all three currently-defined
operations, swtching on an 'int which' argument. This even allows
us to extend this in a BC way, should that become necessary later,
by adding a new Operation and using the void** argument to
transport arguments, if any.
This approach was inspired by:
Ulrich Drepper: How To Write Shared Libraries, Section 2.4.4
http://www.akkadia.org/drepper/dsohowto.pdf
Also move the QSlotObjectBase hierarchy out of QObject so as not
to export all the derived classes.
This was pointed out in review by Thiago.
Results (Linux amd64, GCC 4.8-pre -O2 -std=c++11, stripped):
size tst_qobject*
text data bss dec hex filename
523275 21192 48 544515 84f03 tst_qobject (old)
507343 13984 48 521375 7f49f tst_qobject (new)
relinfo.pl tst_qobject*
(old) tst_qobject: 473 relocations, 0 relative (0%), 240 PLT entries, 240 for local syms (100%), 0 users
(new) tst_qobject: 323 relocations, 0 relative (0%), 238 PLT entries, 238 for local syms (100%), 0 users
Change-Id: I40ad4744dde8c5c29ef62ed2d82d4b1ede178510
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QString::toLocal8Bit() will need to call QTextCodec::codecForLocale(),
which isn't the cheapest of the functions, at least the first time it's
run. So avoid calling it when in most scenarios, the name of the QObject
isn't set, and the information is purely for debugging.
Additionally, avoid allocating memory when setting the thread name to
the class name. The class name coming from the meta object is a static
constant string and we can use it directly.
Change-Id: Ief643bad87a51487b1d41c0a2f323e80bb53e8a7
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
qurl.cpp was removed from the Makefiles on 6ab6b0fc1c,
but I missed the .pro file. You're not supposed to use the .pro file
anyway, it's just for opening in Creator.
But if you forget to remove the qmake build step, it would get compiled.
Change-Id: Ia52ae7349e195df58f76f8d2c5f8b46adfdc7454
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
ICC complains like so:
harfbuzz-gpos.c(95): warning #592: variable "error" is used before its value is set
return error;
^
However, line 95 is never executed because the condition on line 94 is
always false. That's why it's a false positive. The same construct
happens in the other two places.
Still, silence the warning.
Change-Id: I168d916d6837d4ac346facfd22b3e5b4e22ef7f0
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Make sure we pick the same config for the context and window surface,
and do not create unnecessary window surfaces for the desktop widget.
Change-Id: I3c8fb3df9ab8a658196e41dfa1705cfca625a2d7
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Change-Id: I673b884ac8513714d733411729a7418c19f05682
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
This is not the first time that GCC 4.2 on Mac has produced bad code
surrounding the CPUID instruction (see also commit 81d1f79a7f).
So declare it broken beyond repair and don't run the instruction at all.
Instead, initialise the set of features found to be exactly that which
we detected at compile-time. For that reason, we can also disable the
runtime checking of the processor (minFeatures == detected features).
At the time of this commit, only the draw helpers and one QImage
helper make use of the runtime detection. Since the detection now
switches to compile-time, QtGui will start carrying dead code for GCC
4.2 and earlier: it will never run the SSE2/SSSE3 code on 32-bit
builds. (GCC 4.2 does not support AVX, so that code won't be built)
Note: all Clang versions report that they are GCC 4.2, so we need to
exclude it from the test; ICC reports the same version as the system's
GCC.
Change-Id: I43f168a9480a2479c6444eea175782b2eadc2ab2
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
qUncompressCorruptedData() no longer hangs on QNX 650 and Blackberry OS
sytems.
Change-Id: Id131f9f1c6dcd358c152675c7e29ab937052c1d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Modeltest asserts before the patch, and passes afterward.
Task-number: QTBUG-26515
Change-Id: I08a89cd5c9c59613badcddbd056a3d0b8fbbca13
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
GCC 4.8 warns:
main.cpp:165:60: warning: ‘type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
app.arguments().at(3).toInt());
^
Change-Id: Ib0f6847031437b588e14c6708fdddea5fd474b58
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
The bug is that the connection to emit that signal can be made
obsolete if the connection is made too early and the model is replaced.
In the bug report, the connection is made by calling view() early (thereby
causing the creation of a view and a QItemSelectionModel which operates on
the built-in QItemSelectionModel, and then connecting to that
QItemSelectionModel), and then when QComboBox::setModel() is called later
the built-in view creates a new QItemSelectionModel for it. The bug was
that that new QItemSelectionModel is not connected to. This patch fixes that
bug.
Task-number: QTBUG-4454
Change-Id: Ibbdb8731f16ab071008b4a19dc2cc7ae03cebc84
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This reverts remnants of 79747d38987ce42adc510be0c5bb1565f55fd3d6.
Task-number: QTBUG-25571
Change-Id: I1dbf64cfcba889fb0c70ceaeeeffad8334a8aab1
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Fix some foward references from QtCore in addition. This
will require more work.
Change-Id: Ib1bade18c2cc220a7afe25e9fca6a3f50cb1174b
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
This fixes a large bunch of qdoc errors in Qt Core.
Change-Id: Ie3c3cebc730081a0927a0998d8937d721719c1c6
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
The class is private in 5.0, we'll publish it in 5.1
Change-Id: Ia7511db0393528aafa8c8059b4eb1657c8cdcc64
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
The qdoc manual currently claims that the command must stand on its own line.
The change follows the consistency with the rest and how the example looks like
inside the qdoc manual for this command.
Change-Id: I6b653dc95cf9d84e4adf32220dace5d313678419
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
There are some security issues with undo/redo. User should not be
able to get the erased password back in any situation. Therefore
redo must be disabled completely and undo is limited only for erasing
previously entered text.
Task-number: QTBUG-14226
Change-Id: I2b38aca84adbad1c14db76b56ad6303d56b35b4d
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Task-number: QTBUG-26687
Change-Id: Iaa0197efe64c61505e22e4a63a1f5c012af0bc78
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
this puts the whole logic of assembling those paths into qt_module.
Change-Id: Iafbe3969e3092e294bdb8243b2dffa7a899a7eb8
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Instead of first creating an initialized Private struct, then overwrite
the member variables, we added an internal constructor that
initializes the private struct sanely.
In the new (inlined, internal) constructor, both the MSB bits in the
bitfield are 0, and since the value of internal meta-type ID is so
low that the two MSB bits should never be set, the compiler can
(hopefully) optimize away the bit-fiddling initialization of the bit-field.
Callgrind shows about 33% speed-up in e.g. QVariant::QVariant(int)
Change-Id: I706773a71c0d8dcbe119ad15411578b81892deb5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
instead of re-assembling a list from the variables, take the original
command line minus some explicitly stripped out options. this is way
less code and poses no synchronization problem between the two parts.
as a "side effect", variables obtained from $QMAKEFLAGS won't multiply
with each makefile nesting level, as the generated command line won't
replicate data obtained from the environment.
Change-Id: I5d1ce0f11efb338f60405529f9818910103b1b0e
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
it wouldn't do anything particularly useful when parsing QMAKEFLAGS, so
take it out of the common path.
Change-Id: I60f1215c4645707e1f99932dd19160e1d1c9d953
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Except where using the contents of the variable, in which case
collapse two calls to qgetenv() for the same variable into one
that stores the result in a temporary QByteArray and continues
working with that one instead.
Change-Id: I6c09a20ae946327ccb85e4833a60a373a8a07355
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In particular, qEmergencyOut() is now completely exception-free.
Incidentally, this patch shows that Qt isn't consistent in how it
treats empty environment variables used as flags, but that is something
for a separate commit. This patch aims to be behaviour-preserving,
except in exceptional circumstances, of course.
Change-Id: Ie106e7b430e1ab086c40c81cc1e56cd0e5400cb4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
method_relative_ is unsigned, so we can't store a -1 in it.
qobject.cpp(434): warning #68: integer conversion resulted in a change of sign
callFunction_(0), method_offset_(0), method_relative_(-1)
^
Change-Id: If8bf3835590ef2c26b9ca5010d638aa84675ff62
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This is prompted by the fact that QMAKE_LIBDIR_FLAGS is no longer
honoured by qmake, so we need to use LIBS. It didn't make much sense
to have the flags separate anyway...
Change-Id: Iaec4d58f9dbac25755bbc3bad7550e03edb5332b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
this cuts down the enormous duplication of identical command line args
passed to compile.test.
this necessitates the addition of a -config parameter to compile.test,
as QMAKE_CONFIG needs to be extended in some cases.
Change-Id: I677b2fea4a407b9e4395e70a25e4e349efb0a946
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It seems to date from the Qt 1 days, and such abbreviations
are not current Qt style.
Change-Id: Iea7259bd7ba78b2c0863e3f6675e10826712ffd9
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>