Commit Graph

24953 Commits

Author SHA1 Message Date
Friedemann Kleint
d57c661115 MSVC2015: Disable warning C4577 ('noexcept' used with no exception handling mode specified).
Fix the flood of warnings:

src/corelib/global/qflags.h(52): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc

now occurring since we don't have exception handling enabled.

Change-Id: I05d12ee6303b4f9fceb48507fadfd7d1a5604ea4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-08-02 22:35:46 +00:00
Laszlo Agocs
007c60e193 Do not access screens before initialize()
Change-Id: I1d6eaa5a1525ae060f8a9f37ae4295bee2f4bb38
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-08-02 08:21:18 +00:00
Gabriel de Dietrich
69cca470fe Cocoa QPA plugin: Unlock full Q_DECL_OVERRIDE karma
Change-Id: I0f631c3b120d052ad552809d0aab9493e5b41a70
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2015-08-01 21:34:12 +00:00
Gabriel de Dietrich
0193d6d5bb Cocoa Integration: Support non-native input context plugins
This is useful, for example, when we want to test the virtual
keyboard on OS X. It uses the usual QT_IM_MODULE code path
provided by QPlatformInputContextFactory if that environment
variable is set. If not, it defaults to QCocoaInputContext.

Change-Id: Ib917d7bd2f4e86eacbc50dd7592cc288a9a702de
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-08-01 21:34:07 +00:00
Friedemann Kleint
b4f266c4e4 qwindowstheme.cpp: Fix compiler warnings by MSVC2015 (64bit).
qwindowstheme.cpp(635): warning C4312: 'reinterpret_cast': conversion from 'int' to 'FakePointer<int> *' of greater size

Change-Id: Ia2b7c14a5f31bd29243302e76105ad97563951b2
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-08-01 19:08:48 +00:00
Olivier Goffart
0e2d8ba792 QMainWindow: allow dropping QDockWidget to floating docks
In the QMainWindow::GroupedDragging mode, we can have floating
tabs of QDockWidget's, but it was not possible to drop onto
already floating QDockWidgets to tab them.

Task-number: QTBUG-47211
Change-Id: Ic666f6f8816d91a3eed844a6da1eb8698c8c7a0c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-08-01 06:48:17 +00:00
Thiago Macieira
3ae2387f37 QTemporaryDir: fail early if the error isn't EEXIST
Before, stat -c on Linux (enabling this code path):

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 0.00    0.000000           0       256       256 mkdir

After:
 0.00    0.000000           0         1         1 mkdir

“To err is human, to persist in error is diabolical” - Georges
Canguilhem

“The definition of insanity is repeating the same mistakes over and over
again and expecting different results.” - Albert Einstein, Mark Twain or
Benjamin Franklin (all mis-attributed)

Change-Id: Ib306f8f647014b399b87ffff13f0a3c155053e6a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2015-08-01 01:36:58 +00:00
Thiago Macieira
1a3f340d0e Update/fix the qmake support for (f)lex
lex.prf was trying to be halfway between the standard POSIX lex
requirements and those of GNU flex. So fix it to work with both, more or
less, by noticing when lex is actually flex and using the extended GNU
options. Note that POSIX lex is untested and may still not work.

Change-Id: Ib306f8f647014b399b87ffff13f1e8e43fb68b3c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-07-31 17:04:38 +00:00
Friedemann Kleint
af38340720 Port examples/widgets/itemviews to new connection syntax.
Rename some slots to avoid ugly casts.

Change-Id: I5d7b2c044ab6a725f7259e5e34f00c3d06fff050
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-31 14:21:15 +00:00
Friedemann Kleint
7b72cc205c tests/auto/widgets: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0)  by
          Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by  Q[TRY]_COMPARE(a, b) and
  add casts where necessary. The values will then be logged
  should a test fail.

Change-Id: Ie29640451dddeb58342038a8cd5fac152cce39e5
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-07-31 11:50:10 +00:00
Konstantin Ritt
c57c89b3c1 Don't expose qt_setQtEnableTestFont(bool) by default
Build it only in -developer-build mode for tests that might depend
on exact-matching font behavior.
Return earlier to avoid doing any useless job.

Change-Id: I966ee5689f03403e45f4c957b63e3113f0467803
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-07-31 09:50:17 +00:00
Konstantin Ritt
073f4f9bb2 [QBasicFontDatabase] Minor code clean-up
We do not use supportedWritingSystems anymore -> simply remove.

Change-Id: I8c8b4b0614bf396c943d810c396d18e2d0201eff
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-07-31 09:53:20 +00:00
Konstantin Ritt
839af2268e Micro optimization to Basic/Android FDB::populateFontDatabase()
Re-use QDir to check if dir exists
(QDir::exists() also returns false if path specifies a file),
and use somewhat faster QDir::entryInfoList() to iterate the font files.

Change-Id: Iea3a6e5548928a01db71037425adf170cb722151
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-07-31 09:52:49 +00:00
Konstantin Ritt
5e3e34731b Default implementation for QPlatformFontDatabase::fallbacksForFamily()
...mainly for platforms that do not provide a native/unified way
to obtain system-defined font fallbacks list
(ie !CoreText && !FontConfig).

Change-Id: I23c5589d79ddecb6311ccc52ec8b29977f06d408
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-07-31 09:51:35 +00:00
Konstantin Ritt
735cd0ccf3 [QFontDatabase] Defer the fallback families list initialization
Use the same trick the WebKit related path has used for years:
if there is no explicit list that takes a precedence over the
default one (i.e. QFont("Arial,SimHei")), then defer the fallback
families list initialization until it gets requested.

Change-Id: If5a74294bdebb24865c619bc0d7328b3e706de76
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-07-31 09:49:21 +00:00
Jeremy Lainé
76ce564674 ssl: add support for EC keys to non-OpenSSL backends
Adds basic support for QSslKey reading / writing Elliptic Curve keys on
backends other than OpenSSL (i.e. WinRT / SecureTransport for now).

Change-Id: I67012dbe6b844a3ed5b22b63e0cdbacf0497a74a
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-07-31 09:08:47 +00:00
Friedemann Kleint
3859b304e8 tests/auto/gui: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0)  by
          Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by  Q[TRY]_COMPARE(a, b) and
  add casts where necessary. The values will then be logged
  should a test fail.

Change-Id: I624deb320c378c18a29b3707f48583d53bfd5186
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-07-31 08:29:15 +00:00
Kimmo Leppälä
7b6be75796 Add Intel Q965/Q963 and G33/31 to the Windows OpenGL blacklist
Task-number: QTBUG-47522
Change-Id: I3b276e7a07c0b70eaafd244ab1203432df7a22c1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-07-31 07:49:51 +00:00
Thiago Macieira
0aedca2f97 Revert "Fix performance of recursive read-write locks"
This reverts commit 666486b3ef, which
removed the QHash that protected against reader recursion
deadlocks. Without this hash, a reader will block on
d->readerWait.wait() until the writer finishes its task. However, the
writer never starts because there's a reader that hasn't released the
lock. That's a deadlock.

Change-Id: I792373bb361db35eb9e5504229c099008821a665
Task-number: QTBUG-47530
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-31 07:38:17 +00:00
Topi Reinio
590d305f99 qdoc: Fix incorrect keyword details written to .qhp for QML properties
QDoc tried to refer to an non-existing node (a parent of a parent) of a
QML property when writing the unique ID of a QML property keyword.

Change-Id: I90ab92b6ac95cfa688ca79a2c4d6c72f0e30d018
Task-number: QTCREATORBUG-3708
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-07-31 07:28:50 +00:00
Topi Reinio
7a1045b647 qdoc: Fix string used in compatibility members page
Add a missing space in the comment generated at the top of the
compatibility members page.

Change-Id: I21e010f9fca41346bb50c4b400325b18ff672738
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-07-31 07:28:43 +00:00
Topi Reinio
f80143a69a Doc: Add a \target for license information within QImage documentation
This allows us to link to it from the Qt licensing information page.
Also, replace the \legalese command with \badcode in order to
keep the license text formatting intact.

Task-number: QTBUG-46478
Change-Id: I1b5100ca0373a533bd56852ab2a8f18e72404334
Reviewed-by: Sami Makkonen <sami.makkonen@digia.com>
Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
2015-07-31 07:28:37 +00:00
Topi Reinio
8f3e7e3b47 qdoc: Add images used in examples into .qhp
Images used as resources in examples were missing from the generated
.qch files.

Change-Id: I7cdfc65b646a418e3de0b22d9a075e9a413aca29
Task-number: QTBUG-46635
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-07-31 07:28:25 +00:00
Shawn Rutledge
e026fdc4a7 Tablet example: update the cursor according to the tool
Change-Id: Ibbe530856bb833e465dd9fa1da5425c018fecc21
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-07-31 04:33:27 +00:00
Shawn Rutledge
6a991f9cce Tablet example: smoother, rotation stylus, better airbrush
The drawing is antialiased and with rounded caps and joins.
Rotation stylus acts like a felt marker.
Airbrush sprays a radial gradient of color, and its alpha can
depend on the tangential pressure if so chosen.

Task-number: QTBUG-46694
Change-Id: I4fb16eb621707e3c56a75aa302dd0d3bf418a745
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-07-31 04:33:20 +00:00
Friedemann Kleint
ad4d25589f Add recent file handling to SDI/MDI and remove the recentfiles example.
The existing recentfiles example was basically a clone of the SDI
example with a "Recent" menu added. Assuming it is better to have
it all in one place, the functionality is merged into the existing
SDI/MDI examples.

- Implement recently opened files handling using a submenu and a
  QSettings array in the SDI/MDI examples.
- Remove recentfiles example.

Change-Id: Id5a1ab9fa1c2e6b9ec81309cfe74cf86f450392a
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-07-31 04:30:35 +00:00
Friedemann Kleint
57dbdcd92f tests/auto/network: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0)  by
          Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by  Q[TRY]_COMPARE(a, b) and
  add casts where necessary. The values will then be logged
  should a test fail.

Change-Id: Icaa1edafcc6e2779fbd6dbc2c058544d6e07f1e9
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-07-31 04:29:33 +00:00
Thiago Macieira
cc7fcecd7a Add QStorageInfo::blockSize
[ChangeLog][QtCore][QStorageInfo] Added QStorageInfo::blockSize(), which
returns the optimal block size for data transfer to and from the
storage.

Change-Id: Ib306f8f647014b399b87ffff13f4eba6000452d4
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
2015-07-30 21:12:21 +00:00
André Klitzing
0d3c8feeeb Fix SNI for TlsV1_0OrLater, TlsV1_1OrLater and TlsV1_2OrLater
Since SslV3, SslV2 and UnknownProtocol do not support it we can
invert the IF clause here.

Change-Id: I42e942337d01f3a8c97885b268bffa568e40d335
Task-number: QTBUG-47528
Reviewed-by: Mikkel Krautz <mikkel@krautz.dk>
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-07-30 19:50:59 +00:00
Paul Olav Tvete
62bd4f5852 Extend high-DPI manual test
Add several new tests to verify that Qt behaves properly when
high-DPI scaling is enabled. Add a generic framework for
manual tests for good measure. This could be refactored and
used for other manual tests later.

Includes tests written by Morten and Friedemann.

Task-number: QTBUG-46615
Change-Id: Ib6762ec1454711e71f0c094b19015932b99e8d6d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-07-30 18:10:03 +00:00
Morten Johan Sørvig
6309062722 high-DPI tweaks for autotests
Task-number: QTBUG-46615
Change-Id: I724f56fb3bc1a4b671b5d010765ef4e354412e2e
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-07-30 18:09:12 +00:00
Paul Olav Tvete
0f7bc885aa Turn off font hinting when active highdpi scaling
Font hinting is done in the Qt coordinate system, and ends up
looking very wrong if the painter is scaled. Now that high-DPI
scaling is cross platform, we can move the responsibility for
turning off hinting out of the platform plugin.

Note that we cannot change our minds later, since Qt does not have
a reference to all objects that perform text layout. Therefore, we
turn off hinting if and only if there is at least one screen with
scaling enabled at application startup. If this is not good enough
for you, you should disable scaling and support resolution independence
manually.

Task-number: QTBUG-46615
Change-Id: I15fa09aa1e952cf3abeb2d8c26f13ad1f1cbf9bf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-07-30 16:43:38 +00:00
Thiago Macieira
661854bb89 Add a quick optimization for QVersionNumber's constructors
If the data fits inline, let's store it using the dummy member. GCC,
Clang and ICC optimize the code on all architectures I tested to one
single store.

Previously, the function for "return QVersionNumber(5,4,0);" was:
 x86-64:
        movb    $7, (%rdi)
        movb    $5, 1(%rdi)
        movb    $4, 2(%rdi)
        movb    $0, 3(%rdi)
 x86:
        movb    $7, (%eax)
        movb    $5, 1(%eax)
        movb    $4, 2(%eax)
        movb    $0, 3(%eax)
 ia64:
        addl r17 = 7, r0
        adds r16 = 1, in0
        adds r15 = 2, in0
        adds r14 = 3, in0
        st1 [in0] = r17
        addl r17 = 5, r0
        ;;
        st1 [r16] = r17
        addl r16 = 4, r0
        ;;
        st1 [r15] = r16
        st1 [r14] = r0
 armv7a:
        mov     r1, #7
        mov     r2, #5
        strb    r1, [r0]
        mov     r1, #4
        strb    r2, [r0, #1]
        mov     r2, #0
        strb    r1, [r0, #2]
        strb    r2, [r0, #3]
 mips32:
        li      $3,7                    # 0x7
        sb      $3,3($4)
        li      $3,5                    # 0x5
        sb      $3,0($4)
        li      $3,4                    # 0x4
        sb      $3,1($4)
        sb      $0,2($4)
 mips64:
        li      $3,7                    # 0x7
        sb      $3,7($4)
        li      $3,5                    # 0x5
        sb      $3,0($4)
        li      $3,4                    # 0x4
        sb      $3,1($4)
        sb      $0,2($4)
 ppc32:
        li 10,7
        stb 10,3(3)
        li 10,5
        stb 10,0(3)
        li 10,4
        stb 10,1(3)
        li 10,0
        stb 10,2(3)
 ppc64:
        li 10,7
        stb 10,7(3)
        li 10,5
        stb 10,0(3)
        li 10,4
        stb 10,1(3)
        li 10,0
        stb 10,2(3)

Now it is:
 x86-64:
        movq    $263431, (%rdi)
 x86:
        movl    $263431, (%eax)
 ia64:
        addl r14 = 263431, r0
        ;;
        st8 [in0] = r14
 armv7a:
        movw    r3, #1287
        movt    r3, 4
        str     r3, [r0]
 mips32:
        li      $3,84148224                     # 0x5040000
        addiu   $3,$3,7
        sw      $3,0($4)
 mips64:
        li      $3,321                  # 0x141
        dsll    $3,$3,50
        daddiu  $3,$3,7
        sd      $3,0($4)
 ppc64:
        lis 9,0x504
        sldi 9,9,32
        ori 9,9,7
        std 9,0(3)
 ppc32:
        lis 9,0x504
        ori 9,9,7
        stw 9,0(3)

All assembly listings from GCC 4.8.1, but the Clang and ICC outputs are
identical or at least very similar (I tested Clang for ARM, MIPS and
PowerPC). Both MIPS and PowerPC were compiled in big-endian mode and this
listing shows that the 64-bit implementation is correct.

Additionally, the output is also the same for GCC when using brace
initialization (that is, return QVersionNumber{5,4,0}). Clang and ICC
couldn't optimize that.

Change-Id: I9a4a4c9fc83f1182401f63fd2da829c935a8c9da
Reviewed-by: Keith Gardner <kreios4004@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-07-30 16:15:47 +00:00
Paul Olav Tvete
3c12482df0 Fix highdpi drag-n-drop for X11
Task-number: QTBUG-46615
Change-Id: Iad548e62a580d6fbd15b7a826116a53ce23b4b8b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-07-30 12:45:16 +00:00
Paul Olav Tvete
ec462b245f X11 changes for highdpi
Adapt the xcb plugin to work with the new cross-platform
high-DPI scaling.

Fixes for drag and drop is done in a separate change.

Task-number: QTBUG-46615
Change-Id: I29002721169750b9de59edb0f3e9134adabc4855
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-07-30 12:45:07 +00:00
Friedemann Kleint
fd6821740f Highdpi changes for Windows
Adapt the Windows plugin to work with the new cross-platform
high-DPI scaling.

Task-number: QTBUG-38993
Task-number: QTBUG-46615
Change-Id: I108d319255925a290b75611e95ef006d4aaf7ace
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-07-30 12:44:58 +00:00
Morten Johan Sørvig
a705b4ec1f Introduce cross platform high-dpi scaling
Add a coordinate scaling layer to QtGui, which supports 'devicePixelRatio'
type high-dpi on all platforms, in production and also for
development and testing purposes.

High-DPI scaling is opt-in, by setting environment variables:
    QT_SCALE_FACTOR - sets a global scale factor
    QT_AUTO_SCREEN_SCALE_FACTOR - sets per-screen scale factors,
        where the scale factors are provided by the platform plugin.

This QtGui scaling can be used instead of or in addition to scaling
done by the window system. This distinction is not visible to
applications [when they use Qt API], which will see a change in
the value returned by the devicePixelRatio() accessors as usual.

Introduce a new (private to Qt) coordinate system: native pixels.
The coordinate system stack now looks like:
    device-independent pixels (app, upper parts of Qt)
    native pixels (lower parts of Qt Gui, platform plugins)
    device pixels (backing stores and OpenGL)

Add private QHighDpi namespace with scaling functions that convert
between device-independent pixels and native pixels:
    T toNativePixels(T, QWindow *);
    T fromNativePixels(T, QWindow *);

Add scaling calls the QWindow (and friends) cross-platform implementation,
around the calls to QPlatformWindow functions. QPlatformWindow now uses
native coordinates - platform code remains largely unchanged since native
coordinates are window system coordinates.

QWindow now uses (possibly) scaled coordinates. This means that
platform plugins no longer can rely on QWindow::geometry() and
related functions. QPlatformWindow::windowGeometry() and other
convenience functions have been added for use when the platform
plugin needs to convert scaled geometry to native geometry.

Add Qt::AA_NoHighDpiScaling, which can be use to disable any
scaling in QtGui, effectively ignoring the environment variables.
(Note that this does not disable any scaling done by the window
system.)

Contributions from Friedemann and Paul.

Task-number: QTBUG-46615
Change-Id: I673bbd69c130e73b13cce83be11bfb28f580bf60
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-07-30 12:44:41 +00:00
Jeremy Lainé
d113073203 ssl: add test certificates with DSA and EC keys
The QSslCertificate tests only covered certificates with RSA keys, this
extends the test coverage to DSA and EC keys.

Change-Id: Ibee26f449cf6c1d97cbac6b511972eb44d6f0bd2
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-07-30 11:31:40 +00:00
Martin Koller
0617834e0c xcb: Make it compile on systems with xinput2 < 2.2
Change-Id: I7e98d3540cd7717ac8af8d1993618d18320f811a
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2015-07-30 07:50:07 +00:00
BogDan Vatra
d800047dc5 QLineEdit should inherit the input methods from QComboBox.
Task-number: QTBUG-39088
Change-Id: I4dfe9a052c20a4cb0a9d6b0d3337cb5095a3694f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-07-30 07:06:27 +00:00
BogDan Vatra
17caa94190 Android: Start the application when we know the screen geometry.
Until now we'se set the screenGemetry to 0,0 until the layout is
created, but some controls needs it before that.

Task-number: QTBUG-44271
Change-Id: I7d00e2a142572e27fc77e46566bb2cdb37f58035
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-07-30 07:06:18 +00:00
Leena Miettinen
332d41d025 Doc: QFileDialog::ShowDirsOnly not supported on Windows
The native Windows file dialog does not support displaying
files in the directory chooser.

Task-number: QTBUG-46982
Change-Id: Ib58f3d888df564d42044b81ad8e67b8aeae5f3c6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-07-30 06:15:30 +00:00
Joerg Bornemann
edb5f22b0a consistently handle empty program string in QProcess::start overloads
All overloads of QProcess::start will now check whether the program
string is empty and in that case
  - set error to FailedToStart,
  - set errorString to "No program defined",
  - emit error.

Until now only one of the three overloads behaved like this.

As a side effect, start(QString(), QStringList()) will not crash on
Windows anymore.

Task-number: QTBUG-47404
Change-Id: I2f93657204fe3643b1d74a74817843c05fc4a96b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-07-30 05:33:28 +00:00
Morten Johan Sørvig
dcd2debe62 Enable non-integer device pixel ratio
Work around QPaintDevice::metric's int return type
by adding a new metric that returns a scaled devicePixelRatio.
Choose a scale factor that gives us more than enough
range.

The QPaintDevice::devicePixelRatio() convenience accessor
is public API and can unfortunately not be changed
to return a qreal. Add devicePixelRatioF() which
returns the (unscaled) devicePixelRatio.

Change all call sites of QPaintDevice::devicePixelRatio()
to use QPainDevice::devicePixelRatioF().

Task-number: QTBUG-46615
Change-Id: I97ec4000fe379b7ff5e1624a871ae2512790aad9
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-07-30 04:04:01 +00:00
Friedemann Kleint
0167ace5f0 tests/auto/sql: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0)  by
          Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by  Q[TRY]_COMPARE(a, b) and
  add casts where necessary. The values will then be logged
  should a test fail.

Change-Id: I4e4a319c5918d697a33f6d6032c36b8c9660ca05
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2015-07-29 11:35:53 +00:00
Pier Luigi Fiorini
e948f97814 eglfs_kms: Implement DPMS mode
Implement the new QPlatformScreen API for power state.

[ChangeLog][QPA][eglfs][kms] Allow to set DPMS mode and get the current
value for each screen.

Change-Id: I5abfb53c3e2f6579a2d6ff19d780b67f424903bf
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-07-29 09:09:25 +00:00
Pier Luigi Fiorini
d71f3e0882 Add power state to QPlatformScreen
Allows platform plugins to set the power state for each screen.

Change-Id: I4164ca63cbae9fa2ab186dc84c8f704c33fd7c69
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-07-29 08:23:32 +00:00
Thiago Macieira
2d981e7e9f Refactor QVersionNumber so it stores values in-class
The common case of QVersionNumber is that there are few segments and
each segment is a small integers. So instead of allocating a
QVector<int>, just store those numbers in the class itself if
possible. Think of this as a "Small String Optimization" for
QVersionNumber.

QVector<int> costs 16 + 4*N bytes, plus malloc overhead. After this
change, QVersionNumber(5,4,0) will have an overhead of zero.

The memory layout is explained in the header. I've coded it so big
endian also works, but I have not tested it at all.

Aside from the special functions for QVersionNumber and operator>>, all
the rest of the algorithm could have been left unchanged. I only updated
segments(), normalized(), compare(), commonPrefix() and fromString() to
take advantage of the smaller implementation in a more efficient way.

Note: QVersionNumber's constructors often leave half of the object or
more uninitialized. That's not a problem.

Change-Id: I4a2a0ce09fce2580f02d678e2f80b1dba74bac9d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-07-29 08:46:19 +00:00
Sérgio Martins
d7e23c1011 Replace ifdefs with QDir::listSeparator()
Change-Id: I98fab8e0d83b2e7851ba8c0a4adfc02af1271a92
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-07-29 08:01:01 +00:00
Laszlo Agocs
06b86f68e8 Support MRT in QOpenGLFramebufferObject
Introduce overloads in the API to allow specifying multiple color
attachment sizes and formats. When these are in use and MRT is supported,
a texture or renderbuffer is created for each of GL_COLOR_ATTACHMENT0, 1, 2, ...

[ChangeLog] Added support for multiple render targets in QOpenGLFramebufferObject

Task-number: QTBUG-39235
Change-Id: Ie7cfd81d1b796a9166b80dff7513aafe0120d53d
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-07-29 07:54:13 +00:00