Commit Graph

27510 Commits

Author SHA1 Message Date
Loïc Molinari
2ccf6c60d9 Fix the GCC version supporting -Wsuggest-override
Q_CC_GNU is (__GNUC__ * 100 + __GNUC_MINOR__), so 510 is 5.10 not
5.1.0. The first GCC 5 release has support for -Wsuggest-override, so
it should really be 501.

Change-Id: I7b264af087cd4562ce8720c99b70116d7654ea5f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-16 04:11:57 +00:00
Thiago Macieira
ebf0b12108 Make QDBusConnectionPrivate::relaySignal be called in the right thread
This function sends D-Bus messages directly (in huntAndEmit), so it
should only be called from the QDBusConnectionManager thread. Somehow, I
missed this in the Qt 5.6 refactoring of QtDBus.

Being called in the wrong thread means that there's a visible behavior
change compared to Qt 5.5: if the user code sent a method call or method
return/error and then emitted a signal, we'd have two threads racing to
send the D-Bus messages. This was observed in Telepathy-Qt code: certain
signals arrived before a method return, even though they were clearly
emitted by a queued QMetaObject::invokeMethod.

In addition to that, we have has an internal problem (though not
observed): the libdbus-1 timer and socket callbacks would be called in
the wrong thread and we no longer have protection against that.

Unit testing not possible since this is a race condition.

Change-Id: I9e96ecd4f6aa4ff0ae08fffd1471d002142613d6
Reviewed-by: Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2016-09-16 04:11:54 +00:00
Sune Vuorela
469d68b344 Fix handling of bad compose table
The ASAN talk at QtCon was pointing out a out of
bound read in a vector.
Let's try to do something about it.

If the lazy initialization of compose table fails,
the first character handling still tries to actually
access it. Later characters are properly handled
in the caller.

Reported-by: Hanno Böck
Change-Id: Ieac3e95361abd0fcd06c555bcd00ca1c4d8f1931
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-15 17:31:09 +00:00
Thiago Macieira
c59c759fcc Suppress ICC warning #111 about unreachable code in toWCharArray
qstring.h(961): warning #111: statement is unreachable

Change-Id: I33dc971f005a4848bb8ffffd14748ae03dadefc9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-09-15 16:54:56 +00:00
Dmitry Shachnev
5ca9631d3a dbusmenu: Don’t leave dangling pointers when menus are destroyed
Delete references from menu to its containing item, and vice versa.

Fixes https://launchpad.net/bugs/1620937

Task-number: QTBUG-55966
Change-Id: I58f0f0a90184bee4b0466c28d91c670a34fa65a5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-09-15 14:17:14 +00:00
Dmitry Shachnev
63656dbed7 dbustray: Delete m_notifier in QDBusTrayIcon::cleanup()
This fixes a bug where notificationClosed() and actionInvoked() slots
were called more than once, from previous alive notifier instances.

Change-Id: I4cb4dfc27ee129bc5282fbd8e0961959d0765112
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-09-15 14:16:54 +00:00
Dmitry Shachnev
835d7cf543 QMenuBar: Get rid of QMenuBarPrivate::nativeMenuBar
Instead of trying to keep that variable in sync with platformMenuBar
state, just check whether platformMenuBar exists instead.

Now QMenuBar::isNativeMenuBar() is more reliable, and will not return
true if the QPA plugin provides no platform menu bar.

Also, remove useless restrictions for code using isNativeMenuBar().
That method is available on all platforms for a long time, not only on
macOS or WinCE.

This makes sure local menus do not appear if global menus are available,
and setVisible(true) is called.

Change-Id: I7a5944c64376b4714a38ad981089df8a151c3403
Task-number: QTBUG-54793
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-09-15 14:15:21 +00:00
Frederik Gladhorn
f4eefce863 Fix typos in highdpi docs
Change-Id: I15fd6859ff777388a229e3cb10de45886fe543fb
Reviewed-by: Nico Vertriest <nico.vertriest@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-09-15 14:12:50 +00:00
Vikas Pachdha
46913db2ea Fixes issue with iOS when project path has a whitespace
Task-number: QTBUG-55505
Change-Id: Ic853ecd46a3cb098fff2904119e9002f3add3b8e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-09-15 10:17:54 +00:00
Błażej Szczygieł
25c9a6c9b4 QtWidgets: Fix enter/leave events on popup menus
If the sloppy menu popups - send the leave event to the last active
menu (except Cocoa), because only currect active menu gets enter/leave
events (currently Cocoa is an exception).

Check that the menu really has a mouse before hiding the sloppy menu -
don't rely on enter events.

This patch removes some unnecessary synthetic mouse enter/leave events
from QMenu which causes event duplications with different mouse cursor
position.

Refactor sloppy menu timer handling - start or restart timers on mouse
move events. Enter/leave events are not reliable.

Fixes:
- better enter/leave events handling for native widget actions,
- reduce duplicated enter/leave events for menu actions,
- better handle torn off sloppy menus.

Partially reverts: 0ed68f3f58
Amends: 57ecd5aeeb

Task-number: QTBUG-53068
Change-Id: I7ad56ac1619db124915d373fab82d0512d44c90e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-09-15 10:16:44 +00:00
Błażej Szczygieł
2cf3dee10b xcb: Don't send "Qt::WindowNoState" event when hiding minimized window
This prevents getting "QWidget::showEvent()" when hiding minimized
widget on some WMs like Marco or Xfwm4.

If QWindow is minimized and it gets the new "XCB_WM_STATE_WITHDRAWN"
event from XCB, then don't change the QWindow state.

Task-number: QTBUG-55942
Change-Id: I90cfc2bf55e507864ad8f26c8f569ea562c27314
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-09-15 10:16:42 +00:00
Marc Mutz
258e4d05ed QDBusError: don't bother dealing with unusable 'unused' field
The move constructor as well as member-swap were dealing with the
'unused' field as if it would be usable. But as the comment in the
default ctor suggests, the field can never be used in Qt 5, due to
the inline dtor.

So, don't bother with the field. Doing so only triggers checkers
such as Coverity.

Also mark the field for removal in Qt 6.

Coverity-Id: 154503
Coverity-Id: 154510
Change-Id: If42c5ed66d1133e651de7477f3313b3989b64bc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-15 10:10:34 +00:00
Marc Mutz
a54d44298f QLatin1String: Fix UB (nullptr passed) in relational operators
Found by UBSan:

  qstring.h:1160:44: runtime error: null pointer passed as argument 1, which is declared to never be null
  qstring.h:1160:44: runtime error: null pointer passed as argument 2, which is declared to never be null

Fix by avoiding the memcmp() calls if there's a chance that they
might be called with nullptr.

While at it, also implement !=, >, <=, >= in terms of ==, <,
and add a test, because this particular UB was not fingered by
any of the QtCore test cases, but by a Qt3D one.

Change-Id: I413792dcc8431ef14f0c79f26e89a3e9fab69465
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-09-15 10:10:28 +00:00
Dyami Caliri
7529c39ba3 QStyleOption: return Q_NULLPTR from qstyleoption_cast instead of 0
qstyleoption_cast should use Q_NULLPTR to represent a null pointer.

Task-number: QTBUG-45291
Change-Id: I85078ceb435b310daf63db2ed771be2f36cf3e4f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-09-13 04:00:52 +00:00
Milian Wolff
3370ab9119 Never return char variants when reading prepared MySQL statements
This has undesired effects when converting a QSqlRecord to JSON.
A char(0) e.g. has special semantics that are undesired when
reading a Tinyint column.

I don't think that returning bool for the special case of a
Tinyint(1) is required. This also did not happen before, and
is also not happening when not using a prepared statement.
Instead, a plain int/uint QVariant is returned.

This patch extends tst_QSqlQuery::integralTypesMysql to also
cover reading and writing booleans from/to a MySQL table column
of type Tinyint(1). Additionally, the reading is now also done
with a prepared statement and we also check the raw variant
value.

The broken behavior fixed by this patch was introduced by me in
commit 194403a348.

Change-Id: I028a3abd83fdd2b42d98d478950d205e5b6bbeb5
Task-number: QTBUG-53397
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2016-09-12 12:47:08 +00:00
Błażej Szczygieł
3b8df0ea44 QtWidgets: Send show/hide event to children on restore/minimize
Child widgets should get the show/hide event when the TLW changes its
state, because child widgets are also visible or invisible. This
restores the Qt4 behavior (fixes the Qt4->Qt5 regression).

Restoring/minimizing the TLW now sends the spontaneous show/hide event.

Show events are now handled also in the expose event handler in the
QWidgetWindow class, because the show event must occur before the
expose event to avoid possible flicker e.g. the OpenGL content. This
can happen e.g. on XCB platform. If the "WindowStateChange" event occur
before the expose event (e.g. Windows platform) then the code in expose
event handler will be ignored to prevent event duplications.

Added autotest.

Task-number: QTBUG-50589
Change-Id: Ie9a9329b1f29bff876de28d5948d0d5fb6bc1f05
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-09-12 08:38:06 +00:00
Thorbjørn Lindeijer
66fcd0cf66 Fixed glitch when dragging a movable QTabBar tab
When you would start to drag a tab, and then drag it in the other
direction along the point where you started the drag, the tab would fail
to follow the mouse for a distance twice the "startDragDistance", before
jumping to the mouse again.

Fixed this by only taking into account the "startDragDistance" when
checking whether a drag is started, and to rely on the "dragInProgress"
variable otherwise.

Change-Id: I5dd4ebd8340fef7e870f087be68c5097b49728cb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-09-12 08:03:30 +00:00
Alberto Mardegan
a32217cb55 QDBusServer: delay processing of D-Bus messages
We must ensure that QDBusServer's newConnection() signal has been
processed by the application, before starting processing messages on it.

Task-number: QTBUG-55087
Change-Id: I595329b2f98788dbf9f40558b8c230c0c0817ef8
Reviewed-by: Timo Jyrinki <timo.jyrinki@iki.fi>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-06 18:22:58 +00:00
Andy Shaw
43a710df63 MySQL: Fix MySQL plugin build with MySQL 5.0
Task-number: QTBUG-55544
Change-Id: Iff4e3109f475f9c3c8764fc6741b8d0547769ba2
Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2016-09-06 07:41:06 +00:00
Sérgio Martins
bd9f3c50df QToolButton: fix read of uninitialized variable
Calling style() can trigger a call into user code which can read
the tool button's members before they are initialized

==3566== Conditional jump or move depends on uninitialised value(s)
==3566==    at 0x421C39: MyProxyStyle::pixelMetric(QStyle::PixelMetric, QStyleOption const*, QWidget const*) const (MyProxyStyle.cpp:635)
==3566==    by 0x504B8B1: QRenderRule::QRenderRule(QVector<QCss::Declaration> const&, QObject const*) (qstylesheetstyle.cpp:1004)
==3566==    by 0x504D084: QStyleSheetStyle::renderRule(QObject const*, int, unsigned long long) const (qstylesheetstyle.cpp:1747)
==3566==    by 0x504D4A5: QStyleSheetStyle::renderRule(QObject const*, QStyleOption const*, int) const (qstylesheetstyle.cpp:2023)
==3566==    by 0x504FF02: QStyleSheetStyle::styleHint(QStyle::StyleHint, QStyleOption const*, QWidget const*, QStyleHintReturn*) const (qstylesheetstyle.cpp:5146)
==3566==    by 0x517B2D0: QToolButtonPrivate::init() (qtoolbutton.cpp:193)

Change-Id: I56bca15d3ec7cd7b255a83dca786532a2f9b9b48
Reviewed-by: David Faure <david.faure@kdab.com>
2016-09-05 17:54:38 +00:00
David Schulz
a0d3455ee3 Taking trailing whitespace into account when shaping lines
The calculated end position of script lines, consisting of nothing but
trailing spaces, is lower than the start position. This results in not
shaping those script lines.

Task-number: QTBUG-55255
Change-Id: Ib70c1a800d2f70b7f61e3d05c10618e275f45f12
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-09-05 12:49:16 +00:00
Peng Wu
b94111116f Style sheets: detect and apply font set on QHeaderView section
Detect and apply style sheets font set when calculating
QHeaderView section content size and drawing it.

Change-Id: I542cd0d31bbe62f127c509f297eef0a576fec054
Task-number: QTBUG-55597
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-09-04 05:12:20 +00:00
Allan Sandfeld Jensen
24bd7fd651 Fix crash when rendering to grayscale8 images
An entry was missing in one of the tables. This patch adds it back in
and adds the enum comments used to keep track of whether they all are
there and correctly set.

Change-Id: Ic6a55a8f81f9c42a3174a2a75c80c3a354f173b7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-09-03 08:25:23 +00:00
Allan Sandfeld Jensen
c8cb188dd4 Ensure the fontdatabase is initialized when requesting fallbacks
Otherwise we will return an empty list of fallbacks if no QFontDatabase
has been created yet.

Task-number: QTBUG-55222
Change-Id: I50508162fad3206e0acf3cc6eb39aefac5c3e197
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-09-03 08:25:10 +00:00
Marc Mutz
2a6bea7a55 qcompilerdetection.h: retract Q_COMPILER_DEFAULT_MEMBERS for MSVC < 2015
Earlier versions of the compiler cannot default
move special member functions, even though we
also define Q_COMPILER_RVALUE_REFS for them.

Fix by retracting the less-often-used of the
two compiler feature defines.

Q_COMPILER_DEFAULT_MEMBERS is not used outside
QtBase in neither 5.6 nor 5.7 (5.8 is not
released at this time, so wasn't considered).
The same is true of the dependent macros
Q_COMPILER_DEFAULT_DELETE_MEMBERS and
Q_DECL_EQ_DEFAULT.

In QtBase, the three uses are:
1. in QAtomic*, where the user also requires
   Q_COMPILER_CONSTEXPR, which is not defined
   for any MSVC at this time,
2. for QEnableSharedFromThis, which is a class
   template with an alternative {} implementa-
   tion of the default constructor, and uncon-
   ditional user-defined copy special member
   functions.
3. The test of the corresponding functionality
   in tst_compiler, which this commit amends.

That means that neither of these two only uses
of the macro in Qt libraries are affected by
the change.

The reason we do this change, then, is that in
the future, we want to be able to more easily
restore move special member functions for
classes for which they are suppressed due to
user-defined dtors or copy special member
functions.

Change-Id: I6f88cad66d6b87a758231f16355c3bddae697b86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-03 05:11:40 +00:00
Marc Mutz
312d08b290 qstrncpy: don't call strncpy_s with invalid parameters
According to https://msdn.microsoft.com/en-us/library/5dae5d43.aspx,
strncpy_s' second argument must not be 0:

> If strDest or strSource is NULL, *or numberOfElements is 0*, the
> invalid parameter handler is invoked.

Move the existing check for len > 0 up to protect the strncpy_s
call, too.

Change-Id: I70d339ea60d4b76f3038b2e4e4756f6590a9bd31
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-03 05:07:54 +00:00
Dyami Caliri
816a623876 uic: generate translate calls with Q_NULLPTR instead of 0
uic should use Q_NULLPTR instead of 0 as the default disambiguation
context.

Task-number: QTBUG-45291
Change-Id: I889182c7fe1c4be3336f3cd645aa60838863c633
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-09-03 05:07:50 +00:00
Jake Petroules
4e53159d43 Mark Apple Clang 7.x as warning-free on macOS and (also Clang 3.9) iOS
iOS was excluded in 09aeda21b9, probably
unnecessarily. The build has been found to be warning-free.

Change-Id: I81de2fff40938b6ab9f7a6a5b9f08f8a8baadb16
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-08-31 22:16:02 +00:00
Jake Petroules
013210e9da Fix unused variable warning on iOS
Change-Id: Ieae5d7833b45a49a743a52a437d5383bd8a962c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-31 22:15:57 +00:00
Friedemann Kleint
531a2b1b1c Windows QPA: Fix leaks in native file dialogs
Release the IShellItem instances according to the
documentation of IFile[Open]Dialog.

Task-number: QTBUG-55509
Task-number: QTBUG-55459
Change-Id: Ib79622cde21982b1bda0be7d0483c6e652a1d5fe
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-08-30 12:48:15 +00:00
Andy Shaw
2ca4fd401b QIcon: Set the pixmap's dpr to 1.0 if the window is also set to 1.0
When the pixmap is initially from a higher device pixel ratio and it is
being used on a window that does not have a device pixel ratio other
than 1.0 set then the pixmap should also have it set to 1.0. This ensures
that the size of the pixmap is preserved and it is not scaled down as a
result on the normal display.

Change-Id: Ie5d96b3e1508867b723000bea182c8157640af02
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-08-30 12:48:14 +00:00
Friedemann Kleint
579283507c QWin32PrintEngine: Fix uninitialized memory read of dpi_x, dpi_y
Discovered by purify:
QWin32PrintEnginePrivate::initialize() called updateMetrics()
via updatePageLayout() after initHDC(), so dpi_x, dpi_y
were accessed before initialized from the display resolution.
Fix by moving the call initHDC() up and giving default
values.

Change-Id: Ia360c06d156e569ca6b1472ec5b5cdc52948f913
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2016-08-30 12:02:09 +00:00
Tor Arne Vestbø
ce2815b43c Guard against calling QWindow::requestUpdate() on non-GUI threads
Change-Id: I851ff672bc234146deb61615fc7c56df87d62065
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-08-30 11:43:35 +00:00
Olivier Goffart
17e5d9d7ca Fix QMainWindow::restoreDockWidget() with GroupedDragging
We need to account for the fact that the placeholder might be in a
floating tab.

Task-number: QTBUG-50491
Change-Id: I03d8e49cc40f58691154f5c3984f3b0670a974d5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2016-08-30 11:42:18 +00:00
Edward Welbourne
55ab276700 Major re-write of generate_expected_output.py
Restructured, separated the canonicalising of output lines out (into
an object that prepares the necessary regexes and replacements)
suppress more, changed the path-stripping to strip qtbase's parent
rather than os.getcwd() and took account of shadow builds (so both
source tree and build tree provide prefixes we want to strip from
paths).  Also cope with $PWD potentially having symlinks in it, where
os.getcwd() is canonical.

It's possible some output might name files elsewhere in the source
tree; these won't be filtered by the prior cwd prefix removal; and, in
any case, the problem with cwd is only that the ancestry of qtbase is
apt to vary; paths relative to there should be consistent between test
runs.  This change shall lead to a one-off rewrite of all expected_*
files; but it should now catch all paths.  By stripping both build
root and source root (when different) it also avoids differences for
those doing out-of-source ("shadow") builds.

In our XML formats, any hyphens in root paths (e.g. I had Qt-5.6 in my
build root's path) got represented by a character entity, confounding
the replacement; so also do replacement that catches this.  We may
discover other character entity subsitutions needed along with this.

Now filtering line numbers and timing information, including benchmark
results; these numbers all get replaced with 0 to avoid noisy diffs.
Also purging dangling hspace, to placate sanity-bot.

The module can now be imported - the code it runs is packaged as a
main() function that a __name__ == '__main__' stanza runs - and all
data is localised to where it's needed, rather than held in globals.
Tidied up and organized the existing regexes.  There are doc-strings;
there is a short usage comment.  Data is localised rather than global
and modern pythonic idioms get used where apt.

Regexes are compiled once instead of repeatedly.  An object looks
after the list of patterns to apply and its construction handles all
anticipated problems.  Failures are mediated by an exception.

The output file now gets written once, instead of twice (once before
editing, then over-write to edit), and Popen uses text mode, so that
write can do the same.  Its command is delivered as an array, avoiding
the need to invoke a shell.

Instead of relying on qmake being in our path (which might give us a
bogus QT_VERSION if the one in path doesn't match our build tree), use
the relative path to qmake - we rely on being run in a specific
directory in the build tree, after all.  Escape dots in the version
properly, so that 51730 doesn't get mistaken for 5.7.0 (for example),
and moved this check later in the sequence (matching a smaller target
makes it more likely to falsely match).

Overtly check we are in the right directory and tell the user what we
actually need, if run from the wrong place.  Simplify handling of the
unsupported use-case for MS-Windows (but note what would be needed for
it).

Change-Id: Ibdff8f8cae173f6c31492648148cc345ae29022b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-08-29 18:02:35 +00:00
Tor Arne Vestbø
dcfb814498 Cocoa: Add support for triple-buffered GL contexts
As usual, the requested format may not be available, so clients should
check the actual format to confirm triple-buffering.

Change-Id: Icf073cc9ddf2c912eb5c3ce0ac80d1694d1c56d7
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-08-29 10:11:52 +00:00
Samuel Gaist
e52fcb7dc7 QTextDocument: fix string backward search
[ChangeLog][QtGui][QTextDocument] Fixed a bug that would return a wrong
position when searching backward from the end of the document.

Task-number: QTBUG-48182
Change-Id: I6e88f808a50cb840f61e7bc579e2a28c5300089d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-28 15:18:55 +00:00
Thiago Macieira
2743cd54a0 Mark Clang 3.9 as warning-free
Change-Id: Id75834dab9ed466e94c7ffff1444b71f29f49afd
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-08-27 19:05:08 +00:00
Thorbjørn Lindeijer
d7d8cde4bb QColorDialog::getRgba: Fixed ignoring of initial alpha value
The documentation for this method explicitly states that the initial
color+alpha is used, but its implementation used a QColor constructor
that ignores the alpha value.

Change-Id: I71721386e7fae0761e079d8840ec0124a8c14e33
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
2016-08-26 22:18:02 +00:00
Friedemann Kleint
1e85ca2e62 QAbstractSpinBox: Clear 'cleared' flag on receiving a keypress
Prevent QAbstractSpinBoxPrivate::interpret() from bailing out
in focus changes after text has been entered.

Task-number: QTBUG-55249
Change-Id: I250b3c50f7db5de2e9356038df20f18ee059df11
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-08-25 17:29:51 +00:00
Maurice Kalinowski
c0a513d55f winrt: avoid duplicate signal emit
emitChanged() will be invoked when the system notifies the application
about a clipboard change. Hence, there is no need to call it previously
and cause two signals on the same change to be emitted.

Change-Id: I99605c9a71054e0610006dbeaaa90c5fb2f46755
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-08-25 17:29:15 +00:00
Maurice Kalinowski
ea4aa5b722 winrt: store mimedata in clipboard
In addition to setting the clipboard, we also need to store the mimedata
being passed. Otherwise requesting the mimedata returns a different
object, causing comparisons to fail.

Change-Id: I2ffea76e78be091cb98426e387619ac6788ea270
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-08-25 17:29:05 +00:00
Maurice Kalinowski
5f895fe0e2 winrt: Check validity of options shared pointer
QErrorMessage autotests managed to create a scenario where the options
are not initialized yet, causing a crash later on.

Change-Id: Iabad6f181f2bfdc81a9c73f0e67c8ba70753fec6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-08-25 17:28:55 +00:00
Maurice Kalinowski
f4b2115b51 winrt: Add support for version requirements for MSVC2015
Previously we hardcoded the minimum windows version to the initial
Windows 10 release. However features have been added which require a
higher SDK version (eg drag and drop). Deploying such a package might
fail during distribution to consumer devices.

Hence introduce WINRT_MANIFEST.minVersion and
WINRT_MANIFEST.maxVersionTested as variables for the manifest file. If
nothing is specified, both values will be set to the UCRTVersion
environment variable, implying the development setup from which qmake
has been invoked.

Change-Id: I1dcf1e75c67c4ab2fd5a3fdcc32c8783a336e6ff
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-08-25 13:27:22 +00:00
Edward Welbourne
3525ede0a5 QOffscreenSurface: warning-fix - QString(char*) deprecated
Passing a string literal to QWindow::setObjectName() is rude:
it wants a QString.

Change-Id: Ic4c1079889002f0d5f1028c443456a8be0b7b0fe
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-08-25 13:25:13 +00:00
Alex Trotsenko
f063cb7f81 QAbstractSocket: replace a reference to outdated state in documentation
Change-Id: I4acaed88a46acae1ad117b0a95141b20d8744e12
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-08-25 12:49:13 +00:00
Allan Sandfeld Jensen
68c2bf1a1a Correct use of qt_div_255
qt_div_255 does a fast rounded division, the form of rounding is however
only valid for positive integers.

Correct one case where it was used incorrectly and add it one place
it would be valid, and adds a comment to the function.

We were using the optimization (x*a + y*(255-a))/255 ==
(x-y)*a/255 + y but that makes the division by 255 potentially
negative.

Change-Id: Ie53aa82b66ef801f5d43f8d2ec48880cb4972f69
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-08-25 12:12:14 +00:00
Mike Krus
882f344964 Pass no-pkg-config to qmake from config.test if appropriate
On macOS, even if pkg-config is present in the path, configure will by
default correctly ignore it and set no-pkg-config. However, this was not
propagated to qmake when invoked from config.test, so tests which rely on
that did not work.

This was leading to pkg-config (installed from homebrew) to be used in
the libpng test, so it succeeded. But the later Qt build would fail to
find png.h from homebrew, as it correctly ignores pkg-config.

Task-number: QTBUG-55011
Change-Id: Ic6fb866bea0551f528da56cb545174dcd9bacf0d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2016-08-25 12:09:13 +00:00
Thiago Macieira
1f7f73b86a compile.test: append any unknown arguments to the qmake command-line
This allows setting of variables, like FOO=bar.

Yes, it's intentional that there are no quotes.

Change-Id: Ib306f8f647014b399b87ffff13f1d9e6a10fa2f8
(cherry picked from commit e79200bf7f)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2016-08-25 12:09:08 +00:00
Frederik Gladhorn
ddb2fd3f5e Fix the mysql configure test on RHEL 6.6
On RHEL 6.6, mysql_config --libs returns "-rdynamic" among other arguments.
The configure test (config.tests/unix/mysql) would end up passing that
to qmake. qmake responds with "***Unknown option -rdynamic ..."

Change-Id: Ib1300e62aec8a5d866359f3eaea88d9648c872b9
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
(cherry picked from commit d7e27e4d26)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2016-08-25 12:09:03 +00:00