Commit Graph

8956 Commits

Author SHA1 Message Date
Thiago Macieira
f8704a3e95 Cocoa: use filterNativeEvent instead of the deprecated filterEvent
Change-Id: I76259d1a0d978fb2f7fb60cd0d05990365691b7e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-08-20 22:48:53 +02:00
Thiago Macieira
ce9b010ec6 Fix decoding of QByteArray in the deprecated "encoded" setters in QUrl
The asymmetry is intentional: the getters can use toLatin1() because the
called functions, with a QUrl::FullyEncoded parameter, return ASCII
only. This gives a small performance improvement over the need to run
the UTF-8 encoder.

However, the data passed to setters could contain non-ASCII binary data,
in addition to the percent-encoded data. We can't use fromUtf8 because
it's binary and we can't use toPercentEncoded because it already encoded.

Change-Id: I5ecdb49be5af51ac86fd9764eb3a6aa96385f512
Reviewed-by: David Faure <faure@kde.org>
2012-08-20 21:59:32 +02:00
Thiago Macieira
60818231d8 tst_qurlinternal: use qurl_p.h instead of declaring the functions
Just in case someone (like me) changes the function signatures or adds
new functions.

Change-Id: I1025fea012d95ffe89acaf799aa58fd2b0babc80
Reviewed-by: David Faure <faure@kde.org>
2012-08-20 21:59:28 +02:00
Thiago Macieira
373845dfd8 Add Q_DECL_NOTHROW to some qHash functions
The hashing functions for QDateTime and QHostAddress did not get the
noexcept keyword because they might allocate memory. QDateTime doesn't
do it now, but it could in the future. QHostAddress does allocate
memory today.

Change-Id: Ia5f80942944bfc2b8c405306c467bfd88ef0e48c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 21:59:21 +02:00
J-P Nurmi
291938aea6 Moved a bunch of widgets example images from qtdoc to qtwidgets
Change-Id: I46363e19051cca6f088f0ed6df1c9fd113b95fe7
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-20 21:11:42 +02:00
J-P Nurmi
6bb0f2ae46 QStyle docs: fix the location of two paintsystem related images
The following images were misplaced into gui with the other painsystem
related images:
- ../styles/qstyle.cpp:80: Missing image: paintsystem-stylepainter.png
- ../styles/qstyle.cpp:80: Missing image: paintsystem-icon.png

Change-Id: I5a46db04d00b779a6028cda89e436feda75efef7
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-20 21:11:35 +02:00
J-P Nurmi
01216abf92 Moved a bunch of widget images from qtdoc to qtwidgets
Change-Id: Id76e95f7bf7ccbe1716ef4172d36f337780e19f7
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-20 21:11:27 +02:00
J-P Nurmi
58d3156e13 QFontComboBox: fix qdoc warning
Remove link to self:
qfontcombobox.cpp:413: Can't create link to 'currentFontChanged()'

Change-Id: I6eba45ba1d68c6a2c9201fda8c04b47fc711b562
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-20 21:11:16 +02:00
J-P Nurmi
ea77f41e5a QTextEdit docs: fix qdoc warnings
qdoc insists picking Q_PROPERTY(T document) instead of the individually
documented getter and setter

Change-Id: I6f4981db205c5726d70cef4d85b7dfffe2b1fe31
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-20 21:10:54 +02:00
Stephen Kelly
eb0e960e74 Fix the doc errors in itemmodels and itemviews.
Other errors remain, but they appear to be due to missing links
to QtCore documentation (a generic error not specific to itemviews).

Change-Id: I7b83380c3754c26d3d42be9ef0c0721ce3127562
Reviewed-by: Shawn Rutledge <shawn.rutledge@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-20 21:10:02 +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
Thiago Macieira
7315296e9c Disable C++11 noexcept support in GCC 4.6.0 and 4.6.1
See report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50309

Change-Id: I5ab3ab1dea42b03ea22dbfbe5f7039c537dabd33
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-08-20 16:58:49 +02:00
Marc Mutz
31788fc981 QAtomic: make ctors constexpr, if possible
This requires using the same chain of conditions that QBasicAtomic*
uses in order to provide constructors, so we're using the newly-added
macro QT_BASIC_ATOMIC_HAS_CONSTRUCTORS to check.

Even though QAtomic<> is a template, we can't just use Q_DECL_CONSTEXPR
since the body of the constructors needs to change, too.

Change-Id: I462a80ed175040f7709c30d07d34036c6c5507d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 16:58:36 +02:00
Marc Mutz
21072c85b6 QBasicAtomic: add QT_BASIC_ATOMIC_HAS_CONSTRUCTORS macro
This macro is defined when the QBasicAtomic* types have constructors.
It will be used to simplify maintenance of QBasicAtomic subclasses,
as well as classes that aggregate Q(Basic)Atomics and wish to be
literal types if possible.

Change-Id: I7ab181c58a13ec2195449bbae5b3476b9017a8f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 16:58:32 +02:00
Janne Anttila
3ef95347fe Fix processor detection for MSVC ARM compiler (WEC7).
Visual Studio compiler defines _M_ARM preprocessor variable when
compiling for ARM and the value of preprocessor variable indicates the
supported instruction set.

For more information see:
http://msdn.microsoft.com/en-us/library/gg155713.aspx

Change-Id: I54137257b83f64fdf03bf7df9995e08d16dff4df
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 16:58:23 +02:00
Thiago Macieira
eda5d42ab9 Add missing #include <qmetatype.h>
There's a Q_DECLARE_METATYPE at the end of this file.

Change-Id: Ib63aa4397ccba8740d46cf1ee7af712f75d05765
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-08-20 16:58:01 +02:00
Shawn Rutledge
42d712b4ab Misc documentation fixes triggered by qdoc errors/warnings
Change-Id: I6ca3b138114fe957a09e8ec2f22273865635fc8b
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-08-20 16:57:48 +02:00
Yuchen Deng
e6de6c153e Fix C++11 mode compilation with MinGW-w64 4.7.1
Change-Id: I8b840ece7341877fb6f5d6a85d8714517034e319
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 16:57:36 +02:00
Jan-Arve Saether
377171ca0c Remove references to "How to Learn Qt", since that is in qtdoc repo.
Don't use \n in qdoc comments.

Change-Id: I875e37f6a13ab0b7f66da985a2cf157017934bbd
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-20 16:48:29 +02:00
Jens Bache-Wiig
85b4accd82 Fix multiple enumeration warnings when generating docs
Most of these caused by cleaning up enums and not removing
omitted values. Also removed some leftovers from qt3support.

Change-Id: I75efcc9fadc6a430492bab36e86d7b345d3a6a17
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-08-20 16:42:58 +02:00
Gabriel de Dietrich
3a888a7182 Remove dialogs doc related warnings
Change-Id: I79a771d18913237d894ca1a5aeaa07586106c645
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-08-20 16:42:06 +02:00
Robin Burchell
b9ef4a9c30 Speed up sorting of dir entries when sorted by date
QDateTime will attempt to convert unknown types of date to UTC time, which isn't
exactly a fast process. As we don't care about local timezones in the process of
sorting (as this is purely for ordering, not display to the end user), we can
force the dates to use UTC time, avoiding the unnecessary local timezone lookup.

This also adds a benchmark covering this case.

Benchmark results, Qt 5:
 - before: 11, 489ms
 - after: 273ms

Qt 4.8:
 - before: 20, 848ms
 - after: 278ms

Change-Id: I87fa6260e820b5b172d3306ff395dafe767c33ff
Reported-by: Thomas Perl <m@thp.io>
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 16:02:03 +02:00
Geir Vattekar
f3fea329fd Doc: Work on QVariant's equality operator.
Task-number: QTBUG-26018
Change-Id: I6627456d166bc0a036cadeee7bd51aa8e576a818
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-08-20 15:56:58 +02:00
Thomas Hartmann
a03e815b6c Enable QComboBox animation on Windows and fixing related bugs
QWidget:grab() has a default parameter (invalid rect).
QRect() is the null rect and widget->grab(QRect())
returns an empty pixmap.

QWidget:grab() has to be free of side effects and should not
affect any dirty flags.

Change-Id: I8ff558343c366769cd6c587e77f862668e8054f2
Task-number: QTBUG-25436
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-20 15:52:51 +02:00
Jan-Arve Saether
dd121752e9 Replace \QD with the literal 'Qt Designer' to avoid warnings.
Change-Id: Ia28ab42531217df75b626638b1953c393d2e445e
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-20 15:52:15 +02:00
Andreas Holzammer
f2fabf77f9 Fix freetype font rendering for Windows CE
Windows CE does not have support for GetGlyphOutline.
So addGlyphToPath will not work. QML uses it for their
distance field rendering. One option to bypass this issue
is to use freetype as rendering backend.

Change-Id: I965254344945cbdad771a5d505fb61c1cc2087df
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-20 12:25:03 +02:00
Gabriel de Dietrich
806dda08d6 Moving .qdoc files under examples/widgets/doc
Updated those .qdoc files to refer to the new relative examples
emplacement. Images and snippets to be moved later.

Also grouped all widgets related examples under widgets.

Change-Id: Ib29696e2d8948524537f53e8dda88f9ee26a597f
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-08-20 12:20:55 +02:00
Aaron McCarthy
9f942014e3 Fix documented QMetaType::UserType value.
QMetaType::UserType was changed from 256 to 1024, this was not reflected
in the code parsed by qdoc.

Change-Id: I0a02e8b020d495fbf2508d84b690adae1b677125
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-08-20 12:02:45 +02:00
Sean Harmer
fc41ee4c92 OpenGL: Use official glext.h and gl2ext.h headers
The Khronos group makes the glext.h (Desktop OpenGL) and gl2ext.h
(OpenGL ES2) headers officially available nowadays. Most (all?)
Linux systems ship this by default. On Windows platforms the
glext.h file needs to be downloaded from

http://www.opengl.org/registry/api/glext.h

and placed alongside the system OpenGL header.

Making use of the official header reduces the maintenance
overhead for OpenGL support in Qt by removing the need to copy
and paste definitions into the Qt sources.

As the Khronos-provided headers are standardised and backwards and
forwards compatible we can utilise these for all platforms rather
than just for Windows. This means that all definitions required
by Qt will be present even if the system ships out-dated
equivalents.

Mac OS X needs special handling in that we should always use the
system-provided headers there. This is because Apple controls the
OpenGL driver and the headers that go along with it. As such there
is no possibility that the driver exposes additional functionality
compared with the system-provided OpenGL headers. Apple has also
decided to make different decisions about some OpenGL typedefs
compared to other implementations. For example, Apple typdefs
GLhandleARB to void* whereas other platforms use unsigned int.

The alternative, which is to use the system provided glext.h (or
gl2ext.h) header means that Qt code would need to check for the
availability of such definitions wherever it is not guaranteed
to be provided by core OpenGL/ES just to compile.

The proposed approach means that Qt can compile regardless of
the system's OpenGL extension support. We just need to be
rigourous in runtime checking of support for extensions but
that is already a requirement (and is missing in a few places,
see TODO's added in this commit).

The official Khronos headers are added to Qt as

qopenglext.h - Desktop OpenGL
qopengles2ext.h - OpenGL ES2

They need to be public but not part of QtGui module include, hence
the headers have been modified by adding

 #if 0
 #pragma qt_no_master_include
 #endif

to them.

This has been tested on:

Gentoo Linux with GCC 4.6.3
Windows 7 with MSVC 2010
Mac OSX 10.8 with Apple clang 4.0 (based on LLVM 3.1svn)
QNX with qcc (based on GCC 4.4)

A small change is needed to QtDeclarative when building for OpenGL
ES 2 after applying this commit. See
https://codereview.qt-project.org/#change,31794

Change-Id: I4b3d2b1680baf4c78be9a87b4d8de076d23e8f82
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-20 11:58:16 +02:00
Stephen Kelly
799ceebad8 Take account of hidden items in QListView when using scrollTo.
Task-number: QTBUG-21804
Change-Id: I475166f3f60b1278089baa255ace4e18baeb568e
Reviewed-by: Jani Honkonen <jani.honkonen@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-20 11:24:55 +02:00
Jiang Jiang
79f660d374 Replace deprecated ColorSync Manager use with updated CG API
ColorSync Manager is deprecated in 10.6 and new CG API for
copying color space is available since 10.5.

Change-Id: I730431dcd28ca0ff6cec5d1eeff99fff9f3d0a29
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-08-20 11:10:49 +02:00
Miikka Heikkinen
333f641622 Fix in-process QAxServers inside modal windows.
The main window of in-process QAxServers doesn't have QWindow parent,
but it does have native parent that is part of the native window tree
of the application. The lack of Qt parent makes embedded controls look
like toplevel windows, which causes problems e.g. with modality.

Introduced new optional method QPlatformWindow::isEmbedded() to
detect if a window is an embedded window and utilized it in proper
places during modality handling.

Task-number: QTBUG-26871
Change-Id: Iac9a51dae06b8fc15410de7838857e203e4275b8
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-20 10:48:09 +02:00
Andy Shaw
9ea9ec1cbb Ensure that all the children get the new stylesheet set on a parent
When a stylesheet was set on a parent widget then in some cases it would
not get applied to all the child widgets.  This was because the order of
the children list may have been modified while it was being set on
children.  By making a copy of the list we prevent this from being a
problem.

Task-number: QTBUG-26321

Change-Id: Iea6bf72c69a0c39746f7ef5e7893dda5a93ed7e5
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-20 10:28:51 +02:00
Janne Anttila
85bd95cc31 Fix drag curor visibility on Windows.
QDrag has an API to set both pixmap (QDrag::setPixmap) and drag cursor
(QDrag::setDragCursor): http://qt-project.org/doc/qt-5.0/qdrag.html.

We cannot return from createCursors if there is no pixmap, but we need
to go through also dragCursor and use those if one is set.

Change-Id: If2b2139ad193a4ab5b25c65400c595dc7c33de2c
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-20 10:26:28 +02:00
Lars Knoll
1b54d1e4d5 Use QThread instead of QPushButton as an example in the docs
This keeps links local and inside the module.

Change-Id: I5e267197c6356a2c4e231c1941ed4be33b96a16e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 10:23:34 +02:00
Lars Knoll
8a16954661 Fix more qdoc errors
Change-Id: Ieed340068327f37ea0f549d24ea49235994118f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 10:23:27 +02:00
Lars Knoll
b534af3680 Fix qdoc errors in qcoreevent.
Change-Id: Ic6cb963a7df643819dfdd93c7300d054e11cd0d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 10:22:46 +02:00
Lars Knoll
1b5d6f1646 Fix qdoc errors in the QAbstractEventDispatcher documentation.
Change-Id: I7de48286f05b14c831f1290e009a25630504a76e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 10:22:42 +02:00
Lars Knoll
72e2fc6bb6 Fix some qdoc errors in the QJson* classes
Change-Id: If475655445afdba307508c5a3863c4bc8d87ebe6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 10:22:38 +02:00
Lars Knoll
0e59c75e7c Fix snippet bug in State Machine Overview
Cherry-pick of b0facd481a2fc119d87c85481d97357d814a5fd2
from the qtdoc repository.

Task-number: QTBUG-25314
Change-Id: I2166db46399ea6da8cadf02a7f65738c0c252142
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 10:22:34 +02:00
Lars Knoll
b4adefd572 Fix a couple of qdoc errors.
Change-Id: I0770fc61e265face4fa061be9e110814effee181
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-20 10:22:25 +02:00
Stephen Kelly
2fe35bf9a0 Refactor the automatic metatype templates into preprocessor lists.
This will allow re-use in moc.

Change-Id: I99c5f8f0756fccf0fb2bb845c29255c14d4d703e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-08-20 10:11:03 +02:00
Jani Honkonen
d2bba5e553 Fix a QListViewItem width when spacing is set
The listitem width was calculated incorrectly because spacing was
not considered. This fixes the second part of the reported bug where
spacing is set. Added some tests to catch the issue relating to the
reported bug.

Also added a test to check spacing in general.

Task-number: QTBUG-21804
Change-Id: Icc6326bce914264d882a60a9fc0ebe7d2a08dbf6
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-19 08:52:09 +02:00
Jani Honkonen
d4385e48b8 Fix QListWidget scrolling with keys when there are hidden items
If the selected item is scrolled with keyboard keys the selected item
will go outside the visible area. The scrolling did not take hidden
items into account when calculating the amount to be scrolled.

Task-number: QTBUG-21804
Change-Id: I63da0248cec43be464898f9dc8167e739f00ccd0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-19 08:51:57 +02:00
Geir Vattekar
f20472efa7 Doc: Small addition to QAbstractTextDocumentLayout::registerHandler()
Task-number: QTBUG-23345
Change-Id: I6f768472aaef95f5dd88cf896ef3e635d223b635
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@nokia.com>
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
2012-08-18 21:08:33 +02:00
Geir Vattekar
a69425ff3f Doc: Add FOV to rogue example.
Change-Id: Ib0f4caad9bc828a94616466f303d879fc967970d
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-08-18 21:08:33 +02:00
Martin Smith
6f09e100c9 doc: Fixed qdoc errors in SSL
Fixed some bad camel case, marked some parameters with \a,
and changed a \enum to a \typedef. Removed some obasolete
text.

Change-Id: I1e69dd9f3b74129230770addc80fe1c125faf268
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-08-18 21:08:33 +02:00
Jeremy Katz
8f7a135a10 Ignore Q_DECL_NOTHROW in qdoc for Qt Core
This change was already made in the qtdoc repo, but qtcore doesn't
pick up the configuration from there.

Change-Id: I72e747d748705e508521aeba1992d0c47faf2dac
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-08-18 21:08:33 +02:00
Thiago Macieira
c9bfd34fa0 Enable QAtomicInteger for char16_t and char32_t
Those are regular, integer types, of 16- and 32-bit width,
respectively. C++11's std::atomic supports them, so we should too.

C++11 also supports wchar_t, but since that type's size can change, I
don't feel like support for it in Qt is pressing.

Change-Id: I945b641c91a8a98be82715f878c382dee58ac98b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-18 18:35:50 +02:00
Thiago Macieira
2b00f97ab0 Add Q_DECL_CONSTEXPR to the isXXX functions in the new atomics.
This allows one to write code that depends on these values at
compile-time.

Change-Id: I7d78524ed9c70d4141360496d1d764dcbfa92e62
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-18 18:35:36 +02:00