Commit Graph

12183 Commits

Author SHA1 Message Date
Giuseppe D'Angelo
bcd04af4e8 QRegularExpression: don't use study data when getting the pattern info
Information about the pattern (number of capturing groups, newline
settings, etc.) are grabbed when the pattern is compiled the first time.

Studying (=> optimizing) is always done later, after a certain amount
of usages. In case this ever changes, add an assert.

Besides, we're not grabbing any info that require studying the pattern
first.

Change-Id: Ica15fa21f7bf13213288d7090d3396a89900078e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-12 22:40:11 +01:00
Caroline Chao
a317ee0a6f Fix sizeHint for QAbstractSpinBox
The current size hint is not correct and the text is truncated
when using prefix/suffix.

Update QCommonStyle::sizeFromContents() to get the button
and frame widths into account for the QSpinBox width.

Update sizeFromContents() in the different styles to be
consistent with the change in QCommonStyle.

Update minimumSizeHint(), calculate it using the prefix and
data range. The SpinBox can shrunk over the suffix if any.

Task-number: QTBUG-28863

Change-Id: Ia742232edf8b11d0283e8136c2818928f8755103
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-02-12 20:20:03 +01:00
Thiago Macieira
8f00f2020b Leave some Qt 6 remarks for QStringRef
QStringRef could have been trivial. The destructor is empty, the copy
constructor copies exactly the members and has an empty body and all the
members are POD. Both functions should be removed or defaulted in Qt 6.
When the destructor is defaulted, we can make the constructor constexpr.

We can't do that now because QStringRef is exported and some nasty
compilers (MSVC) like to export all functions, even inline ones, and
then call them without emitting a local copy.

Change-Id: Ie7509fd1a3f737a6c9156ea078d13bb347fc6be0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-02-12 20:19:43 +01:00
Oleg Shparber
3a2276c6f3 QNX: Fix QInputMethod::keyboardRectangleChanged() signal
Change-Id: Iad3ee07ba85854d2eb0cf36710643b75993bf61c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-02-12 17:56:10 +01:00
Sergio Martins
3fb356f531 QNX: Fix qFatal() statements.
"QQNXQBBWindow" doesn't make sense.
Change-Id: I0e56d5be4a9bb7a0336f71ea3348621be730dee1
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-02-12 17:56:10 +01:00
Friedemann Kleint
9a74bbf34f Fix developer-build of qsslsocket_onDemandCertificates_member.
Do not include qsslsocket_p.h unless SSL is present.

Change-Id: I7e56b7758729907892d85f97d5a9d3ccaf7a3314
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-02-12 17:56:10 +01:00
Samuel Rødal
c76ec20e55 Fixed QSurfaceFormat documentation about DebugContext requiring GL3+.
GL_ARB_debug_output only requires OpenGL 1.1 and above.

Change-Id: Ib79d370fac36fa737817ea678f0dee25283dfa31
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-02-12 17:56:10 +01:00
Tor Arne Vestbø
74f9664f95 Use CTFontCopyDefaultCascadeListForLanguages for font fallback if available
On Mac OS 10.8 and iOS 6.0 we can use CTFontCopyDefaultCascadeListForLanguages
to get the list of fallback fonts, which is preferable to reading the plist
file from the filesystem. The latter doesn't work (is not allowed) on iOS
in any case, so for iOS < 6.0 we use a static list of fallback fonts.

Change-Id: Ibb5e1b4dedd6bfb936f66b53a20f7ced83536ed7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-02-12 17:43:24 +01:00
Tor Arne Vestbø
183e04a439 Don't use the fallback list to decide if the CoreText font db was populated
In some situation (such as iOS currently) we may end up with an empty
fallback list, and we don't want to re-populate the font database
on every call to fallbacksForFamily().

We do not guard populateFontDatabase(), since it's called both initially
and every time the font database has been invalidated.

Change-Id: Ief1342c40f75e5d393e054e9a20bc94bc357d482
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-02-12 17:43:15 +01:00
Samuel Rødal
62d25e4d4f Fixed QPixmapCache associating path with wrong QPixmap.
QPixmap::load() would not detach, so multiple paths could get associated
with the same QPixmap, causing the wrong pixmap to be shown.

Task-number: QTBUG-29639
Change-Id: I064dd6a9611b5996853bec9fb20b6224a0adcf62
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2013-02-12 15:21:57 +01:00
Samuel Rødal
23b11e792c Added QWindow::Visibility convenience API to QWindow.
This finally makes it possible to make windows fullscreen etc from
QML by doing "visibility: Window.FullScreen". I don't see any reason
from not having the API at the QWindow-level instead of at the
QQuickWindow-level since this way it can benefit other use cases too.

Change-Id: If27344306eb563bc2ccd83296a46b1f2862e2db1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-12 15:02:53 +01:00
Morten Johan Sørvig
f5acd545a8 Mac: Remove broken platformPluginPath code.
The missing "/" in front of "../Plugins" prevents
this from working - platformPluginPath is never
set.

Deployed platform plugin loading works in spite of
this via qt.conf which adds the plugin path to
QCoreApplication::libraryPaths().

Change-Id: I7ae4d13c65a380ddad72bffd29b776c39ea91c8a
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-02-12 14:58:59 +01:00
Mark Brand
60c1f9f274 QSqlQuery tests: fix create table failures
Change-Id: Id20517cc68d03ac008650374fadd96cd6626d3fe
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-12 12:42:54 +01:00
Eskil Abrahamsen Blomfeldt
fe6add818e Enablers in fbconvenience for Android port
Additions to make the convenience classes work for the
Qt for Android port.

Change-Id: I25ba0faf93c7e09ab04a3fa0784e04631e5ab036
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-12 12:25:22 +01:00
Thorbjørn Lund Martsum
686dcce5fb Make QGraphicsViewPrivate::updateRubberBand more readable
This patch changes QGraphicsViewPrivate::updateRubberBand to return
at once in case some of the first conditions (which were needed to
do something with the rubberband) are not true.

The indentation after these ifs is fixed, and there are a few style
fixes, but beside the first 2 ifs, there are only white-space
and new-line changes.

Change-Id: I7e2edb7bfd334b35ee8ab246f733d854bff7e0f7
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-02-12 12:01:16 +01:00
Mark Brand
c6d522532a qpsql: fix spelling in comment
Change-Id: I3d1abd6041a4adf425ba7851146659655fc12183
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-12 10:59:25 +01:00
Mark Brand
46b7c91c81 QSqlQuery tests: fix bool test for postgresql
Change-Id: I60634f89841cbc81058588e435c6482c6c0efed6
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-12 10:56:00 +01:00
Mark Brand
f01caaf64a QSqlQuery tests: fix mysql problems
Change-Id: I82f4e6c8801c7a936b80ad72c229f915e6d2a4de
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-12 10:54:51 +01:00
Pasi Petäjäjärvi
8d2679673e Remove overlapping variable names defined in VxWorks headers
VxWorks has defined variables with same name as in Qt's headers.
Remove these undefines because that has already done in file
src/corelib/kernel/qfunctions_vxworks.h. See related change
f7bd8652ca.

Change-Id: I994ac9d00ca223b9fa955dfcba8ad6c8dcbd0549
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-12 09:40:48 +01:00
Pasi Petäjäjärvi
8840ad56a3 Use stub function rand_r for VxWorks DKM mode
Vxworks DKM mode does not have rand_r function, use function
implementation from qfunctions_vxworks.h/cpp instead.

Change-Id: I8f23c3453ab9f31280eb90f66dd83d7a64ee98c9
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-12 09:40:48 +01:00
Samuel Rødal
1f5b10281f Document the QPainter::HighQualityAntialiasing render hint as obsolete.
It was only used in the now removed OpenGL 1.x paint engine.

Change-Id: I2237172de700bfd31ca25279fbed21d601785962
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-12 09:40:48 +01:00
Morten Johan Sørvig
784b965559 Cocoa: Export QImage <-> CGImage conversion funcs.
For implementing to/fromMacCGImageRef in QtMacExtras.

These do not depend on internal Qt state. The main
reason for exporting them is to keep the implementation
in one place to ease maintenance.

Refactor qt_mac_cg_context to support QImage.
Add qt_mac_toQImage.

Change-Id: Ia9c226ed52d087b2c6b47aa8210ed8f2645b9cf2
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-02-12 07:50:03 +01:00
Mitch Curtis
4aa86461eb Ensure QDateTime can handle QDate's full range of julian dates.
Currently, using QDate::maxJd() in tests will fail. This patch changes
some ints to qint64s to prevent overflows where necessary.

Change-Id: I61ebf8f233411a7544689fd5bfa9c3abee54e933
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-12 07:29:36 +01:00
Mitch Curtis
86115848b5 Correctly detect HTML 5 charset attribute in QTextCodec::codecForHtml()
QTextCodec::codecForHtml currently fails to detect the charset for this
HTML:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9,chrome=1">
    <title>Test</title>
    </head>

This patch makes the detection of charsets more flexible, allowing for
the use of the HTML 5 charset attribute as well more terminator characters
("'", and ">").

I also added a *_data function for the unit tests.

Task-number: QTBUG-5451

Change-Id: I69fe4a04582f0d845cbbe9140a86a950fb7dc861
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
2013-02-12 01:31:26 +01:00
Thiago Macieira
7abc1a6a82 Simplify a function to fix a warning reported by ICC
ICC thinks that the return statement is missing:
src/plugins/accessible/widgets/itemviews.cpp(867): error #1011: missing return statement at end of non-void function "QAccessibleTableHeaderCell::parent"

Clearly it's wrong, but the function is overly complex for no good
reason. So just simplify it instead.

Change-Id: Ic63029df18b4712d9864a4dc66b6751b2d4574b7
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-02-11 23:33:00 +01:00
Thiago Macieira
2d98bd48e5 Add Q_DECL_RESTRICT and Q_ALWAYS_INLINE for MSVC
Change-Id: I598463e5990e91a5a049d1f9f7a4aa80930c0904
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-11 23:33:00 +01:00
Thiago Macieira
f9f0f4aea5 Rename the Q_STATIC_INLINE_FUNCTION macro to Q_ALWAYS_INLINE
That's what the macro did anyway, except it had an extra "static"
keyword. This allows us now to use Q_ALWAYS_INLINE in non-static
contexts, if we wanted to (e.g., certain template cases).

Change-Id: I899d359f46234e93d1912ef9125080dc84e15c93
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-11 23:33:00 +01:00
Peter Hartmann
28d526db74 BB10 systemProxyForQuery: query system proxy also for non-URL requests
... like e.g. in QAbstractSocket::connectToHost().
We can set the scheme on the query URL based on well-known ports; even
if the port is not well-known, we can just query the URL anyhow and let
the netstatus API resolve the right proxy for us.

In addition, return early for local schemes like "file" and "qrc".

Task-number: QTBUG-29425
Change-Id: I900f1ecbac6dd380bb8a77470b39de2c07aa7f6e
Reviewed-by: Andrey Leonov <aleonov@rim.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2013-02-11 21:36:19 +01:00
Mark Brand
00d8de8589 move QSqlResultPrivate to private header
Change-Id: Ice5464989530d521f65703daa080cb2094afef3c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-11 21:23:48 +01:00
Oswald Buddenhagen
46f1c12b9e use install path as fallback when locating tools
all non-installed tools are properly registered, so they don't need the
fallback. conversely, we can assume that non-registered tools are
already installed.

this enables us to build docs in qtbase after an incremental
build+install up to qttools.

Change-Id: I95a55f6b84e01885bcf6dd656caf0dd2b679bb73
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-02-11 18:00:17 +01:00
Oswald Buddenhagen
d72e1e371b create tool pri file for syncqt
so that *really* all non-installed tools are properly registered.
if some day we have more build scripts, this code should be centralized
in a .prf file.

Change-Id: I5b292a4b30199cb59838319f2dc9f88cd54bb57d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-02-11 18:00:12 +01:00
Gabriel de Dietrich
d57e9b35c9 QPA Cocoa Menu: Make sure mouse button state is clean after popup
Calling popUpMenuPositioningItem:atLocation:inView: will swallow any
mouse up/released event, if we popup on mouse down/pressed. Since we
cache the button state in QNSView, the safest way seems to be to clear
this button state. Another option would be to send Cocoa mouse up
events for each mouse button, but we prefer to keep things simple.

Change-Id: I7f3f369c45e9f5ed9d2ab693bffd8be4a4596ae6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-02-11 17:51:24 +01:00
Jon Severinsson
34a3f2cd44 Allow QtTest's QCOMPARE to work with mixed q(u)int32 and q(u)int64
Change-Id: I491edcae84c149775cf3640626ccff8cbf0d69fe
Reviewed-by: Jon Severinsson <jon@severinsson.net>
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-02-11 17:51:19 +01:00
Stephen Kelly
c21ed8ca1f Remove dead code from QPointer.
The compilers checked here are not supported in Qt 5. Additionally,
the QSharedPointer implementation has similar operators without such
guards, so in reality these compilers may not have worked
with Qt 4.6+ either.

Change-Id: I208f3cde7c689770ae15245a555e3a58b749a8a3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-11 17:51:16 +01:00
Andy Shaw
83e6d1fe60 Add support for getting the paper names available for the printer
Task-number: QTBUG-27714

Change-Id: I9bc6f1188f262e43f581add058d7895e1b5bd9e3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-02-11 17:50:56 +01:00
Stephen Kelly
b9c1593435 Fix regex for determining if a path is relative.
Change-Id: I3d638220e16c215b737417c2bf8de02ddf4a8199
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-02-11 15:17:07 +01:00
Friedemann Kleint
d180560e14 Fix QWindow::setFramePosition() to keep the size.
Change-Id: I14551e0d0573c2e8d86d76eadab4df9f3c8ed5e4
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-11 15:17:07 +01:00
BogDan Vatra
78d4c949a4 Also copy checkable property to platform item
Add missing property copy statement.

Change-Id: Ic7cae46becd412194a490d0fe501ce6ebe2737a3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-02-11 13:32:44 +01:00
BogDan Vatra
c4b88b0540 Automatically hide the SIP
Change-Id: I4d63a883941842aed9a9c3806479d7aeeebb9f56
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-02-11 13:32:38 +01:00
Kai Koehne
c927d6b9e1 Rename function to fix symbol clash in static build
Rename qt_gl_read_framebuffer function to qt_gl_read_frame_buffer in
Qt5OpenGL. This fixes an error when linking statically against both Qt5Gui
and Qt5OpenGL:

Qt5Guid.lib(qopenglframebufferobject.obj) : error LNK2005: "class QImage
__cdecl qt_gl_read_framebuffer(class QSize const &,bool,bool)"
(?qt_gl_read_framebuffer@@YA?AVQImage@@ABVQSize@@_N1@Z) already defined in
Qt5OpenGLd.lib(qgl.obj)
   Creating library debug\composition.lib and object debug\composition.exp

The function was duplicated in 6e28e844 .

Change-Id: I9e3b78e0ec5b25264575d563538587b45cd93e86
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-11 12:29:05 +01:00
Frederik Gladhorn
7f15506548 Remove Nokia from ssl linking exception.
Change-Id: I559d4dd8789a249af855f6fe9bfe013ba1d77132
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-02-11 11:59:22 +01:00
Montel Laurent
c080f1f98a Remove unused variable
Change-Id: I3cef189a668f73c8599958b2c15bf140bd86d091
Reviewed-by: David Faure <david.faure@kdab.com>
2013-02-11 11:12:08 +01:00
Montel Laurent
6230873a65 Fix initialize variables
Change-Id: Iaebd03bebf38cddf84f163703e2820925b69c3d9
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-02-11 11:02:56 +01:00
Aaron McCarthy
0114a99bad Fix missing namespace macro warnings when building Qt Addon modules.
Addon modules may not be in the standard Qt namespace and therefore do
not use the QT_{BEGIN,END}_NAMESPACE macros.  Instead module specific
QT_{BEGIN,END}_NAMESPACE_FOO macros are used.  Extend the syncqt test
to allow for this and ensure that the QT_END_NAMESPACE suffix matches
the QT_BEGIN_NAMESPACE suffix.

Change-Id: I33110c01118b0fb4376307db7447f747fc38bb29
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-11 10:58:25 +01:00
Oswald Buddenhagen
42a6d405e4 exclude bootstrapped tools from lupdate message collection
the translation infrastructure is disabled in the bootstrapped tools, so
the translations are wasted.

Change-Id: Ief5d13f09242e03aaf0d4a3d9b1645f9c7a1ab3a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-11 10:57:46 +01:00
Morten Johan Sørvig
5a46251de3 Fix devicePixelRatio getter for embedded QWindows.
m_nsWindow is not set for non-toplevel QWindows,
causing devicePixelRatio to always return 1.

Use [m_contentView window] instead.

Change-Id: I6689a70812c9484f103b5e706fe4c1b76406b750
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-02-11 08:35:03 +01:00
Sze Howe Koh
26817211d2 Fix module name format in displayed code
Follow the conventions at
http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation

QtDBus       -> Qt D-Bus
QtMultimedia -> Qt Multimedia
QtWidgets    -> Qt Widgets

Change-Id: I96a1523b37e294b10b203782074943c6ec55e34a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-11 01:43:21 +01:00
Stephen Kelly
5764f10323 When expanding up the tree, there is no need to expand above root.
The index set by setRootIndex is the root of the visible part of the
model. Expanding more than that is not needed.

Change-Id: I0015e313ef046ff63c67338c4f00c37e1aa71ca7
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-02-10 12:51:43 +01:00
Stephen Kelly
316d8ececa Don't duplicate the 'top-level' include dir in all modules.
This is the <prefix>/include directory which is independent of the
module and which only has to be used once. As everything uses QtCore,
it is enough to set it only there.

The CI system is a special case, in that it tests things before
installation. Handle that case too.

Change-Id: Idcdf9617e199b7d490cb3553cce07f1f464b3bec
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-02-09 19:35:25 +01:00
David Faure
b61cff8d6e qprocess autotests don't need QtGui
(this isn't true of -all- corelib/ autotests though, e.g. tst_qdatastream
uses QBitmap)

Change-Id: I314fda5d85d45cb5eece8da74156989b83cf0299
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-09 18:44:41 +01:00