Commit Graph

15198 Commits

Author SHA1 Message Date
Friedemann Kleint
bd09405792 Add debug output for QGestureEvent and QGesture classes.
Task-number: QTBUG-15768
Task-number: QTBUG-40461
Change-Id: I3fe29f71ddf39c76efaca02d2b70494378d147dc
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-30 16:16:51 +02:00
Daniel Teske
ed3fc4ea47 QObject: Actually check unnormalized method signature
This was broken in f95181c7bb,
and has been broken in all released versions of Qt5.

Change-Id: Ia75ab602be4904cc6ab19471f909716538af8746
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-09-30 15:24:36 +02:00
Topi Reinio
4b128309a3 qdoc: Restore navigation bar titles for QML, QML basic types
Re-add the name of a QML type/QML basic type to the navigation
bar.

Change-Id: Ia0ced775099f1ed4071ae9a922d808b9114c10ea
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-09-30 14:08:24 +02:00
Nico Vertriest
54853c5f66 Doc: Use title case in section1 titles
Using Python script title-cased.py

Task-number: QTBUG-41250
Change-Id: I00d3d7a0b30db7304a7904efd6d63abd9a7b493b
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-09-30 13:52:51 +02:00
hjk
eda8af2a69 Make QAccessible compile with -Werror
GCC was bailing out when attempting to merge this into the dev
branch due to the use of "potentially uninitialized values".

Change-Id: Id2fc4a123a4b180b9ab439429a0d20245c7ee41b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-30 10:33:07 +02:00
Friedemann Kleint
289b4ed705 QMdiArea: Fix positioning of cascaded sub windows.
Take PM_FocusFrameVMargin into account.

Task-number: QTBUG-35146
Change-Id: I1499790537ddf9fbb912ab764b7d049ee11af95d
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-09-30 10:32:52 +02:00
MihailNaydenov
c55324aee0 Additional support for devicePixelRatio in CE_MenuItem’s icon painting
FusionStyle and MacStyle have this already, the change just brings it to the others.

Task-number: QTBUG-40277
Change-Id: I08dc80771b9cd0ab47179e1994ab6510b022eade
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-09-30 10:32:34 +02:00
Eskil Abrahamsen Blomfeldt
27bc4c4ce5 QPlainTextEdit: Fix crash on complex undo w/full width selection
Say you have a document of two blocks of text.

When you select a block of text in the document and then replace this
with a new empty block (by pressing enter) and then subsequently
undo this action, the following three steps are performed as a
chain of undo commands:

1. Remove the empty block at the beginning of the document
2. Insert a new empty block at the beginning of the document
3. Insert the text back into the first block

Since a block is removed and inserted in the same go, both blocks
require a relayout, since the accumulated change spans both blocks.
However, in QPlainTextDocumentLayout we would only look at the max
of either removed chars or added chars. This would match the text
length of the first block at this point, so we would only relayout
that block. However, since we are also removing characters, the
actual accumulated change to the document is larger. We should
relayout any block touched by the sum of the added and removed
character counts.

Missing this, the paint event would later query
block.layout()->lineForTextPosition(0) which would give an invalid
line despite the fact that the block.length() > 0. This caused
a crash in the paint event when the full width selection was
turned on.

Note that the logic here was only recently updated to include the
removed characters at all in the logic, by the SHA1:
2983cb9531.

[ChangeLog][QPlainTextEdit] Fixed a crash when using full width
selections and issuing a complex undo command chain which removes
and inserts an empty block in one go.

Task-number: QTBUG-36415
Change-Id: Iafe8a69e455e0c713a48714f10f0cace69c84f51
Reviewed-by: Axel Rasmussen <axel.rasmussen1@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-30 10:21:39 +02:00
Ulf Hermann
38c4ccbfe6 Handle PPK_CustomBase in QWin32PrintEngine::property
If we leave out the default so that the compiler catches missing enum
values we should actually handle them all ...

Change-Id: Ieb4992dec84ce847e48ab3c4a94bd8825a148706
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-09-30 09:45:07 +02:00
Laszlo Agocs
90ce9701d0 Fix losing dirty state when calling update() from paintGL()
When the paint for the QOpenGLWidget was in invoked on the
fast path, where only that widget was dirty, the resetWidget
call after sending the paint event removed the widget from the
dirty list, making it impossible to schedule an update during the
event handling. The correct way is to clean the list and then send
the paint events.

Change-Id: Icdad5686ded7944fd1c8af56496f725e163a60e6
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-30 09:38:38 +02:00
Friedemann Kleint
5d36c74cb6 uic: Add QOpenGLWidget.
Change-Id: I02cb6bd4a038b865fa414fa557b12e369685248f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-29 20:53:26 +02:00
Marc Mutz
d93e4eff50 Make QRegion::shared_empty const
Continuing the trend of QString, QVector, etc.

Change-Id: I8f53d4abfa0dd941bfdfd3c1a9049a42dbf92691
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-29 20:13:18 +02:00
Alexander Volkov
2045a657da xcb: Fix detecting the fullscreen state from _NET_WM_STATE flags
A fullscreen window can have maximized flags being set so first check
the NetWmStateFullScreen flag.

Change-Id: Ia802abf3cfa4c784baa2d55088e3f53310f0362e
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-29 20:05:11 +02:00
Sérgio Martins
e297d72fa6 Fix build when using -Werror
"accessible/qaccessible.cpp:2154:43: error: 'type' may be used uninitialized in this function [-Werror=maybe-uninitialized]"
Compiler doesn't seem very smart, all enumerators are handled in the switch already.

Observed on android's gcc and gcc-4.7 on GNU/Linux

Change-Id: I30b4660c18992158457cada01b5916aa4feae4ff
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-09-29 18:24:01 +02:00
Thiago Macieira
cc50651cce Update the detection of when to log to stderr
On Windows, the detection changes only by inserting the use of the
environment variable before the existing tests and removing the check on
stderr.

This commit adds logic similar to Windows's: if the application has a
controlling TTY, we'll use stderr. Otherwise, we'll use the system log.
This is technically a change in behavior: previously, we would always
use the system log, unless the environment variable told us not to.

In practice, the behavior doesn't really change: Android and BlackBerry
and systemd-spawned applications are launched with no controlling TTY,
so logging will go to their logging systems.

[ChangeLog][Important behavior changes][Logging (including qDebug and
qWarning)] Log output will now go to the system log (if support for it
was compiled into Qt) if the application has no controlling terminal or
console window. Set QT_LOGGING_TO_CONSOLE to 1 to force logging to go to
stderr.

Task-number: QTCREATORBUG-12564
Change-Id: I043c5c4f47c15f26d4f4a5cf43df466ea38cdbc7
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-09-29 17:42:25 +02:00
Andrew Knight
85062a3028 Revert "winrt: Remove depth/stencil from the default window format"
This reverts commit 636d2e3402.

The issue was caused by a bug in ANGLE, not a lack of hardware support.

Change-Id: If2a66cd023dc7f2329dc2812169042487eecd428
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2014-09-29 16:09:35 +02:00
Andrew Knight
311157c3c6 ANGLE: Upgrade to 2.1~abce76206141
Upgrade to address issues discovered since the last upgrade.

Patch notes:
0000-General-fixes-for-ANGLE-2.1.patch
  added removal of the unused third-party tracing functions

0003-Fix-compilation-with-MinGW-gcc-64-bit.patch
  removed as it is no longer needed

0011-ANGLE-Fix-compilation-error-on-MinGW-caused-by-trace.patch
  removed as it is no longer needed

0016-ANGLE-Fix-compilation-with-MinGW-D3D11.patch
  now supports MinGW 64-bit

[ChangeLog][Third-party libraries] ANGLE updated to 2.1~f8602ad91e4f

Task-number: QTBUG-40649
Task-number: QTBUG-40658
Task-number: QTBUG-41031
Task-number: QTBUG-41081
Task-number: QTBUG-41308
Task-number: QTBUG-41563
Change-Id: I9f776c8d5cb94ddb12d608a8d5630bfc54437bea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-09-29 16:09:29 +02:00
Richard Moe Gustavsen
9af7104359 cocoa: override new QPlatformMenu::popup() function
Having two versions of popup, one that takes a point and one that
takes a target rect, causes problems for client code if they use
the 'target rect' version since not all platforms override that
function.

So this patch will change the remaining platform that override
QPlatformmenu into using the new 'target rect' version.
Calling the old version that takes a point will still work, since
the base version will then convert the point into a zero-sized rect, and
forward the call to the 'target rect' version instead.

Change-Id: Icc8531d79270a4f24ec08b8ed95b18ed3db1ad4d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-29 16:01:06 +02:00
hjk
1e1f5833b1 Do not use Q_COMPILER_CLASS_ENUM for gcc 4.4
It breaks the compiler self-test:

tst_compiler.cpp:754: error: no matching function for call to ‘qCompare(tst_Compiler::cxx11_class_enum()::X&, tst_Compiler::cxx11_class_enum()::X, const char [2], const char [13], const char [17], int)’

We not should assume it is safe to use, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064 and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37946.

Change-Id: I72c9c56e3e4f62bdfdfa133b6b0a2e610b5331c8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-09-29 15:14:04 +02:00
Alexander Volkov
382b7afbe2 xcb: Fix logic for minimized state
_NET_WM_STATE message can be received by a window in the minimized state.
Don't change the window state in this case.

Task-number: QTBUG-31117
Task-number: QTBUG-39376
Task-number: QTBUG-34430
Change-Id: Ic77a345e442891972b692803fab1e2f6aef30433
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-29 14:26:26 +02:00
Oswald Buddenhagen
189dc655bb Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/corelib/tools/qbytearray.cpp
	src/gui/image/qimage.cpp
	src/gui/image/qppmhandler.cpp
	src/gui/kernel/qguiapplication.cpp
	src/gui/painting/qpaintengine_raster.cpp

Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
2014-09-29 14:08:49 +02:00
Gabriel de Dietrich
ee6e9cbf36 QMacStyle: Generalize Cocoa control rendering
So far, we were restricted by the values of ThemeButtonKind, which
consist mostly of buttons. We want to generalize to other kind of
controls when the time arrives. Already, QPushButton with pull-
down menu is not possible to get from that enum, while its easy to
get from NSPopupButton.

Task-number: QTBUG-40833
Change-Id: I244c42c42ab595f4790050eb15ade70443e155b2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-29 13:39:06 +02:00
Gabriel de Dietrich
996054f5e6 QCocoaMenu: Keep a reference to the containing menu item
This allows the menu to tell its containing item the menu got
deleted. This removes the need to reset the COCOA_MENU_ANCESTOR
property value, which would crash since QCocoaMenuItem::m_menu
would be a dangling pointer.

Task-number: QTBUG-41587
Change-Id: Ia3408ef85cf823bfddbc2c41d6534e43bf14ed29
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-29 13:38:57 +02:00
Gabriel de Dietrich
8ab25620d3 Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts:
	src/network/socket/qnativesocketengine_unix.cpp
	src/widgets/kernel/qwidget_qpa.cpp

Change-Id: I6f1aa320d5ca66cd92d601a95885aeaab0abb191
2014-09-29 13:38:11 +02:00
Oliver Wolff
dfe853bff9 Windows: Fix call of ToUnicode
ToUnicode sometimes gives wrong results if it is used with a
keyboard buffer containing the ctrl modifier. Special cases
containing alt and control might trigger the third assignment
of a key, but if no alt modifier is used for the key event,
we temporarily disable the control modifier in order to obtain
the character with ToUnicode.

Task-number: QTBUG-35734
Change-Id: Ifd88c640541b42fa65ee1dc9b55af3386714b0b8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-29 07:26:46 +02:00
Vladimir
8456adf0ee Fix font enumeration, with the same family name, on Windows.
Function EnumFontFamiliesEx with parameters (lfCharSet = DEFAULT_CHARSET, lfFaceName = '\0') enumerates only first installed font from many with same family name.
This patch calls EnumFontFamiliesEx twice:
 1. Without family name to enumerate families;
 2. With family name to enumerate fonts with same family.

Task-number: QTBUG-40828
Change-Id: Ic36a24a9e70f735a7324c05fe4b70f7c7e5710d0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-09-28 16:41:05 +02:00
Marc Mutz
15fc84c48b QSslCertificate: fold a string literal correctly
Change-Id: I8f812002302d3b74af252fa66e9e13154bbf80e1
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-28 16:32:09 +02:00
Thiago Macieira
fa91bb9a02 Don't check for EINTR after calling QT_READ / QT_WRITE
On Unix, those functions are already #define'd to qt_safe_read and
qt_safe_write, which do the necessary EINTR handling. On Windows, EINTR
cannot happen.

Change-Id: I50c46472c04bd90a0bac51c725cc86311ae905c8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-28 01:28:52 +02:00
Thiago Macieira
0c32af08a6 Fix handling of IPv6 addresses in QUrl::fromUserInput
IPv6 addresses can start with ":", for which QDir::isAbsolute() would
always return true (QResourceFileEngine::isRelativePath() returns
constant false) and would trip the calculation for local files.

Similarly, IPv6 addresses can start with strings that look like Windows
drives: "a:", "b:", "c:", "d:", "e:" and "f:" (though not today, as
those address blocks are unassigned). Since a valid IPv6 address will
definitely require at least one more colon and Windows file names cannot
contain ':', there's no ambiguity: a valid IPv6 address is never a valid
file on Windows.

This resolves the ambiguity in favor of IPv6 for Unix filenames (which
can contain a colon) and in case of an URL containing scheme, relative
path and no authority ("dead:beef::" for example could have been parsed
as scheme() == "dead" and path() == "beef::").

Task-number: QTBUG-41089
Change-Id: Id9119af1acf8a75a786519af3b48b4ca3dbf3719
Reviewed-by: David Faure <david.faure@kdab.com>
2014-09-28 01:28:29 +02:00
Christian Strømme
10a0f93c86 Android: Add function to change the stacking order in the layout.
This change enables us to reorder the stacking order used by the
layout. This is necessary if we want to influence the drawing order.

Lowering or raising views are done separately for native views and
Qt surface views, that is, the two different view "types" are moved
relative to other views of the same type and Native views are always
placed on top.

Change-Id: I01cbb88f8efee08877b5972cf330fd25266a2aa9
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-26 23:45:13 +02:00
Christian Strømme
afece6e496 Android: Add findClass() function to the QJNIEnvironmentPrivate class.
The static QJNIEnvironmentPrivate::findClass() function exposes the
cache and the class finding code in qjni.

Change-Id: I42043dc993cf9cace042faf763f2a647ba79d97f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-09-26 23:45:00 +02:00
Christian Strømme
8b0d9a16db Android: Improve the foreign-window implementation
Adds:
- Improved geometry calculations (e.g, inside a parent)
- Change visibility
- proper stacking order. Native views now reserve the top of the stack
  to ensure that they stay visible.
- React to application state changes.

Change-Id: I35de0396937fff37ffcd272c9a7d8e9873a91dfb
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-26 23:44:42 +02:00
Giuseppe D'Angelo
5222abfdf5 Uic: fix a leak
There are a couple of code paths in which we return from a function
without freeing the memory pointed by a local pointer.

For the sake of not over-modifying the code, I chose not to turn
"ui" into a scoped pointer.

Change-Id: I0b23944f7526d250c1ebeca0bae9bdc36dceceed
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-09-26 21:14:49 +02:00
Andrew Knight
a1dea3a62c direct2d: Optimize dashed line drawing
This introduces a combined brush/dash pattern which can be used to
perform faster dashed straight-line drawing. The dash pattern is
prerendered to a tiled bitmap brush, resulting in a significant speedup
for lines with many elements.

As the result of non-rectilinear lines may lose quality compared to the
native dashed renderer, the slow/high quality codepath can be activated
by setting the QPainter::HighQualityAntialiasing render hint.

Task-number: QTBUG-40604
Change-Id: I771e9a81c042b4d8b6891dc9280932696e5a0694
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-26 07:32:33 +02:00
Louai Al-Khanji
3bcbff57e1 direct2d: Fix composition mode support
When the composition mode changes to a mode which is not supported by
Direct2D's primitive blending, the rendering follows the emulated (slow)
code path using rasterFill(). This allows the direct2d paint engine to
handle all composition modes supported by QImage.

Task-number: QTBUG-40602
Change-Id: I0ac0b5c89aab2483cb2ef7768d6dec8e16913249
Done-with: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-26 07:32:29 +02:00
Mark Brand
095f760463 update bundled sqlite to 3.8.6.0
The "Fixed CE build of sqlite3" patch is *updated* in this change.
Since sqlite 3.8.6, SQLITE_OS_WINCE isn't defined early enough so we
have to check _WIN32_WCE directly.
(ea70ec8711)

Change-Id: I63ee5163fb915274c9780c169e1f8673755bba47
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-09-26 07:22:52 +02:00
Marc Mutz
55fbf1db19 Widgets: remove references to QStyleOptionFrameV<n>
They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame.

Change-Id: Icff45cbd3a47db8618a7f7a80f7252651969237c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-26 00:39:48 +02:00
Allan Sandfeld Jensen
8165a9c74b Clean up QImage::Format switches
Changes some switches on QImage::Format that needed to be updated
whenever a new image format was added. Two were changed to matching
formats supported by BMP and PPM instead of what they don't support,
and two were changed to now use QPixelFormat values.

Change-Id: I5a14f1d7b7cc0451c68e4d6ab2361a5bd8dc8915
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-25 18:34:30 +02:00
Alex Blasche
342533864b Fix smooth scaling of large QImages
Task-number: QTBUG-13448
Change-Id: Ie76f5b5deefabeae93ab17eb866aea303692f5ac
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-25 17:20:12 +02:00
Markus Goetz
097b641c3e QNAM: Fix previous HTTP upload CPU fix
My previous fix for CPU load issues between HTTP thread
and user thread  was fragile if the upload QIODevice
emitted readyRead() multiple times.

[ChangeLog][QtNetwork][QNetworkAccessManager] Fix behavior of upload QIODevice
that generate data on readyRead() for HTTP PUT/POST

Change-Id: Idb1c2d5a382a704d8cc08fe03c55c883bfc95aa7
Reviewed-by: Christian Kamm <kamm@incasoftware.de>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-25 17:10:54 +02:00
Sze Howe Koh
a72d585f9b Doc: Restructure "Signal & Slots" article
Put sections with similar content together:
- Put "A Small Example" next to "A Real Example".
- Put "Signals and Slots", "Signals", and "Slots" together. Altogether,
  these 3 sections contain lots of repeated content and should be
  consolidated in a future commit.

This patch only moves content around without adding, removing, or
modifying content.

Change-Id: Ic6bf6a8b51f4785a8bbe6d230c2934f2c952104d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-09-25 16:50:45 +02:00
Sze Howe Koh
f5d58c0442 Doc: Remove irrelevant sections from "Signals & Slots"
- This article is not the right place to describe the low-level
  mechanisms of moc and qmake, or to discuss QMetaObject features that
  are unrelated to signals and slots.
- Most users never need to run moc directly.
- The current content only mentions qmake for moc automation, but CMake,
  QBS, and the Visual Studio Add-In can also do that.

In light of the above 3 points, let's simply link to the "Meta-Object
System" article for those who are interested in the behind-the-scenes
details.

Most of the content deleted by this patch are already discussed in
detail in the articles "The Meta-Object System" and "Using the Meta-
Object Compiler (moc)" (the former links to the latter). The exception
is Snippet 5 -- this is deleted without replacement because
qobject_cast() is a much safer alternative to QMetaObject::inherits()
with static_cast(), so we should encourage the former.

Change-Id: I638c888cedfcdfb818747edeb806213ebd54dfb6
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-09-25 16:50:41 +02:00
Richard Moe Gustavsen
4c08e3dfd5 QIOSInputContext: animate screen from current transformation
Since we assign a fromValue to the scroll animation directly, the
UIViewAnimationOptionBeginFromCurrentState flag does not have
any effect. So we need to set the fromValue based on the current
presentation state explicit.

The reason why we need to ensure that we scroll from the current
state is to avoid screen 'jumping' as a result of the scroll function
being called many times during the same event loop cycle during after a
focus change (focus object/window change, cursor rect change etc).

Change-Id: Id98f43d60ec5d028b113361dab953569accf9b3f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-09-25 16:30:52 +02:00
Richard Moe Gustavsen
956e88f23e QIOSInputContext: change keyboard rect when focus window changes
Since keyboard rect should be in window coordinates, it needs to
change when focus window changes.

Change-Id: I052aa5cadf182841d7c4eb114ebd1ea5317ff39c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-09-25 16:30:29 +02:00
Richard Moe Gustavsen
bd1e52db33 QIOSInputContext: report keyboard rect relative to focus window
After changes to how we scroll the screen, we need to change
the implementation for calculating the keyboard rect as well.

Change-Id: I7f468d55f6e29604b9c276deccd9926e071552a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-09-25 16:29:51 +02:00
Oliver Wolff
eedefa28bd Refactored qt_normalizePathSegments
There were several use cases that did not work with the old
implementation and it was not really readable.

Task-number: QTBUG-3472
Task-number: QTBUG-40067
Task-number: QTBUG-23892
Change-Id: I1e038792dc54cdc6f8d9bb59d80b11dd3c56fac6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-25 16:16:59 +02:00
Allan Sandfeld Jensen
cc3875c2e4 Balloon tip must follow systemtray icon
If the a message notification is created at the same time as the system
tray icon is embedded it may start at a wrong location, since the icon
location it bases its own location is not yet final.

This patch adds code to update the balloon tip location when the system
tray icon is moved or resized.

The bug and fix can be tested by the systray example by disabling the
icon and letting show message trigger both showing it and the message.

Change-Id: Ie1dc10489ad420e581e32afeb757c236fb5129ab
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-25 16:12:55 +02:00
Kai Koehne
568c26227d Silence moc warnings about 'argument mismatch'
The moc preprocessor is not necessarily fully compatible with the native
compiler preprocessor, which can lead to annoying warnings.

This fixes a problem particularly with the boost headers that rely on
MSVC only preprocessor features (to work around other MSVC preprocessor
deficiencies).

Task-number: QTBUG-29331
Change-Id: If884452969b512a746c81e235d31636b39c45b27
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-09-25 15:42:40 +02:00
Richard Moe Gustavsen
ee31bc59be iOS: don't show popup on call to setVisible
It turns out that setting visibility means whether or not the
menu should appear visible in a parent menu, and not to
actually show or hide the popup. This means that the only way
to show a popup is to call showPopup, which also makes
it simpler since we then always get a parent window as
argument that we can activate and get a focus object from.

Change-Id: Ie3866b5664294f9aa4d694fa422e8116e9c75ced
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-09-25 15:35:56 +02:00
Richard Moe Gustavsen
4dffab4c39 iOS: add support for submenus
Change-Id: I3816f2518125ad9c013ab578853295bf2c6bd02e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-09-25 15:35:52 +02:00
Richard Moe Gustavsen
28b5038d1b iOS: don't show separator in native menus
There might be menu types later that should show them, but
for now we just hide them.

Change-Id: Iac31e3204d8dcfd5beb5a2d5a372478ca811776c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-09-25 15:35:48 +02:00
Nico Vertriest
f1a8d7dc9b Doc: 2 minor corrections in corelib/plugin
Task-number: QTBUG-40362
Change-Id: I4fa4a69c13a60f8c7915b6c9659a4daaae4ecc1a
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-09-25 11:52:38 +02:00
Giuseppe D'Angelo
5c2d7b1635 XCB: fix a memory leak
An early return didn't deallocate a xkb_state struct.

Change-Id: I158ffc67030403636aceab985cc605888a31804b
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-25 10:52:11 +02:00
Jochen Seemann
faefd37db6 Fix MSVC2013-compiler warnings with QT_NO_FILESYSTEMWATCHER
dialogs\qfilesystemmodel.cpp(203,1667,1680): C4189: 'd': local variable is initialized but not referenced
dialogs\qfilesystemmodel.cpp(1547,1720,1847): C4100: 'variable': unreferenced formal parameter

Change-Id: Ic3cef264dcd0b939748bec914eb9c29f86f6ed0e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-25 06:50:09 +02:00
Friedemann Kleint
4b03b18548 Generate Show/Hide events for widgets when minimized state changes.
Fixes a regression against Qt 4, where Show/Hide events were received
when the minimized state changed.

It is restricted to QWidget so as not to introduce additional events
to QWindow (which already has signal visibilityChanged()) and cause
unexpected side effects in QQuickWindow.

Task-number: QTBUG-41312
Change-Id: Ib165a5daf7a7e5d8231ef8a94b70e8a2a3253057
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-24 23:07:15 +02:00
Gabriel de Dietrich
b5ae9d8efe QMacStyle: Improvements to some buttons on Yosemite
Radio button, checkbox and non-editable combobox, in normal,
small and mini sizes, and only in the inactive state.

This commit amends 982b9b7ec2.

Task-number: QTBUG-40833
Change-Id: If3f2bb215e9b8966cbf15f08fa252feb92483c7b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-24 15:39:40 +02:00
Matt Broadstone
f84b00c6d2 Expose QSqlDriverPrivate dbmsType in public QSqlDriver api
dbmsType was previously kept as a private variable in QSqlDriverPrivate,
however it's particularly useful for QODBC users.

[ChangeLog][QtSql][QSqlDriver] Add support for determining DBMS type from SQL driver.

Change-Id: If1c221520da9ac4ccef85a02db078679d76eac92
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-09-24 14:44:49 +02:00
Andy Shaw
eef1e51f97 Ensure a window with no stays on top flag is not staying on top
On Windows, if a window was previously staying on top then it needs to be
explicitly told to have HWND_NOTOPMOST set when it is recreated. If it was
not staying on top before the flag has no effect so it is safe to always
set it in this case.

Task-number: QTBUG-30359
Change-Id: I8be546886d6ae61032113c241f5903bcce04c163
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-24 14:39:04 +02:00
BogDan Vatra
1168ed8f6e Handle InsetDrawable.
Remove an unused function.

Change-Id: I79fda0fb56b0621e062a0ccb5bd68291d9ccdf50
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-09-24 13:52:55 +02:00
Matti Paaso
974c210835 Update license headers and add new license files
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3
- Removed LICENSE.GPL

Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-09-24 12:26:19 +02:00
Tor Arne Vestbø
28a57799ce iOS: Don't update screen properties for statusbar frame while rotating
The rotation will already result in laying out of the root viewcontroller,
so we don't need to send explicit geometry changes for the statubar change.
The properties of the screen at that point are also not consistent, as the
screen is about to rotate.

Change-Id: I1b45bee1c1224ca56f9e37068d68c4ee1bfeb9b6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-24 11:53:19 +02:00
Tor Arne Vestbø
f14d86c0f9 iOS: Reflect changes in statusbar height as QScreen availableGeometry
We detect changes to the statusbar height, eg. when the in-call 40px tall
statusbar is active, and ensure that the root viewcontroller view is laid
out again with new screen properties applied. To make the layout match
the animation of the statusbar height we apply the layout inside a
animation block.

Change-Id: I751d9d1273e833ef052a3a4f3d2777e1dffec7dd
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-24 11:53:14 +02:00
Tor Arne Vestbø
f1970c8916 iOS: Fix touch point translation when root view controller is offset
Instead of doing manual translation of the local touch point to global
screen (QScreen) coordinates we take advantage of the fact that QWindow
already has a position that's adjusted for all of the view-controller
offsets in its parent hierarchy.

Change-Id: Ib34173db5ac053c20712dfff469c4a1286f2a324
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-24 11:53:09 +02:00
Tor Arne Vestbø
0cd3416136 iOS: Simplify QWindow/UIView geometry mapping
As we now have a root viewcontroller that always has a geometry that matches
the containing UIWindow, we don't need to do any fancy calculations when
mapping between the two.

Change-Id: I08a7b9992be7b7238cbad2a2da20488bba1c0939
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-24 11:53:05 +02:00
Tor Arne Vestbø
e3a72a8aee iOS: Ensure root view controller always matches size of containing window
Change-Id: I249d847a1f4785b3e63e46759baed340b0d6362e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-24 11:52:58 +02:00
Tor Arne Vestbø
df734769d3 iOS: Move top level window management out of QIOSScreen to QIOSDesktopManagerView
The logic of how to deal with top level windows in the presence of rotation
or status bar changes should be confined to our custom QIOSViewController
that acts as a desktop manager for regular Qt applications.

We no longer treat windows with full-screen or maximized geometry but without
the matching window state flag as being targeted for auto-resizing. In the
future we might detect this case and warn the user that windows should have
the appropriate flags to be able to auto-resize on orientation changes.

Change-Id: Ibab09de5cf37e77c356fbf51a54a2fcec4bb5c51
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-24 11:52:50 +02:00
Tor Arne Vestbø
4f0cd0693a iOS: Calculate screen (available) geometry using [UIView convertRect]
Instead of custom logic to detect portrait/landscape and the height of
the status bar. The latter would fail when the statusbar/orientation was
set explicitly through [UIApplication setStatusBarOrientation], as the
statusbar would not follow the normal behavior of covering the top part
of the screen. The new code also handles upside-down portrait mode, as
well as iOS8's behavior of reporting screen bounds and application
frame in interface orientation instead of device orientation.

Change-Id: I54e3b99246a32e17aaba13960f456fa823768fd8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-24 11:52:40 +02:00
Tor Arne Vestbø
d2c925b977 iOS: Update screen properties more consistently
Instead of updating screen properties (and hence laying out top level
windows) in willAnimateRotationToInterfaceOrientation, we do it in
the more catch-all viewWillLayoutSubviews, which also handles changes
to the orientation while the application is in the background, as well
as changes to the statusbar frame/size, eg. while being in a call.

Change-Id: Ib4a08af2f3a56db426a10ff1ed819867895b5a5a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-24 11:52:38 +02:00
Tor Arne Vestbø
d61d638721 iOS: Scroll root view when keyboard is visible using sublayerTransform
We opt to use sublayerTransform instead of changing the root view's
bounds, so that we can keep the root view at the same position and
size regardless of statusbar height and visibility.

Change-Id: I3f04a4587f1108084208aefa990f91a130fb47b8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-24 11:52:28 +02:00
Tor Arne Vestbø
6742b250b5 Make QScreenPrivate constructor a bit clearer
Easier to read/understand that the screen properties are initialized
from the platformScreen.

Change-Id: I3084c3ac30a08cb4e154536f949475459212d2de
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-24 11:52:18 +02:00
Alessandro Portale
1fc8e089d8 Windows: devicePixelRatio aware QWindowsTheme::standardPixmap
QWindowsTheme::standardPixmap() takes a size parameter which is in user
space coordinates. This patch causes it to calculate the size in device
pixels, to get the image from the OS in the correct resolution and to
set the devicePixelratio of the returned pixmap accordingly.

Change-Id: Ifad5d0a26d5fd5945e37e432787d63ee79269295
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-24 11:34:23 +02:00
Nico Vertriest
0fe2c75273 Doc: Fixed autolink errors qtbase/kernel
Task-number: QTBUG-40362
Change-Id: I54a1111e39fb7e85d34ea97b937d2764d29b27a0
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-09-24 10:49:40 +02:00
Nico Vertriest
cf81bf2e2d Doc: corrected autolink errors qtbase/corelib/tools
Also corrected some minor language/spelling issues

Task-number: QTBUG-40362
Change-Id: I00d76521fc9beb4e7a4a83ff6dc3334a055a7148
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-09-24 10:49:09 +02:00
Eike Ziller
3ea0020d3b Abstract proxy model: Add missing delegation of supportedDragActions
Change-Id: I4d2519aaa46d3ca075330c6680dd3672249cbefe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-09-24 10:37:59 +02:00
Laszlo Agocs
276a5f5acf Change fallback OpenGL library name
Change-Id: I7f07699f860d0300f221b980b7d2fbe0dacbf4a1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-24 09:58:04 +02:00
Alex Blasche
b3bc6b9f7c Fix misleading documentation
Not every length parameter unit is accepted by Qt Style sheets.

Task-number: QTBUG-31907
Change-Id: I953c56caf68c1397ba24369f433d21c6f4772d0d
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-09-24 09:54:49 +02:00
Alex Blasche
d1fabb49a3 QXmlSimpleReader shall handle external entity reference file over 1k
This commit fixes a bug that causes QXmlSimpleReader to handle only
external reference files less than 1k. Instead of reading the
first 1k of the reference file, it reads all data from the file into
memory. The change is not optimal for memory management, but there does
not seem to be better solution without breaking the existing API.

A similar but incomplete patch was already applied to Qt 4.7 but never
made it into Qt 5. This patch is based on a Qt 4.7 patch and adds the
missing cases.

Task-number: QTBUG-26910
Change-Id: Ia4d055ded80a40ce76b79fc61ad585e8ebb719db
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-24 09:54:38 +02:00
Frederik Gladhorn
c96426f19f Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4 2014-09-24 12:04:52 +02:00
Sergey Radionov
2137cb7dc5 Windows: fix obvious mistyping in getSysColor
Change-Id: I1f215cdf17d85119535df35bbff1ee653ecc0ad5
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2014-09-24 09:46:57 +02:00
Friedemann Kleint
2d685b8316 Vista style: Scale hardcoded values in menu drawing code.
Fix the position of the menu gutter.

Change-Id: Ia8e056f14315f314d1e7a8b95a1ac87f6843e466
Task-number: QTBUG-40277
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-09-24 09:46:48 +02:00
Allan Sandfeld Jensen
91b7d53154 Fix QPixelFormat values
The two mono formats are actually indexed and may have both color and
alpha values in the color-table, and Format_ARGB4444_Premultiplied and
Format_ARGB6666_Premultiplied both have the alpha value in the end.

Change-Id: I7f1efb2213710f5eb628d71356f9c8ed75b50f4d
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-24 09:33:51 +02:00
Lars Knoll
44a381087e Add * as a valid token to our blacklisting
This helps to blacklist a test function on all platforms,
something that isn't easily possible currently. Adding

[testfunction]
*

to the BLACKLIST file will now blacklist the function
on all platforms.

Change-Id: I9e1a1daf94caa05408a6b3cd7ea7a3acdc962a43
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-24 08:58:42 +02:00
Nico Vertriest
2699d40b57 Doc: correction return statement QSqlDatabase QSqlTableModel::database()
Task-number: QTBUG-37358
Change-Id: I68a0110a01ac21871e8a369c7ab94d2dadf1d80b
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-09-24 08:49:19 +02:00
Jake Petroules
4cb679d888 Fix doc typo with Q_FORWARD_DECLARE_MUTABLE_CF_TYPE.
Change-Id: I2e6b00513be87640dc20831aab4e972716445e63
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-24 08:27:27 +02:00
Frederik Gladhorn
0c307f45fd Accessibility OS X: Fix image role
Change-Id: I0839a30041dbe558c420c944da49abe8ea26e0ab
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2014-09-23 22:33:29 +02:00
Louai Al-Khanji
4073a3dd77 direct2d: Fix font size when display scaling is in use
Since we already tell direct2d that we are using pixel sizes in the
QWindowsDirect2DDeviceContextPrivate constructor and thereby enable
scaling inside direct2d, there is no need to scale the font size again.

Change-Id: Id9c9ed4d2848bcd09f997e41fb87802a3fe2432b
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-23 21:08:20 +02:00
Marc Mutz
1ce6e432b6 QVersionNumber: correctly fail for numerically very large segments
The result of qstrtoull() was unconditionally truncated to an int,
resulting in wrong values being appended to the segments vector
when the numerical segment value was above INT_MAX.

Prevent this by first checking the return value of qstrtoull
as a qulonglong for values larger than INT_MAX and stopping
processing in that case. That means that segments that
numerically overflow an int are now considered part of the
suffix.

Also added tests for the case where a segment value is larger
than ULLONG_MAX. That was already working correctly.

Change-Id: Ia4b89021dcfe6bfae27c8d89bb678ec5e0e3b847
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-23 20:42:01 +02:00
Marc Mutz
42d4e054a6 QCommonStyle: remove references to QStyleOptionFrameV<n>
They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame.

Change-Id: I55539305df28267d0671a54a5cb7fcc17d045b8b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-23 20:21:14 +02:00
Marc Mutz
d488153fc2 QStyleSheetStyle: remove references to QStyleOptionFrameV<n>
They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame.

Change-Id: Ic165b524e8d86a0dd5355de338e87a33cd7429c7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-23 20:20:43 +02:00
Jochen Seemann
fbc4bce710 winrt: fix compiler warning on Windows Phone
qwinrtscreen(1010): 'd': local variable is initialized but not referenced

Change-Id: Ic21a9bc087d8418ad9f01b263677438a4db8f493
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-23 18:55:30 +02:00
Joerg Bornemann
541b387c10 emulate mouse move in default implementation of QPlatformCursor::setPos
When QCursor::setPos() is called and the platform plugin doesn't
implement QPlatformCursor::setPos, a warning is printed.
Additionally, we now emulate a mouse move to have a default
implementation that's actually useful.

QPlatformCursor::pos() now returns the position that was set by
QPlatformCursor::setPos(), or other facilities that generate mouse events,
for example the Tslib plugin.

Change-Id: Ifc539202765f311baad085f72347aeb732f7b2ba
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-23 18:53:42 +02:00
Kai Koehne
06c31bdbec Fix compilation of ANGLE for XP
Fix compilation errors when trying to compile ANGLE with e.g. MSVC2013
targeting XP.

Change-Id: I3238c47e198662c39e2ca0cb0e53153e8f13d442
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-23 18:29:23 +02:00
Richard Moe Gustavsen
55bd24e961 iOS: Implement support for native menus
Change-Id: I2c7278697499aa046ac7b1240b7bc713ad1fc709
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-09-23 17:51:28 +02:00
Thiago Macieira
79ad2b3799 Fix warning about sign change (ICC)
ICC doesn't like that you assign -1 to an unsigned variable. I could
have used ~0 to mean the same thing, but actually initialization isn't
necessary at all.

error #68: integer conversion resulted in a change of sign

Change-Id: I3e9116d7309f7a7ccd99b1adfa9bffaed1ff1c73
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-09-23 17:44:59 +02:00
Thiago Macieira
0048127c94 Initialize certain Qt environment variables in testcases
QtTest has its own logging environment, such as XML output, so we don't
want to have messages formatted differently than expected or sent to an
unexpected place.

Change-Id: If665c9d7121267269e5b2063f49468eb2b9b9d08
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2014-09-23 17:44:56 +02:00
Thiago Macieira
85ad88b064 Unify the environment variables used for console logging
[ChangeLog][Important behavior changes][Logging (including qDebug and
qWarning)] Support for the deprecated environment variables
QT_NO_JOURNALD_LOG and QT_ANDROID_PLAIN_LOG has been removed. Instead,
set QT_LOGGING_TO_CONSOLE to 1 to force logging to the console (stderr).
Set that variable to 0 to force logging to the system-specific event log
(if any).

Change-Id: I4800fc061752421f67aba1bf4535d524607579d5
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-23 17:44:29 +02:00
Maks Naumov
86922b4655 QRegion: Reorganise members to reduce padding in EdgeTableEntry
On 64-bit platforms: 64 -> 56 bytes.
On 32-bit platforms it's still the same size (44 bytes).

Change-Id: I681b9385ee3bc7601c1e8036efd6544471d1e058
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-23 17:32:58 +02:00
Andy Shaw
3b3ecb79a6 Fix compilation on OS X with macx-clang-32
Task-number: QTBUG-27335
Change-Id: I1703aee2d90e02b1a6ed386715bebddf6dedb9f5
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2014-09-23 17:05:36 +02:00
Alex Trotsenko
48a4a67e8d Fix QAbstractSocket::readData() behavior on buffered socket
Remove an useless check which spontaneously allow direct reads from the
socket engine.

Change-Id: Ia3d2a572d6f1563d613fe2f00d0d6849df259827
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-23 16:55:42 +02:00
Cristian Oneț
9165815c89 Fix the drawing of elided text in QHeaderView.
The text was not drawn properly because when eliding the text a fixed
value '4' was substracted from the rect to compute the available width
instead of the actual value of the header margin.

Change-Id: I1e110f1a6490679730ddf5815d3ff7b679dc1a47
Task-number: QTBUG-24772
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-09-23 16:34:39 +02:00
Shawn Rutledge
cb37ab8298 xcb: support Wacom touch devices; distinguish from tablets
A tablet which can also do touch will show up as several XInput
devices.  The touch device should be treated as a touch pad, not as
a tablet.

[ChangeLog][Platform Specific Changes][X11 / XCB] Wacom touch
devices are not mistaken for additional graphics tablets

Task-number: QTBUG-39572
Change-Id: I7a61a4c0d82925080edb0175b7d03870748f55ce
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-09-23 16:20:47 +02:00
Allan Sandfeld Jensen
710530bc55 Fix too fast zooming in QTextEdit with smooth scrolling events
Do not zoom 1pt on every single wheel-event, but instead scale
the zoom with the size of the angle delta.

Change-Id: Idbe17356c7845ebd0039f655d3e611e71c6f0dd6
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-23 15:59:38 +02:00
Marc Mutz
a2b453502c QCalendarWidget: fix a bug when parsing date/time formats
Quoting was not reset after consuming the quoted character.
This bug only manifests when a format contains two quoted
characters.

It's not possible to write an auto-test for this, since
the format is always read from the locale.

Change-Id: I39aff41f20f647c285c971b4d560f9e36d4b82fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-23 15:30:54 +02:00
Marc Mutz
181980d4a7 QCalendarWidget: move all helper classes into the unnamed namespace
Saves 1920 bytes of text size on AMD64 / GCC 4.7 release builds.

Change-Id: Ib437d285ca0555eb7a3751b53226093b71b789e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-23 15:30:49 +02:00
Marc Mutz
356ab736a7 QCalendarWidget: move QCalendarTextNavigator into qcalendarwidget.cpp
This is in preparation of a change putting all these helper classes
into the unnamed namespace.

Change-Id: I553b1e23b6cdbe6daa492c2dc4c26406ac580de3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-23 15:30:45 +02:00
Gabriel de Dietrich
abde2a59c6 Cocoa: Properly remove content view from its superview in setNSWindow()
-[NSWindow setContentView:] doesn't make assupmtions about where that
view comes from, and just attaches it to the window. We need to make
sure we detach it from its previous window by calling -[NSView
removeFromSuperview], or the previous NSWindow may keep references to
the view. This can be an  issue if the view is deleted right after.

Task-number: QTBUG-39628
Change-Id: I152dedcb64ac044d8ca290c9996b388809e2477b
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-23 13:29:21 +02:00
Allan Sandfeld Jensen
dfb4af1fd3 Fix spin box with fine grained wheel events
Only step the value in the spin box when we have accumulated one wheel
tick worth of wheel delta.

Also fixes the obsolete contructors of QWheelEvent so they set the non
obsolete properties.

Change-Id: Ic6ea4b37afa8eec85a6ca7bdc0d919bf8fb02608
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-23 11:35:30 +02:00
Allan Sandfeld Jensen
e8ef241d0f Use NonPremultipliedImageSrc shader when painting non-premuled images
Recognize non-premultiplied images and draw them using the existing
NonPremultipliedImageSrc shader so we save premultiplying them on the
CPU.

Change-Id: I3dfc8f9385ff91502d64ccabf4bf54049cc28040
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-23 11:29:43 +02:00
Christian Kandeler
e66a878838 QSettings: Don't chop off trailing tabs that were actually part of a value.
This was done wrong when using the ini format.

Task-number:  QTBUG-22461
Change-Id: Ib9390460bce6138659cceac7e3cd25339ba5e9bb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-23 11:28:58 +02:00
Frederik Gladhorn
c5a3e5edd9 Merge remote-tracking branch 'origin/5.3' into 5.4
The isAlwaysAskOption was removed in 3862171315
so manually removed code in
src/plugins/bearer/connman/qconnmanengine.cpp

Conflicts:
	src/corelib/global/qglobal.h
	src/corelib/tools/qcollator_macx.cpp
	src/corelib/tools/qstring.cpp
	src/gui/kernel/qwindow.cpp
	src/gui/kernel/qwindow_p.h
	src/gui/text/qtextengine.cpp
	src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
	src/plugins/platforms/android/qandroidinputcontext.cpp
	src/plugins/platforms/xcb/qglxintegration.cpp
	src/plugins/platforms/xcb/qglxintegration.h
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/testlib/qtestcase.cpp
	src/testlib/qtestlog.cpp
	src/widgets/dialogs/qfiledialog.cpp
	src/widgets/kernel/qwindowcontainer.cpp
	tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
	tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
	tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
	tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp

Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
2014-09-23 11:23:36 +02:00
Jonathan Liu
7b7ad02681 Improve checking for event/socket notifiers and timers
Starting/stopping timers from another thread may result in errors that
may not appear until hours, days or weeks after if a release build of
Qt is used with the GLib/UNIX event dispatchers. Such errors may
manifest as warnings such as "QObject::killTimer(): Error: timer id 7
is not valid for object 0x2a51b488 (), timer has not been killed" and
application crashes (e.g. crashes in malloc, realloc and
malloc_consolidate).

Initial-patch-by: Eike Ziller <eike.ziller@digia.com>
Task-number: QTBUG-40636
Change-Id: I2de50d50eb1fc7467fcebb9c73b74d2f85137933
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-23 00:47:34 +02:00
Thiago Macieira
3bfdacaaeb Document that default-constructed QFuture are canceled
Task-number: QTBUG-40680
Change-Id: Idee9ff75c89c8349be779b90ee9c34a899d92c0c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-09-22 19:13:31 +02:00
Giuseppe D'Angelo
0d48e774c6 Refactor some loops over EINTR
QT_CLOSE is #defined to be qt_safe_close which already performs
the EINTR loop. So there's no need of doing other loops
(either by hand or by the EINTR_LOOP macro).

Change-Id: Icca256124def5ab5d79c2ba101c6f889c85d19da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-22 18:57:23 +02:00
Giuseppe D'Angelo
bc5a1c6d3f QFile: fix undefined behavior when closing a buffered file
C11 §7.21.3.4 [Files] says that

    The value of a pointer to a FILE object is indeterminate
    after the associated file is closed

POSIX.1-2013 reinforces by saying that

    After the call to fclose(), any use of stream results
    in undefined behavior.

This means we can't call fclose() again on a FILE *,
even if fclose() returned EOF and set errno to EINTR.

Change-Id: I282f4ff926e3c134729defa290c80d42431e97ce
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-22 18:57:18 +02:00
Giuseppe D'Angelo
8f622fef41 Prevent a Coverity warning about a dangerous code path
Coverity warns that we may access the gray array without initializing
it. The array is initialized if d (the source image depth) is 8.

However, when doing ordered dithering, we don't check that depth
any more and just use the array. There are instead checks in place
for the other dither modes; the one for ordered has been commented
out before public history.

So, for the love of kittens, put the check back.

Change-Id: I1cc5ced8edbb626777e54e9f4e58f152c6b28ddc
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-22 18:57:12 +02:00
Giuseppe D'Angelo
fb8c795302 QTransform: initialize the d member
Although never used, the d member triggers all sorts of warnings
when copying a QTransform around because it's technically
undefined behavior (reading from an uninitialized variable).

Change-Id: If06b6bea6f0ec0623c38ba330d46958b373cdc65
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-22 18:57:08 +02:00
Giuseppe D'Angelo
8c2f0ac382 QObject: fix a memory leak in moveToThread
For some reason it seems to be supported to call moveToThread(0).
That call will allocate a new QThreadData for the object. However,
if we then detect that we're calling moveToThread from a thread
which is not the one the QObject has affinity with,
we error out leaking that QThreadData object.

Change-Id: I0fe6625a2a9887535e457f3897b514d2a03d1480
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-22 18:56:50 +02:00
Giuseppe D'Angelo
d9e1a0f05b QRegion: fix a memory leak
An early return in case of errors leaked memory tracked in a variable
in scope.

Change-Id: I68cd77890608caff54df7476d38850e5541ce76e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-22 18:56:45 +02:00
Giuseppe D'Angelo
772b799a83 XCB: fix a possible array overflow leading to a crash
The QClipboard::Mode returned from modeForAtom should be checked
everywhere because values greater than Selection (i.e. FindBuffer)
aren't supported on X and should mean error conditions.

The lack of such a check did an out-of-bounds array access, which
could lead to a crash.

Change-Id: I70f70b5f713ab2f892e258d4df2f7afeb434f0c1
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
2014-09-22 18:56:33 +02:00
Giuseppe D'Angelo
ebdd56c5bd XCB: fix a memory leak
An early return caused a leak of a new'd allocated object.

Change-Id: I9fbc37238dd49066d24363a2e8ee8bf35b155301
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-09-22 18:56:26 +02:00
Giuseppe D'Angelo
8259413e41 GTK syle: initialize all members of GdkColor
Coverity rightfully complains that we're copying a struct with an
uninitialized member, triggering undefined behavior.

Change-Id: I7635b859eb11e5eb9b825df8e23b453116059892
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-09-22 18:56:22 +02:00
Timur Pocheptsov
b4af1235ef OS X: File dialog does not show "Media" section.
This bug can be reproduced (AFAIK) only on 10.9. To fix it I suggest we create
NSOpenPanel/NSSavePanel
_every_ time it must be displayed. Actually, that's what I've seen in all code samples
I was able to found - nobody tries to retain this panel and re-use it.
If we re-use it, "Media" section magically disappears.
I believe this bug is not Qt's bug, but something weird in Cocoa.

Task-number: QTBUG-40655
Change-Id: Ic0e76e0a9a5444a76f336d511c0ff93f9fd05797
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-22 17:06:34 +02:00
Timur Pocheptsov
da0c74550f OS X: main window doesn't become key.
When ordering a key window out Cocoa
tries to find a new KEY window. Looks like it prefers the current MAIN
window and since QNSPanel is never a main window, Cocoa is breaking
the stack order. To avoid this - try to change the key
window BEFORE ordering out a window.
The application has a stack of all open windows (visible and hidden),
we iterate through this stack starting from our current key window
and look for the nearest window below, that can become a new key window.
Most probably, it will be our transient parent :)
This code will change (potentially) the key window _only_
if there is a transient parent.

Task-number: QTBUG-39809
Change-Id: I96b630799341875fc7e38dabf1ff6416338e687b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-22 17:06:24 +02:00
Eskil Abrahamsen Blomfeldt
412ec70f14 OS X: Fix menu item shortcuts without modifiers
A regression was introduced by bdebec4e2e.
The intention of the change was to avoid using Qt's shortcut mechanism
to trigger menu items which were already triggered through the regular
menu API in Cocoa. However, Cocoa has trouble with key equivalents that
do not have any keyboard modifiers. Thus, we have to allow these
particular key sequences to go through the regular system. I've verified
that the original bug is still fixed with this change.

[ChangeLog][OS X] Fixed menu item shortcuts without keyboard
modifiers.

Task-number: QTBUG-41192
Change-Id: I8f5a9cbc7a448b3cb0519baed95be5cbb630205c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-22 14:32:28 +02:00
Gabriel de Dietrich
65a991e57e Make sure we don't delete child QWindows if they have WA_NativeWindow set
Deleting a QWindow automatically deletes its child windows because
they are in the QObject hierarchy. However, if the user sets both
WA_NativeWindow and WA_DontCreateNativeAncestors, we can't just
delete that widget's QWindow. First because the widget doesn't get
notified (and maybe it should be), and then because we may invalidate
any reference to the QWindow the user may have kept.

Our solution is to reparent the child QWindows into the new parent's
closest QWindow. We must, however, take the precaution of not keeping
any reference to the backing store in the platform window. Reparenting
operations can trigger repaints on the platform window, but the backing
store is not set and flushed until later.

Task-number: QTBUG-38377
Change-Id: I353f5528f227a227b6d10419367cbe1d5d07a94e
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-09-22 14:11:08 +02:00
Giuseppe D'Angelo
87fbfe074b Fix a mishandling of the fd returned by socket(2)
socket(2) is allowed to return 0, so 0 should not be included
when checking for errors.

Change-Id: I0454ea60347d90078d3ab3046969add8d5c37935
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-22 14:08:57 +02:00
David Schulz
5d688c5780 Add backslash to the list of word separator.
Task-number: QTBUG-40384
Change-Id: I16ae1432f3bdd7e577593fc43336bf29c735a66b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-22 13:42:59 +02:00
Albert Astals Cid
a966b19b52 Fix crash in QNetworkAccessCacheBackend::closeDownstreamChannel
device is private, always null and class has no friends, so no need to have it at all

Change-Id: I320d47f1a712a3202c08b494563533e29d185501
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-22 13:42:03 +02:00
Friedemann Kleint
a6316e6e74 Fix emission of QDesktopWidget::workAreaResized().
Connect to QScreen::availableGeometryChanged().

Task-number: QTBUG-32567
Change-Id: I2097d80faa83ae062f7e149122fba26d23432e95
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-09-22 13:03:21 +02:00
Louai Al-Khanji
4918623f76 direct2d qpa: fix text selection
1cdcf64ad5 recently introduced a rendering
bug whereby certain clips would be handled incorrectly.

Change-Id: I3f486819c66b1d665243c8dc1e9d077dd2f64f25
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-22 13:00:11 +02:00
Christian Kandeler
c6c0eb084a Document non-intuitive behavior of QTreeWidgetItem::setHidden().
Task-number: QTBUG-30366
Change-Id: I02e098fbf0e3a44794ed0e1b1bf533c1c9ad5632
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-09-22 12:38:17 +02:00
Mitch Curtis
3312ac9169 Correct information about all headers being movable.
This only applies to QTreeView.

8eb3d724a9 introduced this error.

Change-Id: Ia8a2c387afbd19e4d98ea6f81e5ce6409d79bcd9
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-09-22 09:13:38 +02:00
Pierre Rossi
52db71f191 [Bearer] Try a bit harder to open a network session
The symptoms were made apparent in the xmlpatterns command line
utility when trying to use the synchronous HTTP code path in
QXmlQuery for fetching schemas.

Change-Id: I93b283fdec4b501a5c1fc646f7ddc30d8407f5ae
Reviewed-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
2014-09-22 09:08:06 +02:00
Maks Naumov
d41c5f9dba Remove unused variable in QStyleSheetStyle::hasStyleRule()
Change-Id: I052fcc067ffbd1d470593d16af5f2189541c6264
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-22 05:43:23 +02:00
Lars Knoll
10414444e1 Add support for blacklisting test functions
We need to have a finer grained control over the tests
we skip in our CI system. This adds a blacklisting
mechanism that allows blacklisting individual test
functions (or even test data) using a set of predefined
matching keys for the operating system and some other
relevant variables.

QTestlib will search for a file called BLACKLIST in the test
directory and parse it if found. The file contains a simple
ini style list of functions to blacklist. For details see
qtestblacklist.cpp.

Change-Id: Id3fae4b264ca99970cbf9f45bfb85fa75c1fd823
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-21 20:58:41 +02:00
Alex Blasche
23a03ebcd1 Fix crash in QCombobox when resetting model during currentIndexChanged()
Task-number: QTBUG-20415
Change-Id: Idffc0f29cc55d834c2736ce7562dd7cfe912d327
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-21 02:24:53 +02:00
Andy Shaw
b53f6fdd31 Respect the PM_SmallIconSize setting for icons in a menu on OS X
When a platform menu is used then it would hard code the icon size to
16x16. Instead of using the hard coded value then PM_SmallIconSize should
be used instead.

Change-Id: I27540ebc4397501e8f57686a118c28cd7167c0a1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-20 18:23:35 +02:00
Dyami Caliri
dbd400b937 Fix memory leak of QSettings in QLibraryInfo::platformPluginArguments
The code calls QLibraryInfoPrivate::findConfiguration() to get a
new QSettings object but was not deleting it.

Change-Id: I207a7ff55f87aff91e2898a99e9cac06d57c5f7d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-20 16:42:08 +02:00
Tor Arne Vestbø
e98b5cddeb iOS: Allow settings custom input and accessory views through ImPlatformData
Change-Id: Ib802c73f9c9e27853fa0dd25c304d77df570309e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-20 11:53:43 +02:00
Tor Arne Vestbø
6910b8a552 iOS: Refactor text input handling to standalone responder
Instead of coupling the visibility of the virtual keyboard to
the first-responder status of the currently active QUIView, we
now treat first-responder as a separate state, tied directly
to QWindow activation. This fits better with the concept of
first-responders in iOS, as a UIView can become first-responder
without dealing with text input, eg when dealing with touch
events or menu actions.

The decision point on whether or not to show the virtual
keyboard is then handled by implementing the conformsToProtocol
method and selectively returning YES for the UIKeyInput protocol.
iOS internally calls _requiresKeyboardWhenFirstResponder on the
UIResponder to determine this, but since we can't override a
private method (like WKContentView in WebKit does) we have to
rely on the fact that the implementation of the method uses the
protocol conformance to make its decision.

Once the virtual keyboard is up, we then need to react to changes
to its configuration, such as keyboard type or the type of return
key. Normally this would be a simple call to [view reloadInputViews],
but iOS will not reload the built-in keyboards unless the UIResponder
returns YES for _requiresKeyboardResetOnReload. Since we again can't
override this private method (like WebKit does), we work around it
by taking advantage of the fact that iOS will treat any change to
the first-responder as a reason to do a keyboard reset. By using
a stand-alone UIResponder for text input we can init and destroy
these responders as needed, so that every call to reloadInputViews
will trigger a reset, as the responder has not been seen before.

We keep track of changes to the input-method-query, and detect
whether or not we need to bring up a new UIResponder for text
handling.

As part of this refactoring we now tie the visibility of the
virtual keyboard to the presence of a focus object that has
input-methods enabled. This means that we automatically will
track changes to input-elements through the focus changes,
and reconfigure or hide the keyboard as appropriate. As a
result the hide() method of QInputMethod becomes a no-op on
iOS.

Change-Id: I4c4834df490bc8b0bac32aeedbd819780bd5aaba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-20 11:53:28 +02:00
Eskil Abrahamsen Blomfeldt
6e4dc7073a Fix default implementations of raster ops
In the list of default implementations, the raster ops added in
ae0ddb8c72 were all offset by one
composition mode because of a duplicate entry in the array. The
effect would be, e.g. that using the NotDestination operator would
resolve to the Set operator instead.

Most users will probably not have experienced this since any of
the asm-based functions will be preferred.

[ChangeLog][Painting] Fixed some very rare cases of mismatched
raster modes in QPainter.

Change-Id: Ia242b54c78acbe1c89d9b4ecd10936564ec134b2
Task-number: QTBUG-41413
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-09-20 10:54:02 +02:00
Tor Arne Vestbø
bbacf3d79d a11y: Don't try to update accessibility if there's no interface
Change-Id: I970729e65ba0eb857e6974f9947f27ae8e6410c3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-09-20 00:21:30 +02:00
Tor Arne Vestbø
076d22efa6 a11y: Make QAccessibleButton and friends resolve role dynamically
The role may changed based on the checkable state of the button, eg, so
we need to resolve the role at runtime instead of hard-coding it in the
constructor.

Change-Id: I78faee08189c5510ca9964b07ad94bcf5d4fa11b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-09-20 00:21:24 +02:00
Alexander Volkov
40add779bd xcb: Fix memory leaks in DnD
Change-Id: Ie19711c17769128db67a0b083ef72109f49bfe78
Spotted-by: Alexander Smirnov
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-19 23:31:37 +02:00
Alexander Volkov
34de989a94 Keep a source of propagated mouse events
Synthesized mouse events should not cause mouse events which
look like they were obtained from the system.
So set the source of generated events from the original event.

Change-Id: I862829446ac6ef664e1b8e4a5b54ed11926a1d4b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-19 23:31:30 +02:00
Alexander Volkov
ba46c0eef5 Set a missing source for mouse events synthesized by Qt
Mouse events synthesized from touch events by Qt
should be marked as Qt::MouseEventSynthesizedByQt.

Change-Id: I73612621a0248440b3b773f1280395c05c55e4aa
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-19 23:31:22 +02:00
Dyami Caliri
b08b536f20 Windows qpa: fix minimum allowed fixed height, width on windows
A window width constraint coded in Qt4.8 was accidentally applied
to the height in Qt5. Upon further review, it does not seem that
this constraint is needed, in any case. Different versions of
Windows have different minimum window widths (8.1 had 124px
instead of 112), and setting a smaller value seems to cause no
harm.

Task-number: QTBUG-32820
Change-Id: I21ad6d406abf7344aff54d32b41974265aa9ea81
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-09-19 19:15:55 +02:00
Dyami Caliri
75e5ffe0f7 Update widget winId when screen changes
When a window's screen changes it may recreate the platform window.
In that case, update the winId in the widget to keep it in sync.

Task-number: QTBUG-40681
Change-Id: Iec815320214832bb63952de3a5bd1340a04dacd4
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-19 19:15:42 +02:00
Andy Shaw
a5df2e7120 Cocoa: Handle insertNewLine selector for when it is sent while composing text
Some IMEs will perform an insertNewLine when Return/Enter is pressed while
composing text as well as causing the edit to finish. By handling this it
will ensure that the extra enter/return event is sent when the IME
requests it.

Task-id: QTBUG-39125
Change-Id: Ice6eded68e6b1dc51703a38316f76f78099923da
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-19 09:35:56 +02:00
Allan Sandfeld Jensen
ca36198251 QPaintBuffer paints drawGlyphRun with wrong font
If QRawFont and and drawGlyphRun is used on a QPaintBuffer it will lose
the QRawFont and end up painting with primary font at the time.

With this patch, QStaticTextItem can now indicate that they must be
drawn using the supplied font-engine and that the font information is
not enough.

Change-Id: Id6bd376d797d2bfb457e7de55c48bdcf9f20ae38
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-19 02:55:29 +02:00
Allan Sandfeld Jensen
4453bfcb20 Restore -qt-block-indent on <li> elements
Task-number: QTBUG-20877
Change-Id: If049065ed99eaf8ffc85c8ff54d3da892a095795
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-18 17:55:03 +02:00
Laszlo Agocs
5d5de7a97f QOpenGLWidget: Play nice with empty paintGL
Applications that do not override paintGL() (may happen in some test code)
will not perform any GL rendering, not even clearing. This is fine, but
to be safe we need to do a clear right after creating the FBO in order to
prevent showing garbage.

Task-number: QTBUG-38327
Change-Id: If062901bb18724f961e41856085470e37b49abbe
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-18 17:45:05 +02:00
lasconic
4aba2d07d2 Use metrics returned by GetGlyphOutline in GGO_METRICS mode
GetGlyphOutline Windows API returns wrong values when used with an
OpenType PS font and in GGO_NATIVE mode. It causes problem when
exporting to PDF. The fix changes the GetGlyphOutline call to use
GGO_METRICS instead.

Task-number: QTBUG-12799
Change-Id: I47d6d16b6e7819b51bc444420ada4a47d5f24f4e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-18 17:44:37 +02:00
Adam Majer
1fa3627423 Remove reference to removed qatomic_sparc.h
qatomic_sparc.h was removed previously as part of general cleanup of
old atomic code for Qt 5.3. Unfortunately SPARC include reference was
not removed resulting in build failure on that platform.

Task-number: QTBUG-41384
Change-Id: Ic6e31b32324b0e5dd3700a6a21515a8eea5668bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-18 15:58:13 +02:00
Eskil Abrahamsen Blomfeldt
a614bc6e39 Cocoa: Always add Arial Unicode MS to fallback list
The fallbacks on the platform should ideally contain all fonts that
support the script passed in, but this would require populating the
font database and checking the unicode ranges for all fonts, so it
would cause a significant performance hit on Mac. What we do here
instead is just return a set of default fonts as the fallbacks
and disregard the requested script.

The consequence of this is that some special unicode codepoints were
not supported on Mac, because we weren't working with a full fallback
list.

To rectify this without breaking performance, we always add Arial
Unicode MS to the end of the fallback list as a final fallback.
This should always be present on the system and has a wide support
of different scripts.

[ChangeLog][OS X][Fonts] Fixed missing glyph box shown in place of some
uncommon Unicode code points.

Change-Id: I4fc8576bfddc8a73204aca2b16437d42c524bc79
Task-number: QTBUG-40986
Task-number: QTBUG-40549
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-09-18 13:42:32 +02:00
Laszlo Agocs
1e41e9b77d Add a note about winId() to QOpenGLWidget docs
Task-number: QTBUG-40765
Change-Id: I0dbb010bb96c6b41c67392b8846782a354481e5e
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-18 10:06:49 +02:00
Laszlo Agocs
add7c0aadd Propagate swap interval from QOpenGLWidget to the tlw
Otherwise it is impossible to set a swap interval different
than the one set by QSurfaceFormat::setDefaultFormat().

Both windows and xcb will pick up the updated interval from the
window on the next frame.

Change-Id: I55a59f83a62d3adcea687adf28639646b576ed58
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-18 10:05:55 +02:00
Giuseppe D'Angelo
6fd5870df0 Deprecate the QStyleOptionProgressBar::orientation member
Its contents are already inside the "state" member.
Fixes a "TODO" for Qt 5 (bumping it to Qt 6, where we will be
able to break API).

[ChangeLog][QtWidgets][Styles] The usage of the
QStyleOptionProgressBar::orientation member has been deprecated.

Task-number: QTBUG-25121
Change-Id: Ie531bb2f2733b15a213e83c9706468e2bf829359
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-18 09:57:28 +02:00
Marc Mutz
40d59496fb QCommonStyle: cache the xpm QPixmaps
The QPixmap(const char* const*) ctor featured prominently in the callgrind
trace of tst_qmdi*, with 23% of total time spent there in tst_qmdiarea
before the change.

Cache the results in the QPixmapCache. That's probably a good idea for all
standardPixmap()s, but none other feature prominently in any of the
widgets/widgets auto-tests, so there's no immediate need to do something
about it.

After the change, less than 3.5% of the total time is spent on parsing
XPMs.

Change-Id: Idfb6ffe0d0f7a4a1f71a7c26fc9ab0f42bdbd7a8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-18 09:46:48 +02:00
Mitch Curtis
f222d520cd Add missing period to QHeaderView documentation.
Change-Id: Ibf3fdb4e1c149b2dbee7bf3043cec9d3e167381d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-18 07:11:36 +02:00
Mitch Curtis
8eb3d724a9 Improve documentation regarding moving item view columns.
The only way I was able to find information on this was through bug
reports.

Change-Id: Iac59a82fab9c216495860ad3b1efad1125130002
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-18 07:11:17 +02:00
Allan Sandfeld Jensen
9b556afc5a Fix menu mnemonic inside ligatures
The code to draw underlines on specific characters in widget menu could
not handle ligatures. Instead of using special code to handle this case
this patch changes the mnemonic underlines to use normal format-ranges
making the text engine deal with splitting ligatures as necessary.

Task-number: QTBUG-20960
Change-Id: I6159110eae7aa8c819af16ba4a393d758871e2e0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-18 00:13:28 +02:00
Dyami Caliri
82dbea55a7 OS X: Add scan code mappings for Escape, Return and function keys.
In OS X, certain keyboard layouts (such as Japanese) do not produce
unicode character conversions for Escape and other keys. In these cases
the code uses a fallback scan code check to map the key. The scan code
mapping had the function keys, but there are several other important
keys it can map.

Task-number: QTBUG-41090
Change-Id: I624793c9bb28ae8c98b54539c277943905cac7e2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-17 22:35:16 +02:00
Frederik Gladhorn
a72d34d26e Merge remote-tracking branch 'origin/5.3.2' into 5.3
Change-Id: Iae36a5178c0411d4d36508e0725e132af390157a
2014-09-17 20:57:50 +02:00
Maks Naumov
1394962ceb Remove pointless check in QImageData::create()
"height <= 0" already verified above.

Change-Id: Ia2ab90a4cd5533f7b5101686876c2c2cc3e275ac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-17 20:38:15 +02:00
Allan Sandfeld Jensen
d84a6eab51 Add Grayscale8 and Alpha8 formats to QImage and drawing
Extend the QImage format with two 8-bit grayscale and alpha formats.
These formats have the advantage over Indexed8 that they have simpler
conversion and can be rendered to by the raster engine.

[ChangeLog][QtGui][QImage] Added support grayscale and alpha 8-bit
formats which can also be rendered to.

Change-Id: I4343c80a92a3dda196aa38d0c3ea251b094fc274
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-17 14:48:48 +02:00
Jan Arve Saether
bce19cb906 Fusion Style: Workaround to get combo box item style from QtQuick Ctrls
This is to align the behaviour with how QGtkStyles behavior is.

Change-Id: Ic85d96cf4a4ab30974b25936de6d5b98e65dd2f3
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-17 11:34:55 +02:00
Erik Verbruggen
e409eafe23 OSX: emit aboutToShow signal for top-level dock menu.
Qt sets a QCocoaMenuDelegate on every menu it creates in order to emit
the (OSX specific) aboutToShow signal. However, there are a few cases
where OSX will copy a menu without copying the delegate. One of those
cases is the dock: the result of -[NSApplication applicationDockMenu:]
is used to create a new menu, to which a few more items are copied.
This copy is then send back to the dock.

This patch invokes the delegate's -menuWillOpen: method when
-[NSApplication applicationDockMenu:] is called. Note that sub-menus
won't receive the call-back, because the dock doesn't tell the
application what happens after returning from applicationDockMenu:.

Task-number: QTBUG-39604
Change-Id: I0e06df371a3d77342ae4b7148041214e5c4579d7
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-16 22:42:50 +02:00
Giuseppe D'Angelo
bb3d2ca9f1 QToolButton: properly reset the size hint when a menu is set on it
QToolButton::sizeHint() takes into account the presence of a menu.
However, setMenu() doesn't retrigger a size hint recalculation. Hence,
(un)setting a menu on an already sized tool button won't properly
reset the size hint. Since the calculated size hint is cached,
delete the cached value and call updateGeometry to cause a
recalculation.

Task-number: QTBUG-38949
Change-Id: I6e79e5e70e31afdfd129282b3668875eca86f51d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-16 22:42:47 +02:00
Eike Ziller
055622ed48 OS X: Fix positioning of popup menus in case of native NSWindows
The code transformed the coordinates from the view to the window's
content view, and since that content view is flipped in the pure
Qt world (content view == QNSView), it manually flipped the
coordinates to transform from that to window coordinates.

Instead just directly transform the view coordinates to window
coordinates using standard Cocoa methods, which then works with
any kind of content view and NSWindow configuration.

Task-number: QTBUG-40958
Change-Id: Idddd327fe9cff3309606379d0e04ee8b4bd5eece
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-16 22:42:43 +02:00
Alexander Volkov
80ca159b47 Fix saving handle width in QSplitter::saveState()
QSplitter::handleWidth() returns either a style dependent value if
d->handleWidth is negative or the value of d->handleWidth itself.
So to preserve this choice after calling saveState()/restoreState()
we should save and restore the value of d->handleWidth rather than a
result of handleWidth() which is non-negative.

Change-Id: Idc11f8063d34b6c4a5f9b0a0032868679766dfb9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-16 20:35:31 +02:00
Alexander Volkov
eb6507039f Allow overriding standardIcon() in a proxy style
[ChangeLog][QtWidgets][Styles] Allow overriding standardIcon() in a proxy style

Change-Id: I3c7983a7e51a8b220a0ca8ead2b4d7b87a77d71b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-16 20:35:21 +02:00
Louai Al-Khanji
4f25bdd21a EGLFS KMS Hooks: Get rid of flashing
Change-Id: I590572ceb0f64d3e6a1d687874d549e84f20f60a
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 15:43:23 +02:00
Louai Al-Khanji
fabef06f33 EGLFS KMS Hooks: Add HW cursor support
Change-Id: I9cd62f3cbcc4ab844f05c43e775512b72d4ff159
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 15:43:18 +02:00
Jocelyn Turcotte
18b0aaab77 Fix QT_LINUX_ACCESSIBILITY_ALWAYS_ON
The current behavior was that accessibility is enabled if the variable
is _not_ set, which causes accessibility to be enabled all the time even
if a screen reader isn't present.

Change-Id: I73286622fb5abe1cedce420e760306ab7f200e69
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Tomasz Olszak <olszak.tomasz@gmail.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-09-16 14:34:44 +02:00
Mitch Curtis
6ecc1e8006 Respect Qt::FontRole for QComboBox items.
Change-Id: I810ae2d77109a36b457f07e4a7b0489c954279e8
Task-number: QTBUG-41131
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-16 14:33:33 +02:00
Michael Brüning
16b72baf2e Fix Windows ICU build break in QCollator after commit c17563ec.
It used LCID without including qt_windows.h while QT_USE_ICU was
defined.

Change-Id: I3d4cf0e6bd0e299729d23d9a36c5a87adde774c9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-16 14:12:32 +02:00
Alexander Volkov
a9d029974e Change the state of only the left mouse button when sending fake mouse events
Mouse events synthesized from touch events affect only the left mouse button.
So preserve the state of other buttons.

Change-Id: I628d41089db39f0c983aa95f311a842111b8c39c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 14:02:32 +02:00
Mitch Curtis
05605b774e Rephrase sentence in QIntValidator documentation.
Change-Id: I53b4e4615ad23a603bc724b896de5fd1644cdab0
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-09-16 13:28:52 +02:00
hjk
f14470fa00 Add some minimal size checking for dynamically loaded resources
This covers the case in the bug report, but not much more.

Task-number: QTBUG-21254
Change-Id: Ie191a39ceddd7e58a0d8baf7d01f2a08c70162e5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-16 13:04:59 +02:00
Robin Burchell
b4da15a5ef QDateTimePrivate: Add a note about wasted space
And a comment to fix it when the tooling situation improves.

Change-Id: I79781da18a36d4e11cede8477f90f216e08bffe2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-16 12:25:25 +02:00
Jørgen Lind
0ed68f3f58 Refactor the sloppy submenu logic
And enable the style to control the behavior of the sloppy submenus

[ChangeLog][QtWidgets][QMenu] QMenu now pick up how "sloppy" submenus
behave from the style

Task-number: QTBUG-20094
Change-Id: Ib1a9770d9b63028033cc360ae236471449d00267
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-16 12:03:20 +02:00
Louai Al-Khanji
fb44d3838a EGLFS: Do not assume all hooks will want to create a QEGLPlatformCursor
Change-Id: I05502c27d697524fb4c4d4ccc3aec0e59589fe24
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 10:35:35 +02:00
Louai Al-Khanji
e22fcc8c06 Add presentBuffer method to EGLFS KMS hooks.
Change-Id: Ia7e4aec30ced249ab8a9feb59401d02f250193a0
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 10:35:29 +02:00
Louai Al-Khanji
0e02f16cea Add presentBuffer method to EGLFS hooks.
Change-Id: Iab5674fe9407d3ab447ef6c16577b24fa60d42aa
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 10:35:25 +02:00
Maks Naumov
ee324e4ed5 QRegion: Reorganise members to reduce padding in QRegionPrivate
On 64-bit platforms: 56 -> 48 bytes.
On 32-bit platforms it's still the same size (44 bytes).

Change-Id: Ia4831753258ef12aa983757523bb76979e6fc4b0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-16 05:48:46 +02:00
Giuseppe D'Angelo
b2b9fdfda0 QSizeGrip: use a QPointer to the tracked TLW
And not a normal pointer. The problem is that in certain scenarios,
if the TLW containing a QSizeGrip changes and the old TLW gets
immediately destroyed, then the mechanism which updates the tracked
TLW is run too late, and ends up accessing a dangling pointer.
Therefore, we need to protect that pointer via a smart pointer.

Task-number: QTBUG-22867
Change-Id: Icfb051132bacde604f660ac7a98bc0a9d1022c68
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-15 20:50:50 +02:00
Laszlo Agocs
75ae4dacbc Fix high dpi support in QOpenGLWindow
Change-Id: I0be29fb25d854e09ae961cade0c8490586788394
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-15 18:57:54 +02:00
Laszlo Agocs
bde9387dba Do not drop the context when sharing globally
There is no point in recreating the QOpenGLWidget's
context when it shares with all top-levels'
shareContext().

Change-Id: I659a8ef6563de0cc1e833198af4dfb8c705e40d8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-15 18:57:48 +02:00
Laszlo Agocs
75834c2232 Fix drag and drop with createWindowContainer
Forward dnd events to the QWindow, exactly like QQuickWidget would do.
This of course requires setting setAcceptDrops(true) on the container widget.

Task-number: QTBUG-39213
Change-Id: I8ea49e630b071dc0aacd53f798d9b46b03502365
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-15 18:57:35 +02:00
Daniel Teske
46ebcb6176 Speed up QStringList::removeDuplicates by ~2x
QSet::contains needs to hash the string, which is unnecessary, since we
can just check if the size of the set changed.

Change-Id: I2c7a42bae6cdf351533d5a582a42079658fa7729
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-15 17:44:52 +02:00
Robin Burchell
46b2c74eaf QFontDatabase: Micro-optimize getFontWeight.
Translation is an expensive thing, and probably quite uncommon - so don't
penalise any common cases by checking for it until we're quite sure they have
failed.

In addition, we avoid repeated string construction when translating (caching the
result) and avoid repeated case-insensitive comparison by toLowering the string
data.

This change either speeds up most runtime cases that were unfairly penalised
(such as "light") by 50-70% or doesn't impact the runtime speed at all (or,
results were within the margin-of-error).

Of course, calling with translated content will be a bit slower now, but the
slowness of the translations should more than dwarf the real change there.

Change-Id: If24685dfd553e4aed07fbf07678b2585e22b0a3a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-15 17:21:11 +02:00
Kai Koehne
0fa0608f70 Logging: Remove use of _declspec(thread)
thread-local variables are known to be broken on Windows XP if the
library is loaded dynamically. This has been fixed since Windows Vista,
but to avoid any elaborate runtime checking of the OS version we're just
removing the logic alltogether for MSVC / Windows.

Task-number: QTBUG-41008
Change-Id: I64ee95270d142294c975a5890d6e1b62a833b6ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-15 15:58:40 +02:00
Oliver Wolff
d4d752e241 QWindowsWindow: Fixed warning text
Change-Id: I80019f705edcf3b5f974af72ef86b45546582210
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-15 15:58:36 +02:00
Aki Koskinen
a3b88a0025 Improved documentation for QStyledItemDelegate::eventFilter
Added the notion that enter and return keys are not handled
if editor is of type QTextEdit or QPlainTextEdit.

Change-Id: I9d5cb529bf154c687fab1949fccf37e9da096c85
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-09-15 15:58:06 +02:00
Oswald Buddenhagen
1da57ecd06 fix bogus library paths in ANGLE prl files
Task-number: QTBUG-41204
Change-Id: I3ddcba23467e7df3a4449c4960972f37810ed323
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-09-15 15:58:03 +02:00
Robin Burchell
1c4786389d QDateTime: Micro-optimize by using QString::fromLatin1 instead of QString::fromUtf8.
This data is clearly not (and will never be) utf8 data, so using fromLatin1
avoids the (slightly more expensive) utf8 mangling.

I didn't see any significant impact on benchmarks, but I also wasn't
specifically collecting data when making this change.

Change-Id: I45190d40b2caccf15b1f9a1ae5b7dcd08cbd541f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-15 12:33:08 +02:00
Robin Burchell
5857809cc5 QDate: Micro-optimize for fromStringIso benchmark.
By using QStringRef instead of QString, we avoid a data copy. This takes the
QDateTime::fromStringIso benchmark from 0.79ms to 0.53ms for me.

Change-Id: Ibb36067491ffc275ce3b667cb0e04941aa9457f0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-15 12:32:52 +02:00
Tim Blechmann
739f98aa09 cocoa: fix namespace manging for QNSView
Change-Id: I83035b45cabd938a9fdfa3a5d12de2c1793b30b3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-15 10:29:38 +02:00
Tim Blechmann
1126701f8c cocoa: don't override NSApplication-sendEvent if configured as AA_MacPluginApplication
Change-Id: I48cebbcb814ee8e97583c3165e7cb668077cfbad
Task-number: QTBUG-40409
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-15 10:29:25 +02:00
Alexander Volkov
256df2484c Make the default value of QTreeView::indentation() be style dependent
Add a new PM_TreeViewIndentaion enum value to QStyle and get
the corresponding pixel metric in QTreeView.

[ChangeLog][QtWidgets][QTreeView] Indentation is now style-dependent by default.

[ChangeLog][QtWidgets][QTreeView] Added resetIndentation().

Change-Id: Ifad7987b8f3c6cd32987b89d95390f33043d8f19
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Adam Majer <adamm@zombino.com>
2014-09-15 10:05:25 +02:00
Samuel Gaist
897346604e QTextDocument: code cleanup
Improve code readability using by-pointer rather than
by reference out argument.

Change-Id: Icf2d609f1b63feac7b1674b357fe64473bfa8f3f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-15 09:36:16 +02:00
Samuel Gaist
eb5dc9ed1c QTextDocument: Correct parameter documentation
Change-Id: Ie91aa2731732e4a6a1abdc2fc7ae00876c5d76e2
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-15 09:36:05 +02:00
Samuel Gaist
d3a5321e57 QTextDocument: doc and function parameter name cleanup
Change-Id: Idecdf66da0d00cbede6ca5b742d10cf536f366d2
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-09-15 09:35:51 +02:00
Samuel Gaist
4066a6a893 Add QRegularExpression support to QTextDocument
Currently QTextDocuement only provides find using QRegExp. This patch
aims to add support for QRegularExpression.

[ChangeLog][QtGui][QTextDocument] Support for searching with a
QRegularExpression in a document has been added.

Change-Id: I6dba10545b83995d093407038a821fe54db3d261
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-15 09:35:47 +02:00
Lars Knoll
0c748fb7b1 Fix 64 bit issues in QIODevicePrivateLinearBuffer
The API was using int, not qint64 leading to implicit
truncation of numbers in a few places

Task-number: QTBUG-40974
Change-Id: I13aedc84557a19b6f74fe6825764e7b5827f27b0
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-09-15 08:08:42 +02:00
Laszlo Agocs
0f92875891 Use default surface format in QOffscreenSurface
Change-Id: I3b2f790089e6d1bcfe92f2f732489c08afa766cd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-14 12:17:27 +02:00
Jake Petroules
4e8720d413 Use new, supported APIs in OS X 10.10 and iOS 8.0 to get the OS version.
Gestalt is deprecated so we can't use it long term. At the same time,
the new API is cross platform, so we'll no longer have to parse strings
in -[UIDevice systemVersion] either.

Change-Id: Ic81797174c1a3d50b47b9b209205a6a506cc75ef
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2014-09-12 22:01:58 +02:00
Dong-Heon Jung
992baedb8b QNetworkDiskCache: fix expiration calculation heuristic with Last-Modified time
Heuristic with last-modified time in Qt has some problems.
1) Remove redundant expirationDate.isInvalid() check
expirationDate.isInvalid is already checked. So I removed.

2) Add dateHeader.isInvalid() check
The dateHeader is used in expiration calculation.
I add invalid check for the dateHeader.
*. The dateHeader is the origin server's Date

3) Change diff time calculation.
The expirationDate is calculated with time diff.

Previous calculation is
// The lastModified is earlier than the currentDateTime.
// The diff has negative value.
int diff = currentDateTime.secsTo(lastModified);
// The expirationDate is earlier than lastModified
// , currentDateTime and dateHeader.
expirationDate = lastModified.addSecs(diff / 10);
*. currentDateTime: current time
*. lastModified: last modified date in server

It means that files are not cached with the heuristic.

I changed diff calculation.
int diff = lastModified.secsTo(dateHeader);
freshness_lifetime = diff / 10; // RFC 2616 13.2.4

4) httpRequest.headerField setting
If current_age is larger than 1 day, the cache MUST attach Warning 113.
*. The current_age is value of age in header
   or elapsed time from dateHeader in Qt source code.

Previous code does not check current_age is larger than 1 day correctly.
// dt = 1970-01-01T00:00:00 + current_age
dt.setTime_t(current_age);
// currentDateTime is much bigger than 1970-01-01T00:00:00
if (dt.daysTo(currentDateTime) > 1)

Task-number: QTBUG-40836
Change-Id: I4b00c3b287e6fafeea6b02681533fe75a198247e
Reviewed-by: Jung Dong-Heon <dongheon.jung@lge.com>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-09-12 17:51:48 +02:00
Mitch Curtis
f1093e06b2 Fix typos in Widgets Tutorial.
Change-Id: Id4a0bef3b00f3869582e76ee45f230120189a268
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-12 15:27:45 +02:00
Allan Sandfeld Jensen
fac71528cc Read and use WheelScrollLines configuration on KDE
Qt supports changing the default lines a scroll wheel click scroll, but
wasn't trying to read the system settings. The patch adds support for
platform themes to set the default.

Change-Id: I53fdcec7984941d1d1285d927d70460356613f81
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-09-12 11:46:59 +02:00
Tim Blechmann
c8d2514347 QGuiApplication: clear font database on cleanup
Change-Id: If196c5e93b7ed68c6a0f6be7414f9efc8195f168
Task-number: QTBUG-40865
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-12 11:14:57 +02:00
Lars Knoll
2de8fb5a6c Force a full layout on the frame if it's vertical geometry changes
When the frame's vertical geometry changes because top/bottom
margins, border or padding changes we need to do a full relayout
of the frame to position it correctly.

Task-number: QTBUG-2975
Change-Id: Ia0f063cc2057b6d7a469977d258ec1608feff9bf
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-12 10:53:07 +02:00
Marc Mutz
2ad5d62f11 Micro-optimize qt_section_chunk ctor
Use C++11 move semantics, and the ctor-init-list.

Change-Id: I1a5faa83ef552e8d98ce994edf967770a73cab0e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-12 10:00:30 +02:00
Marc Mutz
50b34f2a5a QPainter: use qEnvironmentVariableIsEmpty()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I1ac14bb3d262201071025a885633886934f2d74c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 10:00:16 +02:00
Marc Mutz
0a5a41d9a4 QImageReader: use qEnvironmentVariableIsEmpty()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I92805767b55adce478a4bf8eb1cbafaa544f96aa
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 10:00:10 +02:00
Marc Mutz
d2ba9d0962 QIcon: use qEnvironmentVariableIsEmpty()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I427aa5bf5b8d76aabdd5ce5950e9e6762f79b8d8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 10:00:05 +02:00
Marc Mutz
e8aa70c2d6 QFileSelector: use qEnvironmentVariableIsEmpty()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Ib303f00ce45816677ffca0580cc6b91a14a0e5be
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-09-12 09:59:59 +02:00
Marc Mutz
aac6cda804 QWheelEvent: make magic number 120 a symbolic constant
The documentation states that 120 is the value users of
the event should use to determine one full step of the
wheel. Provide that number as a symbolic constant.

Change-Id: I0da0cdd8328a476538080b7276d02863906ea53f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-12 09:59:18 +02:00
Marc Mutz
f826039e09 QGraphicsView: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I774ae9011b855f746b5e3fdf25995d81ec60b82a
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-09-12 09:59:11 +02:00
Marc Mutz
099f188bc8 xcb: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Ie625d79352fa166e45939ef8f0a5e0cc32f8e801
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-12 09:59:06 +02:00
Marc Mutz
dcb48c6dc6 WinRT: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I73d548ad4e25424fc41722961f527e63632a7b56
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-09-12 09:59:01 +02:00
Marc Mutz
1dce3b7d11 QNX: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I211d6de32da06bf465c4f721f39d73289206745f
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-09-12 09:58:56 +02:00
Marc Mutz
0a94712ad5 QMinimalIntegration: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Idaad6ec1d92d9aa58d61e2d98e136f108be2bb4c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:58:51 +02:00
Marc Mutz
b3b29c2592 QKmsScreen: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Iaaba62396de2d70f611bfa2ba5badb070087fa24
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-12 09:58:45 +02:00
Marc Mutz
9b62d37894 eglfs: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I4c43809954ed720de95b3056c13bf520577e3280
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-12 09:58:40 +02:00
Marc Mutz
4aba06aa47 Android: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I6d79852613228658f9093a272edf9b434e60286c
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-12 09:58:34 +02:00
Marc Mutz
6bc9e44433 QEvDevTouch: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I64de0b2644c50469a35fdba9ecde167862975b79
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:58:28 +02:00
Marc Mutz
6d3e9be1d2 QFbVtHandler: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I18c00da9504dd3744e6fbb23ea9b9fb7c6d669c9
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:58:22 +02:00
Marc Mutz
f88c5415ff eglconvenience: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Id50609c1f3511287d99e24b03e48c0a254893194
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:58:15 +02:00
Marc Mutz
9f0d5b3b6c QPainter: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Ie41b95c09f2c6106a6683ba4637513c974555840
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:58:06 +02:00
Marc Mutz
a24566a338 QHash: remove unnecessary #ifdef
There's no need to use a macro here, since we can just store
the pointer value in a qulonglong and have the second shift
operation be done unconditionally. For 32-bit platforms, it
will yield 0, and xor'ing it into 'seed' will have no effect.

Change-Id: I3e63bd504e81c84d13935d5503c3707d40d74d6f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-12 09:57:59 +02:00
Marc Mutz
d04c2fbc1d QPainter: drop a pointless check
There's no need to check for nullptr before invoking delete.

Change-Id: Ied751f76f15f390bf86bbba53c14a3e450aa81e8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:57:52 +02:00
Marc Mutz
44f65a0650 QPainter: use qDeleteAll()
Change-Id: I167e4d7a57e92eb5ea7c39b04246ac2f44c91de0
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:57:43 +02:00
Marc Mutz
b1a8d48e37 QLibrary: simplify qt_debug_component()
Instead of initializing debug_env to -1 (thus forcing the variable
into the data segment), and then overwriting the -1 with a read
from the env-var, dynamically initialize the variable from the
env-var directly, thus allowing the variable back into the bss
segment (which doesn't occupy storage in the executable).

There may have been a reason to do it this way when the old code
could fail due to the memory allocation involved, but now with
qEnvironmentVariableIntValue(), that is no longer a reason.

Change-Id: I9f21b0783ff348f50b574395fc07f2869a14102e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-12 09:57:34 +02:00
Marc Mutz
699df74197 QLibrary: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I8d440619edfbd90045564e1f92676f1e1f87e136
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-12 09:57:26 +02:00
Marc Mutz
bb56586e32 Add qEnvironmentVariableIntValue()
A lot of code in Qt uses VAR=1 for enabling or disabling some feature
or other, ignoring qEnvironmentVariableIsSet(), which was added for
that purpose. Other code actually reads numerical values from
environment variables. For both use-cases, provide a non-throwing,
non-memory-allocating way to get the numerical (int) value of an
environment variable, complementing qEnvironmentVariableIs{Set,Empty}().

[ChangeLog][QtCore] Added qEnvironmentVariableIntValue().

Change-Id: I81c85287ea10d355c1bbf8d7807ec9a0e477bce0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-12 09:57:16 +02:00
David Faure
de4cad945d QAbstractItemView: add iconSizeChanged signal.
This is useful when writing a generic preview-icon-generator which
should work with different type of views, itemviews and QML views.
A way to be notified of a change of icon size was missing on the itemview side.

[ChangeLog][QtWidgets][QAbstractItemView] Added iconSizeChanged signal.

Change-Id: I19b3049961002ca27d71aefbb6980d1e6f225c79
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-12 02:07:48 +02:00
David Faure
31c6d9f04b QTextStream: add fast path for writing char and QChar.
Avoids allocating a QString for every char being written out.
The benchmark went from 5.5 ms per iteration to 0.8 ms,
and from 40 million instructions to 6 million.

Found using Milian Wolff's heaptrack tool.

Change-Id: I1784c47b944454bc947a607a22c39d249372ed55
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-12 02:07:36 +02:00
Andreas Hartmetz
33e7093a84 Set WINDOWPLACEMENT::length as required by the documentation.
Found this while debugging something else in Dr. Memory.

Change-Id: Id295ddf4e07088684ecf91e3c2e0a156bf6054cb
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-11 23:14:25 +02:00
Allan Sandfeld Jensen
294e65f809 QVariant::compare shouldn't return match when QVariant::cmp does not
If the types doesn't match in QVariant::compare we do a comparison based
on QString, this may end up indicating a full match, though the we don't
match according to cmp. In this case it would be better if we preserved
the non-matching to avoid breaking ordering.

[ChangeLog][QtCore][QVariant] Fixed ordered comparison between QVariants
that do not match but produce identical toString output.

Task-number: QTBUG-40363
Change-Id: I84a8eca11e8875dba9948bde2906ae7c5aa35704
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-09-11 23:05:35 +02:00
Richard Moe Gustavsen
8e7cb47a34 QIOSPasteboard: handle zero-pointer argument to setMimeData
QClipboard sends QPlatformClipboard a zero pointer to
QMimeData when it's told to clear. So we need to check
for this to avoid a crash.

Change-Id: I570ed727029ca699673d7b2e989bdff44df8e161
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-11 22:35:01 +02:00
Jerome Pasion
a14ec355c1 Doc: Fixed broken links introduced by "OS X" doc change.
-qtdoc repo uses "OS X" instead of "Mac OS X" and this caused
broken links.
-more comprehensive change still needs to be done but the new
 name is used in the page to maintain consistency. At least within
 the page or class.

Change-Id: I8a5650046fc0413cbb18359b743ecd30fd62e417
Task-number: QTBUG-40759
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-09-11 21:45:46 +02:00
Alex Trotsenko
6600804079 Remove incorrect read from QSslSocket::readData()
QIODevice makes readData() call only when its read buffer is empty.
Also data argument points to the user or reserved read buffer area.
So, no need in data transfer from read buffer at this point at all.

Change-Id: Ieb4afdf7eec37fdf288073e4a060e64424f22b9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-11 19:31:51 +02:00
Nico Vertriest
20a6b6b3ca Doc: corrected link/autolink errors in corelib/doc/src
Task-number: QTBUG-40362
Change-Id: I0ff1523c76724e0662bafed08515ea06bbdd8381
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-09-11 16:11:20 +02:00
Gunnar Sletta
0db3ea4048 Use a dedicated timer for the animation driver.
QUnifiedTimer::elapsed() was implemented using
driverStartTime + time.elapsed() while the driver
was running, but time.elapsed already contains
driverStartTime so that was counted twice. This caused
repeating timers to fire immediately once they first
had fired, if the animation driver was started while
it was running.

Separate the two timers. Animation driver time restarts
from 0 every time it starts.

Change-Id: Icf5cd0381b121b2355d7c6ec3edd0997721cbcdf
Task-number: QTBUG-41198
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2014-09-11 15:25:21 +02:00
Gabriel de Dietrich
982b9b7ec2 QMacStyle: Use NSView rendering for some inactive widgets on 10.10
Right now, we use them for inactive non-editable combo box, check
box, and radio button only on Yosemite. We keep as much as possible
the previous behavior on older versions.

In addition, we add a way for QQuickStyleItem to specify the window
the item is on. This is currently without effect, since we don't
seem to take the inactive window state into account.

Task-number: QTBUG-40833
Change-Id: I2fb2a99e6adf1972f881195b79b07ce85a960273
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-11 11:53:53 +02:00
Jędrzej Nowacki
fa9a407b9f Revert "Reading QJsonObject property should not modify the object itself."
This reverts commit 20cf632ad5. The commit
produced to many problems during statics destruction. For example
causing QtCreator crash (QTBUG-40987).

Change-Id: Ib52f6a449c2d84deab2de792559a6a065ca45e8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-11 10:54:42 +02:00
Eskil Abrahamsen Blomfeldt
c1b46b98ed Fix possible divide by zero in QPlainTextEdit
If the font engine for some reason fails to get font metrics
for the font, the application should still not crash.

[ChangeLog][Widgets][QPlainTextEdit] Fixed a possible divide
by zero crash when font metrics were missing for the font.

Task-number: QTBUG-40347
Change-Id: I571bc3eace07cdbee6f9ce9aa649df95412aed71
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-11 10:15:22 +02:00
David Faure
7b9f7f3891 QLockFile: on Windows, retry deleting the lock file if it is being read.
A "sharing violation" happens when trying to delete the lock file and another
thread/process is reading it at that very moment. Detect the error and try again,
up to 10000 times - to avoid an infinite loop if QFile::remove fails for another
reason such as a sudden change of permissions preventing us from deleting our
own lock file.

On Unix the deletion can't fail because of readers, but it doesn't hurt
to check the return value there too, to catch other reasons for failures
such as a sudden permission change.

Task-number: QTBUG-38853
Change-Id: Icf12a74faed4a4916e3427abc09d9c33aa141476
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-11 00:17:33 +02:00
Laszlo Agocs
92404c9cdb Mark the remaining QGL classes as obsolete
Many of them are already marked. Do it for the rest (QGLWidget et al).

Change-Id: I506d72ad20f8ef39981dbeee0df49229bcf748a7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-10 21:43:13 +02:00
Lars Knoll
c17563eca8 Fix several issues in QCollator
Refactor the code and move more things into the cross platform
code path.

Make sure the flags survive changing the locale of QCollator.
Use the correct locale on Windows, WinRT and OS X. We now
pass all QCollator autotests on these platforms.

Task-number: QTBUG-40778
Change-Id: Ic2d3334b5018c323a35a3ea8fc1d7ab5f99b4e62
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-10 21:11:11 +02:00
Lars Knoll
6316a681f3 Fix user defined conversions to numeric types
The old code was completely broken. It did dereference
val for user types, but val does in this case only contain
garbage. Instead use the pointer to the correct data.

Change-Id: I20ccf0bfa3dd3774c787d08c51cc8dd7b1ec9a1a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-09-10 21:10:57 +02:00
Lars Knoll
df25927a68 Don't accept json strings with trailing garbage
A well formed JSON document is not allowed to contain
trailing garbage at the end. Don't accept this in the
parser.

Task-number: QTBUG-40062
Change-Id: I0a09dbd099a8c643f58023342546c4e67d026fec
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-09-10 21:10:45 +02:00
Lars Knoll
853845a4a2 Fix bugs in internal comparison operators
The comparison operators between QJsonPrivate::String
and QJsonPrivate::Latin1String weren't all correct, leading
to wrong sorting of keys in QJsonObjects when the keys were
outside of the latin1 range and resulting lookup errors.

Task-number: QTBUG-41100
Change-Id: Idceff615f85d7ab874ad2a8e4a6c1ce8c2aa0f65
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-09-10 21:10:35 +02:00
Paul Olav Tvete
395d865b80 Android: fix inputmethod race conditions
focusObjectInputMethodQuery() and sendInputMethodEvent() were not
thread safe. Remove them, and replace with thread safe versions
based on the same principle as queryFocusObjectThreadSafe().

Task-number: QTBUG-40995
Change-Id: Idb6f0c6d3963b7e8e73e029e83d0367088146ca8
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-09-10 20:35:59 +02:00
Marc Mutz
b678cc2989 QRegion: remove some toplevel const from return types
It has no effect and inhibits move semantics.

After this change, two and five more copies are moves in QtGui
and QtWidgets, resp.

Keep the old form for compilers that mangle the return type.

Change-Id: I6257683144110230079fe9095303907ecc858c94
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-10 20:33:18 +02:00
Dyami Caliri
a60e13ce06 Update QOpenGLWidget paintDevice devicePixelRatio when recreating fbo
The QOpenGLWidget's paintDevice needs to update devicePixelRatio when
changing screens.

Change-Id: Iec6e7157f22ff99e04f81347cbbf70f3fc3ff424
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-10 20:20:35 +02:00
Laszlo Agocs
49194275e0 Expose screen change event to widgets so that they can check the dpr
Unlike ordinary widgets, the ones that have OpenGL framebuffers must know
about screen changes because the device pixel ratio may be different on
the new screen. Add an internal event, ScreenChangeInternal, as the
counterpart to WindowChangeInternal.

Change-Id: I5e55999838e4c0284e7d9832299f7cc6b541ee3f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-10 20:20:05 +02:00
Boris Savelev
4b6d873725 Add QMAKE_CFLAGS_XCB to xcb
Add QMAKE_CFLAGS_XCB to xcb-static,
needed for successfully building with -qt-xcb.
Add QMAKE_CFLAGS because some code gets built with the C compiler.
Also, this fixes a compile error
when xcb include is not in system include path.

Task-number: QTBUG-41129
Change-Id: I842ebe391a7a857e234becc451c33601fce9b07a
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-10 16:59:47 +02:00
Eskil Abrahamsen Blomfeldt
8610534f53 OSX: Properly detect language support in fonts
The language support detection in Cocoa does not report the correct
set of languages for all fonts. One consequence of this is that e.g.
Mkhedruli (Georgian) was not supported on Mac because the
'ka' language code was not reported for e.g. the Arial Unicode MS
font.

This was never detected in Qt 4, because the writing system support
we set for each font was never used for font matching, since we let
CoreText do the matching in Qt 4.

To remedy this, we also detect writing system support based on the OS/2
table in the font. We add this in addition to the current test in case
the language list has information about fonts with incomplete OS/2 tables,
to avoid regressing.

[ChangeLog][OS X] Fixed detection of writing system support in fonts for
some scripts such as Mkhedruli.

Change-Id: I26c2a42ef45112e17d6794d8798a57c8d8aaaafa
Task-number: QTBUG-41208
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-09-10 14:33:34 +02:00
Tor Arne Vestbø
2368e62f32 qpa: Make screen geometry updates (full and available geometry) atomic
Updating the geometry and available geometry in two steps means that
QScreen will be in an inconsistent state when emitting the geometry
change signal, as the available geometry has not been updated yet.

Piggy-backing changes to the availableGeometry based on the virtual
geometry changing does not make sense, so we now tie geometry and
availableGeometry (and their size variants) to their own separate
geometryChanged and availableGeometryChanged signals.

Change-Id: Iee0ced642cbb91c470cb54bc507d2c0512482c13
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-10 14:31:35 +02:00
Tor Arne Vestbø
2d2dc976d8 iOS: Move accessibility/textinput includes in quiview.mm
Change-Id: Id982afb06f164bd398a6e642a48a85f277075e74
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-10 14:31:29 +02:00
Jørgen Lind
a56cfad51a Destroy the QOpenGLTextureBlitter in the destructor
if it has not already been destroyed

Change-Id: If9a29da25eb23d5d65204eecabe095df215737ee
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-10 14:22:39 +02:00
Laszlo Agocs
2f96fb1bee Add an option to share between TLWs
Task-number: QTBUG-41191
Change-Id: I510d1631926ed0d9e371703d22229aed92432aa6
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-09-10 13:36:27 +02:00
Oswald Buddenhagen
d572ab1bb4 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: Id4997327cc01bd4bb397a463bdffbd15e80398ef
2014-09-10 11:42:50 +02:00
Topi Reinio
162010441f qdoc: Resolve .qhp table of contents sections correctly
With the recent changes in QDoc, we can no longer assume that
pages listed in the TOC are of type DocNode. For example, all
Qt modules want to list C++/QML type index pages in the TOC,
and those are now of type CollectionNode.

This change fixes the issue by using a more generic search
function when generating the .qhp TOC, one that doesn't
restrict the results to any specific node type. As an
exception, the main index page for a project must still be a
DocNode, i.e. a page declared using the \page command.

However, we do want to restrict the search to the pages in
this documentation module only - for that purpose, a function
for setting a local search order is introduced.

Task-number: QTBUG-40241
Change-Id: Ibaa5af9c5de6436f34b7ae67e56733817fc090b9
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-09-10 10:53:42 +02:00
David Faure
507fff201b qsql ibase: fix memory corruption due to LONG being 4 bytes in firebird.
As fb_types.h says, Firebird requires (S)LONG to be 32 bit, and it defines
SLONG to int. This leads to sqllen being 4, so qsql_ibase.cpp allocates
4 bytes... and was writing 8 bytes into it.

Fixed by checking sqllen, the same way QIBaseResult::gotoNext does.

Change-Id: Ie8680d32f98c354dfc8430b8efbfe95450556956
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-09-10 08:28:11 +02:00
Dyami Caliri
71df09b6cc Fix garbled resize with QOpenGLWidget when using multi-sampling.
If you configure QOpenGLWidget to use sampling, the 'resolvedFbo' isn't
updated during resizing. This leads to garbled views.

Change-Id: I9f9265520134bcf12436778773507df936c5fbb6
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-10 04:49:40 +02:00
Eric Lemanissier
3e80497668 Preventing caching of null authenticator
In some cases, e.g. when bad credentials are provided in an ftp URI,
QNetworkAccessAuthenticationManager::cacheCredentials is called with a
null authenticator. This authenticator should not be cached, because
it is useless, and leads to inconsistencies in the use of the cache

Task-number: QTBUG-40622
Change-Id: If2a0a422b915f268648f5eef1d68601446123371
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-09-09 22:26:27 +02:00
Alexander Volkov
3203239bd8 xcb: fix getting a XdndAware property if a proxy window exists
According to the XDND standard (http://www.newplanetsoftware.com/xdnd/)
if the proxy window exists then it should be checked for the XdndAware
property rather than the target window directly.
c3f9de6296 introduced the mistake.
In the old code the proxy window was used.

Change-Id: I83b66d4b1f08a1f44d5c1451d0f1735c084bcf09
Spotted-by: Alexander Smirnov
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-09 20:59:43 +02:00
Maks Naumov
8db7e47699 QNetworkReply: move "State" enum declaration into QNetworkReplyPrivate
Change-Id: If63a029a7a7ef84fc1b4b73f5bab495992ea7e02
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-09-09 19:21:05 +02:00
Mitch Curtis
5042145dd9 Fix typo in QMetaType documentation.
Change-Id: I934b68978fb32a518ed7cf9b47f1600982f58f66
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-09-09 08:16:11 +02:00
Maks Naumov
e5dbef74b4 QRegion: remove check for null ptr after "new" operator
Change-Id: Iebba0b1f024e22cd36a04c53377b3958638b389e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-09 01:13:51 +02:00
Maks Naumov
fefa4dc1f0 Windows styles: Avoid theme.rect recalculation
In both cases theme.rect calculated right after the
"sub & SC_ScrollBarSlider" test.

Change-Id: I9fa0c4e1327e68b4184674a13e7a4bf362f8deff
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-08 22:44:42 +02:00
Laszlo Agocs
935186d76e Improve QOpenGLWidget docs regarding fb preservation
QOpenGLWindow already has some notes regarding this. It must be
mentioned in QOpenGLWidget too.

Change-Id: I0af90c9410a1c44cb9dd9ce58aa0371a58c57f65
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-08 21:47:28 +02:00
Laszlo Agocs
267eb25151 Enhance the VAO docs
Make it clear that the class is usable regardless of the OpenGL version
the app is targeting. It may just do nothing.

Change-Id: I50e68a46e36ef1f4694016311af93c6f8719ce4f
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2014-09-08 20:35:19 +02:00
Marcel Krems
e6857b7ebc Updated QSql{Query,Result}::bindValue doc to reflect the current state.
Since 5.0 it is possible to use one call to bindValue to bind
values to multiple placeholders with the same name.

Task-number: QTBUG-23360
Change-Id: Ic838150d25dd07bca7bc9e5d91ab3362a73833d6
Reviewed-by: Matt Newell <newellm@blur.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-09-08 16:18:19 +02:00
Alexander Volkov
f3cee50216 Fix a conversion of coordinates of a TouchBegin event
To convert coordinates to a parent's coordinate system one should
translate them by an offset of a child widget relative to it's
parent widget. QRect::moveCenter() doesn't translate, it sets
the coordinates of the touch point's center to this offset.

Change-Id: I9d823784803bd1448c0d665944090674d3ff518b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-08 15:35:40 +02:00
Laszlo Agocs
289e9af668 Define EGL_EGLEXT_PROTOTYPES for ANGLE
Otherwise the protos are not pulled in so the ANGLE-only build cannot
suceed (unless the flag is defined from somewhere else).

Task-number: QTBUG-41164
Change-Id: I959d154da88f7ccc8159ec7e810ffdba0e7f50ea
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-06 22:39:48 +02:00
Adam Majer
357f80878d Bump Q_COMPILER_INITIALIZER_LISTS to GCC 4.5
While GCC 4.4 has the required header, it is missing important
typedefs requiring use of pointers instead. This is acceptable if only
used in one or two places, but a quick search through the source code
lists quite a few usages of const_iterator typedef.

$ git grep -c initializer_list\<.\*\>::const_iterator
src/corelib/global/qflags.h:2
src/corelib/json/qjsonarray.h:1
src/corelib/json/qjsonobject.h:1
src/corelib/tools/qhash.h:2
src/corelib/tools/qmap.h:2
src/corelib/tools/qset.h:1

The lesser-evil is to bump Q_COMPILER_INITIALIZER_LISTS to version
GCC 4.5 and retain usage of required (by standard) initializer_list
typedefs.

Change-Id: I38d6fa0ef3dc7d958587b406d33e3e3a7378c026
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-06 04:11:29 +02:00
John Brooks
61b47cd166 Correct QString::toStdString documentation on encoding
This statement was left from when toAscii was used, instead of toUtf8.
There is no loss of information when converting to UTF-8.

Change-Id: Iad92977af319b324cbf06f1a24712b31a7836622
Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-05 22:59:12 +02:00
Robin Burchell
93560de9de kms: Move debug output behind a category.
Change-Id: I5b2bb8631a33b577afca1a0852abe4cabae1e254
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-09-05 22:18:46 +02:00
Maks Naumov
a3421d1ba6 QDateTimeParser: remove unused local variables
Change-Id: Id78fde8a720961c448d1aa3983ad296974796fdf
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-05 20:18:04 +02:00
Gunnar Sletta
0e2c329313 Remove GLdouble and GL_DOUBLE typedefs for OpenGL ES 2.
We have no business defining types which come from another library.
These originally stem from the S60 port without further explanation
and Qt and its examples today compile without them, so remove them.

Change-Id: I683ea897c00ab3a1f7c809c45352fe590ae9a41f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-05 18:14:15 +02:00
Kai Koehne
3cae7dcc5a Use expiry_date field to check for evaluation timespan
Use the new dedicated field instead of just assuming that the evaluation
timespan is buildtime + 30 days.

Change-Id: Ibf4078f030ea609d823fe01889a106a5da345817
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-09-05 17:19:53 +02:00
Friedemann Kleint
50e1733dfa Bump version of QWidget geometry serialization to 2.0
It was decided not to port the handling of the saved
screen size to Qt 4.8, so, bump the major version to
ensure Qt 4.8 bails out.

Task-number: QTBUG-38858
Change-Id: Ia870519553172cd383830d9a722b0fada180ee1b
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-09-05 15:25:52 +02:00
Alexander Volkov
f721a85b1e xcb: fix coordinates of touch points
Fix conversion from FP1616 to qreal.
Use 16-bit mask 0xFFFF instead of 8-bit mask 0xFF.

Change-Id: I0ee39b2e298b7ff7d7a67981925374d6a18f1474
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-05 15:23:30 +02:00
Friedemann Kleint
eac2876d55 Windows: Move dock windows automatically when screen is disconnected.
Windows does not automatically move WS_EX_TOOLWINDOW type windows.

Task-number: QTBUG-39320
Change-Id: If9804f32beb534a27ba649abf5eaceb686af8f50
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-09-05 15:21:39 +02:00
Jeremy Lainé
070fcf9ce1 ssl: common certificate parser support for extensions
This makes non-OpenSSL backends able to handle to certificate
extensions.

This also converts the Q_OS_WINRT #ifdef's in the unit test to
QT_NO_OPENSSL as the behavior is the same for any non-OpenSSL
backend.

Change-Id: I6a8306dc5c97a659ec96063d5a59cee2ee9a63a9
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-05 14:20:44 +02:00
Topi Reinio
2e667c9171 qdoc: Highlight selected section / entry in the documentation
This commit adds id tags with the anchor reference as the value
to html entities for documentation section titles and function
signatures, properties etc. for both C++ and QML documentation
pages.

Together with new CSS rules, we can dynamically highlight the
title that the user clicked on. This helps to locate the item
of interest on a crowded page or when the page cannot be
scrolled down enough to place the selected item on top.

Change-Id: I7d1db2ed4e12779e1a9e571996ee65c3befa4e7a
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2014-09-05 14:17:29 +02:00
Paul Olav Tvete
675d354815 Avoid deadlock when suspending device
Don't wait for the GUI thread when it's already waiting for us.

An application that uses the virtual keyboard may get an inputmethod
query just when it is being suspended. If the GUI thread is already
blocking on a semaphore at that point, waiting for the android thread,
we really do not want to wait for the GUI thread...

Task-number: QTBUG-40955
Change-Id: Iea2cf0dd058a41a897d596c4bcf16f0508adb20b
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-09-05 14:04:34 +02:00
Paul Olav Tvete
d98df9e929 Android: don't recreate surface on shutdown
When we suspend the app, we destroy the surface to save resources.
We don't want to create it again just as we are shutting down.

Task-number: QTBUG-41072
Change-Id: I7a616249bee869b92716d0911201a80d73c2f8da
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-09-05 14:04:27 +02:00
Maks Naumov
9c4c044338 GraphicsView: Fix resolvePalette() for QGraphicsItem's children
Use a proper function for that.

Change-Id: I166ce44b8987d522cb01bae57009b2b862851b92
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-09-05 13:12:21 +02:00
Friedemann Kleint
585cef5f90 Windows styles: Scale hardcoded-values according to DPI.
Factor out functions to return the fixed values and scale those.

Task-number: QTBUG-38993
Task-number: QTBUG-38858
Change-Id: I59c70a206eae76bf08bc2aeb5cda5a740cd3d6dc
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-09-05 12:14:34 +02:00
Friedemann Kleint
176bd1edfa Windows styles: Add device pixel scaling for system metrics.
Metrics obtained from the system must be scaled down
when device pixel ration scaling is in effect. Factor out
functions to return the device pixel values which might still
be used for drawing.

Task-number: QTBUG-38993
Task-number: QTBUG-38858
Change-Id: I6b90629e4979436bbb46f8c1fa1ee2253ada7ece
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-09-05 12:14:23 +02:00
Andrew Knight
b858e7af4f windows: Enable ANGLE D3D11 renderer by default
Also, remove the -angle-d3d11 configure option, as it no longer is
necessary to select the renderer at build time.

The D3D11 renderer is the default renderer in upstream ANGLE, and has
been shown to be a more reliable solution for developers running over
remote desktop and inside virtual machines. It also provides more features
to the OpenGL ES implementation.

This configuration switch does not disable the D3D9 render; if the GPU
does not support D3D11, D3D9 is used instead.

[ChangeLog][QtGui][Windows] The ANGLE D3D11 renderer was enabled by
default. Systems which cannot use the new renderer will automatically fall
back to the D3D9 renderer at runtime.

Task-number: QTBUG-41031
Change-Id: If894309c07d9309c236b63c36f37679f74375133
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-09-05 07:39:53 +02:00
David Faure
2eb61feb9b Doc: QRect::isEmpty's documentation didn't match the code.
The code says
bool QRect::isValid() const { return x1 <= x2 && y1 <= y2; }
so the documentation should say <= as well, rather than <.

Change-Id: If52005879d2a758b5d1d64b552e6cd96341fae76
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-05 01:28:32 +02:00
Thomas Fischer
983dde1f2f Avoid adding widget to its own layout
Widgets and layouts added or inserted to a layout are checked for:
- Not being NULL
- Not being the parent widget of a layout or the layout itself,
  respectively

Without this commit, adding a widget to its own layout would result in a
CPU-hogging infinite loop. Now, a warning is written to stderr and the
add or insert function call is ignored.

The checks are implemented as public functions of QLayoutPrivate and
thus accessible in QLayout's descendants to be used in various
"addWidget", "insertWidget", etc functions.

Unlike 'classical' layouts like QGridLayout, QFormLayout does indeed
accept widgets that are NULL. To not break this behavior, any call for
the check functions first tests if the widget or layout, respectively,
to test is NULL or not and calls the check only in the latter case.

Automated tests for QBoxLayout, QGridLayout, and QFormLayout were added.
For an unpatched Qt 5.3, each of those automated tests will freeze as
explained in QTBUG-40609. For a fixed version, warning messages about
invalid parameters to addWidget/addLayout/... calls will be read by
QTest::ignoreMessage, resulting in a passed test.

Change-Id: I1522d5727e643da3f7c025755975aca9f482676d
Task-number: QTBUG-40609
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-05 00:05:45 +02:00
Samuel Gaist
8206a263ab Add missing private headers warning
Change-Id: I7a4dd22ea3bcebf4c3ec3ad731628fd8f3c247e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-04 22:58:57 +02:00
Friedemann Kleint
211cef46f6 Introduce flags to QWindowSystemInterface::WindowSystemEvent.
Replace boolean member variables by flags.

Task-number: QTBUG-38768
Change-Id: If1302d9cc555d20df44147c9fa0f193a471fc95c
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-04 22:23:19 +02:00
Marc Mutz
e4fb59c0af QCommonStyle: replace a QPolygon with a QPoint[] (IV)
No need to allocate dynamic memory for a fixed-size point array
when QPainter has a (QPoint*,int) overload.

This one is a bit more complicated, as the QPolygon was returned
from a helper function, so I wrapped the array in a minimal
std::array-like StaticPolygonF.

Together, these four QPolygon -> QPoint[] changes result in
ca. 4.5K text size reduction for libQtWidgets.

Change-Id: I082f199d5edb7a7782173fe3748220f373edac8a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-09-04 21:27:56 +02:00
Marc Mutz
8478fc4e59 QCommonStyle: replace a QPolygon with a QPoint[] (III)
No need to allocate dynamic memory for a fixed-size point array
when QPainter has a (QPoint*,int) overload.

Change-Id: Ie1eecd376a52b73572998ba253a032deaa0daaf9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-04 21:27:50 +02:00
Marc Mutz
e192643c2d QCommonStyle: replace a QPolygon with a QPoint[] (II)
No need to allocate dynamic memory for a fixed-size point array
when QPainter has a (QPoint*,int) overload.

Change-Id: Ifdf8224ddffe06ef7848562023e372e2c32b9ad6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-04 21:27:43 +02:00
Marc Mutz
32a0e0cc61 QCommonStyle: replace a QPolygon with a QPoint[] (I)
No need to allocate dynamic memory for a fixed-size point array
when QPainter has a (QPoint*,int) overload.

Change-Id: I50c69103bba47e9f6de4f5616e8f40fee522ddc2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-04 21:27:37 +02:00
J-P Nurmi
a544ef5906 QCoreTextFontDatabase: reduce memory consumption
ATSFontNotify() allocates over 30MB for no apparent reason for
applications that don't register fonts.

Change-Id: I7bbc97f53b76be1e638de8ca0d1be3a08586cf00
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-04 19:50:19 +02:00
Alex Trotsenko
e35841e374 Fix endianness part of QSysInfo::buildAbi() string
Both Q_LITTLE_ENDIAN and Q_BIG_ENDIAN macros are always defined
on all architectures. So, byte order detection results in
"little_endian" value for big endian systems. Test the system
endianness in a right way, according to Q_BYTE_ORDER macro
documentation.

Change-Id: I5523f90567e78d679a3ff2902a8f5377ed39ceb1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-04 18:31:50 +02:00
Tor Arne Vestbø
59385ff2ca iOS: Update QIOSScreen::nativeOrientation() for iOS8
For iOS8 and up [UIScreen bounds] changes based on the interface orientation,
so we need to use [UIScreen nativeBounds] instead.

Change-Id: I3fc12cfa417df26ca94c803e970bc2dc18a94378
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-04 18:15:51 +02:00
Jake Petroules
20cf2debfb Revert "iOS: Update QIOSScreen::nativeOrientation() for iOS8"
This reverts commit f6c36917f1.

Depends on 203ce7c5ce
which can't go into 5.3 because it introduces new enum values.

Change-Id: I13040a7268fae4baeace244a3e75dc982d3a50b8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-09-04 18:13:10 +02:00
Louai Al-Khanji
2f0fa59d59 Add KMS hooks for EGLFS plugin
Change-Id: Ic703334e52726cdd815cccf152d9d01aa63c803c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-04 15:23:30 +02:00
Andrew Knight
8f88cc2c0f ANGLE: Fix compilation with MinGW + D3D11
Provide workarounds for things GCC doesn't like, and define a number
of macros not found in the MinGW headers.

Change-Id: I254c208209c0071fae5efb6727f2b3cfd5542da6
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-09-04 15:09:34 +02:00
Frederik Gladhorn
68206db907 Improve accelerator stripping in accessible widgets
When we strip the & we should also report the hotkey.
In addition only strip labels when they are buddys and try not to remove
ampersands from all kinds of random text.

This fixes https://bugs.kde.org/show_bug.cgi?id=338282

Change-Id: I401281cd9ff43b23a3923ad9909ca9c469b59506
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-09-04 14:50:36 +02:00
Frederik Gladhorn
52f859604d Accessibility: Improve line boundary helper functions
These functions are supposed to make it easy for third parties (and
QLineEdit) to implement the textAt/Before/AfterOffset functions.
Before the functions were ignoring newlines completely and thus only somewhat
useful.
Change-Id: I7136b9502a7fa6f8ad9ad7236761a34c1a7fd4da
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-09-04 14:50:32 +02:00
Giuseppe D'Angelo
ca1aa81c97 QSslContext: to represent a bool, use a bool, not an int
Change-Id: I2c2f5072302d2989362a382bd24cc10617336acf
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-04 14:13:47 +02:00
Giuseppe D'Angelo
f849583e84 QSslSocket: remove a useless assignment
I was actually wondering if the test always succeeds (i.e. should
be turned into a Q_ASSERT), but I don't know the codebase enough to
justify such a change.

Change-Id: Id01b8de7244428e9b1c240dc365c66eeef0d6111
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-04 14:13:43 +02:00
Samuel Nevala
105fa5b5d9 Respect android:windowSoftInputMode in manifest.
Read and store softInputMode set at AndroidManifest.xml on QtActivityDelegate.
When showSoftwareKeyboard is requested setSoftInputMode for main window if
softInputMode is not defined fall back to old behavior.

Change-Id: I71cb27d4bdb4ae4e3c2a0706560173703a2f5a50
Task-number: QTBUG-34401
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-04 14:04:44 +02:00
Tobias Hunger
627657217e Uic: Fix memory leaks
Fix some memory leaks in uic. These break the Qt build with clangs
address sanitizer feature enabled as Clang will cause uic to fail when
it detects these leaks. This in turn will stop the Qt build.

Change-Id: I6794b29f5a36fc8a2d59cf36f6d7459f3f50d56d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-04 13:44:48 +02:00
Friedemann Kleint
b9e3f59551 QMdiSubWindow: Keep event filter on system menu over its lifetime.
QMdiSubWindow::eventFilter() is supposed to close the sub window on a
double click on the menu icon. However, it did not receive the double
click event since it removed itself when the menu was hidden, which
happened before the double click was delivered.

Task-number: QTBUG-25179
Change-Id: I5e7fb02dda26ceab12e8b7554fc604066a0a3136
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-04 08:58:06 +02:00
Laszlo Agocs
0bb2b62135 windows: Fix dynamic opengl build
Cannot call WGL or EGL functions directly anymore.

Change-Id: I0d5c6217679d87a2092c945a9b841dfd7b6c299a
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-03 18:13:51 +02:00
Laszlo Agocs
38ea5428c4 Enable QT_ANGLE_PLATFORM selection in dynamic builds
Change-Id: I8ebe62ec1e024e8a0a0f9e8aeac6fb81b1095e72
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-03 18:13:47 +02:00
Andrew Knight
20ea0cbaba direct2d: Work around ClearType rendering bug in translucent mode
This switches the font rendering to use gray scale antialiasing when in
translucent rendering mode. It does so by adding a flags argument to the
paint engine, allowing for future expansion in communicating render hints
from the device to the engine.

Task-number: QTBUG-41002
Change-Id: I0265154716a12060e851b603a109e9c693f5e843
Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-03 17:50:11 +02:00
Jeremy Lainé
bdb30abcd2 ssl: add support for ASN.1 boolean values
This adds support for reading and writing ASN.1 boolean
values. It also adds an operator to test two ASN.1 elements
for equality.

Change-Id: I4a22cbf9808533d593fc59d27b63caaf650b1f57
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-03 17:28:02 +02:00
Andy Nichols
c68ef6d2c0 DirectFB: Add QT_DIRECTFB_BLITTER_DEBUGPAINT environment variable
This environment variable will paint an overlay on each paint command
that is using the accelerated blitter path for DirectFB.  This is useful
when you want to assure that you are taking advantage of the DirectFB
blitter.

Change-Id: I6e374754825794daf9c1bf40bee2b963e752a8e9
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-03 17:07:52 +02:00
Dimitar Asenov
633647334c Speed up the removal of items from a QGraphicsScene
When using a linear index, all items in a scene are stored in a QList.
While adding new items is a constant operation, removal requires a
traversal through the entire list. This is especially problematic
when the scene contains millions of items and many of them are removed,
which requires a linear search for each item, resulting in a very slow
operation. Moreover, this behavior is actually inconsistent with the
current documentation which states for the linear index:
"Adding, moving and removing items, however, is done in constant time."

With this change, the list is sorted once an item needs to be removed.
The item to be removed is then found using binary search. To reduce
the overhead of sorting the list is not sorted from scratch. First the
newly inserted items are sorted and then the two parts of the list
are merged.

[ChangeLog][QtWidgets][QGraphicsScene] Speed up the removal of items
when using the linear index.

Change-Id: I28708622605d7fb0fac656df1f9b2f2fa3136759
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-09-03 16:52:17 +02:00
Laszlo Agocs
5b2f77c598 eglfs: Fix regression in config selection
During the introduction of context adoption support the config choosing got
broken for context creation, at least for hooks that return a customized
format in surfaceFormatFor(). The returned format is the one that needs
to be passed to chooseConfig(), not the original.

Change-Id: Iae203cbbf7b39c462386611dd3744f048116df13
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-09-03 16:27:52 +02:00
Dimitar Asenov
ed418f91d5 Revert "Speed up the removal of items from a QGraphicsScene"
This reverts commit bf2ec0183c.

That patch changed the way the linear index works in QGraphicsScene
in order to speed up item removal. That patch occasionally rebuilt
the index by recursively exploring all items in the scene, starting
with the top level. Further testing revealved that in some
circumstances, rebuilding the index in this way can be slow, thereby
significantly slowing down the index compared to the unpatched
version.

The original patch only exists in the qt 5.4 branch and has not been
released.

Change-Id: I081dbcdcc86196ef382466c3e800a33eab9a5b79
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-09-03 16:11:41 +02:00
Paul Olav Tvete
7e1e42cbf2 Android: Avoid deadlocks on suspend
Get rid of the rendezvous at shutdown: the android thread does not
need to wait for the GUI thread. Since the GUI thread frequently does
blocking calls to the android thread, this fixes several known and
potential deadlocks.

Task-number: QTBUG-41072
Change-Id: Ia6fa8da026b1727e7352b22f4df4d72b63b8c847
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-09-03 15:18:49 +02:00
Lars Knoll
5cb21215c9 Change a qFatal to a qWarning
There are valid uses cases how to use Qt without installing
any fonts (e.g. by using an application font), so let's
make the warning non fatal.

Task-number: QTBUG-29192
Change-Id: I5684331b687bef4b8a54be1f68303c80aa8d4372
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-09-03 14:38:18 +02:00
Maks Naumov
7af329fdf2 Widgets: remove pointless assignments
Assignment of a value was two times successively for same variable while
the variable itself is not used between these assignments.

Change-Id: I3c457e3af0505d32a64f6c8576b458cd15a951e5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-03 13:30:12 +02:00
Albert Astals Cid
4dae1a685c Use QPlatformTheme::SystemIconFallbackThemeName in static QString fallbackTheme()
Instead of QPlatformTheme::SystemIconThemeName

Change-Id: Id318944730cd1b8014380a972eb28fd8aab1f382
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-03 13:24:25 +02:00
Friedemann Kleint
74303ad497 QSwipeGestureRecognizer: Use qAbs() to check distances.
Task-number: QTBUG-15768
Change-Id: Idc6c6687430365a015fb2c15f4e4dcae6a687f9f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-03 13:23:42 +02:00
Robin Burchell
3006bd2d44 Make QElapsedTimer default to invalid (and now non-POD).
The practical uses of a POD QElapsedTimer are not really that clear, and the
number of misuses of this API are quite high. Default the state to invalid to
prevent against mistakes.

[ChangeLog][QtCore][QElapsedTimer] Is no longer a POD.

Change-Id: I267292acf2bfca7404e3e449dd04410441d7ce26
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-03 13:19:35 +02:00
Oliver Wolff
8d0e6000cb WinRT: Fixed initialization of udp socket
udpSocket() can only be called after the socket descriptor is set.

Change-Id: If651ff58507cd66c98de4b699a80149913d9ffcf
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-03 13:17:00 +02:00
Yoann Lopes
05670f586f Android: use FBO readback workaround by default.
Maintaining a black list of devices can't be reasonably done.
The workaround is now enabled by default. It can be disabled with the
QT_ANDROID_DISABLE_GLYPH_CACHE_WORKAROUND environment variable, in
which case the current list of blacklisted drivers will still be taken
into account.

Task-number: QTBUG-40483
Change-Id: I9b90ab45e86569e8e4679333ddb9b835189892c7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-03 12:29:23 +02:00
Oliver Wolff
365c6e81be WinRT: Fixed construction of QNativeSocketEngine without parent
Change-Id: If55a8049224a7dceca33a3cf3089d541a3a97b8e
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-03 09:33:23 +02:00
Jan Arve Saether
ec5f402cfd QEasingCurve: The setting order of properties should not matter.
Previously, this failed because QEasingCurveFunction only had a linear
behavior.
The fix is to change that and let QEasingCurveFunction handle
any of the simple "non-parametric easing" functions.

Task-number: QTBUG-38686
Change-Id: I666d59e10ceb589dcc52956b16a6f0c259aebdad
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-02 23:19:44 +02:00
Jeremy Lainé
cd3dece750 ssl: common key parser support for encrypted keys
This adds the infrastructure for reading and writing encrypted private keys
when using non-OpenSSL backends. Each platform must provide its cryptographic
encrypt / decrypt functions.

As WinRT already uses the common parser, this commit includes an
implementation for that platform.

Done-with: Andrew Knight <andrew.knight@digia.com>
Task-number: QTBUG-40688
Change-Id: I0d153425ce63601ff03b784a111e13962061025f
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-02 23:16:25 +02:00
Friedemann Kleint
b17365cda9 Fix drawing of QLineEdit's actions when Qt::AA_UseHighDpiPixmaps is set.
Task-number: QTBUG-40525
Change-Id: Iff3c1e16d9c44e1d36b8f83ca96b48bff05ab1f0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-09-02 22:57:24 +02:00
Paul Olav Tvete
d450eb5e6d Android: Guard against invalid surfaceID
Do not try to resize or destroy invalid surfaces.

This caused update problems with all GL apps after suspend,
since we would forget the dummy view that we always keep
around so we get proper transitions on shutdown.

Also make sure that we don't mess this up even if we try to destroy a
non-existing surface. This would have fixed the bug by itself, but
then we would still be stuck with the annoying warning message.

Task-number: QTBUG-41093
Change-Id: I83299e93eb9ac5357b98ca47014789b56c91b35a
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-09-02 22:00:02 +02:00
Andrew Knight
a8b243b42e windows: Allow selection of ANGLE's renderer
The default behavior of ANGLE is to use D3D11 before falling back to D3D9.
This change improves flexibility the platform plugin to explicitly create
a D3D11, D3D9, or D3D11 software (WARP) context by setting the
QT_ANGLE_PLATFORM to "d3d11", "d3d9", or "warp", respectively.

Task-number: QTBUG-41031
Change-Id: Ie1d399c1cb0e360e5b3a6d9f2a4b28745d86cc71
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-02 21:55:48 +02:00
Andrew Knight
efdabc4b0e Remove vestiges of d3dcompiler_qt
Change-Id: I2a233cb0bfec27a7535a31818568955f8bf85c15
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-02 21:55:41 +02:00
Marc Mutz
5b9e566b4d QImage: add a qMove()
The color table is passed by value (good for C++11), so when
the argument is assigned to the member variable, that's a good
spot for a move assignment.

However, the argument is also declared const.

The standard says that top-level const is ignored, but some
compilers (I know about SunCC) think differently, so we cannot
remove it.

Instead, we do a const_cast. It is well-defined: Even though
apparently the argument was declared as const, the standard
says the const is not there, and no sane compiler would put
the argument copy into read-only memory.

Add a reminder to remove the top-level const from the
signature come Qt 6.

Change-Id: Iac18846ba669de0a30da620685ad1438c267e193
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-09-02 20:43:07 +02:00
Marc Mutz
b04c144297 QOpenGL2GradientCache::getBuffer: calculate hash value outside critical section
The code doesn't touch any member variables, so it doesn't need mutex
protection. Reducing the time spent under the mutex allows a higher
speedup (Amdahl's Law), so do it.

Also made the mutex locker const to indicate it is never unlock()ed
again.

Change-Id: Ic50b827c0e34d39cbddc7ec83675b568a9c33f6d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-09-02 20:42:51 +02:00
Marc Mutz
e12f6a47a5 QColor: remind to remove copy ctor for Qt 6
Change-Id: Ib3fc880ec5c856cc9a7573349f63052f0a00734b
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-02 19:08:48 +02:00
Marc Mutz
d8712ad044 qPremultiply(QRgb): let the compiler see all versions
Use a template helper function and template specialization
to select which of the two versions (64bit / 32bit) to
use. This makes the compiler see both versions on all
platforms, enabling better syntax checking should either
of the two change. It also will fail to compile on platforms
where the word size is neither 4 nor eight bytes now...

And, of course, it's always satisfying to remove a use of
the preprocessor.

Change-Id: I4870411f99eb3b1a2c0c170fa53fa3c9b026da15
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-02 19:07:44 +02:00
Marc Mutz
1629deec83 QTextFormat: use qHash(double/float) instead of own implementation
The implementation of hash(float) does not treat +0 and -0 the same,
thus violating the property required of hash functions that they
produce equal hash values for equal input.

Simply use the qHash() FP functions which recently became available
and which do not have that problem.

This was found by unrelated code review. I'm not aware of any user-
visible issue this fixes.

Change-Id: I458c384aaf112e29cea677022969b62a34263cfb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-09-02 19:07:08 +02:00
Marc Mutz
23c1b132b1 QPdf: Extract Method is_monochrome()
The old code repeatedly evaluated QImage::colorTable(), which returns
a vector by value.

Instead, factor the checks performed on the color table into
a helper function and pass the color table to it, reducing
the number of evaluations from three to one.

Also makes the code more readable, because the condition now
fits on a single line.

Change-Id: I82773c235047e76b87c8a9d630f7df9440430351
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-09-02 19:06:49 +02:00
Jan Arve Saether
3ded19c865 Remove the enum for specifying {In|Out|InOut|OutIn} subtypes.
Instead we can just use the QEasingCurve::Type enum.
This reduces code size and should simplify the code a bit.

Change-Id: I34eb62b7921634c91785c7b8c7c12741e6284fa1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-02 19:06:42 +02:00
Tor Arne Vestbø
8a7fcf0a7d iOS: Don't store UIViewAnimationOptions value as UIViewAnimationCurve
We pull out the magic UIViewAnimationCurve of the keyboard animation
when the keyboard is about to show, but we need to defer the shifting
of the value 16 bits, as that turns it into a UIViewAnimationOptions,
which we can't store in a UIViewAnimationCurve member.

Change-Id: Id35dae1ec487951df749dfffb6118b572c28b103
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-02 16:13:18 +02:00
Tor Arne Vestbø
942c6910d1 iOS: Get rid of markedTextFormat global static variable in IME
Preperation for IME refactor.

Change-Id: I0832c174d05d019d69ef7c01c45aaedc6e4d9468
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-02 16:13:12 +02:00