Commit Graph

9268 Commits

Author SHA1 Message Date
Jan-Arve Saether
8160ca6dfd Clean up docs for graphicsview.
* doc/snippets/graphicsview.cpp is moved from the qtdoc repo
* doc/images/graphicsview-parentchild.png is taken from 4.8

There are still some problems with references to examples, but
Casper meant that Jerome was working on that, so I'll leave
those fixes out.

Change-Id: Ieac8e6564344851fe8e77f2b346b152e57f8485c
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-08-17 19:30:38 +02:00
J-P Nurmi
45982e6c57 QComboBox docs: cleanup Qt3 support leftovers
Change-Id: I59352edee99321c6119aee9c0f5e428a5371c997
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-08-17 19:29:35 +02:00
Rafael Roquetto
f4f185edd9 Decouple -lang-c++ from CXX command on QNX mkspecs
Making -lang-c++ integral part of the $CXX command was wrong, because there are
cases where $CXX must be called without the -lang-c++ file (when building asm
files for instance). This commit moves the -lang-c++ to $CXX_FLAGS where it
belongs.

Change-Id: I667c8d722105c6117fcd8ff3102dbdfcb890b24f
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-08-17 17:06:44 +02:00
Marc Mutz
727039c8e8 QThreadPool: fix race on 'queue' in stealRunnable()
The code under mutex protection already implicitly handles the case where
queue.empty(), so just removing the pre-lock check suffices.

Change-Id: I01467aff62e61bb4efd16359dd64546ff51c6bad
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-17 16:28:01 +02:00
Marc Mutz
d0ae7bef48 QThreadPool: use swap() when making a copy of allThreads
This is the C++98 version of std::move().

Change-Id: Icb73da16bb05bf07114a38e4fd48732b612e2d51
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-17 16:27:56 +02:00
Marc Mutz
e2e1a08140 QThreadPool: don't loop unless needed
The resulting code is easier to understand, too.

Change-Id: I3cd84d85b3186860dd3ccd67c3771b82695e7f83
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-17 16:27:49 +02:00
Marc Mutz
6ac6bc03e8 QFutureInterface<void>: const-correct reportFinished()
The primary QFutureInterface::reportFinished() takes a const T *, so should the
void sepecialisation.

Change-Id: I4d3173f4fd4f8d27baecd407369659a42445aed7
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-17 16:27:43 +02:00
Joerg Bornemann
a72420d012 qmake: object_with_source feature removed
By putting object_with_source into CONFIG one could force qmake to
output each object file into the same directory as its source file
came from. This was a rather nasty work-around from Qt 3 times to
support source files with the same file name in a project.
Unfortunately this doesn't play nicely with shadow builds.

Change-Id: Ie79e14d36ba6eac4219edc14ea75ab6a96f9ea96
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-17 12:27:40 +02:00
Oswald Buddenhagen
af2847260c unbreak "aux" template for mingw & msvc
we cannot just completely stub it out, as then there are no dependencies
on whatever targets we actually *want* to be built.

Change-Id: I32a92fa937d099c153a0082feae5d23e3998ba48
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-17 12:27:05 +02:00
Oswald Buddenhagen
e243f4e291 beautify "aux" target
it works better when it castrates the app template, rather than staticlib

Change-Id: If52960fb48d770e8ec096c66b579539512b8d299
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-17 12:27:01 +02:00
Oswald Buddenhagen
34d964638c remove unnecessary magic
getXQMakeConf now gives properly expanded variables

Change-Id: I17d82a1889fc4e1ee6b74c90aa0e4179ece0e415
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-17 12:26:58 +02:00
Sean Harmer
47fd7128db Fix compilation of QThread on QNX
Commit 3ef51efbe7 broke compilation of
qthread_unix.cpp on QNX. This fixes it by passing in the threadId to
setCurrentThreadName().

Change-Id: I24f32d8054baedbd9a65b6a80fb1f6f37e07092d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2012-08-17 12:23:56 +02:00
Sean Harmer
c7b6a666a8 QNX: Allow app to run when spurious 2nd screen is reported
On the PlayBook, libscreen always seems to report the presence of a 2nd
display even when none is connected. This of course leads to the failure
to query this display for its physical size.

This patch relaxes the demand for a physical size to being for the
primary screen only.

Change-Id: If30b1fd704e7a194a426a0a9f0b85557478105f7
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Frank Osterfeld <frank.osterfeld@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2012-08-17 12:23:43 +02:00
Kevin Funk
525ec093b4 WinCE: Fix call of GetAncestor in setParent_sys()
There is no GetAncestor under Windows CE.
Use GetParent instead.

Change-Id: I87b86961dade0d5c7c8bf6a470f777d32188dcd2
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-17 12:22:09 +02:00
Miikka Heikkinen
0d897a7fb6 Fix setParent_sys() to use native methods when checking for toplevel
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>
2012-08-17 12:21:34 +02:00
Miikka Heikkinen
30f3432845 Fix GDI object leak
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>
2012-08-17 12:21:18 +02:00
Joerg Bornemann
609b0a9c2e remove install/removeEventFilter from QRollEffect
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>
2012-08-16 08:27:03 +02:00
Joerg Bornemann
c9406bcffe qmake: support incremental linking when embedding manifests
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>
2012-08-16 08:26:24 +02:00
Marc Mutz
15b5b28425 QSlotObjectBase: re-enable tail-call optimisation in impl()
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>
2012-08-15 23:40:57 +02:00
Marc Mutz
04c286ceb6 QSlotObjectBase: combat virtual function "bloat"
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>
2012-08-15 23:40:57 +02:00
Thiago Macieira
3ef51efbe7 Avoid an expensive call to toLocal8Bit upon thread creation
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>
2012-08-15 23:40:57 +02:00
Thiago Macieira
03b95247a1 Remove trailing comma in enum
Spotted by ICC:
qfreelist_p.h(127): warning #271: trailing comma is nonstandard
          BlockCount = 4,
                        ^

Change-Id: Ib64d1d19ca0514e7582a295da48cbf6705aa8c44
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
2012-08-15 23:40:57 +02:00
Thiago Macieira
46da68c0bf QUrl is not necessary for configure.exe, drop it from the .pro
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>
2012-08-15 23:40:57 +02:00
Thiago Macieira
d244713340 Silence a false-positive warning about uninitialised variable with ICC
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>
2012-08-15 23:40:57 +02:00
Samuel Rødal
069469b468 Made eglfs work with backing store based applications again.
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>
2012-08-15 21:13:18 +02:00
Frederik Gladhorn
b5a24adb26 Documentation for QWidgetItem::controlTypes.
Change-Id: I673b884ac8513714d733411729a7418c19f05682
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2012-08-15 15:30:07 +02:00
Frederik Gladhorn
76cec118d0 Update docs.
Change-Id: I7bd1f1efe2d6ce3aee8cb7454f43cfef2979f525
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-08-15 15:30:05 +02:00
Frederik Gladhorn
ab802b3c85 Remove docs for removed enum values.
Change-Id: I225ea48606d60894a851c1dd620983b7a65d234d
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-15 15:30:04 +02:00
Frederik Gladhorn
e0133de62f Move docs for QSessionManager to the right file.
Change-Id: Ia3735ac14fe91de8cfbb58fc68f1a37f04d7b668
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-15 15:29:51 +02:00
Frederik Gladhorn
19276ac779 Remove outdated docs.
Change-Id: Ic878226c3b627b445ac45f56497a6a4ae77b2d38
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-15 15:29:50 +02:00
Frederik Gladhorn
45ab1cc073 Remove deprecated docs for QActionGroup.
Change-Id: If086395d3e1d151324df3cc1c59152715cb4af40
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-15 15:29:49 +02:00
Frederik Gladhorn
dd54ba933f Add parameter docs for QAbstractEventDispatcher::filterNativeEvent.
Change-Id: If028d2560d7bb18c9dd3e0f5fa6677c42fbf7d4b
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-15 15:29:40 +02:00
Thiago Macieira
732fc614da Disable CPUID checking with GCC 4.2 or older
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>
2012-08-15 15:20:39 +02:00
Rafael Roquetto
555e4e05f4 Fix tst_qbytearray on QNX
qUncompressCorruptedData() no longer hangs on QNX 650 and Blackberry OS
sytems.

Change-Id: Id131f9f1c6dcd358c152675c7e29ab937052c1d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-15 15:19:55 +02:00
Stephen Kelly
da64a50792 Only emit headerDataChanged for valid proxy intervals.
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>
2012-08-15 15:04:11 +02:00
Marc Mutz
fb07ce50ae tst_QUdpSocket: Remove unneeded ./ in application name printing
Reported-by: Shane Kearns <shane.kearns@accenture.com>

Change-Id: I12f2a23b98c3b0161a2961a9117c196cd7d72a6d
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-08-15 15:01:07 +02:00
Marc Mutz
9e96c4a315 Fix "might be used uninit'ed" warning
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>
2012-08-15 15:01:01 +02:00
Stephen Kelly
351904be50 Emit the highlighted signal if the model changes.
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>
2012-08-15 13:58:29 +02:00
Jeremy Katz
61fa926857 Fix QMessageLogger and associated qdoc errors
Change-Id: I4b9555c8a15a698ef5ce270288c88a0aa88e0033
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-08-15 11:38:37 +02:00
Geir Vattekar
b44670e671 Doc: Fix broken return codes for a few examples
This reverts remnants of 79747d38987ce42adc510be0c5bb1565f55fd3d6.

Task-number: QTBUG-25571
Change-Id: I1dbf64cfcba889fb0c70ceaeeeffad8334a8aab1
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-08-15 11:38:37 +02:00
Lars Knoll
55912e14af Add a module page for QtConcurrent
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>
2012-08-15 11:38:37 +02:00
Lars Knoll
f73e49808d Ignore Q_DECL_NOEXCEPT in qdoc
This fixes a large bunch of qdoc errors in Qt Core.

Change-Id: Ie3c3cebc730081a0927a0998d8937d721719c1c6
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-08-15 11:38:37 +02:00
Lars Knoll
03dba8c596 Mark QCollator as internal.
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>
2012-08-15 11:38:37 +02:00
Lars Knoll
45ecea6a87 Fix QPointer qdoc errors
Change-Id: I54082a87f076aa511329cfb7a6ed6ecabcfb40f7
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-08-15 11:38:37 +02:00
Laszlo Papp
98804946f2 Make the "\internal" qdoc command stand on its own line
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>
2012-08-15 11:38:37 +02:00
Jani Honkonen
121062d884 Fix undo and redo in QLineEdit when in password mode
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>
2012-08-15 11:38:37 +02:00
Stephen Kelly
d19589b90a Make selectAll() do nothing if the mode is NoSelection.
Task-number: QTBUG-26687

Change-Id: Iaa0197efe64c61505e22e4a63a1f5c012af0bc78
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-15 11:38:37 +02:00
Oswald Buddenhagen
43a36a682a set QT_PLUGIN_PATH for tools
Change-Id: Ie76b25b605ab4271eff161ee9bfc4f54df640f4a
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-15 09:19:09 +02:00
Oswald Buddenhagen
07e187a341 make .private_includes in module pri files "self-contained"
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>
2012-08-15 09:18:58 +02:00
Harald Fernengel
17adbb232b Speed up construction of basic QVariants
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>
2012-08-15 09:17:35 +02:00