Commit Graph

20783 Commits

Author SHA1 Message Date
Richard Moe Gustavsen
5d9dcac0f2 qplatformmenu: remove unused and deprecated function
Now that all platforms use the popup function that
takes a target rect, lets remove the deprecated one.

This is sort of important, since QtQuick controls now
uses the new version. So if a (new) platform ends up only
implementing the old version, that can end up not
working correctly.

Change-Id: I34814b3de5ea4954cf21b161e8a834e39e5534c8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-10-13 22:13:18 +02:00
Richard Moe Gustavsen
afefc89d0f osx: let qcombobox specify target rect when showing popup
Let qcombobox use the new API for showing a native
popup menu (introduced with 1a47595).

Change-Id: Id08ef9e59fdd47b2c1df84fa72e3a2c69fe187b0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-10-13 22:12:57 +02:00
Alex Trotsenko
350ab22885 Make QRingBuffer::ungetChar() not leave empty array in buffer list
Change-Id: Ic692693132f0c316ad068cad5423ca8fd32bd40d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-10-13 18:06:33 +02:00
Allan Sandfeld Jensen
29e679bed9 Fix access of non-existing color table
Since alphaMapForGlyph now returns images in alpha8 format, they no
longer have a colortable, so we need to fix the fallback implementation
of alphaRGBMapForGlyph from trying to access it.

Task-number: QTBUG-41855
Change-Id: I232089163cfc817d7cf16df566f05629a968bf12
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-10-13 18:03:40 +02:00
Laszlo Agocs
d92a9ca2d3 Update QOffscreenSurface docs regarding threads
Change-Id: Ic2e3230835aa7fc1b1c3ac0530a65cd478e1ec5f
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-10-13 14:00:21 +02:00
Lorn Potter
d0a6fcd925 Fix QtBearer connman backend report correctly on lte network
Task-number: QTBUG-41813
Change-Id: I977facc2ee59571d24e60ac9d5d41e957403b344
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-10-13 13:53:39 +02:00
Gabriel de Dietrich
b380bcc7e2 QMacStyle: Fix QPushButton with menu appearance on 10.10
As usual, this includes small and mini control sizes.
Flat and oversized buttons will fall back to the HITheme
rendering for now.

Task-number: QTBUG-40833
Change-Id: I08d67c48b2e72681af4dc4a37ea498f7aac1dca0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-10-13 13:53:34 +02:00
Maximilian Hrabowski
4cbb99c5e2 QAbstractItemView: fix CTRL+A select all behavior
The check for Qt::Key_A to handle selectAll was changed to directly
compare to QKeySequence::SelectAll as this will only match Ctrl. The
former implementation also triggered when e.g. Shift was pressed.
Added a check that selectAll is only called when selection is not
disabled, i.e. selectionMode=NoSelection.

Added a unit test for selectAll().

Task-number: QTBUG-26687
Change-Id: I721e7ab590b55d7d754b3b74ef01756fa5aa1315
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-13 13:53:28 +02:00
Dyami Caliri
2b4cda3852 QMacStyle: save context state before changing to avoid crash
qt_drawFocusRingOnPath was saving the graphics state after setting
a new context. This leads to zombie NSBitmapGraphicsContext access
with QFileDialog.

Task-number: QTBUG-41879
Change-Id: I7fc7d959d2b0f01cb3491d639023083f1b46d175
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-10-13 13:53:24 +02:00
Giuseppe D'Angelo
26fbeecfa5 Initialize QFileSystemMetaData::size_ data member
There's a code path which reads that member before it got anything
assigned to it, triggering undefined behavior.

The code path goes as follows:

1. an instance is created in QFSFileEngineIterator::advance
2. the instance is passed to QFileSystemIterator::advance, which fills in
   only some members (not size_)
3. the instance is passed to QFileInfoPrivate which does a deep copy,
   reading an uninitialized size_

Change-Id: I6835ee701a83b63ca4bad6235feeb6a23566fcd3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-13 13:53:17 +02:00
Marc Mutz
df2afcad2f QTableGenerator: replace a call to a member function with direct element access
Saves one copy of a vector.

Change-Id: I3a14c46e306c3d44a64c6e0d8cd2f120b2c208d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-10-13 13:50:04 +02:00
Laszlo Agocs
6c35eb5f0f eglconvenience/eglfs: Clean up warning messages
Remove the last occurrence of ifdefed debug prints and replace it with
categorized logging.

Also clean up the warning texts for some of the serious errors, the old
ones from Qt 4 times were somewhat messy.

Change-Id: I2a3e48c393d56be2511d25c3003b1f2b74ac3c8c
Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-10-13 10:00:45 +02:00
Topi Reinio
8304c8087d Doc: Update description of QKeyEvent class
Update the description on how to use the QKeyEvent pointer
passed to key event handlers, and remove an outdated note about
multimedia key events.

Change-Id: I67a3f0054e28b84d5a0e367c02a329f4670221c7
Task-number: QTBUG-35155
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-10-13 09:33:22 +02:00
Gabriel de Dietrich
e3bfd9bea6 QMacStyle: Use NSRect instead of CGRect in drawNSViewInRect()
Change-Id: I90fd62dea377dfa9569d1730a67136c7a5dc6f82
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-10-13 02:41:42 +02:00
Tom Hirst
1910454fe0 prevent if_nametoindex being called with empty string
Calling if_nametoindex with an empty string will always return 0, but
on ARM linux platforms this call seems to be very expensive (~30ms),
adding a large overhead to calls such as QUdpSocket::writeDatagram()

Task-number: QTBUG-37092
Change-Id: Iad00867585d9534af1ddaee936dd4e4dc5e03611
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-12 10:45:50 +02:00
David Faure
cd824ee791 QAIV: speed up isRowHidden for the case where no rows are hidden.
isPersistent(index) is a linear search, which we can avoid altogether
(as well as the creation of a persistent model index, is idx is indeed persistent)
when the row-hiding feature isn't used at all.

Change-Id: I07488dddf56e299806cc29749e633da00115fc30
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-10-12 10:37:58 +02:00
David Faure
955c9562bd QSettings: undo unintentional change of config dir on non-XDG platforms.
c99dfd8f63 only meant to be able to switch to the test mode of
QStandardPaths, not to move the default dir on OS X, iOS, BB10 and Android.
So this commit restores it to the previous behavior, to avoid migration issues.
The use of XDG_CONFIG_HOME, defaulting to ~/.config, on OS X, is even documented
in the current QSettings documentation, even though these paths are non-standard
on OS X (granted, the use of ini-style config files isn't either).

Task-number: QTBUG-41461
Change-Id: I5eb610ff7ccbdaf6f955ef7f8f7c2658cbecbb86
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-12 10:37:45 +02:00
Thiago Macieira
38c39341b3 Use :- instead of - for empty environment variables
We set the variables to empty when we start processing, so ${FOO-foo}
will never print "foo". We need to use ${FOO:-foo}.

Change-Id: I00c28edb10d8eaa09df689905a302b576b246806
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-10-10 23:34:27 +02:00
Jürgen Hunold
d16f76cde3 Remove duplicate of clang + libc++ mkspec
The same funcionality is already supported, so we avoid confusion.
The corresponding mkspec is name "linux-clang-libc++"

Change-Id: Ib087595298b48c73ad5da8d92cca2d1bac89f2be
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-10-10 18:21:09 +02:00
Richard Moe Gustavsen
65c542bc87 qiosclipboard: take ownership over mime data
QClipboard is documented to take ownership over
the mime data set with "setMimeData" and the value
returned by "mimeData". So we need to implement
this to avoid memory leaks.

Change-Id: Ieb3a17368ed3a698c29a7f92c8ee87a0cca86b46
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-10-10 16:50:35 +02:00
Andy Shaw
7c90778487 Account for the country/language settings when checking for duplicates
When a file has the same alias but a different country or language setting
then it should not warn about it being a potential duplicate.

Task-number: QTBUG-19286
Change-Id: I60a9c422ff02214399bdea3791374a65c9f6c604
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-10-10 16:45:50 +02:00
Timur Pocheptsov
8c538d10da OS X: rename special menu items instead of duplicating
Two-part fix: QCocoaMenu::syncMenuItem, when selecting the "old" menu,
if an item was merged, 'applicationMenu' was always selected, but this
is wrong for any item with a role >= CutRole (such an item still can
be "merged", but it's not in the application menu).

QCocoaMenuItem::sync - item can be merged with itself: after item's
role detected, the search for an item to merge with can find exactly
the same item we've just detected the role for (since a data-member is
modified) - try to avoid this.

Task-number: QTBUG-39934
Change-Id: Ibe1df9e92973380652101143067e14922afdfb9e
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-10-10 16:04:07 +02:00
Eskil Abrahamsen Blomfeldt
9bbf08fcf3 Android: Make memory handling in QClipboard consistent with iOS
On iOS we do deleteLater() on the mime data instead of deleting
it directly, in case the application should happen to use the
pointer again directly after setting it on the clipboard.
Technically it would be a bug in the application, but using
deleteLater() is safer and it's better to be consistent with
iOS so that a buggy application crashes in the same places in
both.

Change-Id: I2996d6c7816a2f83615a43609f5be207aaa72c86
Task-number: QTBUG-41853
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-10-10 14:54:27 +02:00
Oswald Buddenhagen
e4493c41b6 DPI-scale PM_SubMenuOverlap after all
This actually isn't a magic value and needs to be scaled.

This partially reverts commit be1635e2d6.

Task-number: QTBUG-41864
Change-Id: Ie03c96c8b5343386f55c3ae9b988e79f943f334e
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-10 14:31:28 +02:00
Kai Koehne
01f5ba006e Fix patching of installation date
Marking qt_eval_expiry_date alone as volatile apparently didn't stop
the compiler from optimizing away the calculation of the expiry date.

Task-number: QTBUG-41612
Change-Id: Ia51fb83f03250346952a76c8a1a641096b4ff9e7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Kalle Viironen <kalle.viironen@digia.com>
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-10-10 14:29:52 +02:00
Shawn Rutledge
0647f24c7d QMenu: ensure that a menu item's icon can be removed dynamically
Task-number: QTBUG-41348
Change-Id: Iad3b7f000ebce51530f5e196868aefffad2e1eab
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-10-10 13:52:40 +02:00
Eskil Abrahamsen Blomfeldt
74a20b77a6 Fix memory leak in QClipboard::setMimeData()
The setMimeData() function is documented to take ownership of
the object passed in, but in the case where the platform
plugin did not support the requested mode, we would simply
return without deleting the object nor telling the application,
so it would cause a potential memory leak. We need to honor the
contract, even when we fail to set the mime data.

Test was updated to avoid verifying the leak in cases where
the platform does not support all modes.

[ChangeLog][QtGui][Clipboard] Fixed a memory leak in setMimeData()
when the platform plugin did not support the requested mode.

Task-number: QTBUG-41852
Change-Id: I2112da1613199fe1b56724e7ccf097b9e912c117
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-10-10 13:37:59 +02:00
Eskil Abrahamsen Blomfeldt
9685c72e37 Android: Return empty mime data instead of 0 from empty clipboard
This is consistent with other platforms such as iOS and
XCB, which return a QMimeData with an empty text when the clipboard
is empty.

[ChangeLog][Android] QClipboard::mimeData() now returns an empty
object instead of null pointer from QClipboard when clipboard is
empty for consistency with other platforms.

Change-Id: I17068f0afcb63690cf11048ffa60e19dc9b08691
Task-number: QTBUG-41817
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-10-10 13:37:51 +02:00
Eskil Abrahamsen Blomfeldt
aa00020578 Android: Support QSysInfo::productVersion()
Gets the user-readable string for the current running Android
version.

Task-number: QTBUG-41764
Change-Id: Iefea4a4f5291bfddc99bbf901676ccd33fbc23d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2014-10-10 13:37:44 +02:00
Louai Al-Khanji
97f119af14 EGLFS: Add support for multiple displays
Change-Id: Id039e0ed2d99562eb2a5cfe1e7b34013c75ff3ac
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-10-10 13:25:53 +02:00
Tomasz Olszak
8ddaf5c741 Gcc 4.5.* build fix.
Q_COMPILER_DEFAULT_MEMBERS and Q_COMPILER_DELETE_MEMBERS are now set
starting from gcc 4.6. Pre-4.6 compilers implement a non-final snapshot
of N2346, hence default and delete functions are supported only if they
are public. Starting from 4.6, GCC handles final version - the access
modifier is not relevant. Compiler error:

  qsharedpointer_impl.h:717:31: error:
  'QEnableSharedFromThis<T>::QEnableSharedFromThis()' declared with non-public access cannot be defaulted in the class body

Change-Id: If1d3d4696f91912a09ca72bd4aa1fb07f491a0cb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-10 13:20:30 +02:00
Friedemann Kleint
eaf04207bd Improve threadedqopenglwidget example.
Retrieve vendor/renderer name similar to context info
and exclude renderers that do not support threaded
Open GL (ANGLE/noveau).

Change-Id: I690c2fc277538bf28bf1f6032c2e017ede15e434
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-10-10 13:17:13 +02:00
Friedemann Kleint
bf73ab490d Disable tst_qhostinfo on OS X.
Task-number: QTBUG-41847
Change-Id: Idfb4058a50a0baecce1b3e430629ec6b2867550b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-10-10 13:15:43 +02:00
Gatis Paeglis
f813a3e8ad Print warning when unable to query physical screen size
This warning was removed when re-factoring code in:
328f2f9c35

Change-Id: I5a9d7fbbf2b78e6e80a79478f4e9fb08ccaec431
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-10-10 12:48:30 +02:00
Laszlo Agocs
26c104d120 Add a warning when using QOpenGLWidget as a native child
Just like it is done for QQuickWidget.

Task-number: QTBUG-41779
Change-Id: I1b27c2ed34ecb2520edf82843b675dbf6b0eab8e
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-10-10 12:48:27 +02:00
Mikołaj Siedlarek
8fc34e42a8 Add information about unsupported SSL protocol when creating context.
When creating SSL context failed due to unsupported protocol being
demanded, no explanation was given. It's because
QSslContext::fromConfiguration() extracted explanation for error message
from OpenSSL, which at that point hasn't even been called yet. This
patch adds explicit message informing that an unsupported protocol was
chosen.

Task-number: QTBUG-41775
Change-Id: I9d2710da4ba314a16837a90afcdc5d9256179bef
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-10-10 10:17:12 +02:00
Mikołaj Siedlarek
9ddf2fb376 Prevent parsing of SSL certificates from 0-size buffers.
When QSslCertificatePrivate::certificatesFromDer() was passed count ==
-1 to extract unlimied number of certificates from buffer, it also tried
to parse the 0-sized fragment after the last certificate.  This has
caused d2i_X509() to report an error on latest OpenSSL.

Task-number: QTBUG-41774
Change-Id: Ifa36b7ac5b4236bd2fb53b9d7fe53c5db3cb078c
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-10-10 10:17:07 +02:00
Eskil Abrahamsen Blomfeldt
5f1f955524 Android: Fix memory leak in QClipboard::setMimeData()
The ownership of the object passed into QClipboard::setMimeData()
is documented to be transferred to the clipboard, but we never
deleted it, thus all these objects would leak.

[ChangeLog][Android] Fixed memory leak in QClipboard::setMimeData()

Change-Id: I43e6bad1071be5f56c219cb9341584edba54d2bd
Task-number: QTBUG-41852
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-10-10 10:13:53 +02:00
Eskil Abrahamsen Blomfeldt
e31a7e46ea Android: Support QClipboard::clear()
QClipboard::clear() is implemented by calling
QPlatformClipboard::setMimeData() with a null pointer. Since we
would do nothing in this case on Android, then the clear()
function would have no effect.

[ChangeLog][Android] Added support for QClipboard::clear()

Task-number: QTBUG-41854
Change-Id: Id569b102f2e561e46967b52f89d9b54031d92456
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-10-10 10:13:45 +02:00
Paul Olav Tvete
c712ec4543 Android: Thread fix/optimization
Do the cheap test before sending an expensive query that might
use a mutex.

Task-number: QTBUG-41369
Change-Id: I78f03c84e5bbf0492f1b7ea18d1baa752a1beff2
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-10-10 10:04:42 +02:00
Paul Olav Tvete
7755b4af41 Android: null pointer check
Task-number: QTBUG-41680
Change-Id: I740fb2a6df5613a8ee724b59dab08674a3337236
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-10-10 10:04:34 +02:00
Laszlo Agocs
7069ebd1f6 Use requestUpdate in QOpenGL and RasterWindow
Change-Id: Ibed4b8d2e2185f1bcf3430932701f81577b59408
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-10-10 08:37:04 +02:00
Laszlo Agocs
1f040d401d eglfs: Add support for systems without pbuffer support
Use a small native window and window surface in case the hooks indicate
that pbuffer support is not available.

Change-Id: I6515309041f0e1e2f5321d59941f35d6ee16dca7
Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-10-10 08:36:47 +02:00
Christian Strømme
8d8000b5fe Android: Don't call requestLayout() when changing the geometry.
requestLayout() is already called when setLayoutParams() is called, so
calling it again is extremely wasteful.

Change-Id: Iddfb488830a6b7277a653a84ffacabf966baf0b5
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-10-09 22:57:19 +02:00
Frederik Gladhorn
881ceeff42 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: I05fcd8dc66d9ad0dc76bb7f5bae05c9876bfba14
2014-10-09 17:56:52 +02:00
Gunnar Sletta
b3d2c867ed Introducing QWindow::requestUpdate().
Change-Id: I0e2a09b53459a56d90dcd9043e694b19e2d77a9e
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-10-09 10:59:40 +02:00
Alessandro Portale
106487387d Removing a few unneeded "? true : false"
Change-Id: Ib13f0ddd65fe78f5559f343f2fc30756b1d3ef76
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-10-09 09:43:26 +02:00
Marc Mutz
e5f528fb0e Don't stream QStringLiterals into QDebug
Normal (C) string literals do just as well and use more than twice
less space in the DATA section.

Change-Id: Iafb0682a362c41dfd5b4d8b9137d88014d7992a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-09 09:42:27 +02:00
Marc Mutz
a5b647804b QFactoryLoader: de-duplicate two QStringLiterals
When seemingly identical QStringLiterals are used in different
functions, due to the use of lambdas and scoping, they produce
different lambda types and thus duplicated QStringLiteral data.

Fix by moving the QStringLiterals into inline functions and
calling those instead.

Change-Id: Ifaa124ec74e201ccc63fd9afce042f8b2ff22b9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-09 09:42:17 +02:00
Marc Mutz
1cc06b2e94 Don't use QStringLiteral in startsWith/endsWidth
For QLatin1String, startsWith/endsWith is overloaded, so comparing to
a latin-1 (C) string literal is efficient, since strlen() is
comparatively fast.

OTOH, QStringLiteral, when not using RVO, litters the code with
QString dtor calls, which are not inline. Worse, absent lambdas,
it even allocates memory.

So, just use QLatin1String instead.

Change-Id: I7eaf464c67b55116f970fe7f58a85f19ce4d254e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-09 09:42:11 +02:00