Commit Graph

21241 Commits

Author SHA1 Message Date
Giuseppe D'Angelo
d41834b953 QAbstractScrollArea: add a getter for the margins
Strange API asymmetry that needed to be fixed.

Task-number: QTBUG-8315

[ChangeLog][QtWidgets][QAbstractScrollArea] A getter for the viewport
margins has been added.

Change-Id: Ie1460b572206922031fc4effc2aa8261e25088b5
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-12-03 18:03:09 +01:00
Olivier Goffart
5180f32c5a Add Q_DECL_OVERRIDE in the src subdirectory
Done automatically with clang-modernize on linux

(But does not add Q_DECL_OVERRIDE to the function that are marked
 as inline because it a compilation error with MSVC2010)

Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-03 09:57:11 +01:00
Giuseppe D'Angelo
2e271795e7 QSslEllipticCurve: remove a copy when setting the curves
The only reason for copying QSslEllipticCurves into a temporary array
would be to be extra-pedantic about type safety, but in the end,
we can simply force a cast and remove the copy.

Change-Id: Ice8a036fe4b79ba438ce83b5eacf6158eb3f0ce7
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-03 09:55:02 +01:00
Alex Trotsenko
e06f4c2558 QRingBuffer: cache the last released block
A typical ring buffer usage is a sequence of reserve()->chop()->read()
cycles. Usually, between these cycles, the buffer doesn't contain data and
all blocks are released. To reduce reallocations, keep the most recently
used block while the buffer is empty.

Change-Id: I8128f1f04649ae005fd0a480f17f95de01a9a135
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-12-02 20:05:58 +01:00
David Faure
bb4625f472 tst_QItemDelegate: simplify code, no behavior change
Remove duplication of the set of flags.
Remove "text" column which had a constant value.

Change-Id: I39dd541a545664fb3f992b32b8c64e4dd263a9c7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-12-02 14:41:26 +01:00
Allan Sandfeld Jensen
864cf2a6cd Add DeepBind option to QLibrary
Adds an option to request the RTLD_DEEPBIND flag to dlopen. On Linux
this can be used to force a library to resolve global symbols locally
instead of using the similarly named symbols already loaded.

This makes it possible to load and use plugins linked against Qt 4
without crashing.

[ChangeLog][QtCore][QLibrary] Added DeepBindHint which maps to RTLD_DEEPBIND
on Linux making it possible to load libraries with external symbols that
clash with already loaded ones, such as plugins linked to Qt4.

Change-Id: I4edb4af68e4a47e932a87d108360dba8d91dc34a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-02 14:38:36 +01:00
jkobus
f6eb3c220b QTreeWidget: optimize childrenCheckState
When we met at least one checked child
and at least one unchecked child
return immediately PartiallyChecked state
(no need to check other children state).

Change-Id: I17ec07a925667231a1d809695f347a0f3cfffa0e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-12-02 14:36:54 +01:00
Jan Arve Saether
7cea5949ca Don't rely on hasChanged() in ensureGeometries
It can be removed now because we now have a better caching
mechanism than before. It should therefore not be needed anymore.

Since nothing else calls hasChanged, we can finally get rid of it.
This simplifies the code and enables us to further improvements to the
code.

Change-Id: I51afe5a97311e3e361ae8b491ecbcd21bbedacd1
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2014-12-01 14:37:02 +01:00
Giuseppe D'Angelo
9431321c65 SSL: let a server choose the most appropriate curve for a client
OpenSSL 1.0.2 introduces SSL_CTX_set_ecdh_auto, which allows us
to stop using one specific temporary curve, and instead makes
the server negotiate the best curve.

Task-number: QTBUG-42925
Change-Id: I3a68f29030bdf04f368bfdf79c888401ce82bdd8
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-11-29 21:03:17 +01:00
Jan Arve Saether
f9408317e7 Auto-scroll while selecting entire rows/columns did not work
If you press and hold a section in a header view you can extend the
selection to more rows by moving the mouse. This worked fine until you
moved the mouse outside the geometry of the header view. The expected
behavior was then to scroll the view (this is what happens with extended
selections on regular table cells).

[ChangeLog][QtWidgets][QHeaderView] Auto-scroll the view when making
extended row/column selections.

Change-Id: Ic65aa34d370e74054b2123ab57edb1add0e8adb9
Task-number: QTBUG-21201
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-11-29 15:21:48 +01:00
Konstantin Ritt
62bf16d992 Fix assertion introduced in 8e3fdf1354
It is clear from the commit itself that `m_engines[1]` isn't accessible
after `m_engines.resize(1)`.

Change-Id: I7b3977cca3f3aeaabadb5ff4f3e52a418022123c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-11-29 15:15:13 +01:00
Konstantin Ritt
155f664ac2 Use special value SMOOTH_SCALABLE where appropriate
It is the same as USHRT_MAX but mentioning a special value makes
the code more readable.

Change-Id: I91063e472a6130ceb47f866344709786e4b05f20
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-11-29 15:15:10 +01:00
Samuel Gaist
ab3efc09b3 QTextDocument: Don't use QRegExp for string search overloads
Currently both find function with QString input uses QRegExp under the
hood. This patch aims to use only QString search facility to allow
the proper disabling of QRegExp

Change-Id: I3525fd0e969eced635f3d98feb54eb6a05950d8f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-11-27 21:17:59 +01:00
Frederik Gladhorn
ce6990c3e7 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: Id20053d261b4fbbcc0ac8ba49dd3ef2253fa4b95
2014-11-27 18:28:12 +01:00
Richard Moe Gustavsen
fa9bde7d3a iOS: override QPlatformWindow::propagateSizeHints()
propagate size hints means that we should forward minimum/maximum
size set on QWindow to the underlying native window to restrict
how the user can resize the window. On iOS this does not make
sense, but nevertheless, if we don't override the function, the
default implementation will issue a warning. This again will
always make creator inform that the application ended with error
upon exit.

Change-Id: I0a8bd74c47fafe2115add5b6eb4e77616fcbc365
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-11-27 11:40:32 +01:00
Friedemann Kleint
cb679241b1 Implement heightForWidth().
Add a virtual function QWindowPrivate::closestAcceptableGeometry()
which is called from the platform plugin.

Task-number: QTBUG-36220
Task-number: QTBUG-36318
Change-Id: I2b3d205e2c75f1d4dd2ba1d333b0d89bc0fcf13a
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-11-27 11:10:31 +01:00
Benjamin Lutz
c6aa76122e Fix size miscalculation in QByteArray::toBase64
The size calculation in QByteArray::toBase64 overcalculates the size
required for the output by up to 3 Bytes. This is fixed, which also
implies that truncate() at the end is needed only if OmitTrailingEquals
is used.

Task-number: QTBUG-32436
Change-Id: I92a893047e7aca027c4aa0a6655bcca514585ff5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-11-27 10:29:08 +01:00
Allan Sandfeld Jensen
fc3402ca82 Clarify QString::clear()
QString::clear() sets the string to the null QString, not just an empty
one.

Change-Id: Ie6f070f9f2e464105a7b87376e6dad90b5e4d2f2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-11-27 10:18:43 +01:00
Allan Sandfeld Jensen
8d2d4255c6 Clarify QGuiApplication::primaryScreen
Clarify that shown here refers to where they are shown initially.

Change-Id: I962fd4b98d80fb1d43e086660fb74eea6b8f532a
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2014-11-27 10:18:34 +01:00
Shawn Rutledge
b36059f611 fix the build with animation omitted
configure -no-feature-STATEMACHINE -no-feature-ANIMATION

Change-Id: Idb89c0bae8d699e76916317f83490c6c94c7d8b4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-27 09:36:04 +01:00
Friedemann Kleint
09e674849a QCommandLineParser: Show usage and errors in message boxes on Windows.
Use the Windows MessageBox API if no console window can be obtained.

[ChangeLog][QtCore][QCommandLineParser] Message boxes are used
to display errors and usage if no console window can be obtained
on Windows.

Change-Id: I63ee8e4d8bd78db83e688fd69374779102562aa3
Reviewed-by: David Faure <david.faure@kdab.com>
2014-11-27 09:34:29 +01:00
Shawn Rutledge
c124ac42c7 OS X: remove use of Carbon API for scroll events; fix ScrollBegin
NSEventPhaseMayBegin doesn't happen with some types of trackpads, so
don't treat NSEventPhaseBegan as Qt::ScrollUpdate.

Change-Id: Ica97d49692a904e20c8eb0250760e6370311ee40
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2014-11-27 09:29:17 +01:00
Friedemann Kleint
4680052063 Diaglib: Fix typo in .pri file.
Fixes compilation with Qt 4.

Change-Id: I66781089cd4c07a33f8136706e3211a21f41039f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-11-27 09:26:41 +01:00
Samuel Gaist
cc23ebace8 Fix build of QGestureRecognizer on OS X
ifdef panTouchPoints which is not used on OS X. Otherwise the build
fails when the -Werror,-Wunused-function flags are used.

Change-Id: I4f5498774905fcb2ba1fae40e41587d5821af8b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-27 09:18:47 +01:00
Jędrzej Nowacki
cc1d9671b3 Micro-optimize QVariant enum to number conversions
Change-Id: I2296d9417e0d1ef08084fb259885ac2a3eff9fe8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-11-27 09:18:23 +01:00
Olivier Goffart
c294067e4b qdoc: ignore Q_DECL_OVERRIDE
Change-Id: Idf07753b6811c1ec8dba1ddd0fbb8036ce6723f2
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-11-27 09:06:56 +01:00
Giuseppe D'Angelo
8f201ca4e7 QJsonArray::(const_)iterator: mark the pointer typedefs as internal
Just like the other typedefs; removes the doc warnings.

Change-Id: I61142b8db57f4e0cc44cb8c459b1e82e69da3413
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2014-11-27 09:03:02 +01:00
David Faure
2d0b20ef92 QLineEdit: take text margins into account in minimumSizeHint().
sizeHint() did it exactly like this, but minimumSizeHint() didn't,
which made it too small. Didn't affect the actual size in most cases
since the vertical size policy is fixed, so sizeHint() is called instead.
But when writing a subclass, if one re-implements sizeHint() by
calling the QLineEdit's minimumSizeHint(), it would then be wrong,
when text margins are used.

Change-Id: I29ae8dcab00842b3b5ca534cdb250efc0b496f45
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-11-27 04:19:05 +01:00
Shawn Rutledge
b9d98c10bd Deprecate implementations of functions deprecated in headers
If you build with configure -DQT_NO_DEPRECATED this will avoid some
build errors.

Change-Id: If2b2e57b6919091f3f077ebc2aeca0c3fd2421aa
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-11-27 04:16:22 +01:00
Pierre Rossi
583187ed2a QFontconfigDatabase weight-matching refactoring
Factor out the piece-wise linear weight matching in an attempt to make
it less error-prone to add new weights to the QFont::Weight enum.

Change-Id: I5fefdba67a60a061f8b9104393194a27bc8c6e35
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2014-11-27 04:16:09 +01:00
Giuseppe D'Angelo
ffbfd8eda6 SSL: Add support for selecting which curves should be used by an elliptic cipher
[ChangeLog][QtNetwork][QtSSL] It is now possible to choose which elliptic
curves should be used by an elliptic curve cipher.

Change-Id: If5d0d58922768b6f1375836489180e576f5a015a
Done-with: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-11-26 22:07:56 +01:00
Friedemann Kleint
b55f88caba Windows: Correctly associate IME contexts.
Associate a 0-context with the window if IME is disabled, store
this state as a flag to QWindowsWindow. Associate default context
again when enabled window gains focus.

Task-number: QTBUG-40691
Change-Id: I78d5494a05f93a39e245ca7c096d45445e684ea8
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2014-11-26 21:14:48 +01:00
Friedemann Kleint
c91c05b056 Add capabilities to QPlatformInputContext.
Add a capability enumeration to QPlatformInputContext and
use that to turn off input methods for hidden text depending
on platform support. Disable on Windows.

Task-number: QTBUG-40691
Change-Id: I9909005de1f21316ec8f64e2729f1fffcd37c7c3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2014-11-26 21:14:40 +01:00
Laszlo Agocs
421f78a65f Reorganize devicediscovery header
As pointed out in 13b939c7f4 the approach
qdevicediscovery_p.h takes is just wrong. The defines it relies on will
often be missing when the header is included from random places in qtbase.
This results in different class layouts. It was working only because the
interface of the class is very limited and the public part was matching
regardless of having the macro defined.

This is now corrected by introducing subclasses and a common, non-variated
base class. QDEVICEDISCOVERY_UDEV is removed completely.

Change-Id: I9c83b5b041440a3a6ea3a604eee4a325d4d74439
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-11-26 16:22:43 +01:00
Richard Moe Gustavsen
a7dcc661d5 iOS: only skip activating the most simple popup types
The current approach of not activating transient windows with the
popup flag set was found to be too restrictive, as it would
e.g stop transient dialogs from being able to contain editable
controls.

This patch will restrict the number of popup types that we
skip activation for to only contain a few subtypes.

Task-number: QTBUG-41613
Change-Id: I381a5a79fb4f7082da18a6b4e06a7255ff400b1a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-11-26 15:57:23 +01:00
Richard Moe Gustavsen
cf8dc020ff Widgets, iOS: don't tell the input panel to hide on focus out
On iOS, autoSIP is handled by the platform plugin. We therefore
avoid letting widgets tell the input panel to hide on focus out
so we can gain better control over this from the plugin.

Note that we could also set QApplicationPrivate::autoSipEnabled
to false and achieve the same. But since autoSIP is logically set
on iOS, it's better to report it as set in case the app asks.

Change-Id: I96c68bc446a1e299fd57afe03a9e273491df08a7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-11-26 15:56:30 +01:00
Jan Arve Saether
153463ea95 Make sure accProbe can retrieve our relations.
For some reason NVDA didn't seem to be affected by this
(it still read out the related buddy/label)

Change-Id: I028c9cca359091a703c080a7caa8ec6f98444a30
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-11-26 10:41:55 +01:00
Giuseppe D'Angelo
dd97634f80 QList::swap: implement the swap with std::swap
Change-Id: Ide2f8a5581978986607de99ac9b5e9c15b3aceff
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-11-26 09:59:31 +01:00
Laszlo Agocs
9d771c70c3 Avoid crashing on embedded
tlw can be null. handleKeyEvent() is already fixed.

Change-Id: I92ffca30841147aca4fa536b80736c799aae4ac0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-11-26 09:31:26 +01:00
Laszlo Agocs
37cce4cada Add generic OpenGL compositor and backingstore bits
By removing the EGL(FS) dependencies we get classes that can be used
by any platform plugin that runs without a windowing system.

Change-Id: If99b42de5a4da02bbef80863609b6d92c6734613
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-11-26 09:31:16 +01:00
Olivier Goffart
e41713b21d Add Q_DECL_RELAXED_CONSTEXPR to QRect and QRectF
Change-Id: Ifc8fabad46803241ccf30143b0c779f29f696335
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-11-26 09:09:38 +01:00
Olivier Goffart
1217504a60 Add Q_DECL_RELAXED_CONSTEXPR to QPair
Change-Id: I9456e820bb514f020b9f1d6c7d68547f92a1f8ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-11-26 09:09:25 +01:00
Olivier Goffart
94e11a9f0c Add Q_DECL_RELAXED_CONSTEXPR to QMargins and QMarginsF
Change-Id: Id77e22ef458a5f855e6b339ea11f8928ad5a68af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-11-26 09:09:14 +01:00
Olivier Goffart
f0694236f6 Add Q_DECL_RELAXED_CONSTEXPR to QSize and QSizeF
Change-Id: I4ce11373ad533d3f090b2de2e5017f8e34d9cfc4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-11-26 09:09:08 +01:00
Olivier Goffart
9bdcd4485a Add Q_DECL_RELAXED_CONSTEXPR to QPoint and QPointF
Change-Id: Ib039e491856e1a1c69ee17dbd2648dd8171655c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-11-26 09:08:47 +01:00
Jørgen Lind
ddc7323999 XCB: send leave event on grab
When a popup is opened it grabs the input, but the leave event to the other
windows needs to be sent.

Remove the popupEnterLeave test as it did not test any code. The Popup
never gets any enter or leave events so it will succeed always succeed

Task-number: QTBUG-36862
Change-Id: I625c616eeb74b5168af7b751485e2a9a53b76cd3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-11-26 08:43:28 +01:00
Shawn Rutledge
b9ae25fa71 Android: replace qFind with std::find
qFind is deprecated, so these cause build errors with
configure -no-feature-DEPRECATED

Change-Id: Iefcb061d5e8ce256445528f601ead4c9d5d1dfd2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-26 08:42:25 +01:00
Shawn Rutledge
544f82ea3a sqlite: don't use deprecated QSqlError constructor
so that it can build with configure -no-feature-DEPRECATED

Change-Id: Id2decc05974bad249c79936d99ab63d3cfc375ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-26 08:42:05 +01:00
Shawn Rutledge
7dcbd519c4 don't use QCursor if QT_NO_CURSOR
to support configure -no-feature-CURSOR

Change-Id: I8e7f9a7f80d3d44a1f8e25b909d552351b5f37e4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-26 08:41:53 +01:00
Friedemann Kleint
6df7be2476 Prevent duplication of display name in window titles.
Do not append QGuiApplicationPrivate::displayName() to window title
if the title already contains it.

Fixes Qt Designer showing up with window title

Qt Designer -  Qt Designer

after qttools:9a58492ce6b62c0fdab373337f39103f4072ad9d

Change-Id: I5ac07a7f4be70372342324a175faf8c825867f50
Reviewed-by: David Faure <david.faure@kdab.com>
2014-11-26 08:15:19 +01:00