Commit Graph

7646 Commits

Author SHA1 Message Date
Frederik Gladhorn
8b24ed162c Accessibility: Do not automatically add controllers
While I do like the idea, it currently relies on every
QWidget having QAccessibleWidget as a11y representation.

This crashes for example when using the itemviews and
asking them for relations.

Change-Id: Ie15a78dae620eefb97c646b9e802b13bdf864650
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-06-20 09:18:08 +02:00
Yuchen Deng
3db8877d28 MOC: Avoiding MAX_PATH limit on Windows
See: http://msdn.microsoft.com/en-us/library/aa365247(v=VS.85).aspx
Task-number: QTBUG-26157

Change-Id: Ie74481cd06c31149a060a432352da5b2731caaef
Reviewed-by: Debao Zhang <dbzhang800@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-20 08:39:41 +02:00
Gabor Ballabas
8b92d770a0 Fix compile-time error macro when building with -fPIE
This macro causes a compile-time error using LLVM with Clang
when the target that includes qglobal.h is built with -fPIE.

Change-Id: I2e82e1a8feed9009c814f187b06501b26ea3b3b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-20 03:18:13 +02:00
Tobias Hunger
88cf9402e3 Fix access to uninitialized pointer
The C++ standard says in 9.4..2 that the object expression is evaluated,
so any compliant compiler may access d. So this syntax is a bug in this
place.

Change-Id: I37d2c4ea54febd40410ca473c906bcb1c66c4974
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-20 03:18:07 +02:00
Olivier Goffart
958aaf3770 Add qMove macro to support std::move
Change-Id: I373e07f479c11b172dab35ed7e5b62724aa50a1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-20 03:17:55 +02:00
Friedemann Kleint
e4505acd12 Windows: Fix MinGW warnings.
- Missing initializers for structs
- Missing enumeration value
- Mixing enumeration/ints in operator ?

Change-Id: I149ab01ad2ebd04f89e5c699905d5ba724828e0f
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-20 03:17:49 +02:00
Rohan McGovern
f681e99e29 tst_qfilesystemmodel: increased test's permitted runtime
This test has recently timed out a few times on Windows test runs, with
no relevant changes to account for the timeout. Double the permitted
runtime.

Change-Id: I93765c9ea592973495bfe3a2f63e63ed615eb542
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-06-20 03:17:05 +02:00
Janne Anttila
a0cf2119a7 Disable TranslucentBackground for WinCE to fix Windows QPA plugin build.
WinCE and WEC7 does not support layered Windows APIs:
http://msdn.microsoft.com/en-us/library/hh300132.aspx

For now - fallback to default window BitBlt always in WinCE.

Change-Id: I6f99d198dec9e90fb4a968882271b466638009d6
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 09:14:31 +02:00
Bradley T. Hughes
28f193ab53 QEvent: Don't give DeferredDelete special treatment
After commit 9b07fd0d5c, Qt no longer
keeps the loop-level in QEvent's d-pointer. This means we no longer need
to special case this event type in the QEvent copy constructor,
assignment operator, and destructor.

Change-Id: Iff71713d38303674f4517fdfa169cc448ed41dd4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-19 02:55:50 +02:00
Bradley T. Hughes
ccf988e510 clang: Do not use libstdc++ when C++11 is enabled
We expect that the C++ library also supports C++11 when the compiler
says it does as well. When using clang with libstdc++, the library has
no C++11 support or headers, so we cannot use, for example, #include
<initializer_lists>.

Change-Id: I844877107256f15ab314e8f82fe54434dbb07638
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-19 00:39:28 +02:00
Johannes Zellner
60f2abff5e raspberry: remove unused screen size detection code
The fbdev fallback code now resides in the default implemenatation of
the hooks.

Change-Id: Id3d2cd23ab826b90c0e6d442bfb222aa8c291646
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-06-19 00:38:27 +02:00
Johannes Zellner
e7836e6a9a platform hooks: provide defaults for screen size and depth hooks
Default hooks for querying screen size and color depth based on linux
fbdev API.

Change-Id: I7fc75c0df5e0f507cf679439416fe68c8f62f91d
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-06-19 00:38:02 +02:00
Samuel Rødal
95427b0f40 Fixed QOpenGLFunctions API.
We don't use the GL short term in the new API.

Change-Id: I73a51f65f5f4216c1763b95dcddf68fe8fc229d1
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-18 21:58:30 +02:00
Samuel Rødal
7967cb4f48 Prevent ending up in a state where focus is perpetually grabbed.
Mouse / enter / leave / key events etc are all blocked when a window has
the blockedByModalWindow flag set. The problem appears if a QWindow is
created and only later directly or indirectly parented to a modal window
that's currently showing. Since the decision on whether a window should
be blocked or not is based on its parent / transient parent chain, we
need to reevaluate the blocked status each time the parent or transient
parent of a window changes.

Task-number: QTBUG-26112
Change-Id: Ida6b118b556fe26d17fa86335a0fe7baddc7eaf8
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-06-18 21:58:30 +02:00
Girish Ramakrishnan
3c8eb40487 xcb: ensure the primary screen is added first
Currently, Qt windows without an explicit screen parameter always appear
on screen 0 despite the DISPLAY being set to :0.1. With this change,
the xcb backend adds the primary display at the beginning of the
screen list. QGuiApplication::primaryScreen() will then return that
display for all windows without an explicit screen.

Change-Id: I657c4ed92b9e0f0ed379e91c732dad9d69c4f5e0
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-06-18 21:58:30 +02:00
Jeremy Katz
abe4b31713 Make QUuid compile with QT_NO_QUUID_STRING
Task-number: QTBUG-24816

Change-Id: I0cbb0581a1c3abefdde75b7cd45fdafd31640f0d
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-06-18 19:15:54 +02:00
Miikka Heikkinen
486601fbc4 Clean up a partially scrolled QRollEffect widget
If the associated widget pointer got zeroed while QRollEffect was
scrolling, the partially scrolled QRollEffect widget remained on
screen indefinitely as 'done' was never set to true.

Change-Id: If1567ea740e81b5501137d10db471ca97d295ed8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-18 16:11:39 +02:00
Thiago Macieira
ba7f664a7f Fix tst_qfile opening of stdin/out/err: don't assume
The standard streams can be redirected to a file, so don't assume
anything, but try to get the actual size and position from the OS and
from the C library (stdout is usually buffered, so the result of lseek
might be different from ftell).

Change-Id: Ice4a0aa21726671928f56a13cc07cc0e4b52091d
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-06-18 13:45:28 +02:00
Janne Anttila
9fe5139e73 Fix building of qtbase examples when printsupport module is disabled.
Printsupport module is not that interesting in embedded environments,
and it also does not compile at the moment for WEC7. Fixed qtbase
examples to obey the availability of printsupport module.

Change-Id: I960d1b628b9ca82450aa3b0df8dd101b2544ee12
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-18 09:48:55 +02:00
Konstantin Ritt
15db02cb11 tst_QChar: drop outdated testcase
Change-Id: I0c06643165b299c552c697f400608e29ae4e7f7a
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-16 21:15:08 +02:00
Konstantin Ritt
fa705caca7 Improve the code generation by using Q_LIKELY/Q_UNLIKELY
+ reorder conditions in getWordBreaks() to make further updates more clear

Change-Id: I1ca9adde066c3a48830f310202f7181585fac194
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-16 21:14:48 +02:00
Konstantin Ritt
ff1aba7d92 Make QTBF autotest support SMP code points in the test data
I didn't do this earlier since the current test data doesn't contain any SMP code points,
the Unicode 6.2 test data does - so, I can confirm this code really works.

Change-Id: Ieae35e8480a89e22d846fd038e79592fefbbf2ee
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-16 21:14:35 +02:00
Berthold Krevert
3a77bbe68b Fix: Widgets that become top-level widgets may crash the application
You can reproduce the bug with the QMainWindow demo application: Just
dock the toolbar on the left side, then try to drag the bar back to
the top and observe that the application crashes.

This happens, because the toolbar becomes a top-level widget during the
dragging action and therefore some data structures like a window are
created. After the toolbar has been docked, it loses its top-level state
and the window object is destroyed. The same is not true for the backing
store structure, which still keeps a pointer to the destroyed window.
When the toolbar is dragged the next time, a new window object is created,
but the backing store tries to access the deleted one. Crash occurs.

Change-Id: I0d1ffc04c19ec14654ceb62a0d3cf7cf65cb952d
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-06-15 19:36:35 +02:00
Stephen Kelly
e83c3a0d33 Add automatic metatype declaration for QPointer and QWeakPointer.
Change-Id: Ic9a04fa68d0bb14ef07455a6559e59f4b887f38b
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-15 19:33:41 +02:00
Jonathan Liu
aca3513dda Do not redefine NIN_KEYSELECT if already defined
NIN_KEYSELECT is already defined for MinGW-w64.

Change-Id: Ieab9f883cf1680f792d085e254916d51602ce701
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-15 16:13:01 +02:00
Jonas M. Gastal
007476ab19 Fix double error setting, which overrode correct value.
Change-Id: I3bc992b8b41f305a01b80bca16346e18ac4d7833
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-06-15 14:06:49 +02:00
Thiago Macieira
b719bd498e Forward-declare QLatin1String too
qhash.h doesn't include qstring.h and was depending on an indirect
inclusion (probably via qpair.h -> qdatastream.h -> qiodevice.h ->
qobject.h -> qstring.h, which I've broken).

Since it forward-declares QString and QStringRef, let's add
QLatin1String too.

Change-Id: I179ebb22f761b88423ef13643afa2e5ce91ef6a2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-06-15 00:55:53 +02:00
Johannes Zellner
11aa64b1a1 eglfs: Pass QSurfaceFormat to createNativeWindow() hook
Change-Id: Ib352d8591360a224359ef218b95cd27cdfaf81aa
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-06-14 16:12:31 +02:00
Girish Ramakrishnan
f2d04d9b8c eglfs: Make QEglFSWindow respect the window format
Prior to this change, eglfs code used to override the window format
with it's own format. With this change, eglfs will respect the window
format. This is useful when the application requires a surface with
alpha (for example, so that the video layer below is visible)

QEglFSHooks::surfaceFormatFor() allows the hook author to override
the context and window surface format.

Change-Id: I97f03a8b0871dfebfca73004fa0188b33d0d0367
Reviewed-by: Johannes Zellner <johannes.zellner@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-06-14 16:12:19 +02:00
ABBAPOH
ed776e3670 Speedup for QAbstractItemViewPrivate::delegateForIndex
This fix prevents copying of a QPointer on a stack and adding/removing
QMetaObject guards

Change-Id: I844c10cede1536a14ad7cd9f007470966619d6d6
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-06-14 16:00:05 +02:00
Thiago Macieira
606c21526a Use QPointer, not QWeakPointer.
QWeakPointer tracking of QObjects is deprecated.

Change-Id: I1a81a0f9bbe02a6a38a50ab4a50e7c65212fa591
Reviewed-by: Jan Arne Petersen <jpetersen@openismus.com>
Reviewed-by: Michael Hasselmann <michaelh@openismus.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-06-14 15:29:07 +02:00
David Faure
741b1fcfa3 Make qurlinfo private, now that QFtp is private.
Change-Id: I0bb641b397b7087c89009f92d9973e0922dce653
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-06-14 12:23:11 +02:00
Jeremy Katz
cd89b164a5 Extend JSON QStandardPaths to support multiple paths per location
Allow a location to be specified as an array of paths.
    LOCATION: ["first", "second"]

The first value is selected for writableLocation().

Define the first entry as an empty string for no writable path.
    LOCATION: ["", "second"]

A single path may be expressed as a string.
    LOCATION: "only"

Change-Id: I897cf40a039ad7cb680bdf643bfa78020e8eb1cb
Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
2012-06-14 12:20:51 +02:00
Jani Honkonen
a85d15259c Fix QListView::scrollTo() when there are hidden rows
This is a cherry-pick of b0601630dd0ddabfaa3b97d042ee02b981d95988
from February

QListView does not consider hidden rows when scrolling to an item.
If there are hidden rows (or columns) before the selected item then
the visual index of an item is not the same as the row index
from the model. So scrolling will be off by the number of hidden
rows before the selected item.

Added a autotest for this also.

Task-number: QTBUG-21115
Change-Id: I01b097bce7f163cdb480a71b763c060cc006fdc7
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-06-14 10:11:26 +02:00
Stephen Kelly
6649171ddc It should be a moc error for the specified file to not exist.
Currently the missing file is ignored and plugin data is created anyway.

Change-Id: I118fd57b7d05a135e3ff58c0298b25e67cd12587
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-14 10:11:24 +02:00
Jiang Jiang
6da6845f07 Disable hinting for scaled glyphs in FreeType
Scaling hinted glyphs looks ugly, and it makes smooth scaling
animation not possible. Since nothing will work as intended
in hinted mode, we should disable hinting automatically when
glyphs are loaded with scaling transformation.

Task-number: QTBUG-24846
Change-Id: Id7fb5f5bdc2d00be157b0c5d55c316473571473c
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-14 10:11:23 +02:00
Girish Ramakrishnan
cb97d846e2 egl: return EGL config when r/g/b sizes are not set
The check is already done for alpha. Do a similar check for
r/g/b sizes.

The problem was discovered because the default scenegraph context
in QSGContext::defaultSurfaceFormat does not have r/g/b set.

Change-Id: I2f529c9d5cc7dbc61a27722336e8099e7be08965
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-06-14 10:07:23 +02:00
Albert Astals Cid
d40ab8b9f5 Add since 5.0 markers to new QCryptographicHash enums/functions
Change-Id: If367d365510cc7f6bf8f87808f5843c4a41d13e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-06-14 05:26:49 +02:00
Thiago Macieira
5f5555f4d3 Fix encoding of non-ASCII strings
tr() only takes UTF-8 as input, so we must recode to UTF-8. But we can
use QLatin1String elsewhere.

Task-number: QTBUG-26086
Change-Id: I5932ddc96fb817dbe01106e5f6f2b10f58472d6b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-06-14 05:26:45 +02:00
Shane Kearns
dd9bdf5654 Rewrite QNetworkReply downloadProgress autotest
The existing autotest was made invalid by the downloadProgress
signal choking patch.
Rewrote the autotest to download files from the test server
with some rate limiting applied to ensure more than one signal
is emitted.

Change-Id: I6026bacdf356b4e1796b80f6983e5bdce0d1bfce
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-06-14 05:26:39 +02:00
Shane Kearns
46e40214cf choke uploadProgress signals
The QNetworkReply::uploadProgress signal is intended for updating UI
elements such as a progress bar.
Limit the signal emissions to 10 per second to prevent overloading
the UI with updates.
As with the downloadProgress choke, this is implemented by dropping
signals that occur within 100ms of the previous emission.

The 100% signal is always emitted (bytesSent == bytesTotal)
When the upload size is initially unknown, this behaviour is still
provided by the upload device emitting a suitable readProgress
signal when EOF is reached.

Task-number: QTBUG-20449
Change-Id: I77e03c8a49109106e1c375ee00380293fd326b63
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-06-14 05:26:37 +02:00
Shane Kearns
d6d9c8bf32 choke downloadProgress signals
The QNetworkReply::downloadProgress signal is intended for updating
user interface components (e.g. a progress bar).
Limit signal emissions to 10 times per second, with an additional
signal just before the finished() signal to provide the 100% progress.

For the size of download where a progress bar is necessary, this
update frequency seems sufficient.

The implementation is done by dropping signals which would be emitted
less than 100ms after the previous signal emission.

Task-number: QTBUG-20449
Change-Id: I9c2dbe16c70f3270cbf98f3c74cf9d9a3f0ab900
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-06-14 05:26:35 +02:00
Tasuku Suzuki
5a7937bb04 disable codecs for asian language when QT_NO_BIG_CODECS defined
Change-Id: I45025b13bacc5f63946b02a87c742beff1946c0b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-14 05:26:26 +02:00
Konstantin Ritt
f00012aa89 Regenerate the Unicode tables
Change-Id: I64b93ba8ec85eff5e308d92c57e98e8745c43d66
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-14 05:22:15 +02:00
Konstantin Ritt
d8c04d60db Make QUnicodeTables::script() support SMP code points
Instead of expanding the scripts table with script values for the code points
>= 0x10000, it has been merged with the properties table in order to
increase perfomance of the script itemization code (not affected yet).
(Stats: the properties table grew up in 97428-89800 = 7628 bytes;
        the old scripts table was of size 7680 bytes)

The outdated ScriptsInitial.txt and ScriptsCorrections.txt file has been removed
(they were just empty, the "corrigendum" script corrections should be applied
to Scripts.txt directly, *no customization allowed*!).

More script testcases has been added - at least one per supported script.

Task-number: QTBUG-6530

Change-Id: I40a9e76f681e2dd552fd4c61af0808d043962e79
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-14 05:22:13 +02:00
Konstantin Ritt
09bc8e2cb8 QFontMetrics/QRawFont: Optimize SMP code points handling a bit
Calling QString::fromUcs4() for the single UCS-4 -encoded character is quite suboptimal
since the BOM detections and the resulting QString aren't really used;
all we need is to split the UCS-4 code point into the UCS-2 surrogate pair.

Change-Id: Ia5b68312909bf551cf2493d9e2752a7d7d837fb9
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-14 05:22:11 +02:00
Konstantin Ritt
dd68e93de7 Add the AGLFN tables generator, update the tables up to AGLFN 1.7
Task-number: QTBUG-21727

Change-Id: Ib2cacc2a52b2853059d6c873a33dcde735fbe168
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-14 05:22:03 +02:00
Konstantin Ritt
3014c35756 AGLFN: optimize glyph name lookup and reverse map creation
Use binary search in glyph name lookup, drop the linear search sentinel (0xFFFF);
Pass the reverse map by ref, initialize with memset.

Change-Id: I56de64bf2352af0615787e4cc0e13c922c640822
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-14 05:21:54 +02:00
Friedemann Kleint
0137f092af Introduce QPA API for size grip handling.
- Introduce API to do size grip handling (mouse press
  and move).
- Move Windows code to Windows plugin.
- Move X11 code to XCB plugin and activate it.

Change-Id: I2f61d6ddc1fa07447e668554d41ecc820efca23f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-06-14 03:05:41 +02:00
Friedemann Kleint
1539e8e310 Windows: Fix warnings about being unable to load fonts from font dir.
Do not call QPlatformFontDatabase::populateFontDatabase(), which
tries to load qpf2-fonts from the Qt library directory.
This directory is not installed on Windows.

Note: This affects non-in-source builds only.

Task-number: QTBUG-26066
Change-Id: I5782e61965958fc48e0edd7a3d50eef325529708
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-14 03:05:27 +02:00