Commit Graph

4494 Commits

Author SHA1 Message Date
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
Mark Brand
508a90302b QSqlQueryModel::fetchMore() documentation fix
Change-Id: If046e674abad9c2dcff934a2fdd80d4133e1f4ad
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-04-23 19:20:19 +02:00
Stephen Kelly
d21f8c157a Build the QNX plugin with -no-opengl enabled.
Change-Id: I776a3eb0d7ada4399b8c191bbfa1e3ed9236b20e
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-23 17:04:04 +02:00
Olivier Goffart
ecba58500e Fix compilation of QDesktopServices without deprecated
Change-Id: I9e225d32b3f7db403cf3eea6a277580b4b7410a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-23 15:39:24 +02:00
Olivier Goffart
55d1f56c28 Fix warning in qobject.cpp
Variable only used in debug mode

Change-Id: I6601ca68c427b909680423ae81802f1ed5cd178a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-23 15:38:09 +02:00
Miikka Heikkinen
e95d94cbbd Windows: Fix QRawFont loading from data.
The implementation for loading QRawFont from data was missing from
Windows QPA plugin.
For freetype font database, just called the parent QBasicFontDatabse
implementation.
For native font database, ported the implementation from Qt 4.8
qrawfont_win.cpp.

Task-number: QTBUG-24197
Change-Id: Ia784d4cbc4f37c925aa49e53d04faf06a7169a73
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-04-23 15:37:23 +02:00
Casper van Donderen
3a78aabf3f QDoc: Support -indexdir on CLI and depends in qdocconf.
You can now specify a list of modules in the "depends" qdocconf
variable. This stringlist is then used by the -indexdir option to
specify in which directory to search for [depends entry]/[depends entry].index

Change-Id: Icab6dd0133e180ac04365da9605743def6fb754d
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-04-23 09:45:24 +02:00
Casper van Donderen
8d9cb38a66 Doc: Fix most QDoc errors in QtXml.
Changes:
- XML processing document moved from Qt XML Patterns.
- Moves documentation from /doc/src to /src/xml/doc
- Add new qdocconf file.

Change-Id: I4bc2104714a28905304997e5ff252e662ddf0bee
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
2012-04-23 09:45:24 +02:00
Jonathan Liu
6289636365 Fix unmatched double quote character
Change-Id: I25fb7dac38db2800ce974d40ec275d510f6d47f4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-23 09:45:24 +02:00
Kalle Viironen
83c637aa94 Fix bug in qsslsocket peek()
Calling peek() for qsslsocket caused socket data to be copied into
qiodevices buffer and therefore make it unaccessible in qsslsocket.

Cherry picked form 4.8-branch & modified to Qt5 API changes
(int -> qintptr)
Original commits:
commit 621f18955082fc73471e75d1f8c35c2dcd4befeb
Author: Shane Kearns <ext-shane.2.kearns@nokia.com>
commit 68b1d5c17aa38d5921bdade2b0e0cb67c6c90513
Author: Kalle Viironen <kalle.viironen@digia.com>

Task-number: QTBUG-18498
Change-Id: I6be4b19baec2f3197537f5e7b61432040ec84ad2
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-23 09:45:24 +02:00
Stephen Kelly
47617f68cb Make the QNX QPA plugin work with non blackberry.
Change-Id: Id85d18d9f21711e8d53e8e4bfdf39d10e135f593
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-23 07:30:02 +02:00
Kevin Krammer
5c2e560fe9 Send Expose event when top level window becomes visible
Change-Id: I0b45c27fa03bbe073c88ce8d01d9fb283f4051c1
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-23 07:30:02 +02:00
Rohan McGovern
8dea797015 Removed invalid C-style license header from .pro file
/* C-style comments */ cannot be parsed by qmake.

Additionally, Qt Project legal has agreed that .pro files do not need to
be covered by license headers.

Change-Id: Ie4d75ee09c2fc85a2f954ec4a931b36ea9d51d93
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-04-23 04:28:54 +02:00
Michael Brasser
b332a6c1e4 Don't assume QAbstractDeclarativeData::objectNameChanged is available.
Preparation for removal from declarative now that a proper NOTIFY
signal exists.

Change-Id: If0acb73b73d17c49dc8de211d95ecd1e8e80ff1b
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-04-23 01:22:29 +02:00
Thiago Macieira
fcec903da7 Ensure that qXXXdetection.h can be included directly
Those files might have dependency on one another, on qconfig.h and on
early qglobal.h definitions, so ensure that the only correct include
order is that of qglobal.h.

Change-Id: I89098bacaf16353ee8b51604ee885508dc8e201a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-21 11:19:39 +02:00
Thiago Macieira
f4227a7b86 Make the fallback Q_ASSUME and Q_UNREACHABLE be qt_noop
That way, we can properly add ; after them, and I can use Q_ASSUME in
Q_ASSERT's else condition.

Change-Id: Iad35819fbb06714116b7dd0f952e1c2c89044c72
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-21 05:09:24 +02:00
Thiago Macieira
4d55ba046c Move Q_DECL_{IMPORT,EXPORT,HIDDEN} to qcompilerdetection.h
Mindful of QT_VISIBILITY_AVAILABLE and Q_OS_WIN for GCC: when GCC is
used on Windows (i.e., MinGW or potentially Cygwin), use the declspec
variant so we produce proper DLL imports and exports.

When used on other platforms, rely on configure adding
QT_VISIBILITY_AVAILABLE to qconfig.h, which confirms that the
-fvisibility argument is available. That flag has been available since
GCC 4.0 on ELF targets, but it could be missing on some other targets.

Change-Id: I3dbc0043c1eaee0c469c5b1dc8bf05842fe9cd47
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-21 05:09:20 +02:00
Thiago Macieira
32758d917e Move some compiler macro definitions into the compiler sections
Makes for a couple of cleaner definitions of fallbacks.

Change-Id: I9b1a6f77bab986514e1862ae1f431ea37b89c1b5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-21 05:09:18 +02:00
Thiago Macieira
308ffceea5 Move the compiler-related macros to qcompilerdetection.h
This cleans up qglobal.h a little further and organises things a bit
more.

Change-Id: Ic025e720941cdf59b8a1a0baf515b29f25eba0f1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-21 05:09:14 +02:00
Jan-Arve Saether
45991b0f31 Compile on Windows.
The previous code was trying to sum one pointer with one string
literal...
Using QVarLengthArray should also potentially speed things up a bit,
since it will avoid a malloc if className is small enough (less
than 15 bytes).

Change-Id: I41218babb3030e7e6f9c31fc77e4af1c209ae0a5
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-21 05:09:12 +02:00
Stephen Kelly
40fe0721d6 Fix typo in backwards compatibility code.
The patch just submitted to Qt4 is not affected by this.

Change-Id: I3f38f1a56f2a9a2058b2c8ff0a6ee1715be41e85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-21 01:24:05 +02:00
Olivier Goffart
7eebe4e960 Fix compilation with Q_DECL_OVERRIDE
In C++11, the override keyword is placed after the function declaration

Change-Id: I3a079860762f30fa21eb01611c770713f6ba4acb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-20 22:23:23 +02:00
Aurindam Jana
d8a1899682 QDataStream: Update Version info for doc
QDataStream::Qt_5_0 was modified in
aee1f6cc41
but the documentation was not updated.

Change-Id: I520798a7572b0f21cd275290bcd689e1b686d098
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-20 22:23:23 +02:00
Thiago Macieira
369863efef Don't push unnecessary data to a data stream for QVariant()
Adjust the test because we don't read past the end anymore.

Task-number: QTBUG-25108
Change-Id: I8243f1d5ae79d1256aab2cb1132598a716a7eeeb
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-20 22:23:23 +02:00
Shane Kearns
fffc900f78 Windows - "bypass proxy for local..." also affects IP addresses
If the "bypass proxy for local addresses" option is enabled in
the windows proxy configuration, then do not use the proxy for
any IP address in the subnet of any network interface.

As the systemProxyForQuery api is now offering HTTP proxy tunnels
for TCP sockets, this change avoids local ad-hoc network
connections being routed through the proxy.
In the case where the local address was on a different interface to
the proxy server, it may have been unreachable through the proxy.
For example IP over USB or Bluetooth.

Change-Id: I0842732832a7795112be029d923ed168edc008d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-20 22:23:23 +02:00
Miikka Heikkinen
a941e0c0a6 Windows: Remove fontengine autodetection logic
Always default to native font engine as native fonts now work in
QML applications, too.

Change-Id: Iafa5f6d25a9a3b22f49763f287e4e358216cfc2d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-20 16:21:31 +02:00
Miikka Heikkinen
4c6d12e6d2 Fix missing Windows native fonts in QML applications
Windows native fonts were not getting rendered because the font engine
was cloned incorrectly for QRawFont, resulting in multi-engine instead
of the specific cloned engine.

Task-number: QTBUG-25410
Change-Id: I08f543e541739ac1b51f96f381ae1bb20b59399a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-04-20 16:21:08 +02:00
Casper van Donderen
ac090486c4 QDoc: Remove the text around previous and next page links.
Previously we printed "[Previous: <link>] and [Next: <link>]. After this
change we only print the <link>, which should include an icon.

Change-Id: I30d0c7d53b70ec2e537774d57a4ac9af01b26b16
Reviewed-by: Martin Smith <martin.smith@nokia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@nokia.com>
2012-04-20 12:46:47 +02:00
Lars Knoll
9ce1acd9e4 Revert "List QtPrintSupport as a dependency of QtPlatformSupport."
This reverts commit 9c7cdce672.

platform support does not and should never depend on widgets
or print support.

Change-Id: I828d1dfc02e7993325cf653ed92100750761eaae
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-20 12:46:47 +02:00
Friedemann Kleint
6331894524 Fix MSVC conversion warnings in new bytearray code.
Change-Id: Ifc81564daf3fef0d7f08ae8d250ba41d3b1d5b0f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-20 12:46:47 +02:00
Martin Petersson
a8a5b38b00 QSslSocket: call to ERR_free_strings to free loaded error strings
Since we are calling q_SSL_load_error_strings to load error strings
we should call ERR_free_strings to free the memory again.

Task-number: QTBUG-15732
Change-Id: Ie41291bb0e1434f82025378edfca51930712a8aa
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-20 12:46:47 +02:00
Morten Johan Sorvig
fb8cd418fb Fix crash in QCocoaBackingStore.
QWindow->handle() may be null during construction,
and also during calls to resize(). Get and check
the pointer at each call instead of caching it
in the constructor.

Change-Id: Icd950b55e16fdd2077e3b7fe3c3393d8b89b5903
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-20 12:46:47 +02:00
Konstantin Ritt
65ae2151c3 mingw: fix a lot of annoying warnings
like "QRect::intersected() redeclared without dllimport attribute
after being referenced with dll linkage" (-fno-keep-inline-dllexport)

Change-Id: Id24e5ee857579ee9f97a60de0ab88ce3db8385cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-20 10:29:14 +02:00
Morten Johan Sorvig
128b7c56b7 Implement QCocoaWindow::setWindowState.
Add window state change notification logic. Send
and expose event in addition to window state change
on window restore since the QWidget logic expects
this.

Modify QCocoaWindow::setVisible to sync up window
state that may have been set on the hidden window.

Refactor NSWindow event observing to use one observer
function for all notifications.

Add window state testing to tests/manual/windowflags
Add delay after showFullScreen in tst_qstatusbar to
wait for the Lion fullscreen transition.

Change-Id: I57c523cedd0644d4181b40d72046fad4fdb09a9c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-20 10:29:14 +02:00
Eskil Abrahamsen Blomfeldt
ca5918c8b8 Retain bidirectional marks when eliding text
When the text contains unicode markers for bidirectional
text, these will not affect the width of the text, but they
might affects its layout. Thus, we need to retain these
markers in the elided text to avoid the layout of the string
changing when its allocated width changes.

Task-number: QTBUG-3768
Change-Id: I3866c32cd1dcd5fff2b8fa5b25ae89e551531a97
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-04-20 10:29:14 +02:00
Martin Jones
1946740446 Provide versions of qRegisterMetaType() that do not normalize typename.
QML is quite capable of providing typenames in the correct format.
qRegisterNormalizedMetaType() does not normalize the typename, so
avoids the huge overhead.

Change-Id: I96c9a42fe0b5d36ac05a9247f6507dbf9583fa67
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-20 03:39:10 +02:00
Michael Brasser
7e9f7080b7 Minor QObject::receivers() optimization.
Don't lock if there are no receivers.

Change-Id: I922fad10436adeb27aa4f193cc0dcbaa3f0c0f1e
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-20 00:32:53 +02:00
Michael Brasser
5533cc9953 Minor QObject::receivers() cleanup.
Return 0 rather than false; remove extra Q_D().

Change-Id: I3dac733c3fae27c76790f09fd6b63356767a0363
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-20 00:32:43 +02:00
Michael Brasser
56d78e5086 Add a receivers callback to QAbstractDeclarativeData.
Change-Id: I767fabd66c7de535db26e779855d21ec5b94e947
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-04-20 00:32:32 +02:00
Andy Shaw
a48d9b52c3 Fix compilation with QT_NO_DEBUG_OUTPUT defined
Change-Id: If96e93c08240e0f626f8e465993b2c38b2cad832
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-20 00:29:39 +02:00
Konstantin Ritt
8e09e0dc45 QImage: fix declaration of inline methods
Change-Id: If97f423329705dccf98742089362db9eecb55087
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-20 00:29:39 +02:00
Thiago Macieira
5d0da01b54 Mark qt_assert and qFatal as non-returning functions (excpt. MSVC)
This allows the compiler to optimise the code a bit better: since they
don't return, it can assume in the code after the Q_ASSERT that the
condition was true.

MSVC is the exception: with MSVC, we have the CrtDbgReport dialog,
which allows the developer to continue execution, inside the
debugger. Therefore, we can't mark any of those functions as
non-returning because they can, after all, return.

Unfortunately, the Q_ASSERT usually expands to no code in release
mode, so the improvement in code generation happens in debug mode
only...

Change-Id: I4d542d6853cd51c71ffab1d563ed64ef7c419115
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-19 22:15:16 +02:00
John Layt
886aea1250 PrintSupport - Remove Qt5 To-do Messages
Task-number: QTBUG-25085
Change-Id: I4cf3cc4827f5cc0eeade36cfde94472fab3abb92
Reviewed-by: John Layt <jlayt@kde.org>
2012-04-19 22:15:16 +02:00
Shane Kearns
af100dbd7e Abort background requests if policy changes to disallow them
Using the policy change signal from QNetworkSession.
If the new policy disallows background requests and this is a
background request, then generate an error.
This results in a TCP RST on the socket, and a
BackgroundRequestNotAllowedError on the QNetworkReply.

If the reply is already finished, no action is taken.

Change-Id: I4ff5c681a8b7b852727bb95f03664d666f4efe07
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-04-19 19:46:07 +02:00
Shane Kearns
a1e961705c Connect usagePoliciesChanged signal to the QNetworkReply
Change-Id: Ibb8ba0b3226e402dfa9a5a1a64faa80702b11dd7
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-04-19 19:46:07 +02:00
Shane Kearns
96fe7dad38 Set ConnectInBackground also for http implementation
Change-Id: Id82322250d86f35702036c64d725c9d093046d5b
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-04-19 19:46:07 +02:00
Kim Motoyoshi Kalland
8aa0be210a Removed legacy pixmap and image cleanup hooks.
Task-number: QTBUG-25114

Change-Id: Id87172665ec15874e293e3891738e6366aef4554
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-04-19 16:57:08 +02:00
Konstantin Ritt
907909d858 fix qsslsocket build in -permissive mode (assigning const char* to char*)
Change-Id: I76269630ebabdf601c2fcb5f65a8dffbd6cdbc5e
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-19 16:44:47 +02:00
Girish Ramakrishnan
0074cc5d34 Fix detection of default platform plugin.
Let configure generate the QT_QPA_DEFAULT_PLATFORM_NAME in
qconfig.h. This allows us to override the platform name
using a configure argument.

This commit adds -qpa <platform> that lets the user specify
the default platform at configure time. Note that the default
platform is not checked against the tree since plugins are
allowed to exist outside the Qt source tree.

In the absence of -qpa argument, configure checks the mkspec
for a variable named QT_QPA_DEFAULT_PLATFORM. This check is
implemented only in the unix configure because it will be primarily
used in custom mkspecs (devices, boards).

If -qpa argument is absent and the mkspec variable is absent,
the default value is determined based on the OS as below:
    Unix - "xcb"
    Windows - "windows"
    Mac - "cocoa"
    QNX - "qnx"

Done-with: Jørgen Lind

Change-Id: I0df31811a1b901a3242bfada1232e596ebda04f4
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-04-19 16:40:29 +02:00
Bjoern Breitmeyer
14ea50598f Fixed QSimd WindowsCE build
Change-Id: I94de251cf1f283d30f92d0fb9d37a1646765cbdd
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-04-19 16:27:22 +02:00