Commit Graph

28819 Commits

Author SHA1 Message Date
Liang Qi
680dd3313c Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/corelib/global/qlogging.cpp

Change-Id: I9cc8f25ad897efab6a42cb5c5161b1c9402952f0
2016-09-23 22:28:33 +02:00
Allan Sandfeld Jensen
d95cb94baa Fix linear RGB16 gradients
Writing to solid overwrites part of the gradient input messing up later
lines. In particular repeating gradients tended to be broken.

Tested by lancelot (once the baseline is correct).

Change-Id: I64222048ba67b0424b44822f09ddc947973145a6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-09-23 17:14:53 +00:00
Maurice Kalinowski
55f4957cb8 Fix test for sandboxed platforms
The test function tries to create a file inside the application bundle.

Change-Id: Ia429b42b102d5e98f20694058fa2633e3c7de30a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-09-23 17:06:26 +00:00
Friedemann Kleint
29205c53e4 QWindowPrivate::maybeQuitOnLastWindowClosed(): Skip tooltips
Windows of type Qt::ToolTip should not prevent closing the
application when checking for the last window.

Task-number: QTBUG-55523
Change-Id: I47c51abe79bf6c857aba229960de95e1a23efb10
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-09-23 13:57:47 +00:00
Friedemann Kleint
7c18cb4f83 QToolTip: Hide when close event is received
Hide the tooltip when a window is requested to close in addition
to focus/activation change. This fixes the tooltip blocking
the shutdown of a Qt Quick Controls application.

Task-number: QTBUG-55523
Change-Id: I09d10fc162ce125075b03c534412b488974d12b9
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-09-23 13:57:25 +00:00
Liang Qi
90ad487d31 Merge "Merge remote-tracking branch 'origin/5.6.2' into 5.6" into refs/staging/5.6 2016-09-23 13:56:43 +00:00
Nico Vertriest
bde3384c9e Doc: corrected reference to OpenSSL webpage
Change-Id: I0314aac1e37615605a30d9dcc4962b9e7f883517
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2016-09-23 10:48:50 +00:00
Topi Reinio
9f45d2ab03 Doc: Add a custom \borderedimage macro
This macro is used similarly to the \image command; it wraps the image
in a div with class attribute 'border' that allows additional styling
in CSS.

Change-Id: I94271074378d79f0e52f1f5a4715a1f84e0254dc
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-09-23 10:48:38 +00:00
Eskil Abrahamsen Blomfeldt
3ce07c3238 Fix Myanmar text with some fonts
In change db2764db34, we introduced
the requirement of having specific OpenType tables available
to certain fonts. Before, we would not require OpenType support
to use a font for Myanmar text, for instance, since this was
not listed as one of the languages requiring OpenType support.
This patch simply brings back the limitation that fonts are only
disqualified by missing tables if the language is one of the
ones we know to require OpenType.

Change-Id: I6f1ee2c8a068f9e183a36e24967f331dae96c14b
Task-number: QTBUG-55569
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-09-23 10:05:30 +00:00
Liang Qi
53bd8140bb Merge remote-tracking branch 'origin/5.6.2' into 5.6
Change-Id: I570fa9b06e181d02a4bee83500730733b31d4758
2016-09-23 09:36:23 +02:00
Marc Mutz
e2e107556d tst_QGraphicsItem: Fix UB (invalid cast/member call) in prepareGeometryChange()
Found by UBSan:

  tst_qgraphicsitem.cpp:5066:29: runtime error: downcast of address 0x2afcb006c7f0 which does not point to an object of type 'GeometryChanger'
  0x2afcb006c7f0: note: object is of type 'QGraphicsRectItem'
   00 00 00 00  d8 64 ca 98 fc 2a 00 00  40 a9 0b b0 fc 2a 00 00  75 65 29 00 00 00 00 00  35 00 00 00
                ^~~~~~~~~~~~~~~~~~~~~~~
                vptr for 'QGraphicsRectItem'
      #0 0x4c5f1c in tst_QGraphicsItem::prepareGeometryChange() tst_qgraphicsitem.cpp:5066

Fix by actually instantiating a GeometryChanger, which incidentally is
the pattern used by paint() a few lines below, too.

While at it, allocate the item on the stack (as is done in paint())
and create a local QRectF variable to avoid repeating the same magic
numbers over and over again.

Change-Id: If5a3d56511000a17703d78d7dd1f0ea072b8bc11
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-22 15:25:18 +00:00
Marc Mutz
622681eb50 QGraphicsScene: Fix UB (invalid cast) in Private::ungrabMouse()
Found by UBSan:

  qgraphicsscene.cpp:1000:40: runtime error: downcast of address 0x2af0d4072b00 which does not point to an object of type 'QGraphicsWidget'
  0x2af0d4072b00: note: object is of type 'QGraphicsObject'
   00 00 00 00  30 f5 26 bd f0 2a 00 00  90 e1 05 d4 f0 2a 00 00  a8 e3 26 bd f0 2a 00 00  d0 33 0f d4
                ^~~~~~~~~~~~~~~~~~~~~~~
                vptr for 'QGraphicsObject'
    #0 0x2af0badf1305 in QGraphicsScenePrivate::ungrabMouse(QGraphicsItem*, bool) qgraphicsscene.cpp:1000
    #1 0x2af0bae0fc24 in QGraphicsScenePrivate::removeItemHelper(QGraphicsItem*) qgraphicsscene.cpp:692
    #2 0x2af0bacd21f6 in QGraphicsItem::~QGraphicsItem() qgraphicsitem.cpp:1555
    #3 0x2af0bacd4c48 in QGraphicsObject::~QGraphicsObject() qgraphicsitem.cpp:7766
    #4 0x2af0baf7e99c in QGraphicsWidget::~QGraphicsWidget() qgraphicswidget.cpp:231
    #5 0x2af0baf7f8c0 in QGraphicsWidget::~QGraphicsWidget() qgraphicswidget.cpp:282
    #6 0x2af0badcee34 in QGraphicsScene::clear() qgraphicsscene.cpp:2388
    #7 0x2af0badcf3fc in QGraphicsScene::~QGraphicsScene() qgraphicsscene.cpp:1682
    #8 0x4b26f0 in tst_QGraphicsWidget::popupMouseGrabber() tst_qgraphicswidget.cpp:47

Fix by using the existing graphics widget pointer,
determined a line above to be equivalent to 'item',
for the removePopup() function call instead of
casting 'item' itself.

The rest of removePopup() appears to be well-behaved
and doesn't trigger any more UBSan errors, so it was
indeed just the cast which was undefined, no member
calls.

Change-Id: Ia54da90262a7a02f527914a90b0208be0ffc0f0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-22 15:25:14 +00:00
Marc Mutz
f6cb8b1af8 QGraphicsScene: Fix UB (invalid cast) in removeItemHelper()
The variable 'item' may or may not contain a QGraphicsObject
pointer. Using static_cast on an 'item' that isn't, is UB.

Found by UBSan (which failed to print a message, but the
function names gave it away):

  [...]
  #6  <signal handler called>
  #7  0x00002b18813bec05 in __ubsan::checkDynamicType(void*, void*, unsigned long) () from /opt/gcc/trunk/lib64/libubsan.so.0
  #8  0x00002b18813be0c3 in HandleDynamicTypeCacheMiss(__ubsan::DynamicTypeCacheMissData*, unsigned long, unsigned long, __ubsan::ReportOptions) () from /opt/gcc/trunk/lib64/libubsan.so.0
  #9  0x00002b18813be783 in __ubsan_handle_dynamic_type_cache_miss () from /opt/gcc/trunk/lib64/libubsan.so.0
  #10 0x00002b1875e71d4d in QGraphicsScenePrivate::removeItemHelper(QGraphicsItem*) () at /home/marc/Qt/qt5/qtbase/src/widgets/graphicsview/qgraphicsscene.cpp:720
  #11 0x00002b1875e731ef in QGraphicsScene::removeItem(QGraphicsItem*) () at /home/marc/Qt/qt5/qtbase/src/widgets/graphicsview/qgraphicsscene.cpp:2929
  #12 0x00002b1875e6d05f in QGraphicsScenePrivate::removeItemHelper(QGraphicsItem*) () at /home/marc/Qt/qt5/qtbase/src/widgets/graphicsview/qgraphicsscene.cpp:604
  #13 0x00002b1875e731ef in QGraphicsScene::removeItem(QGraphicsItem*) () at /home/marc/Qt/qt5/qtbase/src/widgets/graphicsview/qgraphicsscene.cpp:2929
  #14 0x00002b1875e73e68 in QGraphicsScene::addItem(QGraphicsItem*) () at /home/marc/Qt/qt5/qtbase/src/widgets/graphicsview/qgraphicsscene.cpp:2505
  #15 0x000000000043d34d in tst_QGraphicsWidget::fontPropagationSceneChange() () at /home/marc/Qt/qt5/qtbase/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp:941
  [...]

Fix by using QGraphicsItem::toGraphicsObject().
Yes, it's that simple...

Change-Id: If04d1b62603cfd808cc7b64946da536c221a0c11
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-09-22 15:25:11 +00:00
Marc Mutz
abe8b4ab9b Q(Font|Color|File)Dialog: Fix several UBs (invalid cast/member call) in Private::canBeNativeDialog()
Found by UBSan:

  qfontdialog_p.h:77:5: runtime error: downcast of address 0x7ffc3ceadc90 which does not point to an object of type 'QFontDialog'
  0x7ffc3ceadc90: note: object is of type 'QDialog'
   fc 7f 00 00  38 5f a8 27 fc 2a 00 00  60 e2 14 02 00 00 00 00  10 61 a8 27 fc 2a 00 00  00 00 00 00
                ^~~~~~~~~~~~~~~~~~~~~~~
                vptr for 'QDialog'
    #0 0x2afc24d29490 in QFontDialogPrivate::q_func() const qfontdialog_p.h:77
    #1 0x2afc24d29490 in QFontDialogPrivate::canBeNativeDialog() const qfontdialog.cpp:1033
    #2 0x2afc24c93f56 in QDialog::setVisible(bool) qdialog.cpp:696
    #3 0x2afc24c7b27a in QDialog::~QDialog() qdialog.cpp:357
    #4 0x2afc24d286a6 in QFontDialog::~QFontDialog() qfontdialog.cpp:339
    #5 0x2afc24d481a2 in QFontDialogPrivate::getFont(bool*, QFont const&, QWidget*, QString const&, QFlags<QFontDialog::FontDialogOption>) qfontdialog.cpp:402
    #6 0x2afc24d483f1 in QFontDialog::getFont(bool*, QWidget*) qfontdialog.cpp:396
    #7 0x407652 in tst_QFontDialog::testGetFont() tst_qfontdialog.cpp:120

  qcolordialog.cpp:86:5: runtime error: downcast of address 0x7ffdf50c1ec0 which does not point to an object of type 'QColorDialog'
  0x7ffdf50c1ec0: note: object is of type 'QDialog'
   fd 7f 00 00  d8 6e c7 23 b7 2a 00 00  50 c1 af 01 00 00 00 00  b0 70 c7 23 b7 2a 00 00  00 00 1a 1e
                ^~~~~~~~~~~~~~~~~~~~~~~
                vptr for 'QDialog'
    #0 0x2ab720e4ec97 in QColorDialogPrivate::q_func() const qcolordialog.cpp:86
    #1 0x2ab720e4ec97 in QColorDialogPrivate::canBeNativeDialog() const qcolordialog.cpp:1865
    #2 0x2ab720e84ed6 in QDialog::setVisible(bool) qdialog.cpp:696
    #3 0x2ab720e6c1fa in QDialog::~QDialog() qdialog.cpp:357
    #4 0x2ab720e2b276 in QColorDialog::~QColorDialog() qcolordialog.cpp:2187
    #5 0x2ab720e5e2c6 in QColorDialog::getColor(QColor const&, QWidget*, QString const&, QFlags<QColorDialog::ColorDialogOption>) qcolordialog.cpp:2148
    #6 0x2ab720e5e473 in QColorDialog::getRgba(unsigned int, bool*, QWidget*) qcolordialog.cpp:2176
    #7 0x407180 in tst_QColorDialog::testGetRgba() tst_qcolordialog.cpp:118

  qfiledialog_p.h:112:5: runtime error: downcast of address 0x7ffd6858cc60 which does not point to an object of type 'QFileDialog'
  0x7ffd6858cc60: note: object is of type 'QDialog'
   a1 2b 00 00  d8 1e 5e 0c a1 2b 00 00  b0 af 01 20 a1 2b 00 00  b0 20 5e 0c a1 2b 00 00  00 00 46 00
                ^~~~~~~~~~~~~~~~~~~~~~~
                vptr for 'QDialog'
    #0 0x2ba10980a9e7 in QFileDialogPrivate::q_func() const qfiledialog_p.h:112
    #1 0x2ba10980a9e7 in QFileDialogPrivate::canBeNativeDialog() const qfiledialog.cpp:695
    #2 0x2ba1097efe36 in QDialog::setVisible(bool) qdialog.cpp:696
    #3 0x2ba1097d715a in QDialog::~QDialog() qdialog.cpp:357
    #4 0x2ba109854c4b in QFileDialog::~QFileDialog() qfiledialog.cpp:380
    #5 0x4179dc in tst_QFiledialog::init() tst_qfiledialog.cpp:175

Fix by replacing Q_Q with the the equivalent expression for QDialog.

We can't re-use QDialogPrivate::q_func() here, since that is private,
and probably should stay like that.

Also fix an invalid member call in
QColorDialogPrivate::canBeNativeDialog():

  qcolordialog.cpp:2050:5: runtime error: member call on address 0x7ffdf50c1ec0 which does not point to an object of type 'QColorDialog'
  0x7ffdf50c1ec0: note: object is of type 'QDialog'
   fd 7f 00 00  d8 6e c7 23 b7 2a 00 00  50 c1 af 01 00 00 00 00  b0 70 c7 23 b7 2a 00 00  00 00 1a 1e
                ^~~~~~~~~~~~~~~~~~~~~~~
                vptr for 'QDialog'
    #0 0x2ab720e4e5ea in QColorDialog::options() const qcolordialog.cpp:2050
    #1 0x2ab720e4e8c8 in QColorDialogPrivate::canBeNativeDialog() const qcolordialog.cpp:1870
    #2 0x2ab720e84ed6 in QDialog::setVisible(bool) qdialog.cpp:696
    #3 0x2ab720e6c1fa in QDialog::~QDialog() qdialog.cpp:357
    #4 0x2ab720e2b276 in QColorDialog::~QColorDialog() qcolordialog.cpp:2187
    #5 0x2ab720e5e2c6 in QColorDialog::getColor(QColor const&, QWidget*, QString const&, QFlags<QColorDialog::ColorDialogOption>) qcolordialog.cpp:2148
    #6 0x2ab720e5e473 in QColorDialog::getRgba(unsigned int, bool*, QWidget*) qcolordialog.cpp:2176
    #7 0x407180 in tst_QColorDialog::testGetRgba() tst_qcolordialog.cpp:118

by accessing the data member directly instead of through the Public API.

Fix the same code in QFileDialog, even though the autotest coverage is
too limited for UBSan to point that one out explicitly.

Change-Id: Idd278744961435e417d91fb2f89b6d91a94e0c71
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-09-22 15:25:07 +00:00
Konstantin Tokarev
f050f2180f Describe meaning of typographic units in QRawFont documentation
Text is copied from corresponding QFontMetrics methods.

Change-Id: Ife79e0d1b06ca3f691f2fd8bd796b41aeaa76954
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-09-22 06:06:37 +00:00
Jake Petroules
a45566eec7 Fix code signing for qmake-generated Xcode projects in Xcode 8 (again)
This version now prefers non-free provisioning teams, since the latter
seem to be problematic in more cases.

Task-number: QTBUG-55915
Change-Id: Ie40ddae5e333acdd5327ed46992fb4fb300dee25
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2016-09-22 06:04:57 +00:00
Jake Petroules
c2869c3b0a Pass -quiet to xcodebuild when invoking make with -s option
This makes use of the new -quiet option in xcodebuild 8 to reduce the
noisiness of output when make is invokved in silent mode.

Change-Id: I3730dddcc1d9dae329b5ff254448533cdd573a30
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2016-09-21 21:42:22 +00:00
Olivier Goffart
7c5cf8b2bd Fix bootstrap applications crashing when QT_MESSAGE_PATTERN contains %{backtrace}
tokens[i] was left uninitialized. This could cause a crash when moc produces a
qWarning.

Task-number: QTBUG-56045
Change-Id: I6fba933005edd29756f0d6b1cfe53243254ac7b2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-21 13:22:54 +00:00
Liang Qi
d10e4c193b Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I9cfefaf22b010fca937be77979f5fb50574bb71e
2016-09-21 07:14:40 +02:00
Takumi ASAKI
25e9bde2d6 Bearer/ConnMan: Fix getTechnologies() is not called
Change-Id: I4e39c971198583af815f5bcecaad4a9c52e5d2dd
Reviewed-by: Lorn Potter <lorn.potter@canonical.com>
2016-09-21 00:46:10 +00:00
Samuel Gaist
23e76a12b9 Doc: add macOS example of QAbstractNativeEventFilter implementation
This patch adds a sample native event filter that can be easily
integrated in a project.

Task-number: QTBUG-53209
Change-Id: Iedf6df33a3de5b01dc7871cca5e7897a5b485733
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-09-20 21:23:32 +00:00
Samuel Gaist
9f2c260f88 Add missing test for QReguarExpression for QTextDocument::findMultiple
Change-Id: Ia9b3eb21a178da4ae2844dba37b7e1cc669d6b50
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-20 21:23:08 +00:00
Richard Moe Gustavsen
8347b54b97 iOS: open menu on popup regardless of visibility
It should be possible to show a menu by calling showPopup, even if
visible is set to false. After all, it's only logical that visibility
is false before showing it. And whether or not the menu is
enabled should not matter as well.

Change-Id: I9a2b453c8c6e88c47812c652d99e4b4a9c7524a7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-09-19 11:20:58 +00:00
Richard Moe Gustavsen
e32ecdb280 iOS: explicit synthesize properties as readwrite
The synthesized properties were defined as (read only)
methods in the UIViewController API in iOS9, and we
extended them into readwrite properties in our own
sub class to enable some local bookkeeping in addition
to normal overriding.

But in iOS10, Apple has changed the methods into being
readonly properties instead. The difference then is
that automatic property synthesizing
will ignore our local readwrite declarations, and use
the declarations in the super class instead. And this
will lead to a runtime crash on iOS10 since no
setter methods are generated.

This patch will instead explicit synthesize the affected
properties to ensure that both getters and setters will be
generated.

Change-Id: Iac330e991b8a0fe335e383e1f7d9ff30c0ce1559
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-09-19 11:20:50 +00:00
Richard Moe Gustavsen
d3389a6d46 iOS: let quiview conform to API signature changes in iOS 10
In the iOS 10 SDK, method signatures has been annotated with
NS_ASSUME_NONNULL macros and 'nullable' keywords. This means
that certain methods should not be called with argumens
that can be null, or in this case, set to 0 explicitly. The
result will be compiler warnings.

This patch will rewrite the explicit call we do to touchesCancelled
so that we send an empty set instead of 0.

Change-Id: I50aa80b91312397d17e0e380815adff87cee852b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-09-19 11:20:44 +00:00
Frederik Schwarzer
e30d0e462f QAbstractProxyModel: fix sentence structure in apidoc
Change-Id: Ib3371549ecb80da326260b1df431f20e7a04f07e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-09-19 11:17:58 +00:00
Tor Arne Vestbø
fecee98836 multiwindow: Base vsync debug output on actual surface format
Allows us to detect cases where the requested vsync combination was
not possible to fulfill.

Change-Id: Ie8f3665129f7a1ab7fcefb94b2298d54520b753a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-19 00:42:53 +00:00
Tor Arne Vestbø
efdecff085 multiwindow: Replace per window fps timers with unified approach
The FPS is now calculated and output on the command line in a single
place. The animated fps counter has been replaced with a vertical line
which should make it easier to observe tearing issues when vsync is
disabled.

Change-Id: Id356fc1958c048d85aba48edfed59124454038d4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-19 00:42:33 +00:00
Tor Arne Vestbø
880beb121e multiwindow: Call update() after swap
Change-Id: Ic2c26339bce9fe92b2ccc730c72f53ce94397b78
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-19 00:42:28 +00:00
Tor Arne Vestbø
44fec65624 Update swap interval of QCocoaGLContext after creation
QSurfaceFormat is recreated from scratch, and by not reading back the
swap interval the QCocoaGLContext seemed to be vsynced even if it
actually was not.

Change-Id: I72ddaae9a4c695fe4c74d7b4b70ca9db84bcc084
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-09-19 00:42:23 +00:00
Tor Arne Vestbø
6ce96fdbf5 multiwindow: React to mouse press to allow debugging UI responsiveness
The animated FPS counter should be enough to observe smooth animations,
so we use the color of the window to visualize frame latency.

Change-Id: I1171a1c4bdc261ca8655771290c6735357821781
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-19 00:42:20 +00:00
Tor Arne Vestbø
bcbc8120b3 multiwindow: Use showNormal() instead of show() to ensure normal geometry
Change-Id: Ice607f536a620da5a70f2ba066f4983bb78c6288
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-09-19 00:42:04 +00:00
Marc Mutz
8082c0dc81 QBrush: Fix UB (non-virtual dtor) in QBrush::detach()
As the d-pointer, QBrush uses a QScopedPointer with a
custom deleter that checks for QBrushData::style and
casts the QBrushData pointer down to corresponding
subclasses before calling delete on them.

In QBrush::detach(), however, any of the three brush
data classes were held in a QScopedPointer _without_
the custom deleter, invoking UB when that scoped
pointer would ever get to be the one that deleted
the payload instead of handing it over to the objects
d-pointer.

Found by making dtors protected following a Coverity
report wrongly marked as 'dismissed' (these static
checks are not included in this patch, since they
are binary-incompatible), to find out where Coverity
could possibly see a problem.

Also replace the d.reset(x.take()) that allowed this
mismatch to compile with d.swap(x), which nicely
ensures that x and d are of the same type.

Coverity-Id: 11772
Change-Id: I85e2c205df9291bd7508b6c90f7b03fbe8c3bcd2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-18 17:59:24 +00:00
Marc Mutz
29d64bc8e0 QEvdevKeyboardHandler: use RAII in create()/ctor
Coverity somewhat rightfully complained that the FD may be leaked in
certain cases, e.g. when the new-expression throws. Yes, the plugin
is compiled with exceptions disabled, but the code is still a bug
waiting to happen, because it's too easy to just add an early return
to the function and leak the FD that way.

Fix by writing a small RAII class for FDs (can't use QSharedPointer,
since it's not a pointer we're dealing with). It's quite generically
named, in anticipation that it might come in handy elsewhere, too.

Coverity-Id: 89046
Change-Id: I83d1ed3f11219065d2248c129ed191a651f617c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-18 10:55:27 +00:00
Albert Astals Cid
8d64d1e0c3 xcb: Do not eat events with different keyboard state
Change-Id: Iac8dc7b369eb7c2fbe0cf27baa34a40278088219
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2016-09-18 10:34:53 +00:00
Albert Astals Cid
76adb6c29f xcb: Use the state of the key event to process it
Instead of the global state

Task-number: QTBUG-48795
Change-Id: Ic2c545718adb68df41730e5a3bf25adb374ffce3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2016-09-18 09:56:41 +00:00
BogDan Vatra
734da261a8 Android: Don't hang when resuming the application
If the main thread is blocked updateApplicationState will hang. It
happens when we're using functions like runOnAndroidThreadSync or
requestPermissionsSync.

Change-Id: Ic1135c5630b48cf1076ef5cbc133933fce439bfb
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2016-09-17 07:38:15 +00:00
Liang Qi
bd4d847903 Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7 2016-09-17 03:11:41 +00:00
Liang Qi
d148019f16 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp

Change-Id: I0af32ee55936d523cbd259b6fe82eb9c409f9074
2016-09-16 23:16:25 +02:00
Thiago Macieira
597d625c2c Disable forcing of -fomit-frame-pointer with ICC
qlogging.cpp(1226): error #3175: unrecognized gcc optimization level
  __attribute__((optimize("omit-frame-pointer")))
                          ^

Change-Id: I33dc971f005a4848bb8ffffd14748b100dcefa95
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-09-16 20:50:05 +00:00
Liang Qi
6b9c57f8cd Merge "Merge remote-tracking branch 'origin/5.6.2' into 5.6" into refs/staging/5.6 2016-09-16 18:18:29 +00:00
James McDonnell
8a2401bd45 Switch to 7.0 screen property names
The names of some screen properties have changed in 7.0.

For 6.6, map the 7.0 names to 6.6 names.

Change-Id: Iaf9d297fdd6a0329a84150f2b9a27665d89cc1ec
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2016-09-16 13:21:18 +00:00
James McDonnell
71e195f6ef Reverse the flush-screen-context test
It was backwards so the screen context was being flushed on every screen
interaction when the parameter was _not_ specified.  During mouse/touch
movement, the number of flushes can be so great that it negatively
impacts performance.

Change-Id: I4dfe9c33c8ce31237db1d78db1cb8e04c00c4dd3
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2016-09-16 13:21:07 +00:00
Edward Welbourne
a95d81e786 Q(Date|Time)+::(to|from)String(): mention relevant QLocale methods
The const QString &format variants of these methods lack adequate
control over the locale used; the Qt::DateFormat variants give only
limited control over the format string.  So reference the QLocale
methods that provide the general case, in the docs of each.  Also made
the \sa cross-referencing among these methods a little more coherent.

Task-number: QTBUG-55632
Change-Id: Icd0c8548045e74879e941ba089c3bdea78f14e34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-16 12:07:05 +00:00
Frederik Gladhorn
2c48695f04 XCB Drop from external app: fix keyboard modifier state
Fix inspired by Qt 4 sources. When we get drop events that are not
coming from the same application, it's unlikely that the keyboard
modifiers are in a sensible state (the usual XCB events are not sent
during drag and drop), so set the keyboard modifier state explicitly.

Task-number: QTBUG-49645
Change-Id: I9360f2b7ffeaa5243a4dfe7ccf96df134c5d2156
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-09-16 11:49:12 +00:00
Liang Qi
59b275b284 Merge remote-tracking branch 'origin/5.6.2' into 5.6
Change-Id: I84acde3251893f2a7a776962b2ff970b90884b63
2016-09-16 08:56:12 +02:00
Jake Petroules
f242b91189 Fix code signing for qmake-generated Xcode projects in Xcode 8
Task-number: QTBUG-55915
Change-Id: I7cbddd7ed8a6e0fa220b423e11e4d550e09297f9
Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
2016-09-16 05:49:42 +00:00
Marc Mutz
47d064e905 libjpeg config test: init variable
Yes, yes, this is just a configure test, but why do something stupid
in the code and then have to shut up Coverity manually?

Fix by making it a global, which means it will be zero-initialized
(I didn't want to do the obvious = 0, as that could protentially
create a "0 used as nullptr" warning at some point in the future.

Coverity-Id: 59485
Change-Id: I49ecd28be983a0e42b420d20da0db34a872c6f44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-16 04:12:03 +00:00
Marc Mutz
f1e87dc9bc QTableGenerator: Fix uninit'ed values
It's probably benign, but it causes Corverity to complain,
so always init all fields of QComposeCacheFileHeader.

Format the code so it can easily be ported to uniform init
later on.

Coverity-Id: 93043
Change-Id: Ifa1ccc3fa58dc813306917f216772fd24d4930c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-16 04:12:00 +00:00
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