Commit Graph

19791 Commits

Author SHA1 Message Date
Marc Mutz
184fd8aa6c QPixelFormat is better taken by-value
Being a better quint64, it can be passed in registers, so take them as value args.

Change-Id: I8eb96a2594d910b538b651fb3ca567c0c124dd3a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-08-09 09:04:51 +02:00
Marc Mutz
d131abde59 QPixelFormat: implement some oneliners in the class body
There's little point in duplicating the complex declaration (thanks to C++11), just define
the relational operators and the default ctor where they're declared.

Change-Id: Ie91545b2581c89edd434c911eb05705e2d16debe
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-09 09:04:33 +02:00
Marc Mutz
3469c262fc QPixelFormat: don't use bit fields
GCC at least is generating horrible code for them, so do the bit twiddling
ourselves. This is not premature optimization, because it might be the seed
for a QBitField class, as suggested by Andrei Alexandrescu on GN2013.

The assembler code of default and copy ctors is unchanged between the old
and new versions. Accessors such as redSize() are virtually identical (with
an and and a mov exchanging place). The interesting thing is what happend in
operator== and the set-all-fields ctor. These are the disassemblies of
functions wrapping op== and the ctor, resp.:

bool pf_comparison(QPixelFormat, QPixelFormat):
        .cfi_startproc                                   |        .cfi_startproc
        movl    %esi, %edx                               |        cmpq    %rsi, %rdi
        xorl    %eax, %eax                               |        sete    %al
        xorl    %edi, %edx                               |        ret
        andl    $15, %edx                                |        .cfi_endproc
        jne     .L53                                     |
        movl    %esi, %edx                               |
        xorl    %edi, %edx                               |
        testw   $1008, %dx                               |
        jne     .L53                                     |
        movl    %esi, %edx                               |
        pushq   %rbx                                     |
        .cfi_def_cfa_offset 16                           |
        .cfi_offset 3, -16                               |
        movl    %edi, %ebx                               |
        movzbl  %dh, %ecx                                |
        movzbl  %bh, %edx                                |
        xorl    %ecx, %edx                               |
        andl    $252, %edx                               |
        jne     .L40                                     |
        movq    %rdi, %rcx                               |
        movq    %rsi, %rdx                               |
        shrq    $16, %rcx                                |
        shrq    $16, %rdx                                |
        movl    %ecx, %ebx                               |
        xorl    %edx, %ebx                               |
        movl    %ebx, %r8d                               |
        andl    $63, %r8d                                |
        jne     .L40                                     |
        xorl    %ecx, %edx                               |
        testw   $4032, %dx                               |
        jne     .L40                                     |
        movq    %rsi, %rcx                               |
        movabsq $16911433728, %rdx                       |
        xorq    %rdi, %rcx                               |
        testq   %rdx, %rcx                               |
        jne     .L40                                     |
        movq    %rdi, %rdx                               |
        movq    %rsi, %rcx                               |
        shrq    $32, %rdx                                |
        shrq    $32, %rcx                                |
        movl    %edx, %ebx                               |
        xorl    %ecx, %ebx                               |
        movl    %ebx, %r8d                               |
        andl    $252, %r8d                               |
        jne     .L40                                     |
        movq    %rsi, %r9                                |
        movq    %rdi, %r8                                |
        shrq    $40, %r9                                 |
        shrq    $40, %r8                                 |
        xorl    %r9d, %r8d                               |
        andl    $127, %r8d                               |
        jne     .L40                                     |
        xorl    %ecx, %edx                               |
        andl    $98304, %edx                             |
        jne     .L40                                     |
        movq    %rsi, %rcx                               |
        movq    %rdi, %rdx                               |
        shrq    $48, %rcx                                |
        shrq    $48, %rdx                                |
        xorl    %ecx, %edx                               |
        andl    $126, %edx                               |
        jne     .L40                                     |
        shrq    $48, %rdi                                |
        movq    %rcx, %rax                               |
        xorl    %edi, %eax                               |
        testw   $-128, %ax                               |
        sete    %al                                      |
        .p2align 4,,10                                   |
        .p2align 3                                       |
.L40:                                                    |
        popq    %rbx                                     |
        .cfi_restore 3                                   |
        .cfi_def_cfa_offset 8                            |
.L53:                                                    |
        rep                                              |
        ret                                              |
        .cfi_endproc                                     |

That one is pretty obvious. Hint: the right one is the new version.

QPixelFormat pf_unwieldy_ctor(QPixelFormat::ColorModel, ...)
        .cfi_startproc                                   |        .cfi_startproc
        movq    %rbp, -32(%rsp)                          |        movq    %rbx, -40(%rsp)
        movq    %r12, -24(%rsp)                          |        .cfi_offset 3, -48
        andl    $15, %edi                                |        movzbl  8(%rsp), %ebx
        movq    %r13, -16(%rsp)                          |        andl    $63, %esi
        movq    %r14, -8(%rsp)                           |        movq    %rbp, -32(%rsp)
        andl    $63, %esi                                |        movq    %r12, -24(%rsp)
        movl    48(%rsp), %r11d                          |        andl    $63, %edx
        movzbl  8(%rsp), %r10d                           |        .cfi_offset 6, -40
        andl    $63, %edx                                |        .cfi_offset 12, -32
        .cfi_offset 6, -40                               |        movl    16(%rsp), %ebp
        .cfi_offset 12, -32                              |        movl    32(%rsp), %r11d
        .cfi_offset 13, -24                              |        andl    $63, %ecx
        .cfi_offset 14, -16                              |        movl    40(%rsp), %r10d
        movzbl  16(%rsp), %r14d                          |        movq    %r13, -16(%rsp)
        movzbl  24(%rsp), %r13d                          |        andl    $63, %r8d
        andl    $63, %ecx                                |        andl    $63, %ebx
        movzbl  32(%rsp), %r12d                          |        .cfi_offset 13, -24
        movzbl  40(%rsp), %ebp                           |        movl    48(%rsp), %r13d
        andl    $63, %r8d                                |        andl    $63, %r9d
        movl    %r11d, %eax                              |        movq    %rbx, %r12
        movq    %rbx, -40(%rsp)                          |        movl    24(%rsp), %ebx
        .cfi_offset 3, -48                               |        andl    $1, %ebp
        andl    $63, %r9d                                |        andl    $1, %r11d
        andl    $3, %eax                                 |        andl    $15, %r10d
        andl    $63, %r10d                               |        movq    %rdi, %rax
        xorl    %ebx, %ebx                               |        andl    $15, %eax
        andl    $1, %r14d                                |        salq    $4, %rsi
        andl    $1, %r13d                                |        salq    $10, %rdx
        andl    $1, %r12d                                |        andl    $1, %ebx
        andl    $15, %ebp                                |        salq    $16, %rcx
        cmpl    $2, %r11d                                |        salq    $22, %r8
        cmovne  %eax, %ebx                               |        salq    $28, %r9
        andl    $63, %esi                                |        salq    $34, %r12
        movq    %rdi, %rax                               |        salq    $40, %rbp
        salq    $4, %rsi                                 |        salq    $41, %rbx
        andl    $15, %eax                                |        salq    $42, %r11
        andl    $63, %edx                                |        salq    $43, %r10
        salq    $10, %rdx                                |        cmpl    $2, %r13d
        orq     %rsi, %rax                               |        movq    %r14, -8(%rsp)
        andl    $63, %ecx                                |        .cfi_offset 14, -16
        salq    $16, %rcx                                |        movzbl  56(%rsp), %r14d
        orq     %rdx, %rax                               |        je      .L45
        andl    $63, %r8d                                |        andl    $3, %r13d
        orq     %rcx, %rax                               |        salq    $47, %r13
        salq    $22, %r8                                 |.L44:
        andl    $63, %r9d                                |        orq     %rsi, %rax
        salq    $28, %r9                                 |        orq     %rdx, %rax
        orq     %r8, %rax                                |        movq    %r14, %rdx
        andl    $63, %r10d                               |        movq    -8(%rsp), %r14
        movq    %r14, %rcx                               |        orq     %rcx, %rax
        salq    $34, %r10                                |        andl    $63, %edx
        orq     %r9, %rax                                |        orq     %r8, %rax
        andl    $1, %ecx                                 |        salq    $49, %rdx
        movq    %r13, %rdx                               |        orq     %r9, %rax
        orq     %r10, %rax                               |        orq     %r12, %rax
        salq    $40, %rcx                                |        movq    -24(%rsp), %r12
        andl    $1, %edx                                 |        orq     %rbp, %rax
        movq    -16(%rsp), %r13                          |        movq    -32(%rsp), %rbp
        salq    $41, %rdx                                |        orq     %rbx, %rax
        orq     %rcx, %rax                               |        movq    -40(%rsp), %rbx
        movq    %r12, %rcx                               |        orq     %r11, %rax
        orq     %rdx, %rax                               |        orq     %r10, %rax
        andl    $1, %ecx                                 |        orq     %rdx, %rax
        movq    %rbp, %rdx                               |        orq     %r13, %rax
        salq    $42, %rcx                                |        movq    -16(%rsp), %r13
        andl    $15, %edx                                |        ret
        movq    -32(%rsp), %rbp                          |        .p2align 4,,10
        salq    $43, %rdx                                |        .p2align 3
        orq     %rcx, %rax                               |.L45:
        movq    %rbx, %rcx                               |        xorl    %r13d, %r13d
        orq     %rdx, %rax                               |        jmp     .L44
        movzbl  56(%rsp), %edx                           |        .cfi_endproc
        andl    $3, %ecx                                 |
        salq    $47, %rcx                                |
        movq    -40(%rsp), %rbx                          |
        movq    -24(%rsp), %r12                          |
        movq    -8(%rsp), %r14                           |
        andl    $63, %edx                                |
        orq     %rcx, %rax                               |
        salq    $49, %rdx                                |
        orq     %rdx, %rax                               |
        ret                                              |
        .cfi_endproc                                     |

Without bothering to understand the details, they look pretty similar, with the new
version being slightly shorter. But that may not mean anything.

Change-Id: I31e84c9109ccd0c7282351b2e2802407a9b360b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-09 09:04:16 +02:00
Glen Mabey
35105f173e Long live QByteArrayList!
Initial submission of a new class QByteArrayList with the
purpose of aggregating and then joining QByteArray instances.

[ChangeLog][QtCore] Added new QByteArrayList class.

Done-with: Marc Mutz <marc.mutz@kdab.com>
Change-Id: I503af58f125d7f44fef10360177490c933e5840f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-09 09:01:41 +02:00
Keith Gardner
a332322de9 Long live QVersionNumber!
The class provides compare operators, stream operators, and hashing
functions. This class aims to be compatible with (but not restricted to)
the Semantic Versioning 2.0 standard (semver.org).

[ChangeLog][QtCore] Added QVersionNumber class

Done-with: Marc Mutz <marc.mutz@kdab.com>
Change-Id: I244c8ccc002909af03987a2df052734d1a8621a9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-08-09 09:00:24 +02:00
Olivier Goffart
3750c677ee QObject: fix valgrind warning when disconnecting
QObjectPrivate::Connection::method should never be called when
the Connection was made with the function pointer syntax

This caused valgrind warning about using uninitialized value on such code:

 QObject::connect(&o, &Object::aSignal, &o, &Object::aSlot);
 o.disconnect(&o, SLOT(aSlot()));

Change-Id: Iaff9ecd3ddfe665db92726b420021493453c4cea
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-09 08:31:20 +02:00
Oliver Wolff
6f1299c0b4 SSL: split ssl files into general and "_openssl" implementation
In order to prepare the addition of WinRT and iOS (SecureTransport)
implementations of SSL the structure of some SSL files has to be
redone. Parts of certificate that probably can be reused by other
ports stayed in qsslcertificate.cpp while other parts were moved
to qsslcertificate_openssl.cpp. qsslcontext, qsslkey and qsslsocket
were suffixed by _openssl to show that these are pure openssl
implementations.

Change-Id: I7b022dec49759f882274999c0991bf95788f2a3a
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-09 08:28:56 +02:00
Laszlo Agocs
9aaa615626 Fix crash in QOpenGLWidget when changing the TLW
The documentation was also somewhat incomplete when it comes to
widgets that change their tlw multiple times.

Change-Id: I09dd70167804c50a5283ab3709162c93a3827e9b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-08 17:32:23 +02:00
Gunnar Sletta
88bd28f91e Initialize member.
Change-Id: I9ed8d5a7aeb40886bafbd9eb2003e88e5d796cc9
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-08 13:34:13 +02:00
Frederik Gladhorn
1e2af80785 Fix int conversion to string
clang warning: adding 'int' to a string does not append to the string

Change-Id: I6dc393269a52e9482fde106c17132336cf5ce226
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-08 10:45:53 +02:00
Thiago Macieira
c1be0fbe7d Fix compilation after qstringlist.h stopped including qdatastream.h
Change-Id: Ida09e794262dce78cd5169aac56b610fabc9082c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-08-08 10:44:59 +02:00
Takumi Asaki
8e3aacf61b OS X: Remove mnemonics in parentheses
In some language, mnemonics put after label text within parentheses.
e.g. "&Open" is translated to "開く(&O)" in Japanese.

OS X doesn't use mnemonics and '&' in label text is removed.
Mnemonics in parentheses (and spaces before them) also should be removed.

Change-Id: I88c0a1f60af7e148b3cf24a4e215ce807d62bce3
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-08-08 10:44:29 +02:00
Laszlo Agocs
bb760d9514 Add support for glMapBufferRange in the wrappers and resolvers
QOpenGLBuffer::map() and related helpers are becoming useless in
OpenGL ES 3.0 and up: instead of the old GL_OES_map_buffer,
glMapBufferRange, but not glMapBuffer, is now part of the standard.
On desktop GL_ARB_map_buffer_range is present by default in OpenGL 3.0
and newer.

[ChangeLog][QtGui] Added QOpenGLBuffer::mapBufferRange().

Task-number: QTBUG-38168
Change-Id: I4e9bbe8ced9ee4d535ac32849a8c08c26d79cb49
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-08 07:29:53 +02:00
Laszlo Agocs
22e4391413 Add default format to QSurfaceFormat
Add defaultFormat() and setDefaultFormat() statics to QSurfaceFormat.
These define the default values for the requestedFormat members of
QOpenGLContext, QWindow and QOpenGLWidget (and implicitly QOpenGLWindow,
QQuickWindow, etc.)

This replaces QQuickWindow::setDefaultFormat() which can now be removed.

The main inspiration here is not the convenience (avoiding setFormat() calls
for all windows/widgets), but robustness: by setting the format once at the start
of the application, all windows and contexts, including the internal share context
used by QOpenGLWidget and QQuickWidget, will use the same format, eliminating
the possibility of failing due to trying to share between incompatible contexts.

Furthermore, since such a functionality is anyway mandatory for QQuickWindow
(due to the possibility of creating windows from QML code), extending it to
QSurfaceFormat and QOpenGLContext/QWindow is the next logical step.

Change-Id: Ie94486adc489d17fecfcebb7050fecedffd2688b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-08 07:29:29 +02:00
Laszlo Agocs
41a7072195 Fix the docs for resizeGL in QOpenGLWindow
Some of it was blindly copied from QOpenGLWidget and it
does not apply.

Change-Id: I73f358f74d286d3757a3a77a9bfe06887d57514a
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-08 07:28:41 +02:00
Thiago Macieira
6a237a4e76 Add some missing STL typedefs and functions to QStringRef and QByteArray
These will be needed in some template code that is to come.

Change-Id: I5b93f4320313f7b15a6404de2c98f85485735fda
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-08 00:05:03 +02:00
Thiago Macieira
e8150576cd Document missing QLatin1String methods
Most of them were added before 5.0, but it's ok to just list as 5.0.

Change-Id: I6e83a210a0165659f710d47ed595e9e89d5dbac9
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-08-07 22:39:40 +02:00
Friedemann Kleint
04ba6fbed9 Windows/QGuiApplication::topLevelAt(): Skip mouse-transparent windows of other processes.
Search again when a non-Qt window with WS_EX_TRANSPARENT set is found.

Task-number: QTBUG-40555
Change-Id: I3f53be626f52dc25429661ac8ea5e9f6bb163596
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-08-07 21:05:50 +02:00
Jędrzej Nowacki
2f1ab7156a Micro-optimize qdoc codeparser.
There is no need to allocate new string while a simple reference is
enough.

Change-Id: I137b58fc180fe9a7bff9d0f9e546ca04aa9f4696
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-07 15:54:03 +02:00
BogDan Vatra
8b7a2d582c Android: Say hello to gradle!
Add build.gradle script, move Android template files to another folder.
These files are specific to every project, and they should be copied to
then project android folder.

Switching from Ant to Gradle brings lots of advantages:
 - it is way faster when rebuilding (25-50% faster than ant).
 - it enables first class Android Studio integration.
 - adding Android Extras libs (e.g. Google Play services, OBB, etc.) to
   your project is now painless.

[ChangeLog][Android] Added Gradle support to build the APK.

Change-Id: I9c8cb355118c9ac1997270c8b80916eca43fce4d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-08-07 12:27:51 +02:00
Peter Hartmann
9ad5dd0e8f network tests: add manual test for auth / proxy auth
This is helpful to e.g. test an NTLM proxy.
The test server currently does not support NTLM; this test offers a
possibility to specify a proxy server via environment variables.

Change-Id: Iea94656d38424c1d932fc854d13ca15ca47cdd68
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-07 11:54:08 +02:00
Andy Shaw
866c8bc5e3 Uncomment some tests which accidently got commented
With SHA1 47b3ecf3f4 some tests got
commented out by accident. This re-enables those tests.

Change-Id: If9c7d8a672b66086895a0383fe87d3101fb146fb
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-08-07 10:08:51 +02:00
Gunnar Sletta
50c418b61d Both HiQualAA and normal AA should mean antialiasing in rasterengine.
Change-Id: I1970c96e7681e4059984d837e12f044f138e6d7e
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-07 10:08:24 +02:00
Andy Shaw
51ff044934 Check if Start/EndPage returns non-positive value when error checking
StartPage and EndPage are documented to return a non-positive value (0 or
less) when they fail, therefore it is not enough to check if !StartPage.
Checking if is 0 or less is more accurate.

Change-Id: Ia0ff43da4e4309ba0a5983e91a0ad583aad0a955
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-08-07 10:07:41 +02:00
Thiago Macieira
e26404e43f Add missing #include <qdatastream.h> or <qiodevice.h>
Lots of code depended on an indirect includes from qstringlist.h.

Change-Id: I33d0dce33d64302d6c0e49180cc1249b90ab27c5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-07 08:41:45 +02:00
Laszlo Agocs
78221fe762 Clean up the QOpenGLWindow example
1. Use includes without module prefixes, as is the custom in examples.
2. No inline functions to make it more readable.
3. Pause animation on pressing P and document our signal connection a bit more.

Change-Id: I68dc3d4c74b639cf3fec17b63b7f49626db58bdb
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-07 09:19:15 +02:00
Laszlo Agocs
37023a096d Avoid repaints and swapbuffers when the platform window is already gone
On Linux at least the qopenglwindow example sometimes shows
"QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined"
when closing the window and exiting the application. This patch avoids
this by not triggering repaints anymore when the platform window is destroyed.

Change-Id: I54bd41e5c1471f7cdfec89f8ec3be48d1438be39
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-07 09:03:59 +02:00
Laszlo Agocs
4ff12977d8 Add missing precision qualifiers in qopenglwindow example
Make GLES implementations happy.

Change-Id: Ib389e379f23794eee0fa71ca26b863e56cee662e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-07 09:03:50 +02:00
Laszlo Agocs
e79f008ae5 Avoid crashing in QOpenGLWidget::metrics
When creating child widgets in the derived class' constructor, the screen
cannot be retrieved via window() since it still returns null. Handle this
case properly.

Change-Id: I65bf7f9c338ce8a3ddab8ad7886cfe2f1f253c82
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-07 09:03:37 +02:00
Laszlo Agocs
1b1dd22486 Do not use GLES3 functions in a GLES2 context
Just like the recent fix for VAOs on iOS, where we might deploy a
GLES3-enabled binary on a GLES2-only system, the same issue is
potentially present for blitFramebuffer and renderbufferStorageMultisample.
Handle this properly.

Change-Id: I87268478f1de479dc2c106b46d6e9b84e866fcd5
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-07 09:03:32 +02:00
Andrew Knight
ed7894dd77 winrt: Handle dispatcher thread change
If the calling thread changes when processing events, the dispatcher
will no longer have thread access and event processing will fail. This
can e.g. prevent new threads from being created. To remedy this, the
dispatcher object is re-fetched if the thread is changed.

Change-Id: I519cff521f9b84211db3f28a7a28b532de44a6a4
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-08-07 08:52:34 +02:00
Andrew Knight
c7abf81786 winrt: Refactor backing store
Thanks to new features in ANGLE, the backing store implementation
complexity can be greatly reduced. By using ES3 framebuffer blit,
no shader code is required, and the shader loading code and blit shader
can be removed.

Change-Id: Iab3d915e279ad6468a75ef6257794f12acd8cb65
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-08-07 08:47:41 +02:00
David Faure
1a9701fe81 QFileDialog: implement getOpenFileUrl and friends for real
i.e. make them support remote URLs.
To avoid code duplication, getOpenFileName/getSaveFileName/getExistingDirectory
are now implemented in terms of getOpenFileUrl/getSaveFileUrl/getExistingDirectoryUrl.

Change-Id: If409ac9ab72c2a65f04e2ef1dc28e7d47bbcd73c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-08-06 22:26:11 +02:00
J-P Nurmi
c8321a9c10 Android: extract window style attributes
Task-number: QTBUG-39215
Change-Id: I29120f5dcc97051705bc6ebacfa5843d8953810b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-08-06 22:19:10 +02:00
J-P Nurmi
c793839681 Android: add support for Android.R.attr.state_accelerated
This lets the Qt Quick Controls Android Style choose the appropriate
window background that is meant to be used with HW acceleration.

Change-Id: I65d6f9319d77364637460e7c4ebb7ea3f4d53f12
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-08-06 22:18:53 +02:00
Marc Mutz
7f78d547ca QCommandLineParser: support extremely concise option configuration in C++11
The goal of this commit to make the code in the test work:

    QCommandLineParser parser;
    parser.addOptions({
        { "a",                "The A option." },
        { { "v", "verbose" }, "The verbose option." },
        { { "i", "infile" },  "The input file.", "value" },
    });

For this, QCommandLineParser needs a version of addOption that can
take a list of options. That's what addOptions() is for.

More importantly, the QCommandLineOption ctors mustn't be explicit.
OTOH, any implicit conversion from QString or QStringList to
QCommandLineOption is also undesirable.

To solve this dilemma, add new QCommandLineOption ctors that just
take one argument and are explicit, and make the existing ctors
implicit. In order to avoid ambiguities, remove the default values
of their resp. 2nd arguments. The new ctors are by intention not
\since 5.4, as they are completely transparent to the user.

Et voila, even better than getopt_long(3).

[ChangeLog][QtCore][QCommandLineParser] Added addOptions() method.

Change-Id: I5e779f3406cd0f6c8ec6ecbf6c8074af226de300
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-06 22:17:22 +02:00
BogDan Vatra
a2ad0ba630 Android: Fix debugging.
When re-install a package without uninstalling it first, a few files
are leftover from the previous installation which makes the debugging to
fail.

Change-Id: I603491668bcec2a6f8054951ea2dea806fcc4c88
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-08-06 22:07:52 +02:00
Paul Olav Tvete
1fec23f927 Enable devicePixelRatio for non-Apple platforms
Remove #ifdef Q_OS_MAC around devicePixelRatio code. We are planning
to make it available on other platforms.

Task-number: QTBUG-38858
Change-Id: I25230cb53ea1291095335ef5883b15087e44f6b8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-08-06 17:33:51 +02:00
Eskil Abrahamsen Blomfeldt
8306dee38f Windows: Fix stored family name of fallback fonts
When we create fallback fonts, we copy the fontdef of the main font, but
we need to update the family name to match reality, otherwise a QRawFont
created with the font engine will have the wrong family name. This is
already done in the default implementation of loadEngine(), but was missing
from the Windows implementation.

One large consequence of this was that when the distance field renderer
cloned the font engine (to change its size), it would clone it with the
wrong family name. When it later painted its glyph indexes, they would
of course refer to the wrong font (the fallback) so random characters
would appear.

[ChangeLog][Windows] Fixed using QRawFont with fallback fonts, e.g.
in the case of text rendering in Qt Quick.

Task-number: QTBUG-39172
Change-Id: Ic8fcd9dfc20ec7aadf0b47d4a80417f401f355fd
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-08-06 17:17:09 +02:00
Christian Strømme
1671dacb52 Android: Remove native views when their window is destroyd.
destroySurface() was not removing the native view as they are not
in the m_surfaces map.

Task-number: QTBUG-40159
Change-Id: Ib5457e0bd34141654fa47883f5e125d894b0bd05
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-08-06 17:16:36 +02:00
Christian Strømme
4946ed0496 Android: Fix QAndroidPlatformServices::openUrl().
Return true only if an activity was found for the intent.

Task-number: QTBUG-34716
Change-Id: I764caf1e8afa3b17b2d71f52873c17e5d834a956
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-08-06 17:16:30 +02:00
Christian Strømme
682976def7 Android: Fix recursion bug in callStaticMethod()
calling callStaticMethod() with template type jlong, jdouble or
jboolean would cause the call to loop indefinitely.

Change-Id: I99caa576e761fdef623ece04e0779e4cf2535592
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-08-06 17:16:22 +02:00
Shawn Rutledge
2ad9e69a9f GTK file dialog: pre-fill the filename if given to a Save dialog
The docs for gtk_file_chooser_set_filename explain that if a file is
new, we should call gtk_file_chooser_set_current_name instead.
(But in that case it is necessary to set the directory separately.)
Qt doesn't make a distinction between a save dialog for saving a
new file vs. a dialog for re-saving an existing file, so it seems this
is the better way to do it all the time, since a save dialog would
most often be used for saving a new file.

Task-number: QTBUG-40573
Change-Id: I285e898fafc54ae39f09d564ca431a279a8f8919
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-08-06 17:10:07 +02:00
Shawn Rutledge
276036179a QFileDialog docs: remove misleading sentence about static functions
Native dialogs are used whenever possible, not just when the dialog is
instantiated via the static function.

Task-number: QTBUG-36657
Change-Id: Ibad67114e67f8e2f9956037f8469542c72bfd8ea
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-08-06 17:09:50 +02:00
Richard Moe Gustavsen
1a47595d3a QPlatformMenu: add overloaded function 'showPopup' that takes a target rect
When showing an edit menu on touch platforms, you need to specify a target
rect for where to place the menu. The target rect is normally a rectangle
that encompasses the whole text selection. Using this information the OS
will place the menu so that is doesn't obscure the selection itself, or fall
outside the screen (or overlaps e.g the keyboard). Since we don't know the
size of the menu, or if the OS will end up placing the menu above or below the
pos we give it, we need to do it the correct way and forward the whole target
rect instead.

Change-Id: I638586e9d0dd14c430a22c403c6dce099192a075
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-08-06 16:17:06 +02:00
Shawn Rutledge
c1d2a04923 Add debug operator for QTouchEvent::TouchPoint
dfde72e436 added debug support for
QWindowSystemInterface::TouchPoint, which is useful only near the
QPA interface; but in qtdeclarative it's useful to be able to log
individual touch points too.

Change-Id: I237d354d7018e6326e586ae3355c8aa6f781eff8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-08-06 16:16:35 +02:00
Allan Sandfeld Jensen
589894c072 Be consistent in GrayScale vs Grayscale naming
The enum GrayScale was renamed Grayscale without similarly changing the
helper class for the same enum.

Change-Id: Ie1b34a68654f22a843ce4cfc2ddc1bf06af8dea1
Reviewed-by: Axel Rasmussen <axel.rasmussen1@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-06 16:04:06 +02:00
Allan Sandfeld Jensen
28fe4e3a86 Remove specific maemo/meego codepaths
We no longer support the maemo/meego platform, so we can remove the
specific code for that platform.

Change-Id: Ia7f0730eba2d96794b97b7ca4753f63a2d7bc2a8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-08-06 15:48:02 +02:00
Ivan Komissarov
54ca39afec Add the QTabBar::changeCurrentOnDrag property.
This property indicates that the current tab will change whilst dragging
over the tabbar

[ChangeLog][QtWidgets][QTabBar] Added changeCurrentOnDrag property.

Change-Id: Ib7d5a7613c9cd8432b84c523f66c02cd6c3c3c81
Reviewed-by: David Faure <david.faure@kdab.com>
2014-08-06 15:19:22 +02:00
Marc Mutz
e3e2e68774 Micro-optimize QProgressDialogPrivate::ensureSizeIsAtLeastSizeHint()
QWidget::isVisible() is an inline call, but sizeHint() is a virtual function.
Use QSize operations to call each one only once.

Also reduces the number of q-> qualifications needed.

It must be noted that this change is not entirely behavior-preserving:
If sizeHint() returns a negative component, and the dialog is not
visible, resize() will be called with that negative component now,
instead of zero as was the case previously.

I believe this is not a problem, because the way sizeHint() is currently
implemented, the width cannot be less than 200 and for the height to be
negative, the sum of label, bar and button size hint height would need
to be negative, which is next to impossible.

Change-Id: Ie8ba110e193532921eb4732a0393a377e38d7f7e
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-08-06 14:56:51 +02:00