Commit Graph

20680 Commits

Author SHA1 Message Date
Allan Sandfeld Jensen
5adbb9cc57 Support Alpha8 and Grayscale8 natively in the OpenGL paint engine
Adds special shaders for the Alpha8 and Grayscale8 formats so that
they do not need to rely on the support of GL_ALPHA and GL_LUMINANCE
that has been removed from core in recent OpenGL versions.

Change-Id: Ie370379b458abf2a50e252bc5099aefc1b11fb1d
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-10-27 11:54:39 +01:00
Friedemann Kleint
da72e5538e Retrieve auto-value for ODBC fields.
Introduce a static function returning the value called from
qMakeFieldInfo(SQLHANDLE). The field is currently only populated
when executing a query. Populating it from QODBCDriver::record()
would require executing a dummy query, which is problematic since
QSqlField does not have any provisions for delayed evaluation.
Document the limitation.

Task-number: QTBUG-39388
Change-Id: Ib2d2f2653b8b757389f627142c61c13a117fef72
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-10-27 10:56:13 +01:00
Friedemann Kleint
23cced4530 Split up function qMakeFieldInfo() in ODBC plugin.
Refactor code to extract an overload of qMakeFieldInfo()
that only takes an SQLHANDLE hStmt parameter. This allows
for easy debugging and inspecting driver-dependent additional
columns in QODBCDriver::record().

Task-number: QTBUG-39388
Change-Id: Id338838f837746beff1b2711bf2cd66ca8c7afe6
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-10-27 10:56:09 +01:00
hjk
49ddae28e0 Add a test for QFilePrivate::fileName offset on Linux
This extends the test suite introduced in 497f0af1f7 for
a known-to-be-good case.

Change-Id: Ib574ecfdb8e9d91985d6df8c092896581d1d06ff
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-10-25 11:49:12 +02:00
Olivier Goffart
eaa4496efa Add Q_DECL_RELAXED_CONSTEXPR macro
Expands to constexpr if C++14 relaxed constepxr are supported by the compiler

[ChangeLog][QtCore] Added Q_DECL_RELAXED_CONSTEXPR for the corresponding C++14 feature

Change-Id: Id6b56b3a17da2ff838c80795e528e1247dc13f63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-24 22:22:09 +02:00
Olivier Goffart
6e1718987e QObject: use QDebugStateSaver in the QDebug operator<<
Also remove the ending space if the object is null

Change-Id: Ieb2bb903de35b4e339c812cd07555b5d108d118b
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2014-10-24 16:17:58 +02:00
Friedemann Kleint
89ae5c03a2 Fix MSVC warnings about integer conversions in ODBC driver.
qsql_odbc.cpp(360) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
qsql_odbc.cpp(380) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
qsql_odbc.cpp(2052) : warning C4267: 'argument' : conversion from 'size_t' to 'SQLSMALLINT', possible loss of data
qsql_odbc.cpp(2070) : warning C4267: 'argument' : conversion from 'size_t' to 'SQLSMALLINT', possible loss of data
qsql_odbc.cpp(2096) : warning C4267: 'argument' : conversion from 'size_t' to 'SQLSMALLINT', possible loss of data

Task-number: QTBUG-39388
Change-Id: Ie97d9e968d5c7b013b0d364c64175aa9b329ae97
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-10-24 07:50:23 +02:00
Friedemann Kleint
dc58c6be47 Remove non-UNICODE code branches from ODBC plugin.
Task-number: QTBUG-39388
Change-Id: If22876454547098dd00e477c0593da7c4be0e803
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-10-24 07:48:31 +02:00
hjk
497f0af1f7 Add some tools specific consistency tests
This upstreams parts of Qt Creator's tst_offset test to serve as
an early warning system by testing private implementation details
that are used in Qt Creator's data structure "pretty printing"
facility.

While the tested implementation details can be changed without
breaking binary or source compatibility, downstream tools like
Qt Creator depend on them.

If this test breaks, you are kindly asked to coordinate with the
downstream stakeholders to avoid tool breakage.

Change-Id: I1286efcec9bef105f80c2163a4f66f5c43f3a218
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-10-24 07:18:44 +02:00
Louai Al-Khanji
55be75c969 eglfs: Add better configuration support to KMS hooks
This patch improves the configurability of the KMS hooks. Support is added
for a json config file. The file can be used to specify the device to use,
whether pbuffers are supported, whether HW cursors should be used and the
mode to use per output.

The path to the configuration file is specified through the
QT_QPA_EGLFS_KMS_CONFIG environment variable.

The output initialization code is significantly changed and now closely
matches Weston's drm compositor setup code. We now track which crtc's and
which connectors are already in use for more robust output setup.

Importantly, it is now possible to turn off undesired outputs as well as
select the mode to use on outputs. The configuration syntax is similar
to Weston's config file, and the following settings are supported per
output:

 off, preferred, current, WIDTHxHEIGHT, modeline

Unless the output mode configuration matches "off", "preferred" or "current"
exactly, it is first attempted to parse the mode as WIDTHxHEIGHT, after
which it is attempted to parse the mode as a modeline. The modeline parsing
code is very closely modeled after the parsing code in Weston.

If an output mode cannot be parsed the default fallback is preferred mode.

The defaults for all settings are as follows:
 device: unless specified, the first device found through QDeviceDiscovery
 hwcursor: true
 pbuffers: false
 outputs: empty

An example configuration file might look as follows:

{
  "device": "/dev/dri/card1",
  "hwcursor": false,
  "pbuffers": true,
  "outputs": [
    {
      "name": "VGA1",
      "mode": "off"
    },
    {
      "name": "HDMI1",
      "mode": "1024x768"
    }
  ]
}

Change-Id: Ibe1e446c44a014ae8c7cbd8173a060ca862c2bc8
Reviewed-by: Risto Avila <risto.avila@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-10-24 05:46:58 +02:00
Louai Al-Khanji
70b96c525d eglfs: Add various debug prints to KMS hooks
Change-Id: Ib0284601fa4ce2912312999190e4a1e2dc2afe42
Reviewed-by: Risto Avila <risto.avila@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-10-24 05:46:54 +02:00
BogDan Vatra
8057912915 Android: Remove duplicate code, use pre-calculated variable
Change-Id: I66a7dd2aa9fa67a639b0573641b6bb01ead18d07
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-10-23 08:54:26 +02:00
Frederik Gladhorn
024f595d11 Build with -no-accessibility on OS X
This build will have broken tool button style. I also do not see a reason why
someone would purposefully leave behind people that could otherwise use their applications.
The build with this flag will be completely unsupported as configure states.

Task-number: QTBUG-32551
Change-Id: Ie33269a49ecc10258c9f8611542f7cf99a698bb5
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-10-22 16:19:40 +02:00
Jeff Tranter
4c144d006d Fix spelling errors in method names in QStorageInfo.
The methods retreiveVolumeInfo() and retreiveDiskFreeSpace() should be
retrieveVolumeInfo() and retrieveDiskFreeSpace().

Task-number: QTBUG-42068
Change-Id: I86137fbff26c42c8cc8bad366a4733118d6ca292
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-10-22 14:29:12 +02:00
Frederik Gladhorn
3361fcbc28 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: If7e51514ed6832750e3ad967e4d322ccf920d2bb
2014-10-20 19:12:25 +02:00
Joerg Bornemann
5e342f6f04 embed a VERSIONINFO resource into Qt plugins
This reverts f0ee55c00. VERSION actually makes sense on Windows,
because it embeds a VERSIONINFO resource into the DLL that can
be inspected by the user.

Task-number: QTBUG-37961
Change-Id: I6b81b5aa999eba16cb8d9a4d61bd596310af46b9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-10-20 14:47:53 +02:00
Josh Faust
929d6d6b9b Fix ShortcutOverride for QtQuick on OSX
tryShortcutOverride on OSX gets called via
QWindowSystemInterface::tryHandleShortcutEvent. This change
fixes that to use the QWindow's focus object.

Task-number: QTBUG-32928
Change-Id: I51beb774e1fb91e0d8e2c12d087176d917357311
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-10-20 14:23:25 +02:00
Tor Arne Vestbø
ae89aa330f logging: Fix qCleanupFuncinfo to not mangle Objective-C message names
Change-Id: I823566ba72668c611d225aa92c4d09a53cabe8fc
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-10-20 13:34:37 +02:00
hjk
0c71cbea54 Add a hint on application window positioning with QProcess::start
Task-number: QTBUG-30999
Change-Id: I65c80917c9bad067bb7d8e69e2431dd1c4886b08
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-10-20 12:47:25 +02:00
Leena Miettinen
2679c5f7e0 Doc: add info about letter spacing type to function desc
Task-number: QTBUG-41222
Change-Id: I18168dfa503feac07ee1b7bc349b9f14b7351518
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-10-20 11:59:31 +02:00
Laszlo Agocs
59c68e6830 Remove unused variable in opengl examples
To avoid warnings with some compilers

Change-Id: Iabe4f38c0bee29ab17149120d12ce198b49547c8
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-10-20 11:53:33 +02:00
Leena Miettinen
9dc246c5cc Doc: removed unnecessary text
Added some commas.

Task-number: QTBUG-41928
Change-Id: I52ad75f895f41b109f0496863930ffaa1650447c
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Nico Vertriest <nico.vertriest@digia.com>
2014-10-20 11:45:12 +02:00
Tor Arne Vestbø
e260e1bcae Always report focusObjectChanged on QWidget::clearFocus()
The focusObject() of a QWidgetWindow is based on the focusWidget() of the
top level widget of the window, which is resolved through the focus_child
chain of the widget. This is not the same thing as the focusWidget of the
application. The hasFocus() function of a QWidget queries the latter, so
we can't put the focusObjectChanged signal inside hasFocus() when we
unconditionally clear the focus_child chain (and hence the focusObject)
earlier in the function.

Change-Id: Iae39da5d6031d22b21e9dc9f18e5fe6e6fd11a5c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-10-20 11:42:59 +02:00
Tor Arne Vestbø
0f98d36ff6 Clear specific QWindow::focusObject() on QWindowPrivate::clearFocusObject()
The focusObject of a QWidgetWindow is the focusWidget() of the top level
widget, so when clearing the focus object of the window we should clear
focus of the same focusWidget, not the application-wide focus widget,
which may live in another window.

Change-Id: Ib9162418865c225e23aac7987e119b3b651983eb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-10-20 11:42:48 +02:00
Tor Arne Vestbø
3ab4e869e2 iOS: Don't auto-activate popup windows unless they are standalone
We try to emulate a traditional window manager by activating windows
on touch press (before delivering the event), and on showing/hiding
windows, but this logic should not apply to popup windows (including
tooltips and tool windows), as they are in most cases already active
through their parent or transient parent, and should not steal keyboard
focus and bring the virtual keyboard down.

Change-Id: If10082bd48cdf1a9e1c41d8809066e86dafd7ffc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-10-20 11:42:30 +02:00
Tor Arne Vestbø
31e987f8f0 iOS: Remove unused and duplicated functions from QIOSWindow
Change-Id: I29a2345bddc9ec9577bdc398e4df9914406e5367
QIOSWindow::windowType() is the same as window()->type()
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-10-20 11:42:20 +02:00
Tor Arne Vestbø
e7239e1ce3 iOS: Fade out statusbar when scrolling view due to VKB
Change-Id: I86923a2b2aa2d17d79ba3a11cabf37e615eaf4cc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-10-20 11:42:10 +02:00
Tor Arne Vestbø
cc1058a278 iOS: Move UIView helpers to once place
Change-Id: I9e20d23ad813503ea5c6bef3303ebc0f6b9e99cd
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-10-20 11:42:01 +02:00
Alex Blasche
cc73cc9a4c Remove old Trolltech feature string from QXmlSimpleReader docs
This makes it even more unlikely that anybody uses them.

Change-Id: I6b3a3902687a7fcde2d771617837f738001eeb0a
Task-number: QTBUG-25023
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-20 11:24:59 +02:00
Shawn Rutledge
f5f8ee7af7 transient window manual test: set window type to Dialog
On X11, setting the transient parent is not enough to get it
centered w.r.t. its parent: it must also be a dialog window.

Change-Id: Icfc664e17e53f23cd025dead30e3966f859a1dc5
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-10-20 11:03:30 +02:00
Paul Olav Tvete
1fe8a708cb Android: deadlock avoidance
This change adds deadlock protection to all places where we lock
one thread while waiting for the other to do something. If we
detect that the other thread is going to block, we abort the
operation. This could cause unexpected problems, such as painting
errors, text input errors, or even crashes, but the alternative is
a guaranteed deadlock.

Task-number: QTBUG-41369
Change-Id: I2627a955cfafc4bce54eb9d0d38e19b768b06956
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-10-20 10:23:47 +02:00
Paul Olav Tvete
1faba97683 Delay showing keyboard until application is active
Android starts asking lots of questions when the software keyboard
pops up, so let's wait until the application is initialized. This
works around a deadlock on startup.

Task-number: QTBUG-41369
Change-Id: I1c79e32d08c7cc11748ec55efbff3bc25e40f4b2
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-10-20 10:23:41 +02:00
Mitch Curtis
096d0ef02b Correct QPainter::clipPath() documentation.
Change-Id: Ie8ea01eee23e28378eadca0e87dc89fd62aec14f
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-10-20 10:13:43 +02:00
Jocelyn Turcotte
c762c8accc Remove QOpenGLContextPrivate::globalShareContext
This has previously been replaced with qt_gl_global_share_context
and all using code has been ported to the new name at this point.

Change-Id: I13832f583456891dd057a7b414f45ec3e83f5698
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-10-20 10:11:31 +02:00
Jørgen Lind
c231694949 Fix QOpenGLWindow tests when devicePixelRatio != 1
Change-Id: I83d71de8b9d735cd649a6c514e41a9ff23625005
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-10-20 10:11:25 +02:00
Marc Mutz
bcda685be9 tst_QPointer: fix memleak
Benign, but easy to avoid by using automatic storage.

Change-Id: I60a1a2e85d8c1b2d91f3f33973374afae8876340
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-19 13:18:23 +02:00
Marc Mutz
9dcc38b566 QEasingCurve: fix mem leak in operator>>
The code ignored that the QEasingCurve passed in to op>>
might already have a QEasingCurveFunction set, overwriting
it with a new pointer without deleting the old.

Change-Id: Ic14cf7e4b97c7c8c7edb64cde08fbf22c07ac8f3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-19 13:18:18 +02:00
Marc Mutz
665966d243 tst_QState: fix memleaks
Benign, but easy to avoid by allocating objects on the stack.

Change-Id: I1933d0abb2ebd53bcf0402f392e7e3c201756b9e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-19 13:18:12 +02:00
Marc Mutz
0ebd05686d tst_QThreadPool: fix memleak
Benign, but easy to avoid by using the same pattern as in clear().

Change-Id: Ie382313343385f0709519b232a7d58dd8181b8de
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-19 13:18:07 +02:00
Marc Mutz
4cf9168630 tst_QSharedPointer: fix memleak
Benign, but easy to avoid by using automatic storage.

Change-Id: I4eefce9a7c902ceadebdd0aba1bbba7e5519cf24
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-19 13:18:02 +02:00
Marc Mutz
d78bbf8c81 tst_QMetaType: fix memleaks
Benign, but easy to avoid by distinguishing between
owning and non-owning smart pointers.

Change-Id: Idcd7ae550a8e4e00dfcd5570790e2ed985e2379a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-10-19 13:17:53 +02:00
Marc Mutz
14ea26f708 tst_QMimeData: test doesn't require QGuiApplication
Makes the test execute faster (not that it's slow in any way)
and more importantly gets rid of the QGuiApplication-induced
3rd-party library leaks reported by asan and/or valgrind.

Change-Id: I94b505f15b4db577a2807b0b81464e19ce7e7cab
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-19 13:17:46 +02:00
Marc Mutz
ef1027b824 qdatetime.h: include correct header
QExplicitlySharedDataPointer is defined in qshareddata.h, not qsharedpointer.h.

Change-Id: If81f6615681068a8e8c38817044ea3a0433c42ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-19 13:17:24 +02:00
BogDan Vatra
c5b0308dc5 Android: Update Ministro's requirements.
Task-number: QTBUG-41968
Change-Id: Ia0c204dd87b9de3cbb7bb388099c435b855ad4d5
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-10-19 11:38:33 +02:00
Richard Moe Gustavsen
e5f48c63d2 Widgets: only update IM if the widget is the current focus object
QInputMethod works on focusObject, not focusWidget. These two
are not always the same, and sometimes the focusObject is also
NULL. In either case, we should not tell QInputMethod to
commit, reset or otherwise emit signals based on the internal
state of widgets that are not the focus object.

This led to a crash on iOS, since we got a call to
cursorRectangleChanged when focus object was NULL, which
the code didn't (and shouldn't need to) take into account.

Change-Id: I54e40d7ec35210ba6599a78c5a8c7f982a1c3dbb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-10-19 09:57:45 +02:00
Marc Mutz
32dfbd6dbf Add qHash(QSslError) overload
qsslsocket_winrt.cpp defined it locally, which runs the risk of
clashes with a potential user-defined qHash(QSslError), so
make it public.

Also included both .error() and .certificate() in the hash, as
both of these are used to determine equality (the WinRT version
only used .error()).

[ChangeLog][QtNetwork][QSslError] Can now be used in QSet/QHash.

Change-Id: Ieb7995bed491ff011d4be9dad544248b56fd4f73
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-10-19 07:32:41 +02:00
Marc Mutz
e8bdc949fc Add qHash(QSslCertificate) overload
qsslsocket_winrt.cpp defined it locally, which runs the risk of
clashes with a potential user-defined qHash(QSslCertificate), so
make it public.

Also, the implementation in qsslsocket_winrt.cpp simply hashed
the handle(), which violates the principle that equal instances
must hash to the same value. Also, for some platforms, the
implementation returns nullptr unconditionally, which, while not
violating the above-mentioned principle, will make all users of
the hash have worst-case complexity.

To calculate a meaningful hash, therefore, the certificate needs
to be inspected deeper than just the handle.

For OpenSSL, we use X509::sha1_hash, which also X509_cmp uses
internally to determine inequality (it checks more stuff, but
if X059::sha1_hash is different, X509_cmp() returns non-zero,
which is sufficient for the purposes of qHash()). sha1_hash may
not be up-to-date, though, so we call X509_cmp to make it valid.
Ugh.

For WinRT/Qt, we use the DER encoding, as that is the native
storage format used in QSslCertificate. This is not equivalent
to the implementation used in qsslsocket_winrt.cpp before, but
since handle() == handle() => toDer() == toDer(), it should not
be a problem.

[ChangeLog][QtNetwork][QSslCertificate] Can now be used as a key in QSet/QHash.

Change-Id: I10858fe648c70fc9535af6913dd3b7f3b2cf0eba
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-10-19 07:32:37 +02:00
Marc Mutz
adadb5e870 QSizePolicy: remind to mark as Q_PRIMITIVE_TYPE in Qt 6
Change-Id: I1f18b4cd99f37aadf199e70d3acade9c8f5f9799
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-19 07:32:21 +02:00
Richard Moe Gustavsen
e57153b082 iOS: ensure we have a valid focusObject before sending it IM events
Should not really happen, but since we don't store the focus
object given to us, we should do a check.

A crash was seen from this when running the "Application"
example for widgets.

Change-Id: I9c4121766d7028a4eceede7d7b15c8c53d34e16e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-10-19 00:57:29 +02:00
Richard Moe Gustavsen
0ed65a6513 iOS: ignore sender of actions for edit menu
The reason is that the sender is sometimes 'NULL', so
we cannot rely on it. But the current test with our
prefix should suffice.

Change-Id: Ie58bf062cbade08feda622bda753d63e1d811a8d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-10-19 00:56:18 +02:00