Commit Graph

19700 Commits

Author SHA1 Message Date
Olivier Goffart
135a286844 Fix error reported by address sanitizer
It is not valid to dereference a null pointer, even if it's just in order
to access enum constants

Change-Id: Id404c308ae7ffd879afdd678302e3ac4e0c69001
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-13 00:00:03 +02:00
Olivier Goffart
7ca5af28d0 Fix error reported by address sanitizer
One can't dereference the null pointer value. Even to access a static member.

Change-Id: I5edc92d7886ccc7029d1f3c00a12de78b439f080
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-12 23:59:59 +02:00
Laszlo Agocs
b08cc0ec6f Make the expose region local on all platforms
QExposeEvent::region() reports a region in a random coordinate system.
The behavior is undocumented and the platform plugins do different things.

xcb, offscreen and ios are correct. These set the region in local coordinates,
which is the most logical interpretation of the expose region.

windows is almost correct, except for one occurrence.

cocoa and others need changes: passing in geometry() as the exposed region is
always wrong.

The patch documents the expected behavior both for QExposeEvent and
internally in QWindowSystemInterface. The problematic plugins are fixed to
use local coordinates.

Task-number: QTBUG-40470
Change-Id: I6ded3154d14254fa71d4292d8e1b5e6cf696c81a
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-12 07:47:32 +02:00
Laszlo Agocs
611558d877 Modernize the OpenGL examples
Change them to use QOpenGLWidget and QOpenGLTexture.
Advocate also the usage of VBOs.

Hopeless examples, that rely on the fixed pipeline and will
not compile or work in ES and dynamic builds, are moved to
a "legacy" directory. The documentation pages for these are
removed. This long due change avoids the confusion newcomers
experience when trying to get started with Qt 5 and OpenGL.

hellowindow's behavior is changed to open a single window only
by default. The old default behavior, that opened three windows
on platforms that supported both MultipleWindows & ThreadedOpenGL,
can be requested by passing --multiple. --single is removed since it
is the default now. This plays much nicer with drivers that have
issues with threading.

In addition, say hello to hellogl2.

This is the old hellogl example updated to use QOpenGLWidget and
OpenGL 2. It also has a mainwindow with multiple (un)dockable widgets
containing the OpenGL widgets. This helps testing the behavior when
the top-level of the QOpenGLWidget changes and provides a very
important example of how to do proper resource management in this case.
(must use aboutToBeDestroyed() of the context, since the context goes
away and is replaced by a new one on every dock/undock)

As a bonus, the logo is now real 3D, no more orthographic nonsense.

Launch with --multisample to request 4x MSAA.

Launch with --coreprofile to request 3.2 Core. In this particular example
the shaders are present in both versions and there is a VAO so the application
is functional with core profile contexts.

Change-Id: Id780a80cb0708ef164cc172450ed74050f065596
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-12 07:47:23 +02:00
Topi Reinio
338f9c4f7c qdoc: Distinguish between QML property and attached property
A recent change in qtdeclarative (60ed6a43) added an attached
property 'Window' to Item type, with property names identical
to the ones already available in Window. This caused QDoc to
report warnings for duplicate documentation for QML properties,
because there was no distiction between a QML property and an
attached property.

This change fixes the issue by:
    - Allowing identical names for \qmlproperty and
      \qmlattachedproperty
    - Using distinct URLs/UUIDs/anchor references for them
    - Marking attached properties with '[attached]' qualifier
      in 'All Members' page.

This doesn't solve the issue of disambiguating between a
similarly named QML property and attached property when
linking from an external location. However, these can be
solved with the help of the \target command.

Task-number: QTBUG-40674
Change-Id: Icc74de237366e9897334689fe354ab83e4af0356
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-08-12 07:27:45 +02:00
Andrew Knight
34198cedbe winrt: Fix core dispatcher lookup
The core dispatcher lookup should be performed from the constructor
in all cases but the first (WinMain) thread, and only rechecked if the
thread changes.

Change-Id: I05f0c15b3e199994aa5d740b2092b42fb8d2f596
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-08-11 23:29:27 +02:00
Andrew Knight
57d9eb2b77 SSL backend: Fix pem header/footer utility methods
These methods assumed incoming data would have LF line endings, and
therefore broke when parsing files with CRLF line endings. This
simply removes the line feed from the header/footer strings, and switches
to QByteArrayLiteral while doing so.

Change-Id: I0c14634243c4bd7d19a6b5ef718b6ed1cc6bcdb2
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-11 23:29:25 +02:00
Andrew Knight
259cf68e06 SSL backend: Add a decodeDer() method to the private API
This allows QSslKey to avoid converting to pem format if the backend
supports native der decoding.

Change-Id: I0822a21401ad0ca81c6eeb6c7d53c421e1e2e93a
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-11 23:29:22 +02:00
Andrew Knight
2fe8efbefe winrt: Fix theme palette
Windows Phone didn't handle the base color enums well, and ARM was
getting incorrect colors due to different byte ordering. So, use the
Phone-specific enums where applicable and pass in the proper char sequence
for the color.

Change-Id: I7ffbc383c07d2160974560110fea221a204577ea
Reviewed-by: Jochen Seemann <seemann.jochen@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-08-11 23:29:20 +02:00
Andrew Knight
3846aec83b winrt: Fix backing store blit
The calculation forgot to take the mirrored texture upload into account.

Change-Id: Ia69c9c4b9d852d9ac652e71aaa466c5387ff5bca
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-08-11 23:29:18 +02:00
Laszlo Agocs
00f3f5c0a6 Fix msaa in QOpenGLWidget
Take the correct number of samples from the widget's context, not the
tlw's context.

The original implementation did the blit only after paintGL(). This is
not sufficient for applications that override paintEvent() and do QPainter
calls in there (e.g. the 2dpainting example). Therefore the approach is
changed to perform the resolving of the samples in a function that is
invoked by QWidgetPrivate every time a paint event is sent.

Change-Id: Iae0b2c30f6070ec75201339a848854e4582a9c0c
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-11 13:19:53 +02:00
Frederik Gladhorn
9ba3145f79 Add QAccessible::ActivationObserver
Makes it possible to follow changes in activation an deactivation of a11y.
Needed for WebEngine to know when to activate a11y.

Change-Id: Ia264a76974224d1baad3e88c34a4b8a9f1a3695d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-08-11 13:16:51 +02:00
Jędrzej Nowacki
9d19be5994 Remove unused property from moc
Change-Id: Ia09ce83b23d1d9eb54ab5fac1fee4755913f5a33
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-09 15:38:07 +02:00
Adam Strzelecki
6545acdf68 Enable rpath support on OS X and iOS platform
This is done by defining QMAKE_LFLAGS_RPATH for compilers for Apple platform.

Task-number: QTBUG-31814
Change-Id: I9040df341ad46395d6ab71bc760ba7a5ee5ff291
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2014-08-09 15:37:39 +02:00
Adam Strzelecki
dbb0d54699 qmake: Don't make rpaths starting with @ or $ absolute
Defaults qmake behavior is to make all project RPATHDIR paths absolute prior
passing them to linker. We need to make an exception for paths starting with @
such as @executable_path (Apple platforms) or $ such as $ORIGIN (Linux).

Task-number: QTBUG-31814
Change-Id: Ie9887c0046c5030c4128dda945b491a5d389ba34
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2014-08-09 15:37:32 +02:00
Jędrzej Nowacki
8f22f242a2 Micro-optimize QUrl::topLevelDomain
Using QStringRef saves few instructions

Change-Id: I0d67a1f6a1c1385c88a8b21cb98b9c7dbdfb66e5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-09 15:37:11 +02:00
Andrew Knight
5dd7164c97 winrt: Use native file dialog
The native Windows Runtime file picker is required to support picking
of any file/folder from the system. Due to platform security restrictions,
the non-native file dialog is effectively useless when outside of the
application's installation or local storage directories.

This adds a QPA implementation for the WinRT file picker, as well as
a simple file system engine to handle files which were opened by the
picker. This necessary for platform security reasons, as it is not
possible to open files from arbitrary paths - only file handles opened by
the picker can be used, so these are kept inside this file system engine
and acted upon when a known path is observed.

The file system engine is only instantiated when needed, and may prove
useful for other areas of Qt (such as known folders/standard paths) which
must operate on a virtual file rather than an absolute path.

Task-number: QTBUG-37748
Change-Id: Ia4fd6c5065ac92101ce34adcb6c9026fbcff56df
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2014-08-09 15:37:09 +02:00
Jędrzej Nowacki
4413254ff6 Micro-optimize QDir::relativeFilePath
Use QString::splitRef on platforms with case sensitive paths, to
avoid unnecessary allocations.

Change-Id: Iff331a5eb67c4cbaf1333e663e77290261c5b013
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-08-09 15:37:04 +02:00
Thiago Macieira
b1202e0234 Update the handling of the -xkbcommon configure option
If the user requested the system xkbcommon with -system-xkbcommon, then
don't silently fall back to the bundled version if the functionality
test fails. Instead, print the an error notice.

Also note that the -xkbcommon argument didn't do anything, since it set
the variable to "yes".

Change-Id: I2c9e820bd076995aaaad987ecce76ebddcd79b4a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-08-09 15:37:01 +02:00
Thiago Macieira
db851ed5d1 Trim the QString benchmark test
The comparison, Latin 1 and UTF-8 benchmarks contained in this file are
stale. The implementation changed in Qt 5.3 and this benchmark couldn't
be updated (test data too large for Qt).

Please contact Thiago Macieira to obtain the benchmarks and test data.

Change-Id: I48c19b1f1711eb73c953a30ed4da510e97a62472
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-09 15:36:36 +02:00
Thiago Macieira
e319196f76 Ensure that qCleanupFuncinfo works with some C++11 new constructs
This commit adds tests for ref-qualified member functions, the new
syntax for functions and decltype.

__PRETTY_FUNCTION__ for lambdas varies wildly between compilers and will
produce really bizarre results after cleanup. It's not tested and is
known to be broken.

Change-Id: I70c8dbcba54790357cecba35aa45c5cc672f29d1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-09 15:35:59 +02:00
Thiago Macieira
65ade55c8c Add QtPrivate::is_const and is_volatile
And correct the comment by listing more types that are available

Change-Id: I9cb4b664f97300357a55d81bc99dd542a29e933b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-09 15:35:56 +02:00
Marc Mutz
d1ede822d8 QOpenGLVersionStatus: add constexpr
Also dropped two redundant qMakePair() calls.

Change-Id: I7266ac9a3354ef4f60bf921fc0cd5d5a33c75b93
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-09 09:06:29 +02:00
Marc Mutz
e41b45f1ae QPair: add constexpr liberally
On templates, adding constexpr makes a given instantiation constexpr
if it can be.

This turns qMakePair(0,0), say, into a compile-time constant.

The effects on existing code are small, but exist:

  $ size lib/*{-baseline,-paircexp} | sort -nr
  6516727  211192    2608 6730527  66b31f lib/libQt5Widgets.so.5.4.0-baseline
  6516711  211192    2608 6730511  66b30f lib/libQt5Widgets.so.5.4.0-paircexp
  5373720   44492   15976 5434188  52eb4c lib/libQt5Core.so.5.4.0-baseline
  5373504   44492   15976 5433972  52ea74 lib/libQt5Core.so.5.4.0-paircexp
  5107206  125072    6080 5238358  4fee56 lib/libQt5Gui.so.5.4.0-baseline
  5107030  125072    6080 5238182  4feda6 lib/libQt5Gui.so.5.4.0-paircexp
  1341290   30180    2600 1374070  14f776 lib/libQt5Network.so.5.4.0-baseline
  1341210   30180    2600 1373990  14f726 lib/libQt5Network.so.5.4.0-paircexp
  # no other libraries benefit

[ChangeLog][QtCore][QPair] Can now be used in C++11 constexpr contexts.

Change-Id: I3872e6aa33a7d02a168516f4dfa7119efcac8c40
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-09 09:06:16 +02:00
Marc Mutz
31f2b7e591 Use NAmE spelling of grey (gray)
These occurrences are only in docs or code comments.

Change-Id: Ia114466a85c01e2b978396c329153044921fb20b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2014-08-09 09:05:57 +02:00
Marc Mutz
28bb18c0c0 QStringRef: add missing \since 5.4
{,c}{begin,end}() were added post-5.3, in 1a6f490b, but weren't marked with \since 5.4.

Add it.

Change-Id: Ide743833144f784c7d09b125e7a22f9b184ed823
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-09 09:05:51 +02:00
Thiago Macieira
dcf9883dff Move the special QByteArrayList methods into QList
and make QByteArrayList be a simple typedef.

As a side-effect, the constructor taking a QByteArray is no longer
available since I couldn't find a way to add it to QList<T> when T is
QByteArray. My template-foo failed me. I tried:

 - QEnableIf<is_same<T, QByteArray>::value, QByteArray>::type
   => makes QList fail to compile for any T that isn't QByteArray
 - make the constructor a template member
   => it compiles if the parameter is a QByteArray, but not a const
      char[4] like the test was
 - inheriting constructors
   => runs into ICC and Clang bugs that I could not work around

Besides, the constructor with std::initializer_list is a superior
solution anyway.

Change-Id: Ic86fbadc1104142bfd907a5c4147199bf839fb89
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-09 09:05:43 +02:00
Marc Mutz
2431bf1b20 QPixelFormat: don't inherit it
Instead of abusing inheritance to provide convenience constructors,
use simple inline constructor functions. The name got a lower-case
q to indicate a free function. The usual fromXYZ() static methods
were deemed not fitting in this case in the initial round of review,
since they implied some kind of conversion while these functions are
simply constructors of formsts, which contain no data.

This also solves the problem that some of these ctors could have been
called with just one argument and were therefore candidates for hidden
QPixelFormat temporary injection.

QPixelFormatRgb was renamed to qPixelFormatRgba to explain the third
argument at the call site better.

There seem to be no users of this class in qt5.git at this time.

Change-Id: Ib4fe8ceb2d30744127b116a748724a3406400eb8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-09 09:05:24 +02:00
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
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
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
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