Commit Graph

2772 Commits

Author SHA1 Message Date
Bradley T. Hughes
9834b3681f Make QFileSystemWatcherEngines children of QFileSystemWatcher
To support moving QFileSystemWatcher to another thread, the engines need
to follow when the watcher is moved. The easiest way to do this is by
parenting the engines to the watcher.

Change-Id: Ie2bb701c0c148da9cc2302d4de23286b8ef42c4d
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-12 14:38:18 +01:00
Bradley T. Hughes
716905cd56 Do not call moveToThread(this) in QWindowsFileSystemWatcherEngineThread
This is considered bad practice, and gives no benefit as the threads do
not use an eventloop.

Change-Id: I0de9eca97948571cf5091e2f1b19bb1faab3e2ac
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-01-12 14:38:11 +01:00
Lars Knoll
d613f30bd4 Add setPalette to QGuiApplication
If we have a getter, we also need the setter to be
symmetric.

Change-Id: Ibcb20d66c711e4c1bebd448781fa9eddb9cd773f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-12 14:35:42 +01:00
Lars Knoll
84cad0bfc6 Don't include qdialog.h
Change-Id: I67d48653b90f31d018c77ec069eb559ac46f9275
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-12 14:35:17 +01:00
Samuel Rødal
16c2622fe7 Made it possible to report screen changes through QWindowSystemInterface.
This makes it possible for platform plugin independent code (such as
generic plugins) to report changes to screen properties. An example
would be an accelerometer plugin that reports orientation changes
without knowing anything about the windowing system.

Change-Id: I984984b6d064327772c264bc942269422451da37
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-12 12:08:19 +01:00
Friedemann Kleint
738896d6b9 QFileSystemWatcher/Windows: Output paths if FindNext fails.
Change-Id: I72bd28868c84d37e3dd4ea8ab892fa092d853d4a
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-12 12:08:19 +01:00
Morten Johan Sorvig
ff5ae4a578 Ignore uninteresting accessibile interfaces.
Certain interface roles should be ignored and not
be a part of the user-visible accessibility interface
tree.

Change-Id: I264fef909052c528ee505875e3a211a33114d881
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-12 10:19:49 +01:00
Laszlo Agocs
893eb97b2a Do not mark any touch points as primary when no mouse event is sent
The touchscreen plug-in generates touch events only and therefore no
touch point must be marked as primary because that would mean there
is also a mouse event created from that point which is not the case.

Change-Id: I80c5fdbc52b048cd74c834900b6c8100963210e6
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-12 10:19:49 +01:00
Samuel Rødal
8ff37ff535 Make show() default to sane sizing behaviour based on the platform.
Traditionally it's been hard to write a Qt app that behaves sanely
across embedded and desktop platforms, i.e. defaults to fullscreen on
embedded and non-fullscreen on desktop. For Qt 5 we can fix this by
making the behaviour of the default QWindow::show() be customizable by
the platform plugin.

If the application developer wants to override this behaviour he can
still use the explicit showFullScreen(), showNormal() etc functions.

Change-Id: I26a907b404058e345d841c818daefbb57a26d3fd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-12 10:19:49 +01:00
David Faure
1319bd48c8 QTreeView: fix crash when starting a drag with hidden columns.
Crash was introduced by d639105759491 (pre-Qt-4.8 only)

Task-number: QTBUG-15834
Merge-request: MR-2725

(cherry picked from qt4 commit fd25323de7b5d5f3e0ffb1bd81ea4d251e071566)

Change-Id: I59959d3ba4c9bcb0d39bdbe58432817bbbfdd9f1
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-01-12 08:31:17 +01:00
David Faure
22b7d21186 Set missing flags in the option when rendering QTreeView drag pixmap
QAbstractItemViewPrivate::renderToPixmap was not setting all the flags
that the normal QTreeView painting sets:
option.showDecorationSelected, option.viewItemPosition (so the drag pixmap
looked wrong on Windows 7, with rects around each cell), and then the
unittest also discovered that State_Children/State_Sibling wasn't set either.

Task-number: QTBUG-15834
Merge-request: 2517

(cherry picked from Qt4 commit d63910575949106f84dacf04abaa14fc866aa66b)

Change-Id: I0a5014d960543c3ed8fea73d6df578e7e521b0e0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-01-12 08:31:17 +01:00
Michael Brasser
fa699c8f96 Abstract QUnifiedTimer.
QUnifiedTimer now controls QAbstractAnimationTimers, which
in turn can be used to drive specific animation systems.

The purpose of this change is to allow the QML animation
system to be rewritten so that it does not depend on
QAbstractAnimation.

Change-Id: If06475002e41ba85b1b86b5dd4788de6d27d035d
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-01-12 06:29:37 +01:00
Bradley T. Hughes
b409a81da5 Ensure proper locking in QFileInfoGatherer
The mutex is used to protect the QFileSystemWatcher instance created by
QFileInfoGatherer, except when calling getFileInfos(). Add a locker
before using QFileSystemWatcher in this function.

Note: it appears that QFileInfoGatherer is misusing QFileSystemWatcher
by calling it from multiple threads. QFileSystemWatcher is an event
driven class, and as such, not thread-safe. So far, no problems have
been reported related to this, so I've left the code as-is.

Change-Id: Ib1429d9399e37120acf8e8d3b989b83c4ce24203
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-12 00:45:19 +01:00
Bradley T. Hughes
93a466c6fc Remove unnecessary QMutexes in QFileSystemWatcher implementations
The polling, inotify, and kqueue implementations are no longer threaded,
and as such, do not need mutexes to protect their internal data (since
QFileSystemWatcher itself is not documented as a thread-safe API).

The Windows implementation is unchanged as it uses multiple threads
explicitly.

Change-Id: Ia82510397e576bf704ce3aed3d776b58b39f7ff3
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-12 00:45:13 +01:00
Bradley T. Hughes
d6e0306a90 Avoid races when destroying QFileSystemWatcher
On Mac OS X, socket notifiers need to be disabled/destroyed before
closing their associated file descriptor, otherwise we cause races
inside the CFSocket system. The documentation for CFSocketInvalidate()
says that we close the file descriptor after calling this function when
the kCFSocketCloseOnInvalidate flag is explicitly cleared
(QCocoaEventDispatcher clears this flag).

Do the same on the Linux inotify watcher as well, for symmetry.

Change-Id: I5592cc4bb5be4b752e48d895a685d3c92826acc7
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-12 00:45:10 +01:00
Kim Motoyoshi Kalland
e77ef98683 Fixed QOpenGLShader::log().
log() returned an empty string because the compile log was stored
in a local variable rather than the member variable.

Change-Id: I60142fd0bccfcbb495cea430b583f81fb0241329
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-11 23:55:58 +01:00
Janne Anttila
fc4cc4598e Docs: Forward-ported typo and link fixes from Qt 4.8
This commit brings already accepted doc fixes to Qt5.

Task-number: QTBUG-9224
Task-number: QTBUG-13442
Task-number: QTBUG-19858
Task-number: QTBUG-21447

Change-Id: I2ebc7c3e74427545367bdcec51e9e710a4925747
Merge-request: 1402
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-11 23:55:21 +01:00
Friedemann Kleint
1fbe8242ec QStyleHelper: Base DPI-calculation on QScreen.
- Use qt_defaultDpiX() to obtain the resolution, which
  obtains it from QScreen. This implies that for X11,
  which previously used a hardcoded default of 96 DPI,
  the real resolution will be used (typically 75).

- Since many tests (layouts, graphicsview) contain
  test data for 96 DPI, add an attribute to
  QCoreApplication making it possible to set the
  resolution to 96 DPI for testing.

Change-Id: I77c8233a96b0d75de07406f58d48886a89c3de06
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-11 22:22:34 +01:00
David Faure
f65a10b733 Remove unused QT_NO_TEXTSTREAM.
It was checked in a few places, but it didn't actually remove QTextStream,
so it was pretty useless.

Change-Id: I8eaf28893cd6c7acbe1c0b69d58de90742aee755
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-11 22:17:46 +01:00
Friedemann Kleint
aa4c2bbce9 qlocalsocket_win.cpp: Fix compiler warning.
Change-Id: Ibdb57f99b98b0c603be3c9be043737687034a958
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-01-11 21:59:19 +01:00
Stephen Kelly
0fd8816340 Add QModelIndex as a built-in metatype.
Change-Id: Ib87cfff8b4baee78189f3df5e20d2e1a00d690e1
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-01-11 19:32:34 +01:00
Harald Fernengel
f29e92e96c Fix Q_ASSERT_X to handle QT_FORCE_ASSERTS
This change aligns the behavior of Q_ASSERT and Q_ASSERT_X

Change-Id: Iac9f399da6462fcf70826d3ce1177522bed9f897
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-11 15:48:07 +01:00
Pekka Vuorela
8ae55a3484 Input direction/locale to come from platform input context
Change-Id: Ib049693211a08dcffc9dbe49add54e7feab38978
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-01-11 11:18:51 +01:00
Frederik Gladhorn
30ad53a0a6 Make QAccessibleInterface::indexOfChild() 0-based.
Makes the code nicer and more consistent with the rest of the world.

Change-Id: I5ba0ee39f5b0afd1a079a3cea9990d123955ed3f
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-11 11:18:51 +01:00
Morten Johan Sorvig
630131d585 Add support for accessibility actions.
Match Cocoa and Qt actions manually. Some have no
corresponding action on the other side.

Change-Id: I775cb8987ab843bd88d57d856ef7c0403290db00
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-01-11 11:18:51 +01:00
C. Boemann
d060b6f04f Add methods for font stretch and absolute letter spacing
We basicaly just rely on the methods in QFont

Change-Id: Iaf8cbf4d90d0c5b10b3a85983de7ca58763e0371
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-01-11 09:24:07 +01:00
Jędrzej Nowacki
4d868ece50 Remove redundant parameter from qVariantToHelper.
Change-Id: I3664a74eb8602651547c0c80dc4f628f909d97b4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-01-11 05:01:01 +01:00
Albert Astals Cid
657038ca30 Match the name in the cpp file
Which is actually the name Lars wanted i just forgot to fix it everywhere

Change-Id: Iaa190da6c17d0a423c34202c986d69feec01af96
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-11 01:11:47 +01:00
Friedemann Kleint
da71c1c755 Introduce a QVariant themeHint() to QPlatformTheme.
Start on removing platform-specific code from QtWidgets.

Change-Id: Ic2163a0ce6f2db2151cdf7ca93766b2d861eeb55
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-11 01:11:47 +01:00
Frederik Gladhorn
15db15d448 Document enum value QAccessible::Expandable.
Change-Id: I5280bf3eadf7ef876f89de318a4d6168078d929e
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
2012-01-10 23:18:32 +01:00
Frederik Gladhorn
e8482bb457 Accessibility docs: interfaces: value/action/text.
Change-Id: Ic57305cf9c008c8e861c1bdc66886b43d78c2d76
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
2012-01-10 23:18:19 +01:00
Frederik Gladhorn
8b757325b2 Improve Accessibility documentation 2.
More cleanup, make sure links work.

Change-Id: If72f9cfc0d44aa1fb261be2aace8ddd457295993
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-10 23:18:10 +01:00
Friedemann Kleint
dc5ea80963 Tests: Remove duplicate QTRY_VERIFY/QTRY_COMPARE macros in bearer.
Introduce QTRY_VERIFY_WITH_TIMEOUT and QTRY_COMPARE_WITH_TIMEOUT
to be able to specify a timeout value.

Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>

Change-Id: Iaeaa4938eb14f2c431537055f626510cba183ce3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-01-10 19:54:03 +01:00
Friedemann Kleint
75af95cbeb Fix QWidget::saveGeometry().
Bring back code that was accidentally removed.

Change-Id: Ie1a4d22caa206bc8bb8e678879935e79009e9622
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-01-10 19:53:25 +01:00
Robin Burchell
d7ec8bf29a Remove thread from QFileSystemWatcherEngine implementations.
These threads are actually counterproductive, as generally speaking, processing
watches is not that expensive an operation, so instead, they process at full
speed and can (in the case of slow processing in the thread processing the
events) stack up and consume resources for no good reason.

Threads also have an additional resource consumption per engine (some ~8mb of
thread stack on Linux), so doing away with them is nice.

A side effect of this change is that events are now effectively rate-limited by
the eventloop speed of the thread they run in, so if your thread runs too slow,
and you recieve a lot of events, on some platforms, events may be dropped now
where in the past, they would be read by the monitor thread and turned into Qt
signals (thus not visibly showing as a problem, apart from invisibly bloating
memory usage).

Task-number: QTBUG-20028
Change-Id: I345a56a8c709f6f778ca9a0b55b57c05229ba477
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-10 16:19:32 +01:00
Stephen Kelly
c42a969b2f Rename internal method check to doCheck
Mac OSX has a check macro in /usr/include/AssertMacros.h which can
conflict with this API if used together.

http://boost.2283326.n4.nabble.com/Boost-with-Darwin-Mac-gcc-4-0-1-td2580330.html

Change-Id: I93ddd08fa2b51b198bbc02ce501d79ed97a32c34
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-10 16:11:59 +01:00
Stephen Kelly
c11cb16f3f Add defines for explicit virtual overrides.
Change-Id: Ia9a610e81eeaaa0a08ca6ef4945b002bdb13fe8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-10 16:11:50 +01:00
Stephen Kelly
20abd88e71 Make the supportedDragActions a virtual accessor.
Change-Id: I4001fcabc67e5b46465b3c9111c33247c52e5788
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2012-01-10 16:11:43 +01:00
Friedemann Kleint
c95aea407b Fix a crash in QDialog.
Call d->helperDone before deleting 'this'.

Change-Id: I06224f4d3a868dccd505b1f1d3ed56af6f339ba3
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-10 16:11:19 +01:00
Bradley T. Hughes
7776beacf7 Document timer accuracy behavior on UNIX.
Change-Id: I5e8b383cc4d8ce0d249be164c5ef596328bdc50c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-10 16:11:15 +01:00
Bradley T. Hughes
46b2e5f37d Remove win*Message() exported functions
They are nothing more than wrappers around the Win32 API, and marked
for removable in Qt 5.

Change-Id: Iaf34d463488feb7840185c7b46f65a031232e34a
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-10 16:11:09 +01:00
Bradley T. Hughes
f2edb41c38 Use Qt::TimerType on Windows when starting timers
Make all Qt::PreciseTimers and timers with intervals < 20ms use
Multimedia timers for maximum accuracy. Qt::CoarseTimers and
Qt::VeryCoarseTimers use normal Windows timers, with
Qt::VeryCoarseTimers having their interval rounded to the nearest
full second.

Note that the Windows timer implementation does not attempt to align
timers and reduce CPU wakeups like the UNIX implementation does. This
might be done in the future, though. However, this change does the
best we can do now, keeping most timers working as-is, while allowing
explicit use of Multimedia timers via Qt::PreciseTimer.

Change-Id: I1898272b101c572a2a9b9454fef27a651eb178f5
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-01-10 16:11:00 +01:00
Stephen Kelly
c3ad8c1c06 Make the roleNames a virtual accessor.
This is consistent with the rest of the API of QAbstractItemModel
(which is virtual) and removes the need for code like this
in the constructor (where it doesn't belong):

QHash<int, QByteArray> myRoleNames = roleNames();
myRoleNames.insert(Qt::UserRole + 1, "myCustomRole");
setRoleNames(myRoleNames);

in favor of

MyModel::roleNames() const {
  QHash<int, QByteArray> myRoleNames = QAbstractItemModel::roleNames();
  myRoleNames.insert(Qt::UserRole + 1, "myCustomRole");
  return myRoleNames;
}

which is consistent with all other QAIM API (eg, flags()).

This is a source compatible change.

Change-Id: I7e1ce17f8dab2292c4c7b6dbd3c09ec71b5c793b
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Marius Bugge Monsen <marius@cutehacks.com>
2012-01-10 11:37:28 +01:00
Frederik Gladhorn
1e10e4deb9 Generate docs for accessible interfaces.
Change-Id: Ic385dd416a6d6bce1b999e14a4b36cdd06127ff1
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-10 09:13:11 +01:00
Jørgen Lind
58bdf5c49c We should return texture id 0 for invalid images and pixmaps
in the texture cache

Change-Id: Ib9bb136fa451c571fce2adbee29998b3f3593b31
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-10 09:13:11 +01:00
Jędrzej Nowacki
f85b9f8242 Reimplement QVariant to QDebug streaming.
New implementation fixes some commented code marked as FIXME.

Change-Id: If8f5bebedd65bcf8f839d804c2022ca79ef82ddf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-10 09:13:11 +01:00
Friedemann Kleint
7024ddba4b Platform style hints: Introduce keyboard repeat rate.
Change-Id: I556c2ecec7d5368122875a659af3ae7db88aa481
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-10 09:13:11 +01:00
Zeno Albisser
1f6f1de163 Fix key codes on mac.
Qt key codes match the unicode character in upper case format.

Change-Id: I92b43463921e71f2607e569ba7ee23d6f844c50a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-10 09:13:11 +01:00
Frederik Gladhorn
39a052c664 Accessiblity State as bit field.
We would like to add more flags that will be over the 32 bit boundary.
On Windows enums don't seem to digest values >32 bit.
This patch changes the state flags to be a bit field instead.

The windows part of the patch was written by Jan-Arve Sæther.

Change-Id: I2d1d87807f920ce4d4a5c7bfea8b1122ed44eb08
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-10 07:14:34 +01:00
Jason McDonald
5313c28b30 Update year in Nokia copyright headers.
The previous change missed some headers from years prior to 2011, and a
few new files were merged after the previous change.

Change-Id: Ib7d1a2b7062228c2a5373da64242b2ee1f0981e1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-10 07:12:41 +01:00
Xizhi Zhu
0e0eb207c4 Remove ICD plugin for bearer.
It's only used by Maemo and Harmattan, thus not needed in Qt5.

Change-Id: I8638f4fc63637be88d1aa584cde7e3a4116f2de6
Reviewed-by: Alex <alex.blasche@nokia.com>
2012-01-10 07:12:41 +01:00
Stephen Kelly
67f4893b71 Rename check to checkEvent.
Avoids conflict with macro on Mac OS.

Change-Id: I1b597205c32531e054832fcb396622b47b18040a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-10 07:12:41 +01:00
Liang Qi
8c72dc5907 Add V3(md5) and V5(sha1) version for DCE in QUuid
Add the above versions based on RFC4122 standard.

Done-with: Hagen Rother
Task-number: QTBUG-23071
Change-Id: Ieb90925374d1e3c85011b899b8dd3bb1a608c561
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-01-10 05:12:20 +01:00
Stephen Kelly
626223ca27 Remove symbian debug macro definition.
Change-Id: I3c4cc5cfd8e157587dbda1589501bb829a5a18db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-10 04:13:07 +01:00
David Faure
3e2f32547d If decodestring can't translate the string return Qt::Key_unknown.
Change-Id: Ie082b326e944a28b4e29984a527e3841a05b32f6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-10 02:02:29 +01:00
Samuel Rødal
13c5c81cfa Lock X display while calling XESetWireToEvent and its callback.
Prevent potential race conditions as suggested by Uli Schlachter.

Change-Id: Ia93eb8be1cbbc3d8ae7913a934c195af6b5ec538
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Uli Schlachter <psychon@znc.in>
2012-01-10 02:02:11 +01:00
Sami Rosendahl
b6a43cfe9c Fix memory leak in QDomDocument entity text expansion
The created entity node's reference count needs to be decremented to 0
before it is added as a child, because appendChild will increment the
reference count to correct value of 1. Re-enabled commented-out test data
tst_QDom::setContent to exercise the code path with the leak.

Change-Id: Ieb015d68ba9bbb3f20dd47e76835ad15abb1738e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-10 02:01:41 +01:00
Stephen Kelly
7226630d29 C++11 delete some contructors which are not wanted.
Change-Id: I844a0872e81f1824928814edb8d21c0b6384283d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-10 01:44:13 +01:00
Jędrzej Nowacki
ae9afa6b9e Remove wrong assert from QMetaType.
We can't assert that QMetaType helper arrays are initialized. In rare
situations it may happen that QMetaType compiled without support for an
external type (without compiled Gui or Widgets libraries) will be asked
for additional information for the type.

For example (assuming Qt is compiled with --no-gui):
// typeId it may be received over network (QMetaType::QImage)
void *ptr = QMetaType::create(typeId);

Change-Id: I018a59b23def35c7574e7c921019b5db4f06e800
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-10 01:27:04 +01:00
Jędrzej Nowacki
64a735eed6 Small QMetaType optimization.
Prefer compile time check over a runtime.

Change-Id: Ib78563083c765d1fd72217c5aa529d0cbb951130
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-10 01:25:59 +01:00
Jędrzej Nowacki
18617f2824 Implement QDebug stream operators for builtin classes
QDebug stream operator was added for:
QPixmap, QImage, QUuid, QBitArray, QLocale, QRegExp, QCursor,
QPalette, QTextFormat, QTextLength, QIcon and QSizePolicy

Change-Id: Ibcf5c9b599ba322d53cb106d8e5e157427ebe757
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-01-10 01:25:18 +01:00
Joerg Bornemann
b03fa845a7 QLocalSocket: make socket descriptor qintptr
This is consistent with the other socket classes.

Also see commit bf7f170607.

Change-Id: Ic4bf01bd4abf778e21fe575c5304f86c9bee82fc
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-01-10 01:25:02 +01:00
C. Boemann
1222da803a Make sure cursor navigation in qtexttable works like user expects
Before the selection of cells NW of anchor showed some defects where
cells would not be selected as the user expects

Change-Id: Ia2b63f11b8d534e918ffb97b76339d60f1ca0389
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-01-09 23:09:40 +01:00
Shane Kearns
1ee9c0925b SSL - dump failed certificate chains when debug logging is enabled
This is to help us debug problems with CA certificates.
Code is not compiled by default, only when QtNetwork is built with
QSSLSOCKET_DEBUG defined

Change-Id: I404c36bf4c6bf1190f480196038197be30b4b5f9
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-01-09 22:08:35 +01:00
Allan Sandfeld Jensen
aa23a18ad2 Update the lastPosition with the full current position
By only updating parts of the lastPosition the axislock got confused, since the
direction would be calculated from a mix of delta-movement and movements since
touch begin.

Task-Number: QTBUG-23530
Change-Id: I6b886d4819b963aba18bb86154df172070399206
Reviewed-by: Robert Griebl <robert.griebl@nokia.com>
2012-01-09 22:03:22 +01:00
Simon Hausmann
51d634ce2e Remove QtV8 library from QtBase
The QtV8 library is going to live in the qtjsbackend module.

Change-Id: I72251316163829411dda998b9503ce6f75b3606a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-09 19:54:07 +01:00
Jonas M. Gastal
159098719b Using proper virtual functions instead of Q_INVOKABLE tricks.
This mantains BC between version compiled with and without OPENSSL,
which was the reason for the use of "runtime virtuals". Using proper
virtuals should make code clearer.

Change-Id: I24f141ebaab68c000c2d602b54addbae1679a424
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-09 19:18:08 +01:00
Jonas M. Gastal
4669d657d2 Make (dis)connectTo(From)Host virtual in QAbstractSocket.
Change-Id: Ib1dfae4031f00fb331108152a259f6a2756381c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-09 19:17:47 +01:00
Stephen Kelly
696a6b57d1 Add define for C++11 explict delete methods
Change-Id: Ief4b8949acb528dcfc0be725b562ae71bd1640cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-09 18:54:49 +01:00
Stephen Kelly
75ab5a15c4 Rename handler/handlerManager.
Change-Id: Idbac004120ea686d403421ea4f2fb4db87f55149
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-01-09 18:53:37 +01:00
Stephen Kelly
90a7e6953d Fix constness of QInputPanel::keyboardRectangle()
Change-Id: I13552ed0c357b19486f389a8fbf2c338652437c9
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-01-09 18:53:22 +01:00
Stephen Kelly
ab7c7b66ec Fix constness of QGraphicsSceneBspTreeIndex::bspTreeDepth()
Change-Id: I8298afc9c493a1e9c6e49cc36a97184a50709558
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2012-01-09 18:53:13 +01:00
Stephen Kelly
fa1a142126 Fix constness of QShortcut::context()
Change-Id: Ic819c9b70fb2d6732f3fdc1d151a9adda571211b
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-01-09 18:53:04 +01:00
Frederik Gladhorn
9b2a776ce2 Remove unused function.
Instead this code has been ported to qAccessibleRoleString.

Change-Id: I41dd83d09cbcf2b0de3eb2fa027f24cf070f22a2
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-09 16:44:56 +01:00
Stephen Kelly
f2327c083c Rename private API to avoid conflict with mac OX macros.
Mac OS defines the check macro in /usr/include/AssertMacros.h

http://boost.2283326.n4.nabble.com/Boost-with-Darwin-Mac-gcc-4-0-1-td2580330.html

Change-Id: I99789e4dba25e80afd184c44d0781c4ebde46d74
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-09 16:40:36 +01:00
Frederik Gladhorn
30d3c3b49f Improve Accessibility documentation.
Change-Id: Ifb70d9c6d7b3096e0188e8454191786375296647
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
2012-01-09 16:22:21 +01:00
Laszlo Agocs
e8713e0873 Remove unused touch-related code in QApplicationPrivate header
For X11 and Windows the touch handling code lives in the platform
plug-ins.  The RX71 code is replaced by the generic evdev touch
support provided by the touchscreen plug-in.

Change-Id: I12c9fd3be8b466565cac7abebbb70805f1e28b5f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-09 11:58:03 +01:00
Frederik Gladhorn
f6dd3ab553 Remove docs for removed functions.
Change-Id: I33346d0a2b324afe4b85b1792854b586aa7685ba
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-01-09 11:47:17 +01:00
Bradley T. Hughes
d23322bf1c Change QCocoaEventDispatcher timer handling to use QTimerInfoList
This gives us support for the various Qt::TimerTypes.

We only use one CFRunLoopTimer to drive all of the Qt timers. We update
the time-to-fire for this timer as we add/remove/fire Qt timers. The
documentation for the CFRunLoopTimerSetNextFireDate() function says that
this is a valid use case, and is more performant than constantly adding
and removing CFRunLoopTimers. The documentation recommends using a large
interval for this use case (the docs say "several decades", but we use 1
year).

Change-Id: Ie7fd7a845f4254699a5b6a5720e7626f2c5e787f
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
2012-01-09 09:45:07 +01:00
Bradley T. Hughes
c7755d33db Export QTimerInfoList
... so that QCocoaEventDispatcher can use it to implement timer handling
and benefit from the Qt::TimerType support in QTimerInfoList.

Change-Id: I34b81502465963e2c9d528df463fa2eccd275ad6
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-09 09:45:07 +01:00
Xizhi Zhu
84bd87353a Clean-up the interface for QDate.
Four overload functions removed while keeping source compatibility:
 - shortMonthName()
 - shortDayName()
 - longMonthName()
 - longDayName()

Two functions removed since they have confusing names:
 - gregorianToJulian()
 - julianToGregorian()

Change-Id: Iaaea066a3fb77b1ee3499d3049fcec5563054cdf
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2012-01-09 07:46:08 +01:00
Stephen Kelly
7aeccb183a Remove the Q_TYPENAME define.
It is mostly not used (most places in Qt use typename directly), so
is already not very useful.

For example typename is used in:

QDataStream& operator<<(QDataStream& s, const QVector<T>& v)

Change-Id: I85337ad7d8d4ebbb424bfa2ab9a356456ff3e90f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-08 23:54:56 +01:00
Uli Schlachter
7e40ea4499 xcb: Fix a memleak when atomName() fails
The only reason for GetAtomName to fail is when an invalid atom is specified, so
the xcb_generic_error_t struct doesn't contain any useful information for us.
Still, we have to free it.

Change-Id: I3da98018b7bfe08a9d7dcd566ed010f5d7b0df73
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-08 21:55:10 +01:00
Joerg Bornemann
2588a5b249 QProcess/Win: direct forwarding of stdout and stderr
We are now directly passing the standard out/err handles to
CreateProcess instead of reading the output and writing it.

The downside is, that we cannot automatically forward the process
output of GUI applications anymore.
This behaviour is intended by the CreateProcess API.

Change-Id: Ic6e35c8c338dbea1a9f345567a37d938da1f34a2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-01-08 18:22:46 +01:00
Samuel Rødal
0ba89ed91f Detect autoreapeat in xcb plugin.
Until now QKeyEvent::isAutoRepeat() would always return false.

Change-Id: I7771bc7a7ec848ef280f99bada0a26eda188604e
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-07 20:09:43 +01:00
Pekka Vuorela
a98741516c Move keyboard locale and input direction to QInputPanel
Deprecated QGuiApplication::keyboardInputLocale() and
keyboardInputDirection(), introduced QInputPanel::locale()
and inputDirection().

Change-Id: Ic48c77f10821a949751c73c73f22bd78e2192b9c
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-07 17:25:59 +01:00
Pekka Vuorela
a2fd2f90ec Introduced input method hints for latin
On many cases especially latin input is wanted. Hint for these may,
e.g., help virtual keyboards on changing the layout to a western one.
Added a hint for requiring and another for preferring latin based
input.

Change-Id: I0ea79643665e25d9f916c3b8d0b7d7352843c2dc
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-07 17:25:45 +01:00
Yuchen Deng
0277f14f48 Avoiding crash when insert preEditString
We will insert an preEditString by QInputMethodEvent
See:
Task-number: QTCREATORBUG-5633
Task-number: QTCREATORBUG-6082

Change-Id: I8cfc7ab2543455dfdff8ec3df983d384513453e0
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-07 17:25:00 +01:00
Jonas M. Gastal
b3ce4470ae Removing QHttp class, its tests and its usage in examples.
Task-number: QTBUG-22750
Change-Id: I161fad772bfb26797e6ee9d69da925b6747c371f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-06 23:07:26 +01:00
Jan-Arve Saether
7dca461620 Remove all references to QAccessible:: {Child|Ancestor|Sibling}
These are deprecated in favor of
QAccessibleInterface::child() and QAccessibleInterface::parent()

QAccessible::Sibling can be done with a combination of those two.
This is handled by the bridges, if required.

Change-Id: I2e2a6eb2a982e7c9001a393d69f0c5f1ae9c0970
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-01-06 19:24:23 +01:00
Shane Kearns
ca5072fb18 Fix renewed SSL certificates being incorrectly reported as expired
OpenSSL tries certificates in the order they are added to the store.
There was logic to add the expired certificates after the valid ones
to ensure the valid certificate is checked first if the OS cert store
contains both the expired and renewed version of the same cert (e.g.
the verisign class 3 cert on windows)

However due to a coding error, the ordering was reversed, ensuring the
problem is always encountered instead of always avoided.

Task-number: QTBUG-20012
Change-Id: I7c8dba8a09842540a22b44d33c7dcb22bbbc6a58
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-01-06 19:24:23 +01:00
Thiago Macieira
c87bf2e8e6 Copy qbasicatomic.h to qoldbasicatomic.h
Change-Id: I15df58f9dc29189419f8cbc0ce47bf11e9f17cf4
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-06 19:24:23 +01:00
Friedemann Kleint
50e18de516 Windows: Run on Windows XP.
Replace Q_ASSERT() on missing functions from User32.dll by
qFatal() with error message. Do not check "UpdateLayeredWindowIndirect"
as it was introduced with Windows Vista.

Task-number: QTBUG-23351

Change-Id: I0064611351c687f0c3c6e13156dd534b9f7a5d75
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-01-06 19:24:23 +01:00
Friedemann Kleint
1ff1288c04 Make QUuid a class.
Silence MSVC warnings about forward-declarations as class
in the metatype system.

Change-Id: I676662e5919585e98c87413fd8360d6f41f73631
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-01-06 19:24:23 +01:00
Stephen Kelly
054a4aa7dd Add roles to the dataChanged slots in views.
This is a source incompatible change.

This is for consistency with the signal for the lifetime of Qt5. I could
imagine people trying to override a virtual function (in a new class while
using the Qt5 library) with the arguments of
the signal and have that fail due to the arguments not being correct.

It also allows ignoring dataChange events when they are known not to be for roles
which are relevant to particular views or delegates.

Change-Id: Ica191835125c1c8fdaf665debb62d635e81700dc
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-06 17:21:39 +01:00
Stephen Kelly
9ddd2c0f35 Remove documentation reference to non-existant class.
Change-Id: Idaaf16a9482edaa43e5b2389adc82cad701b1407
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-06 17:21:16 +01:00
Joerg Bornemann
d0bb97c327 split qprocess_win.cpp into Windows and WinCE parts
Change-Id: I7f2cf2c42dd24ca162238e6dc6408ac39dfcd790
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-06 14:44:41 +01:00
Bradley T. Hughes
156d160c56 QTimerInfo::expected is only needed for debugging
The code for calculating the expected time is only useful for debugging
purposes. Don't compile this into the library unless QTIMERINFO_DEBUG is
defined.

Change-Id: I6530e6a70410a12544410ef286225df98ceddcee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-06 14:40:57 +01:00
Kim Motoyoshi Kalland
fc6c050b40 Limit Bezier curve subdivision to maximum 512 line segments.
Avoid running out of time and memory for extreme cases.

Task-number: QTBUG-23443
Change-Id: Iac7799097d61295bb7395a2efe48b3e7d9257919
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-01-06 14:33:56 +01:00
Frederik Gladhorn
ce5c8743e9 Constify more accessibility interface functions.
Change-Id: Iff8da09eef5288de92ccea753a8a5fda03e214b0
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-06 14:26:12 +01:00
Frederik Gladhorn
4f94c73d6b Image interface functions should be const.
Change-Id: I9c6ecd140abc4f4d5c28ad2228e1241d3891b5ad
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-06 14:24:07 +01:00
Robin Burchell
b08daaedd4 Remove all non-inline of qMalloc/qFree/qRealloc.
We're trying to deprecate these, so don't use them anymore.

The inline uses of these have been left intact, for the moment. Inline code will
need to create their own non-inline allocation methods (for future-proofing to
allow alterations in how e.g. individual containers allocate)

Change-Id: I1071a487c25e95b7bb81a3327b20c5481fb5ed22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-06 14:11:14 +01:00
Frederik Gladhorn
514ef34d1f Fix documentation.
Change-Id: Id54263f408e29ed3b9d06712e39759485a42b869
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-01-06 13:42:40 +01:00
Frederik Gladhorn
7e46af4a41 Remove qdoc for code that no longer exists.
Change-Id: I82d4ba930335a03181aa20c9e4cb060ca8b35b9a
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-01-06 13:42:37 +01:00
Frederik Gladhorn
f03099cee3 Remove docs for functions that no longer exist.
Change-Id: Id79d3eeab85b156348054c727ea1897ac3e5842b
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-01-06 13:42:34 +01:00
Frederik Gladhorn
05efb2e1c8 Fix documentation: missing const
Change-Id: Ie90afada6ffe3198314481dd6fc68bce67605efd
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-01-06 13:42:29 +01:00
Simon Hausmann
09ab5e60d1 Fix crashing data urls
Commit 231369eb04 introduced the use of
QBuffer::setBuffer with a QByteArray that is allocated on the stack,
causing plenty of memory corruption.

This patch replaces the use of setBuffer with setData, which correctly
assigns the QBuffer's buffer instead of just relying on the pointer
passed to setBuffer.

Spotted by Rohan in http://codereview.qt-project.org/#change,11859

Change-Id: I7cdf43d438a2a7864de7c35841b42421c1c60e68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-06 13:41:46 +01:00
Robin Burchell
b44c6bef50 Remove duplicate fnctl() call.
QInotifyFileSystemWatcherEngine's constructor calls this, there's no need to do
it twice.

Change-Id: Ic19e758a3f87f2e3a885e5b834f59a5a0fe13f4b
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-06 11:19:23 +01:00
Martin Petersson
5bdd20a085 QNetworkAccessManager: check if networksession is set
Need to check that the networkSession has been set so we don't
crash when bearermanagement is enabled.

Task-number: QTBUG-23484
Change-Id: Ifdb71350ba5b4ddbdbd17a8d87189c78c524783e
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2012-01-06 11:19:23 +01:00
Richard Moore
b328e36e41 Add a new QT_NO_SSL feature macro.
At the moment users of Qt must detect if it was compiled with SSL
support by testing for QT_NO_OPENSSL. This means that any code that is
conditionally compiled this way is tied to the presence of the openssl
backend. This commit makes it possible to implement new SSL backends
during the Qt5 lifetime without breaking this code. People can still
test for QT_NO_OPENSSL if they really need openssl, but if they simply
want to know if there's SSL support at all they should use this define
instead.

In addition, this commit changes the public API headers to use the new
define.

Change-Id: Ib57a71aa65836ac9351f120a487bfeb8009d9515
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2012-01-06 11:19:23 +01:00
Friedemann Kleint
c25d147c43 Windows: Fix compiler warnings in accessibility.
Change-Id: Id9ffe1069116f25b89df85337a75dae54b5beec5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Andriy Golovnya <andriy.golovnya@googlemail.com>
2012-01-06 11:19:23 +01:00
Frederik Gladhorn
41af951eef Remove Cursor functions from invokeMethod.
Cursor position is handled by the text interface.
This was a binary compatibility hack in Qt 4.

Change-Id: I45520e6942a490834f6e9346a4c173300a9bf7a9
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-06 09:38:31 +01:00
Frederik Gladhorn
dfa6ac160f Update docs.
Change-Id: Icd8cbcde6893cc0ee5e7df18b219513cdbc0b2da
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-06 09:38:31 +01:00
Samuel Rødal
d0f74e5dd9 Added xrender as a dependency to build glxconvenience.
Prevents build errors when xrender is not present.

Change-Id: Ib80d52109dd0bcd63ba865c5f6e143961f3c20e6
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-06 09:38:31 +01:00
Sami Rosendahl
d55cdcd59f Fix memory leak in QDomDocument DTD entity declaration handler
The created entity node's reference count needs to be decremented to 0
before it is added as a child, because appendChild will increment the
reference count to correct value of 1. Also added autotest DTDEntityDecl
to tst_qdom to expose the leak when executed under valgrind memcheck.
There was no previous direct test case for unparsed entity declarations in
DTD, only indirect coverage via regression test cloneDTD_QTBUG8398.

Task-number: QTBUG-22587
Change-Id: I394ae9fc32d5b84e4ca287c5db4dd7effde6128b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-06 02:59:59 +01:00
Sami Rosendahl
1bc31fa43d Fix memory leak in QDomDocument DTD notation declaration handler
The created notation node's reference count needs to be decremented to 0
before it is added as a child, because appendChild will increment the
reference count to correct value of 1. Also added autotest DTDNotationDecl
to tst_qdom to expose the leak when executed under valgrind memcheck.
There was no previous test coverage for the notation declarations in DTD.

Task-number: QTBUG-22588
Change-Id: I876186d1277ceb4414f803b58b62f51cc1474367
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-06 02:59:55 +01:00
Stephen Kelly
17cc46a9a7 Add the roles to the dataChanged slot.
This will allow the possibility of ignoring dataChange signals for roles
which are not interesting to particular widgets.

Change-Id: Ia7dcebd875f7b9fa90aa5e9bff7ef5ca9f381d55
Reviewed-by: David Faure <faure@kde.org>
2012-01-06 00:46:18 +01:00
Bradley T. Hughes
7023bb1d35 Do not always compile in QTimerInfoList::repairTimers()
This function is never called on systems that are guaranteed to have
a monotonic click (like Mac OS X). Remove the dead code from the
library.

Change-Id: I95852c8dffaa3a9747367f0abe4a4c62e4f86421
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-05 22:15:25 +01:00
Bradley T. Hughes
c46654b3a5 Use Qt::TimerType on UNIX when scheduling timers
As stated in the documentation for Qt::TimerType, we allow for up to
5% error for CoarseTimers (the default timer type). PreciseTimers are
not adjusted at all, and VeryCoarseTimers fire with one-second accuracy.
The objective is to make most timers wake up at the same time, thereby
reducing CPU wakeups.

Note that this changes makes it possible for timers to fire early, which
may be unexpected for some applications. Such applications should use
PreciseTimers explicitly.

Author: Thiago Macieira <thiago.macieira@nokia.com>
Change-Id: Iaa70314c39a446adbc6dbb6fdfa7bafcd98a7283
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-05 22:15:25 +01:00
Albert Astals Cid
c355c300d9 Use clipboard_timeout instead of hardcoded 5000 (since its the same value)
Change-Id: Ia0edf04e36c8d30394a2bc9a691ab9aa78831f78
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-05 20:40:13 +01:00
Jonas M. Gastal
bf7f170607 Make socket descriptors qintptr.
Windows x64 uses 64 bits integer for sockets, to ensure compatibility we
should use ptr sized integers for our socket descriptors.

Task-number: QTBUG-19004
Change-Id: I4b56023874a4f1bad107c66c054fecfedde33d88
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-05 15:07:51 +01:00
Bradley T. Hughes
eb0ce0d5c1 Use explicit Qt::TimerTypes when starting animation timers.
Similar to commit 4e1ad49998, we know that
CoarseTimers are worst in their first firing, so we prefer a
PreciseTimer for short pause animations to avoid inaccuracies. If the
timeout is too big, we use a CoarseTimer anyway (current threshold is
2000ms).

The timer that drives the QDefaultAnimationDriver is always a
PreciseTimer.

Change-Id: I0939357d768b804f9f9bab3adf5ed1d0f7e012e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-01-05 15:03:30 +01:00
David Faure
9498f1aa54 Fix compile error with qWarning() << myDateTime and QT_NO_DEBUG_OUTPUT
All QDebug operator << in custom classes were disabled by
QT_NO_DEBUG_STREAM, which was set by QT_NO_DEBUG_OUTPUT.

Now QT_NO_DEBUG_STREAM is never set automatically, but remains available
for reducing the feature set altogether (qconfig.h).

Remove check on QT_NO_TEXTSTREAM: this define is meaningless, it
doesn't even undefine QTextStream, and this is unrelated to QDebug
streaming anyway.

Change-Id: I5eeed0144fa684d0e790e9dfd9a4aeb956218c39
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-05 15:02:56 +01:00
Albert Astals Cid
ec104d7a54 Free the replies
Change-Id: I719bd95d94f3bfd41eeb09a49ac3e2701a516619
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-05 14:59:19 +01:00
Albert Astals Cid
689c4009fb Check for the clipboard manager when looping due to app quiting
One can be extremely unlucky and on session logout get this:
 * All apps are going down
 * A Qt app checks if the clipboard manager is there to yield its clipboard contents
   * The clipboard manager is still there
 * Then just after that check, the clipboard manager finishes because of the session end
 * This means the Qt app will loop for 5 seconds trying to yield its clipboard contents
   to a clipboard manager that is not there anymore

Change-Id: Ia89670d4deb72f12e660a0d7aa5b2d212955d6fe
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-05 14:59:12 +01:00
Robin Burchell
848f53a268 Remove OS X FSEvents watcher.
Per QTBUG-9249, this backend is buggy, and not recommended for use by Apple.

Change-Id: I72ce88006a4badbbfdd825717020078778d16a36
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-01-05 14:35:59 +01:00
Pekka Vuorela
8ad583b7f9 Removed QApplication::setInputContext()
Obsoleted by platform input context. Setting a custom QInputContext
wouldn't work properly anymore.

Change-Id: I966573a82fdd7530544878513a655eae7b3ad67b
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-01-05 11:40:08 +01:00
Pekka Vuorela
ad22c0c7cf Removed Qt::ImhMultiLine
Multi line information does not really work that well as
input method hint. Application developer is the one setting
value for the hint, and thus would be responsible for
always having right value for multi line.

Change-Id: I6102be95549f6f6d4da40845f52d5c873cd46a47
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-05 11:40:08 +01:00
Robin Burchell
55a0b33994 Avoid redefining the lastWindowClosed() signal.
This prevents things like the following (from qmlviewer):
QMetaObject::indexOfSignal: signal lastWindowClosed() from QGuiApplication redefined in QApplication

Change-Id: I4b30235e379aedaa913ea30f05daac7079f285e9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-05 11:40:08 +01:00
Bradley T. Hughes
da47d70c32 QCocoaEventDispatcherPrivate members should not be static
Keep the Cocoa event dispatcher's private data as normal members of
QCocoaEventDispatcherPrivate. This removes the global initializers for
the macTimerHash and cocoaModalSessionStask as well.

To keep timers working, we pass a pointer to the timer's MacTimerInfo
struct to the callback, instead of just the timer id. The MacTimerInfo
needs to keep a pointer back to the QCocoaEventDispatcherPrivate to get
access to the private's members.

Change-Id: Ic3a61e5e1d1d82030735de73cf0b0c70a13c21a4
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
2012-01-05 11:40:08 +01:00
Caroline Chao
a8495549d0 CodeCoverage: Remove releaseCoverageTool() function.
QLibraryPrivate::release() can be called multiple times and it is not
appropriate to unregister and save the executed data for a library there.
The library may still be used when it is released and it seems safer to save
its data only once and probably when the application ends.

Not calling __coveragescanner_unregister_library does not affect the
coverage data. Calling __coveragescanner_register_library at load time
without calling __coveragescanner_unregister_library means the plugin will
stay loaded until the application ends. Removing the call to
releaseCoverageTool() is so acceptable since the data will be saved
when the application exits.

Task-number: QTQAINFRA-416.

Change-Id: I3135d2e203ecacfeff4a5b8ffdcd4d62fbc1db33
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-05 08:45:56 +01:00
Bradley T. Hughes
1d63b9beb9 Document that QBasicTimer::start(int, QObject*) uses Qt::CoarseTimer
Change-Id: I553b33ac7adffb0a4fcdfc14d6e34b4e7a494c4d
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-05 08:42:35 +01:00
Bradley T. Hughes
d8d4cc3962 Warn when using QBasicTimer::start() incorrectly
Previously, QObject::startTimer() would warn when called from
QBasicTimer::start() if there was no event dispatcher for the object's
thread. QBasicTimer::start() should output a similar warning when there
is no event dispatcher for the current thread.

Change-Id: I1152f73216c3551c252a7a6995defebc9e1506c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-05 08:42:23 +01:00
Jason McDonald
1fdfc2abfe Update copyright year in license headers.
Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-05 06:36:56 +01:00
Pekka Vuorela
3c40714799 Added flag operators for Qt::InputMethodQueries
Change-Id: I9e65e81c0a5a9854e28e24315a021371c9170f3f
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-01-05 02:17:04 +01:00
Denis Dzyubenko
92f9678055 Registered QUuid in the metatype system as a builtin type.
Change-Id: I6be6129d9f6bf468ba8a5805cfa0f6f79199afb3
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
2012-01-05 02:17:04 +01:00
Pekka Vuorela
99eb505103 QTextLayout::lineAt() to return invalid line if index is out of bounds
Change-Id: I1f93789c96f3b2335b02897ff5fc8385964d1641
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-01-05 02:17:04 +01:00
Jiang Jiang
24e84dd21f Support RTL text with merge font engines
Text like Urdu use mixed RTL scripts from Persian, Arabic and so on.
In RTL, sub glyph runs for individual font engines must be added from
end to start, so that the positions can still be calculated in a left
to right manner.

Task-number: QTBUG-23404
Change-Id: I7e55e4b7b858b3abbe94e352c93d36de6226ff58
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-01-05 02:17:04 +01:00
Samuel Rødal
07edbd23ed Introduced QOpenGLContext::aboutToBeDestroyed() signal.
This signal can be used to clean up OpenGL resources in a safe way
before the context is destroyed.

Task-number: QTBUG-20083
Change-Id: I45a4be01b06af4ee7196fa502116f099d50afeab
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-01-05 02:17:04 +01:00
Friedemann Kleint
8ed53babb9 Fix compiler warnings in QtNetwork.
- Initialization order in QHttpNetworkConnectionChannel
- Potential use of uninitialized value in QNetworkReplyDataImpl

Change-Id: Ia405147ef81a3f1509149349d6b5b01bb078f853
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-05 02:17:04 +01:00
Friedemann Kleint
a793a56d70 QApplication: Remove unused variable causing a compiler warning.
Change-Id: I418ac16a2b3e119569512e38d3f00fb493b769d1
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-05 02:17:04 +01:00
Denis Dzyubenko
b0cf81684d Removed obsolete function QUuid::operator QString()
It is a source incompatible change, but I believe it is safe to say that it is
a small change, which doesn't affect many people.

Change-Id: Iad11befe4cca60484cf4e04cd3049c93a4ea5faf
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-05 02:17:04 +01:00
Frederik Gladhorn
b237c6683b Remove old accessible itemviews code.
We are moving to use IAccessible2.
This code is dead.

Change-Id: Ib1687faeafbec84cfa3b123d6f6398998033d342
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-04 23:52:18 +01:00
Robin Burchell
4b31b4e9e7 Split polling watcher out to its own seperate files.
Just helps maintain sanity and clarity a bit.

Change-Id: Iaf00f9ecf2d959afcd8fe18bbca71a403cf9818d
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-04 22:21:19 +01:00
Simon Hausmann
73187281c3 Fix QPainter::drawText with complex brushes
Commit d52fd497f6 introduced a call path to
QPaintEngineEx::drawStaticTextItem, which has a bug in using the pen's color
instead of the entire brush.

This patch replaces the use of the color with the pen's brush().

Task-number: QTBUG-23450
Change-Id: Ieb3bf352c840ff0d3fb4ac678caf7b13f4f9a8f1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-01-04 21:16:55 +01:00
Robin Burchell
ecb57cfc32 Pass notification of failure of watches onto the caller.
This is particularly useful for situations where the user might really want to
be notified about a failure, for instance, in a backup application.

Empty paths are not treated as an error in calling, as the user code cannot
really do anything sensible to handle this error, but empty paths should not be
used.

Change-Id: Iddb44fd39f4e3fac5c3f9f60fb7999e1833280a8
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-04 21:09:10 +01:00
Jonas M. Gastal
b494672208 Emit error if trying to connect while socket is connected or connecting.
This applies to both local and abstract sockets.

Task-number: QTBUG-22450
Change-Id: I5c58d68da95ffb6bcde5be510853359b288e5984
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2012-01-04 18:46:52 +01:00
Bradley T. Hughes
f821d6352e Don't release timer ids in event dispatcher code
3rdparty event dispatchers are impossible to write without using the
internal API QAbstractEventDispatcherPrivate::releaseTimerId(). Fix
this by having each QObject keep track of its own timer ids, and
release them when they are no longer used. As a side effect, this
makes the QObjectData::pendTimer bit unnecessary.

This also removes the QObjectData::inThreadChangeEvent hack that the
event dispatchers used to avoid releasing timer ids when moving timers
to a new thread.

QBasicTimer becomes even more low-level. It cannot use
QObject::startTimer() anymore, since we do not have a way to call
QObject::killTimer() from QBasicTimer::stop(). QBasicTimer uses the
QAbstractEventDispatcher interface directly, and releases the timer id
explicitly as well when stopping the timer.

This change also fixes some rare timer id "leaks" when destroying or
stopping timers after a thread has exited and destroyed its event
dispatcher (the timer ids would never be released when no dispatcher
exists).

Globally destructed QObjects that have running timers may try to release
their timer ids after the timer id freelist has been destroyed. This
commit accomodates such objects by avoiding the null dereference in
QAbstractEventDispatcherPrivate::releaseTimerId().

Change-Id: I2d7cd8221fae441f3cf02b6c0b4bc16063834d00
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-04 14:31:57 +01:00
Simon Hausmann
bd525a64d5 Fix rare crashes in fontconfig fontdb due to uninitialized variable
Initialize the out variable passed to FcPatternGetString to protect
against the "failure" case. Otherwise the subsequent QString::fromUtf8
is called with an uninitialized pointer.

Change-Id: I31b8b4c366f673609b26eca162334fd8bc9f25d2
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-01-04 14:27:19 +01:00
Jędrzej Nowacki
08863b6fda Refactor QVariant handlers.
QVariant implementation is based on delegation to a handler. The handler
has rather simple construction, it is a set of function that implements
a switch statement over known types and redirects calls to a right
method of an encapsulated types instance. Unfortunately after qt
modularization project, it is not easy to use types directly from
different modules, as they can be undefined or completely unaccessible.
Which means that each module has to implement own handler to cooperate
correctly with QVariant. We can suspect that list of modules known to
QVariant will grow and it is not limited to GUI, Widgets and Core,
therefore it would be nice to have an unified, from performance and
source code point of view, way of working with handlers.

This patch is an attempt to cleanup handlers. Keynotes:
- Each handler is working only on types defined in the same module
- Core handler implements handling of primitive types too
- Custom types have an own handler
- Each handler is independent which means that dispatch between handlers
  is done on QVariant level
- Handlers might be registered / unregistered using same interface

Change-Id: Ib096df65e2c4ce464bc7a684aade5af7d1264c24
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-04 14:25:25 +01:00
Jørgen
7929a910c4 Export QOpenGLTextureCache
because it can be useful outside QtGui. The function
QOpenGLTextureCache::bindTexture gives a very convenient way to get a
texture from an image.

Change-Id: I2e22c0a3a8f1f307d0b558280043f726e3d8093a
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-04 08:00:28 +01:00
Denis Dzyubenko
e570cad9d7 Deinlined QLocale::operator==
Some time ago this was a blocker that didn't allow to refactor QLocale
implementation due without making binary incompatible changes. Deinlining those
functions for Qt5, it shouldn't be performance critical code path.

Change-Id: I6cb19e32188a2df223d04be0c613a6176ad8d118
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-04 06:01:33 +01:00
Denis Dzyubenko
01674860ac Marked QUuid as Q_MOVABLE_TYPE in the metatype system.
Change-Id: I3d343b71294ad5640636694d1a079ea9dcca6348
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
2012-01-04 06:01:33 +01:00
Frederik Gladhorn
edbd3d6a94 Add virtual destructors to accessible interfaces.
Change-Id: I60a6033911757f86c70f06c2d8d4240d2332b4cf
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
2012-01-04 04:27:02 +01:00
Denis Dzyubenko
e3e234b5eb Fixed static assert in qvariant template magic
CallConstructor<T, /* CanUseInternalSpace = */ false> is called when we need to
construct an object that couldn't be fit in qvariantdata, meaning either it is
not a POD type (Q_PRIMITIVE_TYPE), or it is simply too large to fit there.

Change-Id: Ied122b4a6f600e14312a8d515f5b3e91214a94f1
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-01-04 00:32:44 +01:00
Bradley T. Hughes
7a597e6c43 Make QCocoaEventDispatcher inherit from QAbstractEventDispatcher
... instead of QEventDispatcherUNIX. The Cocoa dispatcher does not use
any of the facilities of the UNIX dispatcher, and it reimplements every
virtual method already (with the exception of flush(), which just needs
an empty implementation).

Change-Id: I24aefd169888946afac7800192a0f96770787718
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-03 22:02:20 +01:00
Frederik Gladhorn
9ea608cb54 Use meta object to get string rep of QAccessible::Role.
Change-Id: I69320b69ea13ebc594575277e39d30a066df61fd
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-03 19:27:17 +01:00
Richard Moore
82f9ad6295 Always load the openssl configuration.
This change makes Qt load the default openssl config always, not just
when compiled with OPENSSL_LOAD_CONF. This means that facilities like
openssl engines (and their configuration) are usable. An alternative
would be to call OPENSSL_config(NULL) ourselves, but that's exactly
what the OPENSSL_add_all_algorithms_conf does for us.

Task-number: QTBUG-16018
Change-Id: I4cda701f82627e0541b6225009f4e1249aec9d47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-03 15:12:24 +01:00
David Faure
053676a80e QStandardPaths: add GenericCacheLocation.
Much like DataLocation = GenericDataLocation + domain + appname,
this makes CacheLocation = GenericCacheLocation + domain + appname.
This way a framework library can have an application-independent cache
(like ksycoca).

Change-Id: I6a8c47ff85b7d5c68b594cc8b071a752d96b029d
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-03 15:11:03 +01:00
Pekka Vuorela
bff6cf7b5b QLineEdit to use Qt::ImhSensitiveData input hint on password echo modes
Change-Id: I6922e41e7e57563f1190f46e0890b71e5c4b7ef4
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-01-03 14:58:06 +01:00
Holger Hans Peter Freyther
991b91ce57 directfb: Refer to the right class in the error message
Change-Id: I41d0b95092d16bc3a643fca903c68be82813dad6
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-03 11:23:35 +01:00
Yuchen Deng
c0542c607b Build fix if using '-no-stl' configure option
MSVC2010SP1:
error C3861: 'wmemcpy': identifier not found

Change-Id: Ib28edb5e38d691635c56dac846134e1c88c3f312
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-01-03 09:35:04 +01:00
Stephen Kelly
39f3ee8a5d Close bracket in documentation.
Change-Id: Iabc7c6a9f5554450e766dc63f518595871a3abb7
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-01-02 18:19:36 +01:00
Robin Burchell
d4514b63c7 Remove support for dnotify QFileSystemWatcher.
Inotify has been available in Linux for some ~6 years now, 7 when Qt 5 will
actually be released, so I'd say it's safe to remove this fallback path now,
particularly as the autotest notes that it's broken.

Change-Id: I49dbb161d4765d63e92f512a6375323c7d37ccbe
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-02 18:19:36 +01:00
Robin Burchell
9fbfddfe8a Merge integrity support into unix.
Similarly to ec9ea7f3e8, the code in unix
(non-Linux/OS X) is actually the same as for integrity, so merge the
conditionals together to save duplication.

This should have the side-effect of unbreaking Qt 5 on integrity wrt
the new QStandardPaths introduction, which was not added to the integrity
block.

Change-Id: Ib512fa781f5ceb240069888ce6958c9af2990d37
Reviewed-by: Rolland Dudemaine <rolland@ghs.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-02 18:19:36 +01:00
Jiang Jiang
5295aab4e6 Fix crash in positionInLigature
Check boundary of pos before accessing attributes.

Task-number: QTBUG-23104
Change-Id: I0bc93dbe320badc65acc75bb59b27f481e69b93e
Reviewed-by: Eskil
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-01-02 16:43:02 +01:00
Stephen Kelly
f29e55448b Change the default value of QSortFilterProxyModel::dynamicSortFilter
The value is changed to true. It is a common bug that developers expect
this proxy model to reflect the source model when the source changes.
That requires setDynamicSortFilter(true), so we change the default to
optimize for the common case.

Change-Id: I9bf7efdbda10309fa77aed9391c33054aaae4a29
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-02 16:43:02 +01:00
Samuel Rødal
a23a5487eb Send ApplicationActivate and ApplicationDeactivate from QtGui.
Instead of only from QApplication in QtWidgets, as we need these events
for example in QDeclarativeApplication.

Task-number: QTBUG-21573
Task-number: QTBUG-23331
Change-Id: I0c960bd1c7911d306d274a6e9a1838f158235ed0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
2012-01-02 15:08:19 +01:00
Holger Hans Peter Freyther
16696ce493 corelib: Introduce Q_ALLOC_SIZE and use it on qMalloc and friends
GCC 4.3 introduced the alloc_size attribute to hint the compiler
that allocated memory will be returned, inform the compiler which
parameter holds the size of the allocation.

Change-Id: I8734868f6bd19e201abdacd0a1b0fb80a27883c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-02 15:08:19 +01:00
Robin Burchell
fb7404e569 Implement (and unit test) simple QVarLengthArray::first()/last().
Pure syntactical sugar, to match up with what the other container
classes offer.

Change-Id: I0f97de011923d9d204cca0fa906b059dc5054a89
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-02 15:08:19 +01:00
Robin Burchell
467a000089 Remove Symbian support from src/corelib/io/.
Change-Id: I52c2a58396e03f29ca478de34c914535c7ae1012
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-02 15:08:19 +01:00
Denis Dzyubenko
5a3b08e994 Do not unconditionally define QT_BEGIN_MOC_NAMESPACE
Qt5 modules are supposed to be in a namespace, but if the namespace definition
is hidden in a macro, then moc doesn't know about it and generates invalid
moc_xx.cpp that cannot be compiled due to usage of classes outside of their
namespaces - e.g. in qtjsondb we have QtAddOn::JsonDb::Foo class, but the
moc_foo.cpp expects to find that class in the global namespace instead.

Fixed it in QtJsonDb to define QT_BEGIN_MOC_NAMESPACE="QT_USE_NAMESPACE
QT_ADDON_JSONDB_USE_NAMESPACE", however we need to ensure qglobal.h doesn't
re-define that macro back.

Change-Id: Ic8407f50c11d2d787167ad2f92457aa3ec126d45
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-02 13:33:11 +01:00
Robin Burchell
8cb0ef0793 Inline some methods in qgrayraster.
gray_conic_to, gray_cubic_to and gray_line_to were all single line wrappers
around their equivilent gray_render counterparts, with an additional lie of
error handling that never actually happened.

Since this doesn't really do anything except confuse the reader, let's ... not
do it :)

Change-Id: Id5d86c49174acb92514b628a70bd32d6c6640a5d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-02 12:53:34 +01:00
Frederik Gladhorn
1323eebfbf Remove env var to enable accessibility on linux.
Usually we don't have a plugin for this on linux anyway.
But if we do, we should actually allow it to interface with the
system.
When using AT-SPI the plugin can detect if it should be active.
Other plugins can fall back to using an env var if really needed.

Change-Id: Ic9dcfa305e7cdafbf4a93bcc2dc9a0fcd9b9a7a2
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-02 10:44:00 +01:00
Holger Hans Peter Freyther
6a1ee9667f blitter: Base QBlitterPaintEngine on QRasterPaintEngine
The original intention was to identify a clipping bug, it turns out
that during a ::begin() (and systemChanged) we should forward the
QPaintEnginePrivate state to our proxy engine.
Instead of using the proxy-pattern subclass rasterengine and
specialize the paths we are able to accelerate using the blitter
interface. This will avoid similiar problems in the future. I have
no performance measurement to show which of the two approaches is
faster/slower.

Change-Id: I39bff11b32b1fe20284c7e8df60050de5991bb6e
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-02 10:44:00 +01:00
Holger Hans Peter Freyther
ca1921ffe9 blitter: Group code by functionality in header and cpp file
* Group code responsible for tracking the render pipeline state
  to check if we can easily accelerate it
* Code that will call into the QBlittable
* Code that will lock the QBlittable before calling into raster

Change-Id: I862e242d59805de5094ed363b486afcdbc23ff78
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-02 10:44:00 +01:00
Holger Hans Peter Freyther
cef3eb5211 blitter: Fix the 'solid' detection for the brush in case of fillRect
A default QPainter will set a QBrush with Qt::NoBrush BrushStyle, the
current code detects this as a non solid fill and all calls with fillRect
and a color will not go through QBlittable. Check for Solid or NoBrush
style. Manually verified that a p.fillRect(rect, Qt::red) goes through
the accelerated path now.

Change-Id: Ic0d98030e94f5d11abbe61628fbf71d1e08219c2
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-02 10:44:00 +01:00
Holger Hans Peter Freyther
feb6211dfb blitter: Move state updates into new methods
Create updateCompleteState(QPainterState*) so we don't need to
call into the paintengine, move all state methods into the
QBlitterPaintEnginePrivate class.

Change-Id: If30fdcc3f63755e0443bced7d9d9fb993d4ec2b7
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-02 10:44:00 +01:00
Holger Hans Peter Freyther
e02749fe7e blitter: Move the definition out of the class
Cosmetic change to remove four spaces of indention from some of the
deeply nested methods.

Change-Id: I67fdd0ab722b7c7c67c4da7a0a0bd86459751700
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-02 10:44:00 +01:00
Holger Hans Peter Freyther
3ec27f827e blitter: Kill the isBlitterLocked variable of the QBlitterPaintEngine
It starts with being initialized wrongly, the call to buffer() will
lock the data while we think it is not locked, it can also get out of
sync by someone calling buffer() again. Remove the variable and
check with the QBlittable if we need to lock the resource into memory.

Change-Id: I350375011138d1b4c2c48c100b7b30b8ea2ae460
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-02 10:44:00 +01:00
Holger Hans Peter Freyther
24c88ebcde blitter: Use CapabilitiesToStateMask as a class member
Move the bit helper functions into CapabilitiesToStateMask as they
are only used in this class, allocate the class as part of the
QBlitterPaintEnginePrivate, shorten the name as well.

Change-Id: If22ddd117a9789cd98edb08f23fd0ffabb17d5a5
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-02 10:44:00 +01:00
Holger Hans Peter Freyther
1180de6d98 blitter: Style changes to the code
Spend some bytes for spaces after comma and keywords. This should
now mostly follow the Qt style guidelines.

Change-Id: I3298c8d41d40ab5b0153a33d44b1b607a2edca8e
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-02 10:44:00 +01:00
Holger Hans Peter Freyther
9a17df0090 raster: Fix typo in a function argument
Change-Id: I903e1245667680f43414414bb0b4bfaa6240ea04
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-02 10:44:00 +01:00
Bradley T. Hughes
4e1ad49998 Make QTimer::singleShot use Qt::PreciseTimer for lower timeouts.
CoarseTimers are worst in their first firing, so we prefer a
PreciseTimer for something that happens only once. If the timeout is
too big, we use a CoarseTimer anyway (current threshold is 2000ms).

Author: Thiago Macieira <thiago.macieira@nokia.com>
Change-Id: I30b20acf506e442cd58126abfe3a4d70fc13b075
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-02 10:44:00 +01:00
Bradley T. Hughes
6fc9820d2a Change QTimerInfo (UNIX) to keep the interval in milliseconds.
The API passes the interval as an int, there's no reason to convert
it to a timeval struct. This also prepares for changing the UNIX
timer code to support the different timer types.

Author: Thiago Macieira <thiago.macieira@nokia.com>
Change-Id: Ie3cc1ae8f1be6a9ad3f1766051642cbf3e614418
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-02 10:44:00 +01:00
Bradley T. Hughes
2bbf9befd8 Add Qt::TimerType argument to QAbstractEventDispatcher::registerTimer()
... and deprecate the old registerTimer() functions. The new pure-
virtual registerTimer() breaks source-compatibility. Subclasses cannot
be instantiated anymore, since the pure virtual function signature has
changed.

QAbstractEventDispatcher::TimerInfo is no longer a QPair. It is now a
struct with timerId, interval, and timerType members. This is a source
incompatibility that should only affect subclasses of
QAbstractEventDispatcher, which will need to pass 3 arguments to the
TimerInfo constructor instead of 2. If the subclass used QPair<int,int>
instead of the TimerInfo typedef, the QPair<int,int> declarations will
need to be replaced with TimerInfo.

Call the new registerTimer() function with the type from
QObject::startTimer(). Change all subclasses of QAbstractEventDispatcher
to reimplement the new virtual function. The type argument is unused at
the momemnt, except to ensure that registeredTimers() returns the type
each timer was registered with. Implementations for the various
dispatchers will be done in separate commits.

Author: Thiago Macieira <thiago.macieira@nokia.com>
Change-Id: Ia22697e0ab0847810c5d162ef473e0e5a17a904b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-02 10:44:00 +01:00
Bradley T. Hughes
ef60ed1c9d Add Qt::TimerType and the QTimer::timerType property
The timer type will control the accuracy of the timer. By default, all
timers are CoarseTimers, which allows for +/- 5% interval adjustment.
PreciseTimers will not have any interval adjustments, VeryCoarseTimers
will have intervals adjusted to full second resolution.

Use QTimer::setTimerType() or the QTimer::singleShot() overload to
specify the type.

QObject::startTimer() now takes a Qt::TimerType argument which defaults
to Qt::CoarseTimer. QBasicTimer::startTimer() gets an overload that
takes a Qt::TimerType argument. The argument is unused for now, since
the QAbstractEventDispatcher interface needs to change (done in a
separate commit).

Author: Thiago Macieira <thiago.macieira@nokia.com>
Change-Id: I3100da5aa1fe17ec30b8644897d0fe6ec4a07f52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-02 10:44:00 +01:00
David Faure
05ca21411e Handle -1 (Invalid Key) and Qt::Key_unknown gracefully in encodeString.
Previously they would fall into the unicode handling and return very
strange values.

Change-Id: I62a53894c0983bf53fd79f924b40a6fd3ba02993
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-02 09:04:12 +01:00
Sergio Ahumada
dce0563b27 Unbreak cross-compilation to ARM.
v8snapshot is not required to build V8

Change-Id: I75f728a1237acaac9d3a10a87673fb2b6dd2dc91
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-01 15:17:22 +01:00
Robin Burchell
69a44f9cfc Change event posting to use a QVector.
This provides a ~10% improvement to the newly introduced QCoreApplication
event_posting_benchmark (a simple synthetic benchmark of creating a bunch of
events, posting them, and sending the queue).

before:
********* Start testing of QCoreApplicationBenchmark *********
Config: Using QTest library 5.0.0, Qt 5.0.0
PASS   : QCoreApplicationBenchmark::initTestCase()
RESULT : QCoreApplicationBenchmark::signal_slot_benchmark():"1000":
     0.82 msecs per iteration (total: 53, iterations: 64)
RESULT : QCoreApplicationBenchmark::signal_slot_benchmark():"10000":
     8.6 msecs per iteration (total: 69, iterations: 8)
RESULT : QCoreApplicationBenchmark::signal_slot_benchmark():"100000":
     84 msecs per iteration (total: 84, iterations: 1)
RESULT : QCoreApplicationBenchmark::signal_slot_benchmark():"1000000":
     874 msecs per iteration (total: 874, iterations: 1)
PASS   : QCoreApplicationBenchmark::signal_slot_benchmark()
PASS   : QCoreApplicationBenchmark::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of QCoreApplicationBenchmark *********

after:
********* Start testing of QCoreApplicationBenchmark *********
Config: Using QTest library 5.0.0, Qt 5.0.0
PASS   : QCoreApplicationBenchmark::initTestCase()
RESULT : QCoreApplicationBenchmark::event_posting_benchmark():"1000 events":
     0.781 msecs per iteration (total: 100, iterations: 128)
RESULT : QCoreApplicationBenchmark::event_posting_benchmark():"10000 events":
     7.8 msecs per iteration (total: 63, iterations: 8)
RESULT : QCoreApplicationBenchmark::event_posting_benchmark():"100000 events":
     75 msecs per iteration (total: 75, iterations: 1)
RESULT : QCoreApplicationBenchmark::event_posting_benchmark():"1000000 events":
     774 msecs per iteration (total: 774, iterations: 1)
PASS   : QCoreApplicationBenchmark::event_posting_benchmark()
PASS   : QCoreApplicationBenchmark::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of QCoreApplicationBenchmark *********

Change-Id: Ibf56d9526b0a8cbaf171008da4104bb457628172
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-12-30 21:58:10 +01:00
Jonas M. Gastal
231369eb04 Make qDecodeDataUrl return bool.
Change-Id: I23b9fed39af7bea6c171b35e10bd72c424bd903e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-29 16:20:45 +01:00
Sergio Ahumada
78c27380c6 Fix printerPaperSize and some tst_qprinter test failures
Removing QEXPECT_FAIL accordingly.

Task-number: QTBUG-22296
Task-number: QTBUG-22562
Change-Id: I128a78897722cc067168ee50dbcbfc7537abdfcd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-29 13:18:20 +01:00
Stephen Kelly
fb9b5d65d8 Enable variadic macros if building in c++0x mode.
Change-Id: I40d1f1f64ad31a299ccad9258f70e9bf3255c3cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-29 03:20:53 +01:00
Jonas M. Gastal
7dffcf8a74 Clarifying the flow of signals on QNetworkAccessManager.
Task-number: QTBUG-22858

Change-Id: I07eaecebf17e73f9c3148465d8970ca7672a900c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-28 16:12:56 +01:00
Robin Burchell
c559edd76b Remove non-const getters marked for elimination.
These all have consted overloads, so there's no need for them.

Change-Id: I3d4f63b8eb8f1b7df7fa772d6172e0a954184d24
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-27 23:38:26 +01:00
Robin Burchell
7f32f6d682 Merge QTextDocumentFragment::toHtml() overload per Qt 5 comment.
Change-Id: Ic8850684c2298b996354e27cc96ad6486d7a3679
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-27 18:37:10 +01:00
Stephen Kelly
38d640ae67 Fix typos parametter -> parameter.
Change-Id: I0ebb3658477a1afdc1af5f4f6f64f12dc20ace56
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-27 15:57:36 +01:00
Stephen Kelly
6bb0fe08d8 Increase the value of the UserRole for the ItemDataRole enum.
For future proofing. No need for it to be so small.

Change-Id: I8a0c734f87671881f114922ada7c5bc9524de19b
Reviewed-by: Marius Bugge Monsen <marius@cutehacks.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-27 15:57:36 +01:00
Stephen Kelly
636aebb823 Replace a pseudo-virtual slot with a virtual method.
Change-Id: I5d0e1e54e0d3d441b71b7594bc14e872512cc937
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-27 15:57:36 +01:00
Jonas M. Gastal
d17b56f42b QLocalSocket shouldn't emit disconnected if it isn't connected yet.
Task-number: QTBUG-22082
Change-Id: I2e1dae133f50a232d4be3ff63cafaf1b417b286c
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-27 14:17:35 +01:00
Sami Rosendahl
b9acd85b2f Fix crashes and non-portable functionality in QDBusDemarshaller QByteArray extraction
QDBusArgument QByteArray extraction operator and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting a QByteArray when the value actually is e.g. a struct of
mixed types the byte array extraction will crash as it attempts to extract
the struct data as a fixed array.

The fix adds DBus type checks to QDBusArgument byte array extraction
operator implementations.
The checks invalidate extracting arrays of other types than bytes to a
QByteArray that worked with the unchecked implementation. The rationale
for this restriction is
1) extracting a QByteArray to a variant checks already that the array
   element type is byte
2) Results of extracting arrays of types wider than a byte to a QByteArray
   are architecture-dependent making such code inherently non-portable.

Task-number: QTBUG-22840
Change-Id: Ie20f2adc06c697a68055c803215fb408568fdd90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Sami Rosendahl
b4398dc4e3 Fix crash in QDBusDemarshaller QStringList extraction
QDBusArgument QStringList extraction operator and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting a QStringList and the value actually is e.g. an array of
bytes the string list extraction will crash as it interprets the bytes as
char pointers.

The fix adds DBus type checks to QDBusArgument QStringList extraction
operator implementations.
The checks are as permissive as possible provided crashes are avoided.

Task-number: QTBUG-22840
Change-Id: I4b67d75b59c5052d939f3a69f3e92dabdb3bdd6b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Sami Rosendahl
8f19f14274 Fix crash in QDBusDemarshaller basic string-like type extraction
QDBusArgument string extraction operators and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting string-like basic DBus type that actually is e.g. an
integer the string extraction will crash as it blindly attempts to use the
integer as a pointer to char.

The fix adds DBus type checks to QDBusArgument string type extraction
operator implementations.
The checks are as permissive as possible provided crashes are avoided.
Previously supported functionality of extracting an object path or type
signature to a string type is retained.

Task-number: QTBUG-22840
Change-Id: I29be1ae592658ca268c65ed692e1d42619d52280
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Holger Hans Peter Freyther
03b6cb9345 v8: Build V8 for FreeBSD
For FreeBSD the libexecinfo port needs to be installed and linked to, all
tests execute and pass.

%uname -a
FreeBSD qt-ppa 8.2-STABLE FreeBSD 8.2-STABLE #4: Sun Oct 30 20:43:37 UTC 2011     ich@freebsd:/usr/obj/usr/src/sys/GENERIC  amd64
%./tst_v8
********* Start testing of tst_v8 *********
Config: Using QTest library 5.0.0, Qt 5.0.0
PASS   : tst_v8::initTestCase()
PASS   : tst_v8::eval()
PASS   : tst_v8::evalwithinwith()
PASS   : tst_v8::userobjectcompare()
PASS   : tst_v8::externalteardown()
PASS   : tst_v8::globalcall()
PASS   : tst_v8::cleanupTestCase()
Totals: 7 passed, 0 failed, 0 skipped
********* Finished testing of tst_v8 *********

Change-Id: Ia8198128126c2931807c7fb872c15baad47022e1
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2011-12-23 23:21:03 +01:00
Holger Hans Peter Freyther
1cb96a6809 v8: Change the selection of Operating System
Instead of doing "I want Linux and do it by selecting Unix and
discarding everything not implementing the Linux ABI". Select the
other operating system first and have a catch all Linux/Unix anchor.

!symbian is left inside as it does not hurt right now but could probably
be removed before Qt 5.0.0.

Change-Id: I731d8349e4f9c0ac33d547523f0a0f422e994e54
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2011-12-23 23:20:49 +01:00
Jørgen Lind
57d2306f44 Link to X and Xrender libs in glxconvenience
Change-Id: I54b2704be678f2c3b9ab8d24d044977c9c01e98e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-23 15:21:27 +01:00
Jan-Arve Saether
a203debb0b Fix regression, make sure hit testing work on windows again.
The previous code did not make much sense

This regressed due to 74c9f9d83f

Change-Id: Ia4374623257863edca706a1c3d8b565d0c6bd4c1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-12-23 13:40:12 +01:00
Bradley T. Hughes
ae8c61db21 Finish removing Qt3 support
Remove the (-no)-qt3support options from configure, and remove the last
remaining references to Qt3Support, QT3_SUPPORT, and
QEvent::ChildInserted.

The compatibilityChildInsertEvents() tests in tst_QObject and
tst_QWidget have been renamed to childEvents(), which is a more
appropriate name.

Change-Id: Id0b45e9b177efcc8dceee8c9ed8afafedeeace2f
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-23 11:59:11 +01:00
Sune Vuorela
ef03396072 QCryptographicHash: allow to hash the content of a QIODevice
This adds a new function (and tests) to give the possibility of doing a
QCryptographicHash of a QIODevice, like a QFile or whatever people
needs.

It is a quite handy overload in many cases.

Change-Id: I22fd272f05571844641b3daefcc6746be4e5c7c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 19:47:47 +01:00
David Faure
eff09a2794 Fix for -Werror -Wshadow
qevent.h:792:49: error: declaration of 'device' shadows a member of 'this' [-Werror=shadow]

Change-Id: Iccb7e79dd97d55b17fbd4dfaf3503b9e251adcfc
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 18:07:34 +01:00
Jędrzej Nowacki
1dc86cbe85 Remove redundant template parameter from QMetaType's internal classes.
Filter doesn't have to be a parameter because we always use
DefinedTypesFilter.

Change-Id: I19b8eb47a4c50e290cf712f909aaead8fdc94cd9
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-22 16:29:14 +01:00
Shane Kearns
4954f71648 Fix http authentication to a different realm on the same server
This is a regression caused by the NTLMv2 authentication patch.
I have manually tested NTLMv2 authentication against MS IIS and reverting
these two lines does not break it.

Task-number: QT-5209
Change-Id: I64159cbe468e1a7f834f8726fd0c9d4ab4c54b38
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 16:10:33 +01:00
Jędrzej Nowacki
ee0a997bcd Fix movablity of QVariant.
After 8fd64d22ac (Make usage of internal
QVariant space.) change QVariant started to "inherit" movablity from
interned type.

This change fix it by interning only movable type in QVariant and by
using external allocation for not movable ones.

Obviously, this change has negative impact on QVariant it self, but
after it, QVariant will behave a lot nicer with our containers.

Change-Id: Ibffc95833918f65be737f52d694ee81a2036c412
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 16:09:34 +01:00
Shane Kearns
a7b99151f4 Fix race in http connection channel
When authentication is cancelled, close the channel instead of the
underlying socket.
The previous behaviour could result in further requests being sent
on the closed socket, which caused errors in case of https over a proxy.

Change-Id: I3dbfc164de4fb29a426c06acaac8f29b9da1d705
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 15:56:08 +01:00
Shane Kearns
d24aad8289 Don't fetch credentials from cache following a failed proxy authentication
Add variable to QAuthenticatorPrivate for tracking failure
Track authentication success/failure in http proxy socket engine
Track authentication success/failure in http connection channel

Task-number: QTBUG-22875
Change-Id: Id5d39e839428271ad687e9da12fbbdea9c478f4f
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 15:56:00 +01:00
Shane Kearns
2cc78885b0 Handle plain socket write errors in SSL
When an ssl socket is closed during connecting, and it is using a proxy
then it is possible for the plain socket to be in pending close state
when transmit() is called.
As errors were not handled, this caused the socket (and https request)
to "hang".
It now propagates the error from plain socket.

Change-Id: I6fb86815a2a63e197cea582f4b153e487543477c
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 15:55:21 +01:00
Shane Kearns
96cda705dc Fix for assertion failure
Change-Id: I97b9ecc37e938a3050793fc746288243a1cb40b7
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 15:55:00 +01:00
Shane Kearns
058fb94aff Fix faulty logic in http connection pipelining
The code which prevents pipelining of requests when authentication is
in use had || where && should have been used.
Also check for blank user with a password.

Change-Id: Ic278cedd370c9d81377f49a0af43aef415cb49ad
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 15:49:14 +01:00
Jędrzej Nowacki
56f154c747 Allow QMetaType to register information about movability
We need that information to perform some optimizations in QVariant.

Change-Id: Id9a1716e49e4cedd17cd09a32fea4ff003ef61f2
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-22 13:20:40 +01:00
Harald Fernengel
d868c9945a Remove QT_NO_STL_WCHAR hack
We don't support gcc 2.95 any more.

Change-Id: I842f1f8ac64b9006516c104add0991830ac9a46a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 13:20:40 +01:00
David Faure
c02ca6752a Fix handling of invalid modifiers in QKeySequence.
When decoding a string don't assume valid modifier strings. If a
modifier string is unknown return Qt::Key_unknown instead of skipping
the modifier.
Currently 'Win+a' is decoded to 'A' but should be Qt::Key_unknown.

Change-Id: I1c82031159a8b3c19924a7c9e991bc6b1f90d617
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-22 13:20:40 +01:00
Harald Fernengel
500fd52232 Use strlen() inline whenever possible
This allows us to benefit from compile-time optimization

Change-Id: I63dfde3758fcb0ff919fdc0418df1b7586da0b2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 13:20:40 +01:00
Morten Johan Sorvig
40cfdf30fa Enable Mac style on Mac OS X.
Add styles/qmacstyle_mac back to the build, modify
qstylefactory to load it on Q_OS_MAC.

Move helper functions from platforms/mac to
qmacstyle_mac.mm. QMacStyle should now be self-
contained and not rely on anything from platforms/mac.

Change-Id: I68fe40bb7f88c01269968bffd9579b7f3b932d4c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-22 13:20:40 +01:00
Martin Petersson
08845d3531 QNetworkAccessManager: fixed foreach copy of host address
Change-Id: I50cb113fb3c803fc5b13c74b3f7ad1fc4283065b
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 11:43:55 +01:00
Jonas M. Gastal
755fe9da1d Add ToS option to sockets.
Creates a new SocketOption called called TypeOfServiceOption that can be
used with the existing setSocketOption method to set the ToS byte in a
socket socket. This is done only for unix systems because windows
doesn't support directly setting the ToS/DSCP byte:
http://support.microsoft.com/kb/248611
http://blogs.msdn.com/b/wndp/archive/2006/07/05/657196.aspx

Change-Id: Idf9da2dd8307ac7057982fbfdf9e4e9ebe366780
Task-number: QTBUG-6221
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 11:43:55 +01:00
Peter Hartmann
86f5b78394 SSL: fix build with -openssl-linked for OpenSSL 0.9.8*
OpenSSL's SSL_ctrl() always took a "void *" argument as 4th parameter,
since at least version 0.9.7.
I have no idea why we had "const void *" in there.

Reviewed-by: Richard J. Moore <rich@kde.org>
Task-number: QTBUG-23132
(cherry picked from commit 4db91cbd6147e40f543342f22c05b7baddc52e5a)

Change-Id: Ie570e1cc59b72f13d3e6f3ed6fc1892444a63743
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2011-12-22 11:43:55 +01:00
Jørgen Lind
e6ee1848a3 Disable logging in xcb
The logging groves and modifies a vector.. It should at least be a
linked-list. but anyway, it shouldn't be enabled by default

Change-Id: Iaebb1158eea1c907e31e9606b143c0318a189dd1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2011-12-22 10:01:16 +01:00
Morten Johan Sorvig
1b51079e48 Mac: Add temporary solution to fix app deployment.
Look for the the platform plugin in "../Plugins" first.
When deployed inside an app bundle this path will
point to the plugin directory inside the app bundle.

Change-Id: I362981a9e0ca9a3e69396b033a571d0b4e2bf78a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-22 02:28:09 +01:00
Jan-Arve Saether
f718728567 Do not crash in the windows accessibility bridge
If the object did not have a QAccessibleInterface subclass it would
crash in the windows accessibility bridge.

Change-Id: I931d69466a5a74a87f1c1c577fb1c918dcc8accf
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-12-22 00:47:03 +01:00
Martin Petersson
54c487cdd2 QNetworkAccessManager: delay IPv4 or IPv6 based on getaddrinfo order
Instead of always delaying IPv4 when we have both Ipv4 and IPv6 we
should use the order we get from getaddrinfo to descide which one
that should be delayed.

Task-number: QTBUG-23066
Change-Id: Ibe8c4d7000abd6e57fe8c6afac8a4a843e17ff27
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2011-12-22 00:47:03 +01:00
Friedemann Kleint
bc8f25c7e6 QTestlib: Make QImage comparison more verbose.
Introduce a specialization for qCompare(QImage,QImage) that
checks isNull, size and format and outputs verbose messages.

Check isNull, size similarly for QPixmap.

Add an autotest:
- Add test to cmptest and make it a GUI application since
  QImage requires QGuiApplication.
- Make testlib/selftests capable of running X11-GUI applications
  by passing DISPLAY.
- Ignore stderr output for cmptest
- Add test data

Change-Id: I2b29c7822fbeedf2b22c90889739ed7ff859ce92
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-21 22:59:28 +01:00
Friedemann Kleint
5d4acbab0e QTestLib: Fix QFINDTESTDATA for Windows.
- Scan the parent directory of the executable if it is located
  in a 'Debug' or 'Release' directory
- Report with native separators in the log.
- Use the QString::arg() overloads with several string parameters.

Change-Id: I5ea84411e12978f8f958a0bce3ae10da44cc4e3f
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-21 22:59:13 +01:00
Stephen Kelly
9c67364708 Convert macros to functions.
Change-Id: I43f4188d1c33cd5a07eb7a12bf3343af7e6a211f
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2011-12-21 19:58:14 +01:00
Stephen Kelly
8c207a46e6 Port to list(APPEND)
Change-Id: I198622270324eea62dd5ad6343fdf7c89e736e6c
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2011-12-21 19:57:58 +01:00
Stephen Kelly
ad14089179 Remove misleading and incorrect information from dropMimeData docs.
It is not the responsibility of the view to insert data into the
model after a dropMimeData call.

Change-Id: Ib2dedddb3239af0e2bf722a28081c68677e6b2af
Reviewed-by: David Faure <faure@kde.org>
2011-12-21 17:40:15 +01:00
Stephen Kelly
bec40ee055 Fix style in cmake macros files.
Change-Id: I2806ce63f5948dde9c582740bc2f070900987fb5
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2011-12-21 17:40:01 +01:00
Stephen Kelly
c76f938fe1 Connect to the moved signals in the header view.
Change-Id: I6954f77ad7d02970f562abcbaf4e733c6d43ead5
Reviewed-by: David Faure <faure@kde.org>
2011-12-21 17:39:36 +01:00
Stephen Kelly
930bcb266c Fix whitespace consistency.
Change-Id: Ia5debce8e5be4e9c67e1ef303e136816ab55bf90
Reviewed-by: David Faure <faure@kde.org>
2011-12-21 17:39:25 +01:00
Robin Burchell
a09fdd91cf Fix -tickcounter in qtestlib.
HAVE_TICK_COUNTER is supposed to be set (if possible) from cycle_p.h, so
guarding cycle_p.h's inclusion with HAVE_TICK_COUNTER ensures it will never be
set.

Change-Id: I6313d0a2efd47c89522623e8e7b3f505489ded90
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-21 07:50:30 +01:00
Jason McDonald
bf4177e9db Remove mention of Trolltech in installation path.
Task-number: QTBUG-19653

Change-Id: Ic92e0bb4980af53568efe77ebc72e048ee5a32d7
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-21 01:17:37 +01:00
Robin Burchell
e5f84ebf01 Merge QReadWriteLock constructor overloads per Qt 5 comment.
Change-Id: I3b569b1240a0bc5b2589de353dbf62c175472448
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-20 20:47:13 +01:00
Stephen Kelly
341b62d308 Add missing connections.
Unit tested in next commit.

Change-Id: Iab37829f98ef8f2258a30aed60e95aa114379b7e
Reviewed-by: David Faure <faure@kde.org>
2011-12-20 19:02:54 +01:00
Robin Burchell
189f944a0d Remove unused QPicture::detach_helper() private method.
QPicture doesn't need this for quite a long time now, so get rid of it.

Change-Id: Ie575f32555deb130f7b27e11a7617fb2b3dc4e43
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2011-12-20 16:18:27 +01:00
Robin Burchell
43aef6f8d2 Remove non-const QMovie::cacheMode().
There's a const QMovie::cacheMode(), so having this makes no sense.

Change-Id: I0b6f20055fcbb28f3a21a8bc303f82543592c9c6
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2011-12-20 16:18:27 +01:00
Harald Fernengel
2532ddc48b make QString::fromLatin1 partially inline
This allows us to benefit from compile time optimizations when calling
strlen()

Change-Id: If6694117e613a012fce97f8664e6b43005d255de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-20 16:18:27 +01:00
Robin Burchell
2992db14e7 Remove unused qInitResourceIO() method.
Was effectively removed in 4.x's 2e7d5def1fdabb5949fbffc629da500aa2bb78d7, but
couldn't be removed due to it being exported.

Change-Id: I5061f50deaeae7f53e8b688633e377095b4463c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-20 16:18:27 +01:00
Robin Burchell
ab9ce77e09 Remove qt_image_id() and qt_image_colortable().
Both of these have been unused at least as far back as Qt 4.5 according to git
log -p.

Change-Id: I381024cb1621fbfdb806a62e1cc55ce13219ef17
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2011-12-20 14:38:10 +01:00
Pekka Vuorela
b652cc8d20 Adapt from input context mousehandler to input panel in QLineEdit
Change-Id: If14d0cc18188da1dbc8b152fa2fa9583ff03b3bc
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-20 12:57:38 +01:00
Pekka Vuorela
a1743e4681 Remove input context action support from editors
Relying on obsolete QInputContext API.

Change-Id: I954ccf57204cbb24ff5cec622384fa3b9932a079
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-20 12:57:38 +01:00
Pekka Vuorela
34cb690163 Adapt from QInputContext interface to QInputPanel
Change-Id: I4143c3b516e7b0e46c706b8a6560bca9d8951572
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-20 12:57:38 +01:00
Frederik Gladhorn
a730a2b196 Add destructor to QPlatformFontDatabase.
Virtual functions deserve a virtual dtor.

Change-Id: I71b7ae3b7fb0aa1553a37a90dce6270740d49e32
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-20 12:57:38 +01:00
Alan Alpert
cb9b7ceffb Revert "Revert "Add QObject::objectNameChanged(con... signal""
This reverts commit 9b17557f3b.

Justification: Temporary commit, see JIRA task.
Task-number: QTBUG-22985
Change-Id: I3df9eb5fdbdc133349dca5e192dcfcc9e758626c
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-20 11:15:21 +01:00
Olivier Goffart
8754bf03f5 Better error reporting in case of connection failure.
Use Q_STATIC_ASSERT_X give a better error message.
If C++11 is used, you get the string in the error.
Else, clicking on the QStaticFailure error still shows you the
string in the qobject.h source code)

And report better failure if the return types do not match.
(Without the static assert, you would still have a compilation error,
but in an unrelated place, with no reference to the actual connect()
call. The error was thrown from the virtual call
QSlotObject::call, without saying where it was instantiated)

Previously the error was relying on the existence of a type inside
CheckCompatibleArguments, but the Q_STATIC_ASSERT requires a bool
(hence the introduction of CheckCompatibleArguments::value)

There also was a typo in the return value of
AreArgumentsCompatible::dummy that made that code not work, and that
error not be reported.
(Instead, the error was reported when QObjectSlot::call is instantiated)

Specialization of AreArgumentsCompatible for the void type have been
added because if the return value of a signal or slot is void, the
connection should work.

Change-Id: I5a93ec787ce2a4b94a26630ca31d5001cd294e4d
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-20 09:15:41 +01:00
Jason McDonald
85a77cd5c8 Retire QTest::pixmapsAreEqual().
QTest::pixmapsAreEqual() was left in the Qt4 API for compatibility with
some old tests written for Qt3.  QCOMPARE() is the preferred way to
compare QPixmaps and provides superior diagnostic output when a
comparison fails.

This commit removes QTest::pixmapsAreEqual() from the testlib API and
replaces the last few remaining calls with QCOMPARE.

Change-Id: I051c0e7d3bda072855fcd262d82e8e540619233b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-20 06:17:42 +01:00
Stephen Kelly
1749fef3c5 Remove declaration which is exported from QtGui.
Fixes static build.

Change-Id: I6f82ded7bf6cb3b72b0ef987e781c7e8f9ed932b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-19 23:04:38 +01:00
David Faure
8707c09fcd Fix QDir::removeRecursively so it doesn't follow symlinks to directories.
Critical bug... Good thing I had backups of my $HOME.

Change-Id: I43b3a80786c946b0aec797036c1164d436d521f8
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-19 20:48:16 +01:00
Shane Kearns
9ffd69a6a6 Fix regression in user-agent setting of http proxy in a QNetworkRequest
Modifying the proxy causes a detach(), so the socket is still using
the unmodified proxy.
Changed this to setProxy() the modified one back to the socket.

Test case tst_QNetworkReply::httpProxyCommands()

Change-Id: I448c2f2ab43ce8d78bc6edb8261599bf67372676
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-19 19:08:57 +01:00
Laszlo Agocs
2edada763a Update the touchscreen plug-in.
Now works with bcm5974: Added manual contact tracking for drivers that
do not report a tracking id and fixed abs limit querying to use
ABS_MT_* instead of ABS_*.

Fixed reported area: The incoming point was the top-left point instead
of the center which was incorrect.

Added pressure support.

Tracking of event type has been removed as handleTouchEvent no longer
needs it.

Broken debug prints have been removed.

Changed udev auto-detection to pick only /dev/input/event*.

Fixed multiple released state reports with some drivers.

Name and capabilities are now set properly for the QTouchDevice.

Change-Id: I8f026c9a14465bfb6d567f4dcf36c5c03f843868
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-12-19 17:29:10 +01:00
Olivier Goffart
87679491cb Do not call QueuedConnection slot on partialy destroyed object
This is a regression introduced in Qt 4.8
When QApplication::processEvents is called from a destructor, it is
possible that pending events would still be called on the already
destroyed subclass.
Prevent that by using the same pattern as in QMetaObject::activate

Change-Id: Ida50db07ae089264402dafcde7a41a066479d08b
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-12-19 14:06:12 +01:00
Friedemann Kleint
bbc098ab9f Windows: Remove Window from list before calling DestroyWindow.
Change-Id: Ifef99d9e4e46f0450cecf8ecba18ce79ebec3e8d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-12-19 12:27:45 +01:00
Olivier Goffart
92464faea9 Q_STATIC_ASSERT: fix C style cast
Else tst_moc::oldStyleCasts will fail if one add STATIC_ASSERT in
some headers included by moc generated files

Change-Id: I29ae64c14f10c889137fde36bb14c8ce047d5244
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2011-12-19 12:27:45 +01:00
Frederik Gladhorn
74c9f9d83f Accessibility: childAt returns interface
childAt used to return an integer.
Return an interface instead.

Not requiring a direct child to be returned allows optimizing
by bypassing iterating through the hierarchy of accessibles.
For QtQuick this is the only sensible way of implementing this.

The bridges are still responsible for finding the top-most element.

The default implementation in QAccessibleObject is sufficient
to return direct children. The implementation in
QAccessibleApplication is therfore no longer needed.

Change-Id: Id7100dd5bcc3a98de516a7f4a12eaaa41cb46d26
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-19 12:27:45 +01:00
Stephen Kelly
7e12d2d30f Change a slot into a virtual method.
Implements a BiC Qt5 TODO.

Change-Id: Ie7dc32d954335019166dbd78d8b01ef79e2ad5c2
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-19 10:42:26 +01:00
Stephen Kelly
c023f5600a Remove plugin related variables from the CMake files.
It doesn't currently have any effect and needs to be re-thought
anyway.

Change-Id: I6e620ca5b341264bbf5279a19e8f25af8fa7d396
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2011-12-19 10:42:02 +01:00
Jędrzej Nowacki
31d8ecfe3b Make QMetaTypeInterface POD.
QMetaTypeInterface has to be POD because it is constructed in a static
array. Constructors in POD types are not allowed so we will use a macro
instead.

Change-Id: Iab9ae776dfe4dcd7148558f02d6181c5917aa5c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-19 10:21:16 +01:00
Chris Meyer
e75e4421cd Enable option to see filename extension in Mac save dialog
Many Mac OS users expect to have the option to see the file extension
of the file being saved in the save dialog. This patch enables that
option.

Change-Id: I7713bcef16b6f43135b382c7107f306009c7a0a1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-19 09:55:24 +01:00
Chris Meyer
b13f630c81 Add check to make sure qApp exists before using
Check for qApp before using. I'm aware that this is in commented
out code right now; but I wanted to make sure it doesn't
accidently slip back in without this check so I'm submitting
this patch. It caused problems at shutdown in 4.8.

Change-Id: I1c2358ab94f8b698e5519b3e0f988fb5cdd653fa
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-19 09:53:42 +01:00
Jason McDonald
e299832dbf Avoid confusing method overloading in QTestTable.
The private class had two append() methods, one appending a column and
one appending a row.  Use more meaningful names instead of overloading
orthogonal operations.

Change-Id: I97e0268d6cb289694557846f244fe770cf980aaf
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-19 04:43:38 +01:00
Robin Burchell
3992c1cb15 Remove note about Maemo5-reserved enum values, and renumber appropriately.
With the ABI/API break, we can afford to do this.

Change-Id: Iaf318a56d572679322fde0448556eaa4242842d1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-18 15:15:21 +01:00
Robin Burchell
eada3449b9 Remove widget attribute orientation values from Qt:: enum.
These were only actually implemented on Symbian, thus, they aren't too useful,
apart from confusing developers when they don't work.

Removed per the discussion on:
http://lists.qt-project.org/pipermail/development/2011-December/000860.html

Change-Id: Id097cb392a3d964364adbe51a72a22927b9c382c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-18 15:15:12 +01:00
Friedemann Kleint
51fb43b37f QSortFilterProxyModel: Fix warnings about unused variables.
Introduced by 4ebceaba39.

Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>

Change-Id: I81985c4121db5f6abd832f64ef412646daec6259
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-12-16 19:10:47 +01:00
Joerg Bornemann
d1a671b698 extract QWindowsPipeReader from qlocalsocket_win.cpp
The code for reading named pipes can now be used in
other places as well.

Change-Id: Id734617a3927e369491a6c5daf965169ceb01f74
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-16 15:14:12 +01:00
Morten Johan Sorvig
ac0e35c8c7 Cocoa: Accept mouse clicks that activates windows.
Events for mouse clicks that active windows are by
default suppressed. Qt needs to see all events in
order to properly close popup windows.

Wether or not the event should be sent to the
target needs to be implemented later on - in the
QWidget world this is controlled by WA_MacNoClickThrough

Change-Id: I4b96d33978ed2b3cb793f52bb5b6fef234190a00
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
2011-12-16 14:57:04 +01:00
Stephen Kelly
211e434a05 Move proxy and selection models to QtCore.
Change-Id: I71097855cb9e28105238e496778f29f99f7fc84e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-16 13:00:57 +01:00
Martin Petersson
9bc4b56656 QNetworkAccessManager: delay IPv4 connection with Happy Eyeballs
Incase we have both IPv4 and IPv6 available after the host lookup
we should delay the connection attempt to IPv4.

Task-number: QTBUG-23066
Change-Id: I8c0177cf125c9daae314ada73cacef790a39b856
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-16 11:22:52 +01:00
Jason McDonald
f4ccbc2868 Avoid qDebug in verbose benchmark test output.
Use QTestLog::info() rather than qDebug() to output informational
messages from testlib.  Source file and line are deliberately omitted as
they would come from testlib rather than from a test program.

Change-Id: I7b479bba4d3d553c6fa846d8d5ea2c29a8ef42b8
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-16 02:43:46 +01:00
Jason McDonald
8c2727ac18 Switch off signal dumper when testing is completed.
Previously, if the signal dumper was switched on with the -vs
command-line switch, it would never be switched off again.

Change-Id: I192e188010471525723fad0844ff33e9482128ea
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-16 02:43:46 +01:00
Kim Motoyoshi Kalland
6506e0a6ee Improved path filling performance in the raster paint engine.
Convert bezier curves to polylines before rasterizing with gray
raster.

Change-Id: I353debd4338f2a3ce2fa1cfa1bff9dd2e36f05ab
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2011-12-16 00:51:47 +01:00
Morten Johan Sorvig
7b874b7fc4 Cocoa: Update geometry on window move.
Call [QNSView updateGeometry] directly. We can't
got through the frameDidChange notification since
we are not actually changing the QNSView frame.

Rename frameDidChangeNotification -> updateGeometry
sine it now handles updates from two different sources.

Change-Id: I848e558294093cd51d97778734b5cf872435266a
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-15 21:04:27 +01:00
Morten Johan Sorvig
140579cb3e Cocoa: Don't set window size in propagateSizeHints
Unless QWindow:baseSize returns a valid value.
Setting the size caused lots of window geometry
instability in Creator.

Change-Id: Iab45e88b47207db900c7655c217959391d84a1bb
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-15 21:04:27 +01:00
Morten Johan Sorvig
c13b223979 Cocoa: Add version check for convertRectToScreen.
convertRectToScreen was added in 10.7, use
convertBaseToScreen on 10.6

Change-Id: Ica1ee0f62e1fc9b0d5ccf463419496684da779b7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-15 21:04:27 +01:00
Robin Burchell
81d55783bb Rename QEventDispatcherQPA to QUnixEventDispatcherQPA.
This removes confusion when we add a Linux-specific QPA dispatcher, and is
technically more accurate, as QEDQPA was not 'the' QPA event dispatcher in the
first place.

Change-Id: I2a41d425f284522ee76ef86782d5eb2bdd805120
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-12-15 21:04:27 +01:00
Robin Burchell
ec9ea7f3e8 Merge integrity support into unix.
Since integrity was pulling in all the same code (except the glib-in-QT_CONFIG
branch), we can just merge this in.

This shouldn't break integrity unless they somehow magically inject glib into
QT_CONFIG without actually having glib, but the removal of redundancy makes this
worthwhile.

Change-Id: I527b5e60bea4452fdca5eedfe729214f16519234
Reviewed-by: Rolland Dudemaine <rolland@ghs.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-15 21:04:27 +01:00
Joerg Bornemann
0330036631 QLocalSocket/Win: eliminate checkReadyRead()
Change-Id: I459c0ba42d3e5b0da57884f5cdfc6f44a11600f7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-15 19:17:04 +01:00
Joerg Bornemann
3ccd626429 QLocalSocket/Win: make emitReadyRead timer persistent
This saves us from creating a single shot timer every time we emit
readyRead and eliminates the parallel pendingReadyRead flag.

Done-with: ossi

Change-Id: I1de7f07b83b583b9d60dd8862d6a9f7865b5b891
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-15 19:17:04 +01:00
Joerg Bornemann
abccefa4a8 QLocalSocket/Win: fix behaviour on broken pipe
We must not close the QIODevice, if we detect a broken pipe.
We still can have data in our read buffer that can be read by the user.

Autotest: tst_QLocalSocket::threadedConnection

Change-Id: Ibe823c006516acb27f51a06ca0bbe5555dbd88f5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-15 19:17:04 +01:00
Robin Burchell
1431679fb5 Remove Symbian support from /src/corelib/kernel/.
Change-Id: Ic4a1b4f074d2ffd4cdfcb44e47c9bfccc2378760
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2011-12-15 17:20:03 +01:00
Thorbjørn Lund Martsum
f405a57fa1 QHeaderView - remove stupid if
Not only is this extra if unnecesary - it is confusing.
oldSize is different from size.
(otherwise we would have returned less than 10 lines above)

Change-Id: Ie911414f679df2be7b5c8bc2670225d46e986b32
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2011-12-15 15:39:24 +01:00
Thorbjørn Lund Martsum
3bb0c88de8 QHeaderView - no big update work if updates are disabled
There is no reason to find out where to update the headerview
if updates aren't enabled.  Another approch I considered to skip the
whole calculation and just call update. I seriosly doubt that this
calculation and update of a particular QHeaderView rect will normally(*)
be faster than just updating everything.

However to be safe I have done the conservative fix.

(*) Normally but with many/fragmented spans in the headerview.

Change-Id: Ia812a747ee825653db0345cdc34f9d2f7155ea01
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2011-12-15 15:39:24 +01:00
Robin Burchell
f9516e4c8e Split timer handling out of QEventDispatcherUnix.
This makes it easier to see the guts of the unix event dispatcher, and to
experiment with it.

Change-Id: I715bb68c4de6798e10bc55304a128b88e0249c63
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-15 13:33:31 +01:00
Bradley T. Hughes
317ee62d44 Remove unused ownObjectName field from QObjectData
This field isn't used at all in qtbase, nor in any of the qt5
submodules.

Change-Id: If57d389935593f797818506a220c6a3cc04b6078
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-15 13:33:04 +01:00
Bradley T. Hughes
2561ab5841 Remove QT_JAMBI_BUILD code
Change-Id: Ic9231b11293af4352f11cf075893175f0c9a471f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-15 13:28:09 +01:00
Bradley T. Hughes
0501c9d8f1 Correct sizeof(QObjectData) after out-of-order cherry-picks by Gerrit
Commits a6ae75f92a and
6f0f9f6928 were cherry-picked in the wrong
order (despite the dependencies shown in Gerrit), causing the
QObjectData::unused bitfield to be too large.

Change-Id: I65acaa8b507f7f6f2c5735f45bd0ad8343abea54
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-15 08:17:49 +01:00
Jason McDonald
a925226d44 Remove Qt5 comment from qsignalspy.h.
The removed comment refers to a task in a bug tracker that no longer
exists.  The comment also mentions making (part of) testlib use Qt's
regular binary compatibility mechanisms, which is desirable in the long
term but not in scope for Qt 5.

Change-Id: I6f23a9a2c8a84e30afe2aeb5c53ea93c25ba6f11
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 08:15:13 +01:00
Jason McDonald
95cb93dc59 Fix incorrect function name in assertion.
Change-Id: I3eb8e7afe3f7ca514dd4839e603612b56c7d8082
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 08:15:08 +01:00
Jason McDonald
a3109c8b0b Remove QTest::qt_snprintf() from testlib API.
This was an internal function that used to act like qsnprintf() but also
filtered unprintable characters out of the test output.  The filtering
has been moved somewhere more appropriate and this function is no longer
used by testlib.

Unfortunately, the function was exposed in the public API due to its
former use in the implementation of a public macro.

In the unlikely event that any code outside testlib calls this function,
the call should be replaced by calling qsnprintf(), which comes from the
QtCore/QByteArray header.

Change-Id: Iddc17b4361d16ebddd19346ae7d1064951dd7738
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-15 08:02:36 +01:00
Giuseppe D'Angelo
be6b29f001 Fix typos in QObject::(dis)connect warnings
For some strange reason "Object::method ..." was printed, without
the leading Q.

Change-Id: I10b99e8aa8730e4020d15b3e04a01004bade76c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-15 05:48:27 +01:00
Jason McDonald
dc98d58562 Improve QTest::keyClick documentation.
Make it clear that the delay is applied before each key-click is
simulated.

Change-Id: Id100f1f2db1a5b1651c3046905719d7eb06ec1a0
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 01:57:57 +01:00
Jason McDonald
5b413852dd Update documentation of QTEST_MAIN macro.
Update the docs to describe the behaviour that resulted from moving the
traditional Qt widgets into a separate library from the rest of GUI
classes.

Change-Id: Ibd0ef05cc871b8f5a6700e421aa41bdf64c1210b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 01:57:53 +01:00
Jason McDonald
c45f9c7761 Improve QCOMPARE for QStringList
After establishing that both lists are the same size, there is no need
to calculate the minimum of the list sizes.  Also, use sizeof() instead
of hard-coded values when calling qsnprintf().

Change-Id: I2396cf3f941770229e1cef6422aeddbe549c51fc
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 01:57:48 +01:00
Bradley T. Hughes
c4e36728bc Disable warnings when building mkv8snapshot
Like in commit 5341cf7831, do not enable
warnings when building V8 code.

Change-Id: I447db52d546b50aea1c3afc88db7ce6923a5e310
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2011-12-14 23:26:15 +01:00
Morten Sorvig
f950a0f0c0 Make QCocoaWindow independent of NSWindow.
QCocoaWindow now gets resize events from QNSViev
and does not require a NSWindow. QWindow instances
can now be inserted in NSView hierarchies. This is
useful for Qt-as-a-plugin use cases and is needed to
implement QMacNativeWidget for Qt 5.

Change-Id: Ia95ea9c22a15a3e62d1e6543466cff07390c70a2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-14 23:26:15 +01:00
Morten Johan Sorvig
f295ef1a4b Cocoa: Add window debug output
Add logging for setGeometry/setVisible/propagateSizeHints.

Change-Id: I3590caed586d36f789dd67b1951e8152f923a407
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-14 23:26:15 +01:00
Friedemann Kleint
3b2d99a5c8 QIBusPlatformInputContext: Fix a crash in tst_qinputpanel::update.
Change-Id: If50c442958b6f25f17325f7792bb3f882e4b13e7
Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-14 23:26:15 +01:00
Friedemann Kleint
56c4ddfdf6 QPlatformDialogHelpers: Reduce dependency on QDialog.
For each QDialog-derived class, introduce a Q[X]Options class
containing the options of the dialog. An instance is shared
between the QDialog (or dialog desktop component) and the
helper.

Change-Id: Ibabf508a4b9eaea25615638a47a4c1b8f93c019e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-14 21:49:33 +01:00
Thorbjørn Lund Martsum
f86007175d QHeaderView::ResizeToContents slow hide fix
I have been a bit confused about what QHeaderView::ResizeToContents
does good. It only sizes depending of the visible part.

However in hide it goes crazy and checks calculates size hints
for every row. At first I considered to solve it in QTableView.
It could be made to calculate the maximum height of the maximum
screen - however I decided not to touch it since I was not
certain that it wouldn't have any unexpected side effects.

Therefore I instead made this patch which is more simple and seems
to be safer. The logic is that when a QHeaderView is hidden we actually
only want to recalculate sizes if the headerview has a visible parent.

Task-number: QTBUG-14234

Change-Id: I186ab6afa95aed43022f2bb7c36e3fd008355d9b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2011-12-14 18:18:59 +01:00
Aaron Kennedy
eeade8bf9c Update V8 to match current patchset
Change-Id: Ib3a093129b1f8bbe66fc870af8871dea3f58c081
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2011-12-14 15:39:43 +01:00
Aurindam Jana
cd44813bae Update V8
Update V8 with fix for Issue 1853
(http://code.google.com/p/v8/issues/detail?id=1853)

Change-Id: I10f652228ab1421b280b433eb2a59aeb83a7699f
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2011-12-14 13:19:03 +01:00
Laszlo Agocs
3064c1bc8c Remove redundant touch processing in QtGui and widgets.
The duplicated hash tables in QGuiApplicationPrivate and
QApplicationPrivate are now unified into one single hash table in
QGuiApplicationPrivate. This also reduced the number of lookups.

The extra processing needed to keep the touch points' first/lastPos
values in sync is now done only once, in QGuiApplication. This
eliminates the performance penalty (for widget-based apps) that was
introduced during the QPA migration.

As an added bonus the patch adds support for touch events arriving
simultaenously from multiple devices. This was broken before: As there
is no guarantee that two devices/drivers will not send touch points
with the same ID, using structures with only the ID as key is
wrong. The proper key is composed of the device ID (that is, a
QTouchDevice pointer) and the touch point ID.

The exported internal function qt_translateRawTouchEvent() has been
removed. This function cannot work properly in the QPA world: It
injected touches into the widget subsystem (QApplication) only which
is wrong, and would result in half-filled touch events due to not
routing the injected data through QGuiApplication. Autotests using
this function are migrated to
QWindowSystemInterface::handleTouchEvent().

Change-Id: I7632781d77f9e0ac4626fd7c9933511c94492156
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-14 13:17:19 +01:00
Bradley T. Hughes
14d9a2b06c Remove QAlphaPaintEngine::drawImage()
It was not a proper reimplementation of QPaintEngine::drawImage(), which
takes 4 arguments, not 3 as declared in QAlphaPaintEngine. Remove the
code, since it is not being called.

Change-Id: Ia125a9c7e8a2e05ec2ca11b859c01ccbf4d55af5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-14 09:27:04 +01:00
Jason McDonald
2395a3c897 Remove incorrect information from QCOMPARE documentation.
The documentation stated that QStringList objects would be compared
starting from the end of the lists.  The implementation in qtest.h
actually starts at the beginning of the list, and always has done since
qtestlib became part of Qt.

Change-Id: I056f584564d46402ba23fc6a89c801cb5c3c6262
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-14 09:27:04 +01:00
Morten Johan Sorvig
876b2d06f7 Cocoa: Use new 10.7 mouse wheel API.
Silence "deprecated" warnings. Use the old API
on 10.6.

Change-Id: I0cfa3a083108618023b491589a85ddfc268f990b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-14 09:27:04 +01:00
Michael Brasser
a9ad8886fe Fix possible jump in animation timer.
When starting new animations with existing animations running, ensure
we force an update to the timer first, so that the new animations can't
mistakenly start with a very large delta.

This fixes tst_qdeclarativeanimations::alwaysRunToEndRestartBug failure
on slow machines.

Change-Id: Ida4e5dcf0ff792e6bfe0d244b6e969d04d0b20fa
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2011-12-14 02:16:40 +01:00
Jędrzej Nowacki
3ed0a23323 Add specialization for QTypeInfo<void>
QTypeInfo uses sizeof which is illegal operation for void type.

Change-Id: Idf43551bdfafbb76e32f4f2785af5f4291981e73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-13 16:36:33 +01:00
Debao Zhang
7694599ef9 Fix Memory leak related to Content Menu
From Qt4.7 on, the contextmenu of
QTextEdit/QPlainTextEdit/QLineEdit/QLabel/QMainWindow etc using
QMenu::popup() instead of QMenu::exec(), but the
setAttribute(Qt::WA_DeleteOnClose) does not work, as QMenu::close()
isn't called when the menus disapper. And this causes a memory leak.

This is a side effect of b7af368e86874d71ffc9071c9ef009814d6a3467

Task-number: QTBUG-22817
Task-number: QTBUG-19592
Change-Id: I4c2c3edb3f63ce914b7b57cd0fbcec20488c8315
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-12-13 16:36:33 +01:00
Bradley T. Hughes
d308797d00 Finish removing virtual child integers
Finish the work started by commit
beb72b2fbf. This silences warnings found
by -Woverloaded-virtual.

Change-Id: Ic6f5e77e324463ade8349f23f272b41b509d87e4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-12-13 14:54:09 +01:00
Johannes Zellner
8757aaaf2f Fix debug output in eglfs with QEGL_EXTRA_DEBUG enabled
Change-Id: I615a953b52184d01c5b1b78d1cff283f94c458d9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-13 13:58:56 +01:00
Kim Motoyoshi Kalland
d52fd497f6 Improved performance of large text when parts are outside view.
Avoid generating paths for the parts of the text that are outside
the viewport in the raster paint engine.

Task-number: QTBUG-22687
Change-Id: I06159bc4c1aa82a07606f4b2f0336cb25dfd56d2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2011-12-13 11:11:58 +01:00
Bradley Smith
0553ab9127 Fix QPA xlib plugin handling of setParent(0).
Dereference of the parent argument did not check for nullptr. For
example, the hellogl example would crash. Now if the parent
argument is null, the screen's root window is used.

Change-Id: Ib06181c9ab9794d577722f1c1dd5ee92e4edaee5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-13 11:11:58 +01:00
Jason McDonald
d702da7482 Add missing assertion to QAbstractTestLogger.
If passed an empty string, QAbstractTestLogger::outputString() would
crash, so add a QTEST_ASSERT to make the cause of any crashes more
obvious.

Change-Id: I00afe2e73120b87e211f858402d441f345dddd08
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-13 07:41:27 +01:00
Rohan McGovern
9f592dbd60 testlib: fixed actual, expected order in QTest::compare_helper
These two parameters were written in the opposite order in the
function's declaration and definition.  Harmless to the compiler,
but confusing to developers and reviewers.

Change-Id: I1d4cb0a41b465b5f918daa76756677fe0cfe0a59
Reviewed-by: Jason McDonald
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-13 05:19:08 +01:00
Michael Brasser
5d00ae3b69 Stop animation driver in the appropriate place.
Calling stop from restartAnimationTimer was incorrect (it was initially
added as a fix after the introduction of QAnimationDriver, but this is
a better location for the fix).

Change-Id: I2507096b846ada061e36a9ece6aa814d801ddd53
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2011-12-13 02:24:03 +01:00
Michael Brasser
30a4d9bc99 Only call profiler callback once per animation tick.
Change-Id: I369afdf34ded2c6327ce36cdb80fab51bf89a1b5
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
2011-12-13 02:23:55 +01:00
Michael Brasser
08d378d933 Cleanup pause timer handling in QUnifiedTimer.
The animationTimer is now only used for pauses, so can be renamed to
pauseTimer, and directly queried for whether it is active.

Change-Id: I3d9319b6ee76158e875ab43657126a0aa0a1cf2e
Reviewed-by: Leonardo Sobral Cunha <leo.cunha@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2011-12-13 02:23:47 +01:00
Michael Brasser
3bd3b82a2f Fix possible jump in animation timer.
If both a stop and start happen within an event loop, ensure they are
processed in order.

Based on a patch from Charles Yin.

Task-number: QTBUG-22865
Change-Id: I6131bd43a6ba5ad4fa37c863a9f4598bf2ac0e01
Reviewed-by: Leonardo Sobral Cunha <leo.cunha@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2011-12-13 02:23:42 +01:00
Stephen Kelly
309cdc358e Move QAbstractItemModel into a separate directory.
Change-Id: Ib505520dd5b52743634befbf3f148d7f8c21ec44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-13 02:23:42 +01:00
Thorbjørn Lund Martsum
4465fdd166 Compile fix - qxcbconnection.cpp (‘Display’ was not declared)
To avoid getting
qxcbconnection.cpp:89:29: error: ‘Display’ was not declared in this scope

Platform linux - configured with
./configure -nokia-developer -nomake examples -nomake demos -nomake tests -no-gtkstyle -no-v8

Change-Id: Ief7315bb8aa67c6454cdeddb1c02e60ea79801b5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-13 00:44:09 +01:00
Robin Burchell
a3b3cfe3b8 Use QVarLengthArray in QXcbConnection.
There's no need in using a QList here, since it's never passed around anywhere;
the reference counting is just unnecessary overhead.

Change-Id: I92107c69f7338acc396e2ac4a69123c6a2becaed
Reviewed-by: John Brooks <john.brooks@dereferenced.net>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-13 00:44:00 +01:00
Stephen Kelly
23ab6a726a Add the .exe suffix to executables on Windows.
Change-Id: I257bb7d62ae18ea529df6b10694fcf25eedc83f4
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-12 19:10:34 +01:00
Frederik Gladhorn
2e02aaf24c Make QApplication::type() set by QGuiApplication.
QApplication::type used to be static and set by the
QApplicationPrivate constructors.

In QCoreApplication we have the new application_type that should take its place.
QApplication::GuiServer is deprecated (since it doesn't have any functionallity
any more with QWS being removed).

This change prepares QStyle to be called from a QQuickCanvase based application
that does not inherit the QWidget version of QApplication.

Change-Id: Ifbe992e25f1e5821fa047b6eb915f75fa675ab97
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2011-12-12 17:28:24 +01:00
Rohan McGovern
1b6b1358bf v8: give sensible error message if v8 sources are not checked out
A common error for developers attempting to build qtbase for the first
time is to miss cloning the v8 submodule.

Let qmake check for existence of the sources so we get a sensible error
at qmake time, rather than a relatively inscrutable error at make time.

Change-Id: I70b478e63c962263dac4f2ddccb377b4c9777ceb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-12 17:27:19 +01:00
Laszlo Agocs
91b48208f5 Add touchEvent() virtual to QWindow.
Unlike keyPressEvent(), mousePressEvent(), etc. the touch events had
no equivalent so one had to fall back to reimplementing event() or
using an event filter. This is now corrected by introducing
touchEvent(). Touch events are finally becoming a first-class citizen
in Qt 5.

Change-Id: Ia2044030154fd5b1b5384f08a3cb1749b798435f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-12 17:27:19 +01:00
Stephen Kelly
0319f13f1a Remove symbian cases from library and plugin loading code.
Change-Id: I381873449b1520152cd2a7aede9c7253e110ef7a
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-12 17:27:19 +01:00
Morten Johan Sørvig
82b73ab03a Cocoa: Add autorelease pools.
A couple of cases where we call Cococa APIs without
having an autorelease pool in place surfaced after
removing the global autorelease pool in 1a218a7. 
(This happens when when Qt API is called before 
app.exec() has started the Cocoa event loop.)

Add local autorelease pools to prevent memory leaks.

Change-Id: I0c4be3ff102aaff4539235857f95ab29fdbc9d70
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
2011-12-12 17:27:19 +01:00
Robin Burchell
6802e3165e Add QVarLengthArray::length().
This also adds a unit test for length()/count()/size(), since there wasn't one
testing it explicitly.

Change-Id: Ifb7f113aa97beef5f76e5fb246eb38495344b0ad
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Marco Schmidt <Marco.Schmidt@Taugamma.de>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-12 17:27:19 +01:00
Richard Moore
3ac957690c Remove unused member variables from private class.
These aren't used, and so they shouldn't be there.

Change-Id: Id4a08d90836c45c140d811b8eca07756e14c56e5
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2011-12-12 17:27:19 +01:00
João Abecasis
e7a6906da6 Remove template <class T> class QRingBuffer
.. as it is declared and defined in .cpp file but never used.

Change-Id: I7b72daf62712b4ec25717afbe2b7f0792ffa2a85
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-12 17:27:19 +01:00
Friedemann Kleint
c9d6def002 Windows-DnD: Fix cursors.
Re-add pixmaps that were removed from QGuiApplication.

Change-Id: I9936da115e494cf816116159419d40840176afd5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-12-12 15:38:47 +01:00
Friedemann Kleint
5b7a1ca85b Windows: Fix clipboard test.
Return the QMimeData set on the Ole object if we own it.

Change-Id: I08de0968e04a7356fed1255feb495f7b85e7a6f8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-12-12 15:38:40 +01:00
Bradley T. Hughes
7ac4bf8a40 Silence -Woverloaded-virtual warnings in QRasterPaintEngine
The QRasterPaintEngine::updateState() is not a reimplementation of
QPaintEngineEx::updateState(const QPaintEngineState &state). Rename the
updateState() function to updateRasterState(), and ensureState() to
ensureRasterState(). These names were chosen to match the class name
QRasterPaintEngineState on which these functions operate.

../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/painting/qpaintengine_raster_p.h:271:10:
warning: 'QRasterPaintEngine::updateState' hides overloaded virtual
function [-Woverloaded-virtual]
    void updateState();
         ^
../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/painting/qpaintengineex_p.h:202:18:
note: hidden overloaded virtual function 'QPaintEngineEx::updateState'
declared here
    virtual void updateState(const QPaintEngineState &state);
                 ^

Change-Id: Ie9ff0230019b383d53757029c6b2194dfc6a2664
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2011-12-12 15:35:54 +01:00
Bradley T. Hughes
c560836263 Silence -Woverloaded-virtual warnings in QBlitterPaintEngine
QPaintEngineEx declares several virtual clip() overloads, but clip()
with no argument does not reimplement any of these. Rename it to
clipData() (to make the name of the return value more closely).

../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/painting/qpaintengine_blitter_p.h:104:29:
warning: 'QBlitterPaintEngine::clip' hides overloaded virtual function
[-Woverloaded-virtual]
    inline const QClipData *clip(){return raster()->d_func()->clip();}
                            ^
../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/painting/qpaintengineex_p.h:157:18:
note: hidden overloaded virtual function 'QPaintEngineEx::clip' declared
here
    virtual void clip(const QPainterPath &path, Qt::ClipOperation op);
                 ^

Change-Id: Ifd7c494e2c999d743216cfb4c27a9c3ccf66f2a9
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2011-12-12 15:34:14 +01:00
Shane Kearns
f74ff46c7a Fix NTLM authentication with email address
When using "user@dns-domain" for NTLM authentication, the whole string
should be sent as the username, and the domain should be set to an
empty string.
The domain sent by the server is still reflected if the username
does not contain an '@' character.

Manually tested using MS IIS on a domain-joined PC.

Task-number: QTBUG-19894
Task-number: ou1cimx1#949951
Change-Id: Ie1f81172e71cb7cce7b8c909062be990c24aea47
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2011-12-12 13:34:25 +01:00
Shane Kearns
b830c9cede Fix null pointer dereference in NTLM authentication
If NTLM authentication is required for the URL with an empty path,
then QNetworkAuthenticationCache::findClosestMatch(url.path()) returns 0.
e.g. "http://10.1.2.3".
Return a default constructed credential in this case.

Change-Id: I84ad3b308ee3f74fbbac9ad0f11dbdc66047b50b
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2011-12-12 13:34:11 +01:00
Andrew den Exter
d6fb4463b8 Delay masking the last character in Password echo mode.
If QT_GUI_PASSWORD_ECHO_DELAY is defined in qplatformdefs.h with an
integer value in milliseconds, QLineEdit and TextInput will display
the last character entered unmasked for that delay period and then
mask the character as normal.  If QT_GUI_PASSWORD_ECHO_DELAY is
not defined then the behaviour is unchanged.

Task-number: QTBUG-17003
Task-number: QTBUG-20719
Reviewed-by: Martin Jones
(cherry picked from commit f9e7aee2019d321edd655bfde7de43f20a106971)

Change-Id: If69b384636e3775ad7898b8ffc441011c21abe98
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-12 13:19:40 +01:00
Andrew den Exter
6e0e834e03 Fix TextInput test failures.
emitCursorPositionChanged won't emit cursorPositionChanged if the
cursor position hasn't changed but that doesn't mean the micro focus
hasn't changed, so emit updateMicroFocus changed when
cursorPositionChanged isn't.

Task-number: QTBUG-21017
Task-number: QTBUG-21011
Task-number: QTBUG-20719
Change-Id: I86344621151dbeba0eebc67fbc786a8da76b7021
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-12 13:19:34 +01:00
Andrew den Exter
28165d5446 Move cursorDelegate with the mouse selection of read only text input.
Task-number: QTBUG-20719
Task-number: QTBUG-19109
Reviewed-by: Martin Jones

Change-Id: I2cec51eb5b01dc5750614edf5b39d6a3da661fc6
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-12 13:19:28 +01:00
Andrew den Exter
734033e71d Make it easier to select words at the start of a line.
QTextControl's word selection will only include a word if the cursor
position is past the mid point of the word. This can make it
difficult to select words near the edges of the screen on touch
devices.  For the TextEdit word selection mode select a word ignore
the relative position within a word.

Task-number: QT-5206
Task-number: QTBUG-20719
Change-Id: I77e71e01d8021d66ada785cf894ba876faccefdf
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-12 13:19:13 +01:00
Laszlo Agocs
6f1c4fb342 Store the primary status in the touch point flags.
For some reason the primary bit has previously been encoded in the
touch point state, even though it has nothing to do with the regular
states like Pressed, Released, etc.

The value is now stored in the recently introduced flags member of the
touch points. This also reduces the need for error-prone internal
masking of the state value.

The structure used by QWindowSystemInterface::handleTouchEvent also
becomes cleaner because the primary status can now be set in the flags
member and the isPrimary bool can be dropped.

Change-Id: I1da2cb99154afd97e1e3a5943ab115cae3a8232f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-12 12:28:29 +01:00
Honglei Zhang
67be01ae50 Check driver validity before using it
Even though it is stated in the documentation that the SQL driver must
remain valid during the life time of QSqlQuery, there are users who don't
follow the rule. It's common that the destructor of QSqlQuery is called
after the driver is already deleted. This fix checks the validity of
the SQLite driver before QSqliteResult uses it in destructor.

Task-number: QTBUG-16967
Change-Id: If0f52113f12e14102da1671cd6e12bdaa267114f
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2011-12-12 10:43:44 +01:00
Friedemann Kleint
b9ebb65c77 Revert "Remove unused overload of QTest::qExec."
The overload is used in Qt Creator
(see src/libs/extensionsystem/pluginmanager.cpp).
The use case here is an application whose internal
QObjects can be tested by passing a command line parameter.

For this use case, it is inconvenient to have to allocate
memory and create a char argv[]- array.

This reverts commit ad80d42f8e.

Change-Id: I2a2f91e2840100fd62743f6d03b33005d67b18f8
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-12 10:43:44 +01:00