Commit Graph

18698 Commits

Author SHA1 Message Date
Kai Koehne
297be273a3 De-inline QDebug destructor
This injected quite some code on every use of qDebug and friends,
while not giving any measurable performance benefits.

Change-Id: I7b51f99130f18f1252da01e313f7b97c43a5480d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-22 08:35:06 +02:00
Jake Petroules
f2891be008 Add a menu item to mainwindow example to toggle unified toolbars.
Change-Id: Id7d7433849565b1acfc690cf5e23e8105c6af993
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-05-21 21:07:58 +02:00
Jake Petroules
a97f96ca8e Turn setUnifiedTitleAndToolBarOnMac into a slot.
Change-Id: Ieb28960bf3fb9e70a6bcc6d47ff723f0ed4e1b63
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-05-21 21:07:52 +02:00
Thiago Macieira
309d3557ca Improve a few string operations with AVX2
AVX2 brings the new PMOVZXBW instruction that extends from one 128-bit
SSE register to an 256-bit AVX register. With that, the main decoding
code is just two instructions (the loop requires a couple more to
maintain the offset counter and do the end-of-loop check).

This buys us another 4% performance improvement in the fromLatin1 code,
calculated on top of the VEX-encoded SSE2 code (which is already a little
better than plain SSE2).

Change-Id: I675fa24de4fa97683b662f19d146047251f77359
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-05-21 17:10:56 +02:00
Konstantin Ritt
4dba08eebf Decrease the life time of SpecialData::resolvedFormats
Once LayoutData::items gets cleared, accessing (or re-using)
SpecialData::resolvedFormats may lead to a undefined behavior,
so clear SpecialData::resolvedFormats right after LayoutData::items.

Change-Id: Ib389f0029a0562f5d2837f62f76197510a0db099
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-05-21 15:05:33 +02:00
Oswald Buddenhagen
c9be7743cd nuke findtr script
it's a precursor of lupdate from the stone age.

[ChangeLog][Tools] The obsolete findtr script was removed.

Task-number: QTBUG-30900
Change-Id: Ic3efdc44df084573aec2512d8f86101832253d77
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-05-21 13:41:30 +02:00
Richard Moe Gustavsen
77982c4823 qscopedvaluerollback: add convenience constructor
It's a common need to assign a variable to something when entering a
code block, and then revert it upon exit. qscopedvaluerollback can
be used for this. But as a convenience, this patch adds an
extra constructor so that you can "protect" and set a variable
in one go instead of using two lines.

Change-Id: If4b89d3a5ba32ef2304bda058b1b6050932612ed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-21 02:15:10 +02:00
Denis Shienkov
aefa611f0c QWinOverlappedIoNotifier: Add an extended waitForAnyNotified() method
The existing waitForNotified method has the design limitation that it
doesn't allow the tracking of multiple I/O operations on a single
file handle.

Therefore we introduce an additional method waitForAnyNotified that
returns a pointer to the triggered OVERLAPPED object.

Change-Id: I536ed7f6828daa2b0ce03f2d662eeb10aa89ca99
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-05-21 02:15:10 +02:00
Konstantin Ritt
0ab9188ad7 Rename some QTextEngine members to reflect their meaning
formats() -> formatCollection()
additionalFormats -> formats

QTextEngine has three different code paths: in context of QTextDocument,
additionalFormats are currently _additional_ formats;
though in QTextLayout, they are the only formats in use;
and the QRawFont-related path shares the QTextLayout's behavior.

This is a preparation step to consolidating these three into a single one.

Change-Id: I427ccc3c2f672ce090899bb0a0995972315daafa
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-05-20 20:25:02 +02:00
Konstantin Ritt
4976e6817a Minor code clean-up
Change-Id: I5c43db4e0a499ecfd23f3dac63615e7c40208f36
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-05-20 20:24:54 +02:00
Konstantin Ritt
4ee3c17944 Drop some qtextengine_win.cpp leftovers
Change-Id: Id0d39acfcb340b40e51b8d06a4308df809a8fc1b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-05-20 14:33:32 +02:00
Friedemann Kleint
54da6c25eb Windows: Adapt custom cursors to observe the system metrics.
Change the cursors Qt provides to use freely scalable pixmap cursors
and scale them to observe system metrics. Make it possible to
use pre-saled bitmap data later by passing the system cursor size
and the intended target size into the creation function
createBitmapCursorFromData().

Task-number: QTBUG-37862
Change-Id: I23899a77f86d0b08b858a81870a57b2e6570ebbe
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-05-20 06:31:43 +02:00
Tor Arne Vestbø
9d1f059fc5 qpa: Rename qwidgetwindow_qpa_p.h to qwidgetwindow_p.h
Change-Id: I24835b86194653e89c0bacefd22ddbff06b6e97b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-05-20 00:20:02 +02:00
Tor Arne Vestbø
e8510d7952 qpa: Merge qapplication_qpa.cpp into qapplication.cpp
The variable 'appFont' was removed as it was not used.

Change-Id: I8dfa8382b3f30b72490fd22b4e0a27e991318a9c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-05-20 00:19:56 +02:00
Friedemann Kleint
6c5645578a Remove friends of QEvent.
Introduce function to set the spontaneous flag to
QCoreApplicationPrivate to solve a few cases.

Change-Id: I7c1f1f3644defe00deea9cecb244ca258afd5b94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-18 13:53:15 +02:00
Thiago Macieira
bf3e80023a Stop using setSharable in the Java-style mutable iterators
First and foremost, the STL-style iterators don't do this. Those don't
provide a guarantee that the container won't get shared again while the
iterator is active.

Second, there's no protection against a second mutable iterator being
created and resetting the sharable flag back to true.

[ChangeLog][Important behavior changes] The mutable Java-style iterators
like QListMutableIterator and QHashMutableIterator no longer set the
parent container to unsharable mode. If you create a copy of the
container being iterated on after the iterator, any changes done with
the iterator might affect the copy too.

Discussed-on: http://lists.qt-project.org/pipermail/development/2014-February/015724.html
Change-Id: Iccfe411d5558c85ae459cff944215614c392388e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-05-18 02:08:13 +02:00
David Faure
1aede2d7fc QPainter on QBitmap: make setBrush(NoBrush) work as expected.
It had no effect because of an explicit check for NoBrush.
However the default in QBitmap is (unfortunately) QBrush(color0), rather
than NoBrush, so the brush must be updated when calling setBrush(NoBrush).

I suppose the real issue is that lastBrush is default-constructed in
QRasterPaintEngine, rather than starting with the brush from QPainter,
which is QBrush(color0) for the case of the bitmap. But no reason to
special case NoBrush here anyway.

Task-Number: QTBUG-38781
Change-Id: I9996ac12bf628920cfaf0de9c886f637a336028b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-05-17 08:59:08 +02:00
Konstantin Ritt
4689a9b3f0 Minor optimization for QTextLineItemIterator
Don't store unused values (pos_x and levels) and re-use
already calculated ones (itemStart, itemEnd, and itemLength).
Also const-ify some members to make the code a bit more clear.

Change-Id: Ied80ebf9e4e7e8a1d057e413a9bd24f84b8aaf92
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-05-16 21:42:45 +02:00
Konstantin Ritt
7952cf7e27 Ensure we don't re-use webfonts where the "local" font has been requested
For webfonts, we can't rely on the fontDef (and hence the cache Key) alone,
since the resulting fontcache key might be strictly identical.
Instead we have to check if the cached engine doesn't belong to a webfont
when we're looking for a "local" font.

Change-Id: I2de11c8fdbef53362b66674d3429a042e1835757
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
2014-05-16 18:24:14 +02:00
Jędrzej Nowacki
39efc7c3e3 Optimize QVector::mid
Change-Id: Iff7d9ec85a095c6712e6045e7708bb88eac629e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-05-16 18:24:14 +02:00
Friedemann Kleint
7c17b0ad2b Remove friend class QETWidget.
The class no longer exists in Qt 5.

Change-Id: Icd98c151f8e06910a3240d0bec6fff333a8ef3e3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-05-16 15:36:44 +02:00
Sean Harmer
a295bb575f Expose multisample settings on QOpenGLTexture
Change-Id: I877f4139aed8bb03b798818a3fac00dab1523ce1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-05-16 09:54:09 +02:00
Sean Harmer
ca15825ed4 Add viewport transform to QMatrix4x4
This allows to easily create a matrix that performs the transformation
used by OpenGL fixed function to go from normalized device coordinates
to window coordinates.

This comes in useful if you need to perform the NDC->window coordinate
conversion inside a shader.

Change-Id: I183b3545bfb3eb1e8b13fc3172911b46926fcbb7
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-05-16 09:53:58 +02:00
Jędrzej Nowacki
71fb3633e8 Unify all mid() functions in QtBase.
Up to now, Qt had at least 3 different implementations of the mid().
Only QString::mid implementation was not crashing on edge cases and
was protected against overflows, therefore I picked that one as the
base implementation, even if it has weird semantics for an invalid
input.

As a side effect QVector::mid was slightly optimized to not detach in
all cases (which follows current QList behavior). Documentation of
QVector::mid and QList::mid was updated to not mention "copy of data"
which could suggest that the mid() result is detached.

QStringRef::mid was fixed and now it follows general Qt behavior, by
returning a null value for a null input.

Change-Id: Ie9ff5d98372bd193d66508e6dd92b6ed1180ad9b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-16 09:51:38 +02:00
Tor Arne Vestbø
8f3a393e41 qpa: Merge qwidget_qpa.cpp into qwidget.cpp
Change-Id: I8424ec7290b366f4c76999a956fce1428fc56626
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-05-15 23:07:42 +02:00
Friedemann Kleint
b7275eee49 Remove unnecessary friend declarations from qevent.h.
Change-Id: Iec35b94f3898004850a076d4760d675248246ea7
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-05-15 22:58:56 +02:00
Friedemann Kleint
6a61a00ddb Windows: Use new clipboard API for listening to changes.
The currently used clipboard chain API has various problems with non-
responsive applications and requires checks for hung/debugged applications when
sending on notifications.

The new clipboard format listener API available from Windows Vista onwards
requires less code and does not have these problems, however the change
notifications now arrive asynchronously.

Change the tst_qclipboard  to be able to deal with asynchronous change
notifications.

Task-number: QTBUG-38670
Task-number: QTBUG-33492
Change-Id: I3c49e346a34310431c20f3051d12eaabf330a3ad
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-05-15 15:31:07 +02:00
Friedemann Kleint
f618dbdd04 Windows: Refactor cursor creation code.
Factor out a function creating bitmap cursors, streamline code.

Task-number: QTBUG-37862
Change-Id: Id9d4af34acb2cf15d8553d5e5a6390fae6014ff6
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-05-15 12:53:09 +02:00
Alex Blasche
60d0b900d7 Force qdbusxml2cpp to use QStringLiteral rather than QLatin1String
Change-Id: I6db4c80a14466b51d73c2704e8fc2e2e8a8a6b02
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-15 10:08:59 +02:00
Friedemann Kleint
9b121e5579 Windows: Use WinAPI CommandLineToArgvW() to create argv from command line.
Split the Windows CE/Desktop Windows code paths in winmain.
Use CommandLineToArgvW() to obtain argv[] for Desktop Windows.

[ChangeLog][QtCore][Windows] Command line parsing on Windows
now uses the WinAPI function CommandLineToArgvW() to exactly
match the quoting of the command interpreter.

Task-number: QTBUG-35432
Task-number: QTBUG-23687
Change-Id: I6743e73649d953497642f7717d3731a83ffda2a2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-15 09:34:19 +02:00
Tor Arne Vestbø
9dc254ad50 qpa: Merge qdesktopwidget_qpa.cpp into qdesktopwidget.cpp
Change-Id: I39316744b87d1fd588a99ab71edbd711ee8fae47
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-05-15 02:51:06 +02:00
Tor Arne Vestbø
768f59202d qpa: Merge qgl_qpa.cpp into qgl.cpp
Change-Id: I91cfd7daf7f1dd88659019ccc671ec0d9245067f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-05-15 02:51:06 +02:00
Tor Arne Vestbø
a5ea74b98b qpa: Clean up and refactor qfontengine_qpa
QFontEngineQPA was really QFontEngineQPF2, and has been renamed. The
multi font engine in qfontengine_qpa.cpp was really a base implementation
of a multi font engine, used by other multi font engines, and has been
renamed and moved accordingly into qfontengine_p.h/cpp.

Change-Id: Iac7409c4dbf0fdc3ee993ce4f7dc96cb00a422e6
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-05-15 02:51:06 +02:00
Gunnar Sletta
cd910e9254 Don't crash when platform plugin sends us two close events.
Change-Id: Icfe2954908fad2abfb4195fc535aadd1e6302f76
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-05-15 02:51:06 +02:00
Giuseppe D'Angelo
1ae7c76b2a Do not build or link to PCRE if QRegularExpression is disabled
Per Oswald's suggestion, just don't touch PCRE if it's not needed.
This can save ~500kB between text and data in QtCore.

Change-Id: Ia10c819c7fff562dda84ab0b77194baffbc8904e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-05-15 02:51:06 +02:00
Giuseppe D'Angelo
4c14fa607f Fix QtTestlib build under QT_NO_REGULAREXPRESSION
Change-Id: I4458226e814641269062990f272a40ca577bc9db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-15 02:51:06 +02:00
Giuseppe D'Angelo
77425eefec Make QColorDialog build under QT_NO_REGULAREXPRESSION
Since we can't set a validator on the HTML-color lineedit,
just make it readonly.

Change-Id: Ibeaacbea00867cdb6ef33b6667f7ee3539b7f929
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-15 02:51:06 +02:00
Friedemann Kleint
70cd276db0 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-05-14 18:43:38 +02:00
Friedemann Kleint
800214f0b9 Windows: Improve checking of options to the QPA plugin.
Change-Id: I59129132c7caa13d5c9d8f1e6211da68505dd838
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-05-14 18:42:27 +02:00
Richard J. Moore
1a8788d966 Move the PKCS#12 support from QSslSocket to QSslCertificate.
Discussed with Peter and agreed that it's a slightly better fit there.

Change-Id: If8db777336e2273670a23d75d8542b30c07e0d7b
Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-05-14 11:08:01 +02:00
Frederik Gladhorn
3d4aeb7919 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/gui/kernel/qguiapplication.cpp

Change-Id: Ibe75603dc8a51769db6550ea3f07bc8d19b0be85
2014-05-13 22:19:10 +02:00
Ivan Komissarov
b861c43395 Removed unused variable macItemVMargin in qmacstyle_mac.mm.
Change-Id: Ib888781238f6cc9407732431219e570299a47198
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-05-13 16:08:01 +02:00
Ivan Komissarov
ba1262187b Moved qt_mac_toQColor(CGColorRef) to qcocoahelpers.
Change-Id: I8f8feab3f2b88373bf9ad4d69b8de56b480910ac
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-05-13 16:08:01 +02:00
Ivan Komissarov
7db24dd864 QMenu: Use Qt::QueuedConnection when connecting to native menu.
This fix allows to catch exeptions thrown in slots connected to
QAction::triggered() signal via QApplication::notify().

Task-number: QTBUG-15197
Change-Id: I6f3e51ec39139ffb0a5f3a31b79f839c18089b26
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-05-13 16:08:01 +02:00
Joerg Bornemann
697cb33896 remove unused macro definition
Change-Id: Ic2451dd7ae352b9e515c52c20a43495066fb72c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-05-13 16:08:01 +02:00
Frederik Gladhorn
ff334fd574 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-05-13 16:08:01 +02:00
Jędrzej Nowacki
ec4c93a852 Remove unsused local variables from tst_collections
Change-Id: I4ca1862d29432ca83b90024664b548ea0eef26c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-13 16:08:01 +02:00
Jędrzej Nowacki
ac660a0f8b Fix gcc warning in tst_collections.
warning: typedef 'Foo' locally defined but not used [-Wunused-local-typedefs]

Change-Id: Ifb1213414feb3aa5a5e46dac163e51ccd4925498
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-13 16:08:01 +02:00
Jędrzej Nowacki
36d5f80d97 Move tst_collections test to corelib/tools.
There is no reason to have the test separated from other tools tests.

Change-Id: Ie5b19961c383f5e4bc1ad4452cba7b92153fc303
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-13 16:08:01 +02:00
Kai Koehne
7cafb62538 Remove OOM exception handling from QDebug
According to the documentation, Qt doesn't even attempt to handle OOM
issues anymore. It's questionable in the first place why this should
be available only for the stream operator logging ...

Change-Id: If94c971793bc6c6773daf3997fe82b410a29538d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-13 16:08:01 +02:00