Commit Graph

267 Commits

Author SHA1 Message Date
John Layt
54b899f448 SIC: QtPrintSupport - Remove QAbstractPageSetupDialog
QAbstractPageSetupDialog is a completely unnecessary base class that
is not really abstract and is used nowhere else.  This changes merges
its methods into the QPageSetupDialog main class.

While technically SIC no-one else uses this so no apps should be
affected.

Change-Id: I59b1739f1c453c34c25d1664d5d042e7918db316
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-17 22:08:16 +02:00
Kai Koehne
4f4fc20d2d Mention logging related changes in changes-5.0.0 file
Change-Id: I6798a2b09fb0f832c32bac325fa0bcf40dbb854e
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-08 01:43:57 +02:00
J-P Nurmi
dd299a568b QStyle: make standardIcon() & layoutSpacing() virtual
Removes standardIconImplementation() and layoutSpacingImplementation()
that were added in Qt 4 as a workaround for binary compatibility reasons.

Change-Id: I45292dc6802310d6cda4f443bb7484b061af0138
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-31 18:56:35 +02:00
Marc Mutz
ca7be5c154 dist/changes-5.0.0: note that QtConcurrent is a separate library these days
Change-Id: Ib8ab6e40d9827697d1061a1b369e150f33d63be9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-30 02:29:02 +02:00
Samuel Rødal
c1e5f600ab Made QImage::fill(uint pixel) for RGB888 accept QRgb values.
Previously QImage::fill() for Format_RGB888 expected a BGR value
instead of the RGB order defined by QRgb, making it counter intuitive to
use related to the 32-bit formats.

Fixed the QPixelLayout data for RGB888 and changed the byte order of
quint24 based on what the optimized image conversion routines expect.

Change-Id: I72926debbc6f5b5cb10b8aa0b2a2a916a04db946
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
2012-08-29 16:53:00 +02:00
Stephen Kelly
96d5c28a11 Make QAbstractItemModel::sibling virtual.
This would allow implementations to create an optimized way to create
sibling indexes.

A typical pattern of QAIM implementation is to use the same internalPointer
for each row of a subtable of a model (such that the internalPointer is
related to the common parent of each set of rows) and differentiate on the
row value in the QModelIndex. Alternatively, it is also common to have the
internalPointer correspond directly to the row value for the QModelIndex.

In both cases it is possible for the implementation to optimally create a
sibling QModelIndex in the same column as a known row. Provide a virtual
method for them to do so.

Change-Id: I3b076abcd5f6087a4cb108fbc6dceeef15529987
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-23 15:54:02 +02:00
David Faure
9bb8035603 Document QTranslator::translate SIC (91d2ee5e09)
Detected by a unittest failure in KDE, due to the KDETranslator subclass
not being called anymore.

Change-Id: I0171117a677e2d58aba2f76bc27f7f1f7a521cc1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-21 06:48:50 +02:00
Stephen Kelly
fe0a6e57a0 Remove QProxyModel from qtbase.
A copy is placed in uihelpers for anyone who might be using it.

Change-Id: I175f7bc5dcbf25a910d28bfd8985579866392938
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-20 21:10:01 +02:00
Stephen Kelly
f6c58d242a Add a changes file entry for QMetaType QObject related change.
Change-Id: I2f902ffe6b18034047114626dd4cbe9d2f96c2fc
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-18 10:55:47 +02:00
Stephen Kelly
4d9d88af6f Remove QWidgetStar.
This allows us to remove the odd hacks to get the static metaobject
for the QWidget* metatype.

The QWidget* is still an automatic metatype thanks to the QObject
partial template specialization. It is registered as a metatype
at runtime automatically in qwidgetsvariant.cpp.

Change-Id: Ie01b69eadf2cbe87af1a86c3284550f60dcf9e94
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-18 10:55:47 +02:00
Kent Hansen
06f4f11419 Add some more of my 5.0.0 changes
Change-Id: I606a11cb11d1559476eab6532db22f4bc81fed90
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-08-14 12:49:37 +02:00
Stephen Kelly
c5d7ea5bad Only emit the clicked() signal from views if the left button is used.
This is consistent with QAbstractButton, QCalendarWidget,
QDialogButtonBox and QGroupBox (ie, all other widgets with
a clicked signal)

Task-number: QTBUG-26105

Change-Id: Ieafe988b5c03216796b69a7cd70ac1a03fc12b0a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-07 16:40:07 +02:00
Kent Hansen
9a0b7348b3 Make QSignalSpy copy QVariant parameters directly
Previously, a QVariant parameter would be wrapped inside a new
QVariant, and you would have to cast the QSignalSpy's QVariant to
a QVariant to get the actual value. This behavior was unintuitive
and undocumented.

Check if the parameter type is QVariant, and copy it directly if it
is. This makes the QSignalSpy's QVariant directly usable (no need to
"unwrap" the value in user code).

Existing tests that use QSignalSpy together with QVariant parameters
(such as tst_QPropertyAnimation::valueChanged()) and do cast the
QVariant parameter to a QVariant, continue to work after this change;
this is because qvariant_cast<QVariant>() returns its input value
(unchanged) when the type is not QMetaType::QVariant.

Task-number: QTBUG-21645
Change-Id: Ibfb171edd60c0d3f7ca1d5419e5c5f3d0380d5b3
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-08-07 11:15:55 +02:00
Lars Knoll
328550ff00 Remove the obsolete scene argument for constructors of graphics items
The argument has been obsoleted and not documented since 2007. Get rid
of it now before Qt 5.0

Task-number: QTBUG-25089
Change-Id: I91a5508a5e1606f5b5c289501295c67be4abe6a0
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-08-03 00:37:59 +02:00
David Faure
42c86bba9d Remove winEventFilter, replaced with installNativeEventFilter.
No reason to keep a virtual method for Windows when all other similar methods
(macEvent and x11Event) have been removed, and when installNativeEventFilter
provides a much nicer solution (no need to derive from QApplication).

Change-Id: Ia2a7960e320fcbd04cef91f467900861dbb377c1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-07-24 00:08:28 +02:00
David Faure
1603ba2365 Provide public API for native event filtering, moved up from QPA.
The previous API was hard to use (global function, no type safety,
manual chaining), and confusing (app vs dispatcher split only made
sense on Windows). Installing and removing out of order would have
the risk of setting back a dangling pointer (crash). Meanwhile QPA
added type safety, and this new API models the QObject::installEventFilter
API for ease of use. The virtual method is in a new interface,
QAbstractNativeEventFilter.

QPA was even calling the dispatcher event filter with QPA-private event
classes, which made no sense (refactoring leftover from when the code
was in the dispatcher). Now the QPA plugins trigger the qcoreapp event
filters with the actual native events directly.

Change-Id: Ie35e47c59c862383bcaf857b28d54f7c72547882
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-07-20 18:34:08 +02:00
Mark Brand
76880aa2c4 QSqlTM: use generated flag more correctly in setRecord()/insertRecord()
The generated flag should affect the generation of SQL commands rather
than how the fields of the source record are applied to the model before
submitting. This correction allows setRecord() to be used to change TRUE
generated flags to FALSE.

Clarified documentation on this point and updated change log.

Change-Id: I7ee124930822561ed8beee6c6259970b3e929c9b
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-07-17 08:13:30 +02:00
Andras Mantia
8ccab9b029 Add support for SQLSTATE error codes
Postgres can report detailed information about an error using error codes.
See http://www.postgresql.org/docs/8.1/static/errcodes-appendix.html .
The current driver doesn't report the error, nor is it supported by the
QSqlError object.
The patch appends the error to the error message, helping applications to:
- handle different errors in a specific way
- show correct, translated error messages, independently on the language of the postgres installation

Change-Id: Ica3530ac33d3aaa9985e06f6c1f302ece9891033
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-07-03 13:21:23 +02:00
Stephen Kelly
1b6c83f7a3 Document that the object of a plugin must be default-constructible.
Change-Id: Iaaf56ec3bb0d2423c8ab5deb0627dc1357cee830
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-27 14:43:00 +02:00
Stephen Kelly
579ea489a4 Record if a metatype is a smart pointer to a QObject derived.
This allows QVariant/QMetaType software (such as QtDeclarative) to
deal with smart pointers in a similar way to how they can deal with
naked pointers (accessing properties etc).

This also adds a requirement that T be fully defined when
QSharedPointer<T> is inserted into a QVariant.

Change-Id: I29e12b8a6aa5f4aadbd62f92b89bc238f64b5725
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-20 15:45:07 +02:00
David Faure
741b1fcfa3 Make qurlinfo private, now that QFtp is private.
Change-Id: I0bb641b397b7087c89009f92d9973e0922dce653
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-06-14 12:23:11 +02:00
John Layt
b9fc8bc10f SIC: QPrintSupport - Remove options api from QPageSetupDialog
QPageSetupDialog has an enum PageSetupDialogOption, however one option
had support removed in Qt 4.5 and the remaining 2 are actually for an
internal implementation detail that could lead to memory leaks if
changed by an app.

This change removes the enum and the api as they is now useless.

Change-Id: I9a3ab689dcab57151de894db5ebf22f6ad90d71e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2012-06-07 21:18:36 +02:00
Bradley T. Hughes
bf84d1a1fe configure: Auto-detect and enable C++11 support if available
Enabling support for C++11 adds CONFIG+=c++11 to the Qt build. Projects
using Qt can check for C++11 support using contains(QT_CONFIG, c++11) in
their .pr[iof] files.

The QMAKE_CXXFLAGS_CXX11 and QMAKE_LFLAGS_CXX11 qmake varibles contain
any arguments the compiler needs to enable C++11. CONFIG+=c++11 adds
these arguments to the build.

Support for clang, g++, and the Intel C++ Compiler for Linux are
included in this commit.

Change-Id: Id77f86d7ad4d5c740b890446a40b105879a0d327
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-05 12:30:13 +02:00
Friedemann Kleint
e7f1106edb Windows: Add ANGLE support.
- Add QWindowsEGLContext usable for ANGLE and Windows CE.
- Add QWindowsEGLStaticContext containing the display
  for resource cleanup.
- Add EGLSurface to QWindowsWindow.
- Add a -angle option specifying the path to the external
  ANGLE installation to configure, add libraries to
  the mkspecs.

Initial-patch-by: Jabot Corentin <corentinjabot@gmail.com>

Task-number: QTBUG-24207

Change-Id: I5f80b1efb6996da7c5d70aa3720f7801c9e4c6af
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-05-31 09:13:01 +02:00
Lars Knoll
83645377e9 Make QCoreApp::translate and related methods use UTF-8
Deprecate the Encoding enum in QCoreApplication and the
trUtf8() methods. Qt now assumes that source code is
always encoded in UTF-8 to be consistent with QString.

Change-Id: Ic62d6947046dee9be0cbd37f2d2f6976b9e572a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-18 21:38:35 +02:00
Lars Knoll
2b21dd69d6 turn off exceptions by default where they aren't required
This significantly reduces the size of the generated code
in places where we don't need exceptions.

The -(no-)exceptions configure flag has been removed in the
process, as there is now a fine grained way to control this
on a per module level, and Qt is being compiled without
exceptions in most places.

Change-Id: I99a15c5d03339db1fbffd4987935d0d671cdbc32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-17 05:14:26 +02:00
Kent Hansen
f544d7189e Remove const char *-based connectNotify() API
This completes the transition from connectNotify(const char *) and
disconnectNotify(const char *) to the new QMetaMethod-based
functions.

Removed the old connectNotify autotests and renamed the
connectNotifyMethodXXX autotests to connectNotify, since there is
no longer any ambiguity about which overload is being tested.

Change-Id: Icf108a80177155f21bb73c165fb8ab5d4e997bc2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-05-15 04:57:37 +02:00
Thiago Macieira
57c755fef0 Deprecate the ability to change the FS encoding separate from the locale
Changing the encoding used by filenames separately from the locale
encoding is a broken concept and cannot work properly. This creates
ambiguity depending on the data source and how it's being treated.

Instead, enforce that the locale encoding is the only possibility to
deal with file names.

The QFile::encodeName and decodeName functions are retained due to the
Mac-specific issues and due to the sheer number of current
uses. There's no point in deprecating them and moving away from them.

Change-Id: Iedb2d8715d166a59a824f05bc11d107fd44f9c17
Discussed-on: http://lists.qt-project.org/pipermail/development/2012-May/003782.html
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-05-15 04:57:29 +02:00
Bradley T. Hughes
7a67c822e3 configure: Remove the -dwarf2 argument for Mac OS X builds
Modern versions of Xcode properly support dwarf2, and as such dwarf2 is
always enabled. This change removes the ability to turn it off, making
dwarf2 non-optional.

Change-Id: I149daeae6048ee8a1ed116363572173ad219102e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-05-11 12:52:21 +02:00
Rafael Roquetto
ee69c935c0 Enable some SQLITE extensions by default
Enable SQLITE_ENABLE_FTS3 SQLITE_ENABLE_FTS3_PARENTHESIS SQLITE_ENABLE_RTREE
by default on all platforms. These options were previously enabled in Ubuntu,
Nokia N9 and in some mobile devices.

Change-Id: I5b3d2d9a683916216058ca94ec82957bd8cacdb0
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-05-04 15:24:52 +02:00
Thiago Macieira
babd3e252b Revert "[SIC] Make non-const the QRegExp methods that modify the internals"
This reverts commit 75a0c7f9b5. The
source-incompatible change proved to be more trouble than it's
worth. Too much intrusion into the porting effort of applications for
no appreciable gain, especially considering that we have a replacement
class.

Change-Id: Ia99a2360390a2062a8ddb6e12c8f2099287a2704
Discussed-on: http://lists.qt-project.org/pipermail/development/2012-May/003562.html
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-05-03 16:14:21 +02:00
Lars Knoll
1e49914fee Merge remote-tracking branch 'origin/api_changes'
Conflicts:
	src/corelib/global/qglobal.cpp
	src/corelib/global/qlogging.cpp
	src/gui/kernel/qguiapplication.h
	src/gui/kernel/qwindow.cpp
	src/gui/kernel/qwindow.h
	tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp

Change-Id: I62a8805577a7940d4d36bed985eb3e7019d22f2e
2012-05-03 12:26:09 +02:00
Thiago Macieira
75a0c7f9b5 [SIC] Make non-const the QRegExp methods that modify the internals
These methods modify QRegExp internals and should not have been
const. It's actually dangerous to have them const, since users may
think it's safe to use the matching method in a thread-safe manner.

Task-number: QTBUG-25064
Change-Id: Ia370eb42fd0407a94924f420297c5e83d3908214
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-28 19:42:51 +02:00
Thiago Macieira
4544ec931f Update the QUrl documentation concerning the encoding
Looks like I failed to update this earlier, when the behaviour changed.

Change-Id: Ic020c2a14d4e9153f2bc9d22d943a3a380c0851c
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-24 17:02:23 +02:00
Mark Brand
83c9ebbd66 QSqlQueryModel::setQuery() don't use deprecated reset()
Previously the method attempted to reset only as a last resort.

Now reset() is deprecated and resetting must happen between emitting
modelAboutToBeReset() and modelReset(). Since this suffices in all
cases to notify views that they must reinterrogate the model, it is no
longer necessary to signal explicitly row removals and insertions
within the scope of the reset.

Additionally, fetchMore() is now called within the scope of the reset
so insert signals do not have to be emitted here either.

This improved handling of resetting in QSqlQueryModel also allows the
cache in QSqlTableModel to be cleared directly at select().

This change may actually allow views to operate more efficiently since
they no longer have to react to separate row removal and insert
signals. Views can avoid pointless deallocation and reallocation
by considering row count only after the reset is finished. The cost is
that the columns and horizontal headers must be considered in the view
at each setQuery() call. In any case, it is not clear that trying to
be smart about this in the model justifies additional complexity.

Tests had to be adjusted where they expected explicit row removal
and insert signals.

Change-Id: I4f7eac1419824361d7d9bdcc6a87092b33e80d7a
Task-Id: QTBUG-25419
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-04-23 19:20:19 +02:00
Jędrzej Nowacki
ff55d64f67 Remove QVariant constructor taking Qt::GlobalColor.
The constructor is wrong, it creates instance of QVariant encapsulating
a QColor instance. QVariant should not implicitly convert data, never.

Change-Id: Idc794ecdecb42d8b53fee3f993bf51ddd43f595d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-19 10:09:39 +02:00
Thiago Macieira
e02a144a3c Finish cleaning up com.trolltech -> org.qtproject in QtDBus
Lots of uses of the annotations and error names, plus a bunch of local
unit test names (including one file that had to be renamed).

The meta object generator is updated to support both the old and new
names. That means some references to com.trolltech *must* remain in the
source code.

Task-number: QTBUG-23274
Change-Id: Icc38ae040232f07c437e7546ee744a4703f41726
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
2012-04-16 00:07:39 +02:00
Jason McDonald
4f929e01e0 Address Qt 5 to-do comment for QColorDialog.
- change customColor() to return QColor instead of QRgb.
- change setCustomColor() and setStandardColor() to take
  a QColor instead of QRgb.
- add missing standardColor() getter method.

Task-number: QTBUG-25087
Change-Id: Ic6adb2031ef47f5e9b15fa3560a5322e6847c0bb
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-12 10:40:23 +02:00
Oswald Buddenhagen
143c4d3e13 Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
	configure
	src/widgets/styles/qwindowsxpstyle.cpp
	tests/auto/gui/kernel/qwindow/qwindow.pro
	tests/auto/gui/kernel/qwindow/tst_qwindow.cpp

Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
2012-04-10 15:31:45 +02:00
Giuseppe D'Angelo
9a77171ccc QHash security fix (1.5/2): qHash two arguments overload support
Algorithmic complexity attacks against hash tables have been known
since 2003 (cf. [1, 2]), and they have been left unpatched for years
until the 2011 attacks [3] against many libraries /
(reference) implementations of programming languages.

This patch adds a qHash overload taking two arguments: the value to
be hashed, and a uint to be used as a seed for the hash function
itself (support the global QHash seed was added in a previous patch).
The seed itself is not used just yet; instead, 0 is passed.

Compatibility with the one-argument qHash(T) implementation is kept
through a catch-all template.

[1] http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003.pdf
[2] http://perldoc.perl.org/perlsec.html#Algorithmic-Complexity-Attacks
[3] http://www.ocert.org/advisories/ocert-2011-003.html

Task-number: QTBUG-23529
Change-Id: I1d0a84899476d134db455418c8043a349a7e5317
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-04-04 13:02:58 +02:00
Mark Brand
f1d2f7cfa0 add change log entry for QTBUG-23895
Follow-up to 50ad785bdd

Change-Id: Ib44a274148631fe96e13b8fe29436b556c14d34d
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-04-03 10:45:02 +02:00
Mark Brand
314b20e813 fix typo in change log
Change-Id: Id7c3cab500fb3f41fbced5a4012dc0ae5d108192
Reviewed-by: Debao Zhang <dbzhang800@gmail.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-04-02 23:06:30 +02:00
Matt Newell
ccf25f1d28 QSqlDriver functions made virtual
Certain QSqlDriver functions were marked to be made virtual in Qt5.
subscribeToNotification, unsubscribeFromNotification,
subscribedToNotifications, isIdentifierEscaped, and stripDelimiters.

This patch makes them virtual and removes the no longer needed
Implementation counterpart functions. It also updates the relevant
drivers. This patch has no regressions on the tests in
tests/auto/sql/kernel/, tested with sqlite and postgres.

Change-Id: Ia2e1c18dfb803531523a456eb4e710031048e594
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-04-02 22:26:10 +02:00
Stephen Kelly
c3e1abad4e Add USER properties to QDateEdit and QTimeEdit.
Both classes had such components before, but there were issues with
the NOTIFY signal not being in the same class as the Q_PROPERTY.

This patch solves that problem by using a signal of a different name.

Task-number: QTBUG-15731
Change-Id: Ibc7ce4dba8a6b88c05d62a90e14d0101c5cd3082
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2012-03-28 02:01:49 +02:00
Kent Hansen
22d621dd99 QMetaMethod::typeName() should return "void" if the return type is void
QMetaMethod::typeName() is documented to return an empty string if
the return type is void. But after the introduction of
QMetaType::UnknownType (where void was made a distinct type),
returning an empty string causes the idiom

   QMetaType::type(method.typeName())

to break; the result will be QMetaType::UnknownType rather than
the expected QMetaType::Void for methods that return void.

New code should use the new function QMetaMethod::returnType()
instead, but it would be good if existing code still did the right
thing.

The consequence of returning "void" instead of an empty string is
that it breaks existing logic that uses the typeName() length to
determine whether a method returns void. But we judge this as the
lesser of the two evils; it's better to have a typeName() function
that is consistent and keeps the QMetaType::type(method.typeName())
idiom working, than to force the typeName() inconsistency for void
only to keep code that does "strlen(method.typeName()) == 0"
working.

The places in Qt that were relying on a zero-length typeName()
(testlib, dbus, declarative) have already been changed to use
returnType().

Also adapt QMetaObjectBuilder, which is internal API.

Change-Id: I70249174029811c5b5d2a08c24b6db33b3723d19
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-21 18:55:51 +01:00
Kent Hansen
95d6f8a4cf Merge master into api_changes
Conflicts:
	src/corelib/tools/qvector.h
	tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp

Change-Id: I877256e95f3788e617437f4e9661a88047f38cd6
2012-03-19 10:03:48 +01:00
Debao Zhang
78e0ab3342 QPointer: update its document and changes-5.0.0
QPointer has been un-deprecated and one behavior which slightly different
from Qt4 has been fixed.
see SHA: b8773165d7
and SHA: 497622cafe

Change-Id: I4bae2cce3ebfebd8f59b18b5a6a7a7226b8353b9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-03-18 03:55:07 +01:00
Samuel Rødal
52c1df5a7c Updated changes-5.0.0 with some information on the new QtGui classes.
Change-Id: Idcdfdb506e75d74b3a89e6c2e914802ddfc11031
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-03-17 01:52:07 +01:00
Kent Hansen
440f452aa3 Merge master into api_changes
Conflicts:
	src/corelib/kernel/qmetatype.cpp
	src/gui/kernel/qplatformsurface_qpa.cpp
	tests/auto/corelib/tools/qtimeline/qtimeline.pro

Change-Id: Iff3fff34eeeb06f02369767ddfce44cfde505178
2012-03-16 10:01:29 +01:00
Mark Brand
26450fe6a6 QSqlTableModel::removeRows() enforce edit strategy
For OnFieldChange and OnRowChange, we don't want more than one row in
the cache with uncommitted changes. This could happen if deletion in
the database fails while other changes are pending.

Chosen solution is to return false if other rows have pending changes.
Also, we only allow 1 row removed at a time.

Updated test, changes and documentation.

Change-Id: I68baf6d221789b4754e891535070011c759a2155
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-15 15:35:43 +01:00
Mark Brand
108748404b QSqlTableModel::setData(): no longer autosubmit for OnRowChange
The model can never do a good job of knowing when user moves to a
new row in the view. Faking it by detecting when another row
is changed was not a good solution because it cannot detect
when the last edited row is left.

Either the view should automatically submit when the user leaves
a row or the application should provide a way to submit.

This change made it possible to reuse the logic of flags() in
setData().

Change-Id: I2550e5b113bceba1a852fc21203babeca07c5748
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-15 15:35:32 +01:00
Mark Brand
3d7cec6577 QSqlTableModel: disallow insert if changes are pending
For OnFieldChange and OnRowChange, inserting rows should not be
allowed if there are pending changes in cache.

Change-Id: Ia794332959a35a1de87e798ba1a74ace3dfae68f
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-15 15:35:22 +01:00
Mark Brand
f6ca63f896 QSqlTableModel::setData()/setRecord(): fix incorrect row
For OnFieldChange and OnRowChange, before submitting new changes,
setData() and setRecord() attempt to submit pending changes and
revert them upon failure. However, they fail to consider that
reverting pending insertions removes rows from the model. As a
result, the new change can be applied to a row higher than intended.

One possible solution would be to adjust the targetted index for the
removed rows, so that the intended row is affected by the new change.
But this still causes the strange editing experience as rows jump
up just as they are being edited.

It does not seem right in the first place for the model to initiate
reverting changes. It should be up to the application to decide what
to do when data cannot be committed. In particular, setData() and
setRecord() should not have the side effect of reverting already
pending changes.

The chosen solution is simply to refuse new changes that don't make
sense for the edit strategy. For OnFieldChange, flag() will
indicate read-only when editing is blocked by a pending change.

Since setData() and setRecord() submit data immediately for
OnFieldChange, it no longer makes sense to resubmit changes
automatically before a new change.

For OnRowChange, setData() keeps the behavior of automatically
submitting a pending row before starting on a new row. This is
historical behavior and is probably motivated by the fact that
QTableView does not automatically call submit() when editing leaves a
row. The obvious shortcoming of this is that the last row to be edited
will not be submitted automatically. It also prevents us from flagging
rows other than the pending row as read-only.

For OnRowChange, setRecord(), being row-oriented by nature, should
submit the change immediately rather than waiting for the next call
to setRecord(). This makes setRecord() consistent with insertRecord().

Change-Id: Icb4019d8b7c53a7ee48f8121a7a525e8bc35d523
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-15 15:35:17 +01:00
Thorbjørn Lund Martsum
b64426248d QHeaderView - renaming functions in Qt5
This patch renames the functions in Qt5 according to the
notes. It also renames resizeMode to be consistent.

The old functions are both marked with both QT_DEPRECATED
and '### Qt 6 - remove'

All usage of the function within the qtbase are also
changed to use the new functions.

Change-Id: I9e05fa41d232e9ca43b945fcc949987017f3aedd
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-14 11:37:18 +01:00
Mark Brand
13c57d0f68 QSqlTableModel::isDirty(): new overloaded method
Checks if model has any changes to submit.

Includes new test covering isDirty(index) as well the new
overloaded function.

Task-number: QTBUG-3108
Change-Id: I0ccbda45d5d9f06434cf1e1c037a9efb76d0cc37
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-12 23:29:37 +01:00
Lars Knoll
d5098f2802 Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
	tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp

Change-Id: I884afc3b6d65c6411733a897a1949e19393573a7
2012-03-12 21:03:49 +01:00
Oswald Buddenhagen
aed6eaa5b2 QT_RAW_INSTALL_FOO => QT_INSTALL_FOO/raw
this makes the "sysrootable" properties more magic, with the raw
versions being omitted from the qmake -query output and automatically
falling back to the "cooked" variant if there is no sysroot set.

this makes the "normal" qmake -query less noisy. this will become even
more obvious when i add more "overloads" of the properties.

Change-Id: I08000986427264ec6238c8fe0a77f5cecdbf1201
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-12 11:01:02 +01:00
Holger Hans Peter Freyther
bbc97c38d5 misc: Fix some random typos and grammar while reading code.
Typos:
recieve   -> receive
descrived -> describe

Grammar:
this types -> these types

Change-Id: Iedacc51a6322996f423ac9472af0a597424a4fed
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-03-09 07:18:34 +01:00
João Abecasis
79f2480c86 Merge remote-tracking branch 'origin/api_changes' into containters
Conflicts:
	src/corelib/kernel/qmetaobject.cpp
	src/corelib/kernel/qvariant.cpp
	src/tools/moc/moc.h

Change-Id: I2cd3d95b41d2636738c6b98064864941e3b0b4e6
2012-03-08 12:02:41 +01:00
Frederik Gladhorn
316b050324 Changelog: QEvent::Accessibility
Change-Id: I705d21f62e6101599ab59d9b8768c47d3a536bfd
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-08 07:28:21 +01:00
Mark Brand
79c0d9adbe QSqlTableModel::selectRow(): complete documentation
Mention in changes and document Qt version (merci à dfaure).
Follow-up to 291e2c7d54.

Change-Id: Ie5626e9cd268812c1173ca494ccd8d6bd9be2687
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-07 09:33:44 +01:00
Mark Brand
888fed8065 QSqlTableModel: use selectRow() for field and row edit strategies
Calling select refreshes the query data but disrupts view
navigation.

For OnFieldChange and OnRecordChange it makes sense to only
select the row in question. This does not disturb view navigation.

Assume disruption of view navigation is not a problem
for OnManualSubmit because the user or application decides
when submitAll is called.

Task-number: QTBUG-2875
Change-Id: I1e5f68668fb9102f6296d67d543e80daa403f1c4
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-03-07 00:01:32 +01:00
Giuseppe D'Angelo
c7cb455a47 QRegularExpression: add QRegularExpression* set of classes
Added QRegularExpression, QRegularExpressionMatch and
QRegularExpressionMatchIterator as PCRE-enabled, regexp classes.
Documentation is included, as well as a first round of autotests.

Task-number: QTBUG-23489
Change-Id: Id47031b80602c913ccd2fd740070e3024ea06abc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-06 21:53:39 +01:00
Robin Burchell
95fa88abe7 Remove codecForTr().
Similarly to change id I2f429fa7ef93bd75bb93a7f64c56db15b7283388, the capability
to arbitrarily alter the encoding of literals is very destructive, especially in
a world with libraries and plugins.

Change-Id: If0d4cd8dcf89792e39c1984cbde6b036cebfc02f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-06 06:34:52 +01:00
Oswald Buddenhagen
a91c997238 give load()/include() with target and infile()/$$fromfile() a clean environment
load()/include() with a target namespace would inherit the current
context. however, if you source a project with all bells and whistles,
this makes completely no sense and may be actually counterproductive.

infile()/$$fromfile() would have interited only the functions from the
current context. that was only a hack to support abusing them.

Change-Id: I2e992b923d9e5b0e5056001ca49b35de573abc63
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-05 14:46:36 +01:00
Lars Knoll
96232be146 Merge remote-tracking branch 'origin/api_changes'
Conflicts:
	dist/changes-5.0.0
	mkspecs/features/qt_module_config.prf
	qmake/project.cpp
	qmake/property.cpp

Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
2012-03-04 21:45:05 +01:00
Sergio Ahumada
db1abf9f76 Change bugreports.qt.nokia.com -> bugreports.qt-project.org
Change-Id: Ia795098f24cf358b15067f54cd08dff0bd792bc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-02 23:16:25 +01:00
Oswald Buddenhagen
dce3821b8a make evaluation of spec+cache independent of build pass context
don't inject the build pass specific variables into the project even
before evaluating the .spec file and the .qmake.cache. they are not
supposed to base configuration on that - feature files should do that
later.

the immediate advantage of this is that base_vars is never manipulated
upfront any more, which allows for cleaner setup paths. also, we can do
more caching of the spec+cache contents.

Change-Id: I19d7f8bec1fb7c3b54121e26794340b287055ebf
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-02 21:33:08 +01:00
Jędrzej Nowacki
362bde8e8e Introduce QMetaType::UnknownType.
QMetaType::Void was ambiguous, it was pointing to a valid type (void)
and in the same time it was signaling errors in QMetaType. There was
no clean way to check if returned type was valid void or some
unregistered type.

This feature will be used by new QMetaObject revision which will
store type ids instead of type names. So it will be easy to
distinguish between:
 void mySlot();
 MyUnregisteredType mySlot();

Change-Id: I73ff097f75585a95e12df74d50c6f3141153e771
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-02 12:57:29 +01:00
Oswald Buddenhagen
012f799254 revamp -sysroot and -hostprefix handling
instead of being a variable added to the makespec (via qconfig.pri),
QT_SYSROOT is now a property.

the QT_INSTALL_... properties are now automatically prefixed with the
sysroot; the raw values are available as QT_RAW_INSTALL_... - this is
expected to cause the least migration effort for existing projects.

-hostprefix and the new -hostbindir & -hostdatadir now feed the new
QT_HOST_... properties.

adapted the qmake feature files and the qtbase build system accordingly.

Change-Id: Iaa9b65bc10d9fe9c4988d620c70a8ce72177f8d4
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-01 23:18:23 +01:00
Marc Mutz
a1c75534a4 QtGlobal: remove qIsDetached()
There's not a single in-tree user of this function, and
the concept is a broken one in MT programs: By the time
qIsDetached() returns, the result can already be
different due to another thread taking a copy, or a
copy in another thread being destroyed (note that this
doesn't require mutex use by the user, since we promise
(implicitly, if not explicitly) that you can copy from
const objects without holding a lock).

QTBUG-10813 talks about a use in QCache::trim(), but
677cf76340 removed it, so
there's no reason to keep it anymore.

Change-Id: I20380c12bdf00ac764b89d84392f0f34727b1971
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-01 17:03:29 +01:00
Kent Hansen
96f2365cf4 Rename QMetaMethod::signature() to methodSignature()
In Qt5 the meta-data format will be changed to not store the
method signature string explicitly; the signature will be
reconstructed on demand from the method name and parameter type
information.

The QMetaMethod::signature() method returns a const char pointer.
Changing the return type to QByteArray can lead to silent bugs due to
the implicit conversion to char *. Even though it's a source-
incompatible change, it's therefore better to introduce a new
function, methodSignature(), and remove the old signature().

Task-number: QTBUG-24154
Change-Id: Ib3579dedd27a3c7c8914d5f1b231947be2cf4027
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-29 12:50:14 +01:00
João Abecasis
c4ad58ed22 Merge remote-tracking branch 'gerrit/master' into containers
Change-Id: I97ba222435ff50a9e5422e6f2c73e4bb8d1b865c
2012-02-29 00:58:13 +01:00
Oswald Buddenhagen
e34ee31270 remove fallback re-initialization of TARGET after parsing project
we already initialize it before parsing a project. if a project is daft
enough to clear TARGET, it does not deserve differently than breaking.

Change-Id: I6c727bc27d72a00e84b676ae3c169024bdb2d929
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-02-26 13:23:49 +01:00
Robin Burchell
186692f81f Remove custom text codec for C strings.
This setting is extremely harmful, as code cannot know whether or not to expect
it. It also made the behaviour of QString::fromAscii and ::toAscii unintuitive,
and caused a lot of people to make mistakes with it.

Change-Id: I2f429fa7ef93bd75bb93a7f64c56db15b7283388
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-22 14:00:32 +01:00
João Abecasis
7bbe79fe5f Drop file-engine abstraction from public API
This abstraction imposed serious performance penalties and is being
dropped from the public API.

In particular, by allowing file names to be arbitrarily hijacked by
different file engines, and requiring engines to be instantiated in
order to decide, it imposed unnecessary overhead on all file operations.

Another flaw in the design with direct impact on performance is how
engines have no way to provide (or retain) additional information
obtained when querying the filesystem. In many places this has meant
repeated operations on the file system, where useful information is
immediately discarded to be queried again subsequently.

For Qt 4.8 a major refactoring of the code base took place to allow
bypassing the file-engine abstraction in select places, with
considerable performance gains observed. In Qt 5 it is expected we'll be
able to take this further, reaping even more benefits, but the
abstraction has to go.

[Dropping this now does not preclude that virtual file systems make an
appearance in Qt at a later point in Qt 5's lifecycle. Hopefully with a
new and improved abstraction.]

Forward declarations for QFileExtension(Result) were dropped, as the
classes were never used or defined.

Tests using "internalized" classes will only fully run on developer
builds. QFSFileEngine was removed altogether from exception safety test,
as it isn't its intent to test internal API.

Change-Id: Ie910e6c2628be202ea9e05366b091d6d529b246b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-22 00:07:31 +01:00
João Abecasis
31a0358afb Merge remote-tracking branch 'gerrit/master' into containers
Conflicts:
	src/corelib/tools/qbytearray.h

Change-Id: I03b1f3e05c9b7a45130887c522fcd9b7aa387129
2012-02-21 14:58:57 +01:00
Bradley T. Hughes
84438a77cc Remove qMacVersion()
Add QSysInfo::macVersion() instead, to match the windowsVersion()
function.

Change-Id: I783e59583ca21653d25586156cbb0cb1f301868b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-21 12:48:04 +01:00
Jan-Arve Saether
06ebe5bc80 Updated for accessibility
Change-Id: I13b5c2f293e9c1c238c7b7c6aae9d26f5c150f24
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-02-20 15:17:08 +01:00
Mark Brand
2ecdb8c091 QSql*Model: make indexInQuery() virtual
Qt 5 seems like an excellent opportunity to simplify logic and separate
concerns by making indexInQuery() virtual. Note that this wasn't my
idea, but was mentioned in a helpful comment.

Change-Id: Ie29ead110def45297c32de3ce6d07a8eefb08d8c
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-15 02:36:07 +01:00
João Abecasis
5d593da3d3 Remove constructors taking implicit string sizes
Constructors taking explicit sizes got a default -1 size argument that
triggers length calculation from nul-terminated strings.

This imposes a slight change in behavior: negative size arguments would
previously be ignored and generate an empty string whereas with this
patch we expect to see a nul-terminated string.

On the other hand, keeping the previous behavior could effectively hide
errors in user code and I can't find a good reason to support it.

Documentation for the constructors was updated and made more consistent
between the classes.

Change-Id: I738ac3298cffe3221c8a56e85ba2102623e7b67d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-14 15:25:37 +01:00
Jason McDonald
9b2971cbb4 testlib: Count passes, fails and skips consistently.
For data-driven tests, testlib previously counted one fail or skip for
each data row that failed or skipped, while it counted only one pass
for a test function where all rows passed and counted no passes for a
test function where some rows passed and some rows failed. A similar
problem also existed for benchmark tests, which could run multiple
iterations of the same test, with each fail and skip being counted but
only a single pass being counted for the entire series of iterations.

This commit makes testlib count one pass, fail or skip for each data
row.  Test functions that are not data-driven count one result for the
test function, as before.  Benchmark tests count one pass, fail or skip
per iteration.

A side-effect of this change is that the test output in plain text, xml
and light xml formats now shows a result for every data row and
benchmark iteration executed, allowing post-processors to correctly
calculate the total number of tests executed.  Previously, individual
rows were not shown in the test output if they passed, making such
calculations impossible.

The only change to the xunitxml output format is to correct a bug where
no test result was recorded for a test function if the last data row
was skipped and all other rows passed -- in which case the overall
result should be a pass.  Note that there is also a pre-existing bug
in the xunit logger, where no result is reported if all rows are
skipped; that bug is unaffected by this commit.

Task-number: QTBUG-21848
Task-number: QTBUG-22124
Change-Id: I7e17177e10d6e89e55b9684c159bd506f21d002b
Reviewed-by: Ed Baak <ed.baak@nokia.com>
2012-02-13 01:46:09 +01:00
Laszlo Agocs
89b192a082 Add an entry about TouchCancel to the changes file
Change-Id: If6d29db42ac59fcdbab82c23f30bd32e884354b2
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-10 19:40:29 +01:00
Mark Brand
68cee5258b QSqlTableModel::insertRecord(): clean up after failed setRecord()
Change-Id: Ic9f314144bd3ccf4b59b9cb3f0d79f8d6f97a824
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-09 10:45:38 +01:00
Mark Brand
a58e630b61 QSqlTableModel::setRecord(): improve handling of field mapping
-Only use fields where generated flag is set to true.

-Require all fields to map correctly. If fields don't map, that is a
sign of a programming or user error.

Change-Id: Ie8474393005de6c9926b4e46985d62b194eafde2
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-09 10:45:38 +01:00
Stephen Kelly
2ba0700ebf Update note about metatype fully defined requirement.
There is now public API to re-allow forward declared types
as metatypes.

Change-Id: I6c956ea2dc96f66eccfcfa81fcbb833b58b58d61
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
2012-02-09 04:08:17 +01:00
Mark Brand
f3138fa080 QSqlTableModel: do not suppress dataChanged() on inserted record
Affects setData() and setRecord().

Previously dataChanged() was suppressed when editing an inserted
record, except for OnManualSubmit. The motivation was probably to
allow setData() to be used while handling primeInsert().

Suppressing dataChanged() is not a good idea since views other than
the one which made the change will not know of the change.

It is a terrible idea to call setData() or setRecord() while
handling primeInsert(), so this is now expressly forbidden.
setData() and setRecord() now do nothing and return false if called
while rows are being inserted.

Change-Id: I96738c09a6268704c5626d95b72bfb46378e3242
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-02-08 14:43:18 +01:00
Mark Brand
269ef14215 QSqlTableModel::removeRows(): require valid full range of rows
If an invalid range of rows is specified, it's likely to be a
programming or user error. The old behavior of ignoring out of range
rows seems dangerous and complicates the code.

Also implement the documented behavior of returning false if
changes are unsuccessful for OnFieldChange and OnRowChange.
Previously the return value of submit() was ignored.

Updated and improved documentation.

Change-Id: Iaaf51c6d9a0c8c06fd5d186b4b88358fbeab9936
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-07 22:05:51 +01:00
Mark Brand
f5e1da12f0 QSqlTableModel::removeRows(): don't emit extra beforeDelete
Qt 5 seems like a welcome opportunity to stop emitting this
spurious beforeDelete signal.

Change-Id: Ib8628343ca9b8fdd85c154a206c7e2bf2c4c9dc1
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-07 22:05:51 +01:00
Jędrzej Nowacki
b8cf1d6bdc Remove QMetaType::unregisterType().
The function hasn't been working properly. It was not well tested, for
example it is undefined how QVariant should behave if it contains an
instance of an unregistered type.

Concept of unregistering types was inspired by plug-in system, but in
most supported platforms we do not unload plug-ins.

Idea of type unregistering may block optimizations in meta object
system, because it would be not possible to cache a type id.
QMetaType::type() could return different ids for the same name.

Currently QMetaType::unregisterType() is not used in Qt.

Change-Id: I878b6e8d91de99f9bcefeab73af2e2ba0bd0cba0
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-07 08:53:18 +01:00
Jędrzej Nowacki
56265031b7 Align QVariant::UserType and QMetaType::User
There is no point in keeping separate values which should mean the
same.

QVariant::UserType was used also to construct a valid, null QVariant,
containing an instance of unknown custom type. The concept was strange
and useless as there was no operation that could be done on such
QVariant. Therefore it was dropped.

Please note that the patch slightly changes behavior of different
functions accepting a type id as parameter. Before QVariant::UserType
was an invalid type from QMetaType perspective (id 127 was not assigned
to any built-in type), but QMetaType::User points to the first registered
custom type.

Change-Id: I5c7d541a9affdcdacf53a4eda2272bdafaa87b71
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-02-07 08:52:32 +01:00
John Layt
23457bd6d9 SIC: QLocale: Make QSystemLocale a private class
As discussed on list and approved by Lars and Thiago.

Make QSystemLocale private to give us time and space to change it to a
better implementation.

Change-Id: Ifd806972f3996c43a876f544f78c6557ad71cd75
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-05 17:50:04 +01:00
John Layt
29c4a27a94 SIC: QLocale: Remove base argument from conversion to number api
As discussed on list and approved by Lars and Thiago.

Remove the option to use QLocale to convert strings to non-decimal
numbers as they are not localised and the api is available in QString.

Change-Id: Ib810505ba86fb08ad23571b39f1520e86fde6787
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-05 17:49:56 +01:00
John Layt
1e3833bed8 QString: Make convert to number methods only use C locale
Ensure consistent conversions by not using the system default locale.

Change-Id: I60db9fc4f465c0254f3213419e57d7879aaddd65
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-05 17:49:42 +01:00
John Layt
fc24979e43 QDateTime: Remove Julian Calendar
Convert QDate to only use Gregorian calendar and not Julian calendar
before 1582.  In future the Julian can be used via proper calendar
classes.

Change-Id: I547a3550332057a0ab1be616706630b6afaceffc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-05 00:26:07 +01:00
John Layt
8327fa7c11 QDateTime: Store Julian Day as qint64
Store the QDate Julian Day number as an qint64 instead of uint32 to
enable support for dates before 2 January 4713 BCE.  This changes the
possible date range to be approx 2.5 Quadrillion BC to 2.5 Quadrillion
AD. A qint32 was not used as it only covers 5 million BCE to 5 million
CE which does include Geological or Astronomical time.

The effective supported date range is currently 4800 BCE to 1.4 million
CE due to restrictions in existing conversion formulas.  The effective
range will be extended later with new formulas.

Change-Id: Ib4345369455b31d4edae8c933b7721e76414e914
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-05 00:26:07 +01:00
Pekka Vuorela
c802a5d272 Remove QInputContext
This has only been around as compatibility interface for Qt4
but is now replaced by QPlatformInputContext.

Change-Id: I677dbbea46311bf39f6c5ca9dc3fb5009abe924a
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-03 11:01:34 +01:00
Giuseppe D'Angelo
3578e05b29 Merge QStyleOption*V{2,3,4} classes together
In order to keep binary compatibility, Qt 4 introduced V{2,3,4}
classes for QStyleOption subclasses. They're simple, low level
containers for various members with public access (no accessors
required).

In Qt 5.0 we can break BC, so this patch moves the members
from the derived classes into the ``base'' ones.
The ``base'' ones get a version bump matching the highest
version available, and the V{2,3,4} classes become typedefs.

This change can cause problems in code that used QStyleOption
directly, especially QStyleOptionViewItem, because the old V4
fields get default initialization but the QStyle subclasses
detect that the option is a V4 option and expect all fields
to be properly initialized. The fix in such places is to
properly initialize all fields.

Task-number: QTBUG-23522
Change-Id: I2f782da09ca5cc8c4cbafc07448fb0d33153a251
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-02 20:18:55 +01:00
Jonas M. Gastal
c22be73168 QDir::NoDotAndDotDot is now QDir::NoDot|QDir::NoDotDot.
Change-Id: I8ef7782258c2ec02ad2ec2a5d5cab90f53c62aa3
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-31 20:01:02 +01:00
John Layt
0436281771 QValidator: Don't fallback to C Locale when validating input
QIntValidator and QDoubleValidator used to accept C formatted input if
the input wasn't valid in the default locale.  This change removes this,
only the default locale is now used.

Change-Id: I8b2d8f9f3849abe3fcb5c12083aae542a76eaf90
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-01-31 07:02:11 +01:00
Lars Knoll
0f48d1a523 Remove QIconEngineV2 and fold it into QIconEngine
Change-Id: Ife590b7639f4aadcfbd4d77ca170285b623c14ae
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-01-31 04:56:14 +01:00
John Layt
0e62fc73c9 QDateTime: Add validity checks
Check the validity of date/time before attempting to perform maths.

Change-Id: Ia6a2caf07c6c36f7d7fac713a77bc4eb456c6ed6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-31 04:18:37 +01:00
John Layt
35b96c0d3d QDateTime: Deprecate setYMD()
Change-Id: I077332df554fb750666d51486c97724411276679
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-31 04:02:25 +01:00
Stephen Kelly
d9468a9752 Change the type key for delegate editors to int.
Previous type of QVariant::Type does not allow for custom types.

While technically source incompatible I found no re-implementation
of this class in qttools or qt-creator (most likely to use it for
property editors). The virtual methods are not needed because
registerEditor is all the API that is really needed.

Task-number: QTBUG-1065

Change-Id: I2a9c578c444a80359416f2224a0ee03903bfe779
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-30 16:25:09 +01:00
Lars Knoll
0fb5c7e71d Make coordinates float based where it makes sense.
Mouse and Hover events already use FP corrdinates. They
also make sense for tablet and drop events.

Task-number: QTBUG-20115
Change-Id: Iff35d1f468567bd5a37236853dbc7725a37d87f2
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-25 02:23:25 +01:00
Giuseppe D'Angelo
601d685849 Make mid() and midRef() properly return empty, non-null objects
If we request a substring starting at the very end of the string,
QString::mid should return an empty string, not a null string.
For instance, QString("abc").mid(3, 0) used to return a null
one, while this patch makes it return an empty one. The
same thing applies to QString::midRef() and QByteArray::mid().

Change-Id: Ie9efd7a0622d429efd0fb682c19856c19e9469af
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-24 17:36:11 +01:00
Stephen Kelly
4b8ceb41ae Store the is-a QObject fact with the metatype declaration.
This is a source incompatible change for Q_DECLARE_METATYPE(T*),
which now requires T to be fully defined.

The consequences of this are:
 * Forward declared types can no longer be declared as a metatype.
     (though this is a very uncommon thing to do).

There is a trivial workaround where necessary.

Change-Id: Id74c40088b8c0b466fcd7c55abd616f69acc82c8
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-24 15:27:25 +01:00
Robin Burchell
7c247d3e70 Obsolete QInputDialog::getInteger() 'officially'.
It has long since been obsolete in code and removed from the documentation, but
was never marked QT_DEPRECATED. Do so, and inline the implementation.

Change-Id: Ic7bfdaf76269b7f9addeba83e64bc9525c581dda
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-22 22:10:02 +01:00
Thorbjørn Lund Martsum
5ff1a76a53 Change QMessageBox::question to default to yes/no buttons instead of ok
Beside that it also removes a suggestion about making Ok==Yes and
No==Cancel. It would be a problem since we (at least)
can have messageboxes with both yes, no and cancel.

Change-Id: I567979b2e697e7103968d6512fe4835f86888ca3
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-21 14:29:49 +01:00
Mark Brand
3a3356a850 remove obsolete codec plugin loading code
Change-Id: I1f3dbb5c10009413f701947b1b89ed3dbc94bf3d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-20 18:48:22 +01:00
Friedemann Kleint
688d463f4a uic: Add translation-attributes to string list properties.
Task-number: QTBUG-8926
Task-number: QTBUG-20440

Change-Id: I57d92110bf532c717451336bd1943c9571020478
Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com>
2012-01-20 14:17:41 +01:00
David Faure
47d5d349d8 Remove QBool and use bool instead.
QBool was introduced with Qt-4.0, to detect Qt3-like code like
 if (c.contains(d) == 2) and break compilation on such constructs.
This isn't necessary anymore, given that such code couldn't possibly
compile in Qt4 times.
And QBool was confusing developers, and creating compile errors (e.g.
QVariant doesn't have support for it), so better remove it for Qt 5.

Change-Id: I6642f43f5e12b872f98abb56600186179f072b09
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-20 14:17:41 +01:00
Lars Knoll
253c801c56 Remove QDir::convertSeparators()
This method has been deprecated since Qt 4.2.
QDir::toNativeSeparators() replaces it since then.

Change-Id: I49e6e1bfd50f26aa30134e599ee82067709549a7
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-19 16:41:44 +01:00
Orgad Shaneh
f9b94a7ee1 qmake: Normalize paths instead of converting to native separators
Task-number: QTBUG-22738

Change-Id: I40163a883d84beff79f52bff141d61dfe921c129
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-19 00:17:32 +01:00
Xizhi Zhu
8ecc2da31d Remove QNetworkConfiguration::bearerName().
It was added only to maintain source compatibility with Qt Mobility.

Change-Id: Iea8d40e401bd1f8d5115268e09b256eacca69ea0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2012-01-18 12:53:13 +01:00
Jonas M. Gastal
bdce610022 Fixes examples/tests to use qinptr in QTcpServer::incomingConnection.
This is a fix for problems introduced by bf7f170.

Change-Id: If5dd8e031ef2efea578b3efb188c2e950e1ba41a
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-13 20:55:00 +01:00
Samuel Rødal
72d7dd478e Modified changes-5.0.0 to reflect change to QTouchEvent API.
Change-Id: I378da8d16e1b3b2ea5bd89ede0f194b49c51ae85
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
2012-01-13 16:29:38 +01:00
Jonas M. Gastal
1453f74cc5 Make QFtp private.
All references to QFtp in documentation have been removed, QFtp's
documentaiton was marked internal. The QFtp example was removed.

Task-number: QTBUG-23199
Change-Id: Ifff83cac069fb350e8ebeae63e605850e65c0c30
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-01-12 14:38:55 +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
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
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
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
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
Sergio Ahumada
c9ee64d8b7 Remove qttest_p4.prf file
qttest_p4.prf was added as a convenience for Qt's own autotests in Qt4.
It enables various crufty undocumented magic, of dubious value.
Stop using it, and explicitly enable the things from it which we want.

Most autotest .pro files should look like this:

  CONFIG += testcase
  TARGET = tst_something
  QT = core testlib
  SOURCES = tst_something.cpp

Change-Id: I051b230c5c4fd56dc6eae2b9b7bdff6c033248fd
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-06 09:38:31 +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
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
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
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
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
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
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
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
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
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
Bradley T. Hughes
6f0f9f6928 Remove QMetaObject guards and deprecate QPointer.
QWeakPointer is superior and preferred.

Remove QMetaObject::addGuard(), QMetaObject::changeGuard(),
QMetaObject::removeGuard(), and QObjectPrivate::clearGuards().

Implement QPointer using QWeakPointer<T> instead. This changes the
behavior of QPointer in 2 ways:

- During destruction of a QWidget. Previously, the destructor of QWidget
would reset all QPointers so that they would return zero when destroying
children. Update tst_QPointer to account for this change.

- When constructing a QSharedPointer to take ownership of an object
after a QPointer is already tracking the object. Previously, the shared
pointer construction would not be affected by the QPointer, but now
that QPointer is implemented using QWeakPoiner, constructing the
QSharedPointer will cause an abort(). Fix tst_QSharedPointer by
removing the use of QPointer in the objectCast() test.

These behavior changes are documented in the QPointer class
documentation and in the changes file.

Change-Id: I92d0276219c076ece7bcb60f6e1b9120ce4f5747
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-10 16:11:48 +01:00
Laszlo Agocs
4222603f8e Extend touch events.
The capability flags indicate which information is valid in the touch
points. Previously there was no way to tell if e.g. the value returned
by pressure() is actually the value provided by the driver/device or
it is just something bogus due to pressure not being supported.

The points' flags return information about the individual touch
points. One use case is to differentiate between touches made by
finger and pen.

Velocity, if available, is now also exposed.

Each touch point can now contain an additional list of "raw"
positions. These points are not reported individually but are taken
into account in some way by the underlying device and drivers to
generate the final, "accurate" touch point. In case the underlying
drivers expose these additional positions, they are made available in
the lists returned by the touch points' rawScreenPosition().

The raw positions are only available in screen coordinates to prevent
wasting time with mapping from global positions in applications that
do not use this data. Instead, apps can query the QWindow to which the
touch event was sent via QTouchEvent::window() and can call
mapFromGlobal() manually if they need local raw positions.

The capability and device type information is now held in a new
QTouchDevice class. Each touch event will contain only a pointer to
one of the global QTouchDevice instances. On top of type and
capability, the new class also contains a name which can be used to
differentiate between multiple touch input devices (i.e. to tell from
which one a given QTouchEvent originates from).

The introduction of QTouchDevice has three implications: The
QTouchEvent constructor and QWindowSystemInterface::handleTouchEvent
need to be changed (to pass a QTouchDevice pointer instead of merely a
device type value), and each platform or generic plug-in is now
responsible for registering one or more devices using the new API
QWindowSystemInterface::registerTouchDevice.

Change-Id: Ic1468d3e43933d8b5691d75aa67c43e1bc7ffe3e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-09 14:15:37 +01:00
Stephen Kelly
8021e2d5e7 Remove the backwards compatibility signal emissions when moving items.
Change-Id: I29a44835d3397c1dbf37026daf0c5234dae770e0
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-08 23:22:39 +01:00
Jason McDonald
ad80d42f8e Remove unused overload of QTest::qExec.
The overload of QTest::qExec() that takes a QStringList is not used
anywhere in Qt's autotests, despite having been in the qtestlib API
since Qt 4.4.

This lack of use most likely derives from the fact that none of the
QTEST_MAIN macros use the overload, and more than 99% of Qt's tests
use those macros to avoid explicitly calling QTest::qExec().

Change-Id: I264b21d7fe1a9f2d565f748cf8bbe32414a73bb0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-08 03:04:55 +01:00
Friedemann Kleint
ebfdb73b75 qtbase: Remove QSound.
Which currently causes tests not to compile on Windows
due to missing symbols in QtWidgets (QSound::QSound() ,etc).

Change-Id: I87f0a403e61c3a67f9a758f114e33db1012e33e8
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-07 14:37:41 +01:00
Frederik Gladhorn
88834ffe78 Update changelog - Accessibility
Change-Id: I03a2d8c53ebc84ebf7219bff751821e00fbfa170
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2011-11-23 16:30:26 +01:00
Peter Hartmann
4dc390e66f SSL namespace: rename TlsV1 to TlsV1_0
This is a source-incompatible change.

TlsV1 is ambiguous; what is actually meant is TLS version 1.0. There are
also TLS versions 1.1 and 1.2; we might want to add options for these
once OpenSSL supports them (apparently they will be with OpenSSL version
1.0.1).

Change-Id: I940d020b181b5fa528788ef0c3c47e8ef873796a
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-16 10:32:10 +01:00
Richard Moore
6f115edd74 Always use the hex format for certificate serial numbers.
In Qt 4.x the serial number is reported by a mixture of the hex value
and the number, The hex is what is used by other tools, and we should do
the same.

Change-Id: Ia0361d43fb5b920d053c95e932e0c8a012436e5e
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-11-15 10:16:12 +01:00
Richard Moore
e66d3d9899 Deprecate QSslCertificate::isValid() replace with isBlacklisted()
Currently isValid wrongly gives the impression it checks a certificate
for validity - it doesn't. It merely checks if the certificate dates
are valid and if the certificate is blacklisted. Since it's already
easy for users to check the dates, let's just give them access to the
ability to check for blacklisting.

Change-Id: I25be3bde6a01063034702a9574b28469bf4882cd
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-11-14 10:39:47 +01:00
Jason McDonald
4d643a0614 Update changes file for tests and testlib.
Change-Id: Ib8bc7b365166e75e54e693c550832849de6a0363
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-28 07:17:33 +02:00
Shane Kearns
3736dcb65e Network - Add QHostAddress::isLoopback API.
The standard IPv4 loopback address is 127.0.0.1, however anything in
the 127.0.0.0/8 range is also a loopback address.

isLoopback returns true for any address that is in the IPv4 loopback
address range, or is the single IPv6 loopback address ::1

Task-number: QTBUG-22246
Change-Id: Ic39100e2e97a52db700e01b109998a1cfd4335e3
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-24 13:56:41 +02:00
Kent Hansen
e5ce564b1d Rename QMetaType::construct() to create()
create() is symmetric with destroy().

Also rename the internal methods and fields to be
consistent (qDeleteHelper already had the "right"
name, though!).

This change will allow us to use construct() and
destruct() for something else: Placement new-style
allocation (QTBUG-12574).

The old construct() is still kept for now, until
the other repositories have been updated to use
create().

Change-Id: Iceb184af6cffcb0a634359cfc3516c718ba0c2f5
Reviewed-on: http://codereview.qt-project.org/6342
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-11 16:01:45 +02:00
David Faure
b863df7de9 Rename Qt::escape to QString::toHtmlEscaped, add compat method
Merge-request: 56
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>

Change-Id: I46bbb2df10968e88b5eb5ef8dae182a651b622b8
Reviewed-on: http://codereview.qt-project.org/5793
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-09-29 15:22:07 +02:00
Pekka Vuorela
3d71266fea Remove support for QWidget specific input contexts
QInputContext is migrated to QInputPanel, which allows only one
instance.

Change-Id: I4912164790d5a6bdff41e11cbe4bc4e2f9f111ec
Reviewed-on: http://codereview.qt-project.org/5641
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-28 14:02:08 +02:00
Oswald Buddenhagen
187ee8842b "empty translation" does not mean "no translation"
this makes QCoreApplication::translate() consistent with
QTranslator::translate(), and is semantically cleaner.
users wishing to shrink their QM files can do that properly by using
lrelease -removeidentical.

Change-Id: I2b367314cfb985c3d130c7c6347e2742311f497a
Reviewed-on: http://codereview.qt-project.org/5165
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
2011-09-26 18:20:05 +02:00
Keno Fischer
b2780e60c7 added QMAKE_MOC_OPTIONS variable to qmake
Merge-request: 41
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>

Change-Id: I8d492e9fbdbeeffa9f702a3a1f2fab314586809f
Reviewed-on: http://codereview.qt-project.org/4375
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-09-07 19:04:20 +02:00