Commit Graph

197 Commits

Author SHA1 Message Date
Thiago Macieira
ce17ca7791 QGraphicsItem::setAcceptsHoverEvents is deprecated, replace it
It is replaced by setAcceptHoverEvents (note the lack of s), even
though the original name made more sense -- "set (if this item)
accepts hover events".

Change-Id: Ia6137c0e37b0a5932836f1d08fb8fa436f736eed
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-26 04:18:22 +02:00
Thiago Macieira
62d4840011 Replace the QGraphicsItem deprecated transforming functions
The scale(), rotate() and translate() functions are replaced with
QGraphicsItem::setTransform.

Change-Id: Icb81c71b1513c049e2fd607995ca3a868108ee30
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Andreas Aardal Hanssen <andrhans@cisco.com>
2012-06-26 04:18:14 +02:00
Gatis Paeglis
7f139e8844 Update calendarwidget example
Due to API changes introduced by ff55d64f67

Task-number: QTBUG-26130
Change-Id: I4e5bdf3dd81d75308a3e565239b9d7a95452cd43
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-20 12:38:32 +02:00
Janne Anttila
9fe5139e73 Fix building of qtbase examples when printsupport module is disabled.
Printsupport module is not that interesting in embedded environments,
and it also does not compile at the moment for WEC7. Fixed qtbase
examples to obey the availability of printsupport module.

Change-Id: I960d1b628b9ca82450aa3b0df8dd101b2544ee12
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-18 09:48:55 +02:00
Thiago Macieira
5f5555f4d3 Fix encoding of non-ASCII strings
tr() only takes UTF-8 as input, so we must recode to UTF-8. But we can
use QLatin1String elsewhere.

Task-number: QTBUG-26086
Change-Id: I5932ddc96fb817dbe01106e5f6f2b10f58472d6b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-06-14 05:26:45 +02:00
Gatis Paeglis
deed9c75b4 Change path for 'mousebuttons' widgets example
Task-number: QTBUG-26121
Change-Id: Icaeb6038d166fb0ffadf1657ddef21c18b3d3be6
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-06-14 03:03:38 +02:00
Gatis Paeglis
aa9942a530 Add install path for qpa windows example
Task-number: QTBUG-26150
Change-Id: I8e981318e05cca6628160aea31281f8e3baaa50f
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-06-14 03:03:38 +02:00
Stephen Kelly
f9caf48bee Use a QVector<int> instead of a QSet<int> in itemviews/models.
The QSet<int> is a more expensive container to use and create, so
it should be avoided.

This is source incompatible compared to earlier Qt 5 for
QAbstractItemView subclasses which reimplement dataChanged, but this
patch changes nothing compared to already-present SiC compared
to Qt 4.

Change-Id: Id95391dfd62a0a7f487a8765790b007badefb937
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-06-12 04:30:07 +02:00
Thiago Macieira
693468a54d Replace deprecated QGraphicsScene::itemAt() with items()
Change-Id: I33ee03db775d3cf6807372e0963748cf6a4e07db
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-06-09 10:45:01 +02:00
Friedemann Kleint
e454000abc Fix assert in painting demos when switching to OpenGL.
Fix creation order. The ArthurFrame receives a paint
event with OpenGL set to true when the glw-member is still 0.

Task-number: QTBUG-26084
Change-Id: Ib4b568d22ae925542e3a775403e4c983ea0b4de5
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-09 10:45:01 +02:00
Kent Hansen
6b95e54f1f Fix compilation of examples with -no-widgets
Change-Id: Ie0e19daf6c6476b5c5130f4930dfa3df92917384
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 07:27:53 +02:00
Kent Hansen
ef30a59121 Remove widgets dependency from xmlstreamlint example
Change-Id: I2c7609077bd18864ffd9b2ba5086eb590aff3df0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:39:12 +02:00
Kent Hansen
1f8b8d56b2 Remove widgets dependency from qtconcurrent/map autotest
Change-Id: I734ae73a530ab6eb27271586040ef910e6ad0e2c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:39:09 +02:00
Kent Hansen
fa7c9bbe1c Remove useless "QT += widgets"
These .pro files have TEMPLATE=subdirs, so there's no reason to be
adding libraries here.

Change-Id: I0fb0a44107710ee746d354106d0c46006958ee62
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-05 16:01:29 +02:00
Janne Anttila
adbf443c47 Fix digiflip example build.
digiflip examples depends on qtwidgets, let's link to it also.

Change-Id: I4f4434c747d143942909797491153a4f358e6fef
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-05-31 02:06:42 +02:00
Morten Johan Sorvig
d725c3ee23 Remove the MacMainWindow example.
setUnifiedTitleAndToolBarOnMac will not be supported
on Qt 5, which removes the point of having this example.

The replacement for setUnifiedTitleAndToolBarOnMac
will be a NSToolBar wrapper in the MacExtras module,
and this example will probably re-appear in some form
there.

Change-Id: I46d5e70a7c45625d9334911bb48059e86f05282d
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-05-30 01:54:45 +02:00
Thiago Macieira
291b05e4b2 QApplication::syncX doesn't do anything in Qt 5 anymore
Change-Id: I325f8badeb5bd7120c691b49fdf51dc9b2649f68
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-05-29 11:35:21 +02:00
Jędrzej Nowacki
db06953ca1 Replace QVariant::typeToName usage by QMetaType::typeName call.
Type information is kept in QMetaType class. QVariant is delegating
operations, so it is better to use QMetaType directly.

Change-Id: I91209fa1c9dc4303d6bd47c96824d3cd64ce5291
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-28 03:30:21 +02:00
Friedemann Kleint
57f243594e OpenGL/HelloWindow example: Fix resource leaks.
Change-Id: Icf776b5581b3a632e8cef19af1059503146c158c
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-05-25 21:42:14 +02:00
Mitch Curtis
b1f12913a6 Fixed unused paramater warning in download example.
Change-Id: I9688ff6a583591f04aa81bb2714c33fc02da77c7
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-05-22 10:27:54 +02:00
Mitch Curtis
730dfc74d3 Fixed "No such signal" error in download example output.
The signal sslErrors is not defined by QNetworkReply when QT_NO_SSL
is undefined. The solution was to add the an ifndef guard around the
call to connect so that the signal is only used when it is defined.

Change-Id: I9f104ec630ed448af65669b0861df233de5172ac
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-05-22 10:27:46 +02:00
Mitch Curtis
899f1d35a4 Fixed unused variable warning in anchorlayout example.
Change-Id: I54c6e471531485e33b20b6a6da7f52dab5c3a32a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-05-19 01:45:04 +02:00
Mitch Curtis
a490cd61fa Fixed unused variable warning in chart example.
Change-Id: I0985ff1b1224b29a394ae2a594aeaa783d650ffa
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-05-19 01:45:04 +02:00
Mitch Curtis
9e13d169a4 Fixed unused parameter warning in hellowindow example.
Change-Id: I48ea19b5548a179d8116685fa481c4d1b3804bba
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-05-18 21:25:18 +02:00
Mitch Curtis
91a5e272c5 Fixed unused variable warning in diagramscene example.
Change-Id: I85cc038602e22c140f0564b15ebcb3872750b162
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-05-18 21:12:16 +02:00
Marius Storm-Olsen
2d23374a6f Merge "Merge branch 'docs-refactoring' into master" into refs/staging/master 2012-05-10 11:34:25 +02:00
hjk
7f2c22e891 gettingStarted, part 3-5: sanitize parameter names and compile fix
Change-Id: I12795439de71a41728f98b3d3438324664b27a0f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-05-10 09:16:35 +02:00
Marius Storm-Olsen
9456528aac Merge branch 'docs-refactoring' into master
Change-Id: Iebd1966abace3cdf7f9428dcfc1ded5b124ab113
2012-05-10 09:11:23 +02:00
hjk
cc8d9fb85e gettingStarted: sanitize parameter names and compile fix for Qt 5
Change-Id: I3f30ccee89b8add8718a9a36f0f16fa7b2e9bad1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-05-09 17:16:55 +02:00
Marius Storm-Olsen
9fde9ab167 Properly implement a 'make docs' target for subdirs and apps/libs
Only call qdoc for projects which sets the QMAKE_DOCS variable to
point to a qdocconf file.

Exclude examples/ and tests/ from the qdoc run, by adding
    no_docs_target
to CONFIG for those projects.

Change-Id: Ic856c8f19db59309302d0602b3e99735609e525a
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-05-09 08:34:42 +02:00
Girish Ramakrishnan
36547f4eff Expose QPA API under qpa/*
The main reasons for doing this are:
1. _qpa.h end up in the master QtGui include file. QtGui is meant for
userland applications. qpa code is neither binary nor source compatible.
Inadvertant use of QPA api makes the user code binary-incompatible.
2. syncqt creates forwarding headers for non-private header files. This
gives people the impression that this is public API.

As discussed on the mailing list, even though QPA api is internal and subject
to change, it needs to  treated differently from private headers since they
will be used by  in-qtbase and out-of-qtbase plugins.

This commit does the following:
1. The _qpa in QPA header files is dropped.
2. syncqt now treats any file with qplatform prefix as a special file and
moves it to qpa/ directory. The recommended way of using QPA API in plugins
is: #include <qpa/qplatformfoo.h>. This allows the user include QPA API
from multiple modules (for example, qplatformfoo might be in QtPrintSupport)
3. The user needs to explicitly add QT += <module>-private to get access to
the qpa api.
4. Creates compat headers for the olden style qplatformfoo_qpa.h and QPlatformFoo
includes.

This commit does not change the cpp filenames. This requires a more careful
merging of existing non qpa cpp files and existing cpp files on a case by
case basis. This can be done at anytime.

The following files are not renamed as part of this changed but will be fixed
as part of a future change:
src/gui/kernel/qgenericpluginfactory_qpa.h
src/gui/kernel/qgenericplugin_qpa.h
src/gui/kernel/qwindowsysteminterface_qpa.h

files were renamed using

    for x in `find . -name "qplatform*_qpa.h"`; do git mv $x "${x/_qpa.h/.h}"; done
    for x in `find . -name "qplatform*_qpa_p.h"`; do git mv $x "${x/_qpa_p.h/_p.h}"; done

includes were renamed using script

for file in `find . -name "*.h" -or -name "*.cpp" -or -name "*.mm"`; do
    sed -i -e 's,.*#.*include.*<\(Qt.*/\)\?\(QPlatform.*\)>,#include <qpa/\L\2.h>,g' \
        -e 's,.*#.*include.*"\(Qt.*/\)\?\(QPlatform.*\)",#include <qpa/\L\2.h>,g' \
        -e 's,.*#.*include.* "\(qplatform.*\)_qpa.h",#include <qpa/\L\1.h>,g' \
        -e 's,.*#.*include.*"\(qplatform.*\)_qpa_p.h",#include <qpa/\L\1_p.h>,g' \
        -e 's,.*#.*include.*<\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)>,#include <qpa/\2\3>,g' \
        -e 's,.*#.*include.*"\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)",#include <qpa/\2\3>,g' \
        $file
done

Change-Id: I04a350314a45746e3911f54b3b21ad03315afb67
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-05-07 20:25:24 +02:00
Stephen Kelly
8ec1594e63 Rename setResizeMode to setSectionResizeMode.
The overload of this method was renamed
in b64426248d but this one was not.

Change-Id: I60a6ddf0fcf9deea31ccf51e7b0db16c66023356
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2012-05-07 17:55:47 +02:00
Thiago Macieira
e563ca1a75 Change remaining uses of {to,from}Ascii to {to,from}Latin1 [platformsupport]
This operation should be a no-op anyway, since at this point in time,
the fromAscii and toAscii functions simply call their fromLatin1 and
toLatin1 counterparts.

Task-number: QTBUG-21872
Change-Id: Ie1a4e5ceca21c31e7357f28b90abc9129b122104
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-05-04 15:27:59 +02:00
Thiago Macieira
dd5b373d41 Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtNetwork]
This operation should be a no-op anyway, since at this point in time,
the fromAscii and toAscii functions simply call their fromLatin1 and
toLatin1 counterparts.

Task-number: QTBUG-21872
Change-Id: I94cc301ea75cc689bcb6e2d417120cf14e36808d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-05-04 12:46:05 +02:00
Thiago Macieira
5f22899a17 Use org.example instead of com.trolltech for the D-Bus examples
We could use org.qtproject, but since this is an example anyway, and
since example.org and example.com are reserved to IANA by RFC 2606
anyway, let's use that.

Task-number: QTBUG-23274
Change-Id: Icdb1ac0390f88b72fa21b02ab362f1a98f26266c
Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
2012-04-22 21:32:33 +02:00
Olivier Goffart
910b446fb2 Examples: Don't use deprecated methods
Change-Id: Ib6e795f6b5bb6a3ac19882a5fb224460ef1fc8ad
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-21 17:29:40 +02:00
Samuel Rødal
528cb10d53 Made hellowindow example respect the expose event.
The expose event is sent when the window can start rendering.

Change-Id: Ifdfb01a107e3bf665fb7be65802cdaabea4c5a34
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
2012-04-20 08:14:22 +02:00
Andreas Holzammer
90292529b9 Compile fix if QT_NO_CLIPBOARD defined
Change-Id: Ie8ecaa2ba8f99d0b531b3a81b5f0005508e677eb
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-04-19 16:20:28 +02:00
Andreas Holzammer
4acb8bfc59 Compile fix if QT_NO_CLIPBOARD defined
Change-Id: I818122f2b2d2119248ad2e84b138aab8ab621a41
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-04-19 16:20:02 +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
Robin Burchell
c82d40749d Fix multicast join/leave when binding to QHostAddress::Any.
On OS X and Windows, this was not working, because the socket was being bound
in v6 mode (due to ::Any being for dual mode), but the address passed was a v4
address, meaning it took the wrong codepath. Linux, strangely, apparently works
anyway.

This is fixable in OS X (by using the v6 join path when bound in v6/dual mode),
but the same fix doesn't work on Windows, failing with WSAEADDRNOTAVAIL.

Don't allow this behaviour, and provide a sane error message telling the user
what to do instead.

Done-with: Shane Kearns
Task-number: QTBUG-25047
Change-Id: Iaf5bbee82e13ac92e11b60c558f5af9ce26f474b
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-02 12:49:38 +02:00
Kent Hansen
3b512ae142 Merge master into api_changes
Change-Id: I93551e4d13a1b0815b359b9415060e9089477db1
2012-03-23 14:10:58 +01:00
Samuel Rødal
55fa3c189f Got rid of Map / Unmap events in favor of Expose event.
Since change 2e4d8f67a8 the need for Map and Unmap events has
gone away, as now the Expose event is used to notify the application
about when it can start rendering.

The Map and Unmap events weren't really used except by QWidget to set
the WA_Mapped flag, which we now set based on the expose / unexpose.

Also guarantee that a Resize event is always sent before the first
Expose, by re-introducing an asynchronous expose event handler. Since
an expose is required before rendering to a QWindow, show a warning if
QOpenGLContext::swapBuffers() or QBackingStore::flush() if called on a
window that has not received its first expose.

Change-Id: Ia6b609aa275d5b463b5011a96f2fd9bbe52e9bc4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-22 11:43:36 +01:00
Jędrzej Nowacki
10df7967d9 Disable some tests and examples when --no-widgets is specified
There are many tests, examples that depends on widgets. This patch
disables some of them if Qt is configured without widgets.

Change-Id: I5460dadca736c54221874adcd518a7021725d90a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-19 20:16:04 +01:00
Donald Carr
81043dcb55 Remove all QWS centric examples
Change-Id: I1bd9c40c7cc70e088a23283d1c3e89d12c1c5f7d
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-03-15 15:18:16 +01:00
Sergio Martins
62dfed9a7f Use QRect::united(), QRect::unite() is deprecated.
Change-Id: Ia7aac74596c2f251c96fecf157d2aa4a935cf602
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-14 11:37:18 +01:00
Friedemann Kleint
8be558e99d Fix icon suffixes in systray example.
Change-Id: If464befa88f26a881557724b4fc175f0a82c90b6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-13 10:11:22 +01:00
Friedemann Kleint
502673ab3a Re-add the Systray example.
Remove its dependency on QtSvg by converting the icons to
(optimized) png files.

Change-Id: If63257938dc816d7ab76a3042b9ac88ef3d51b07
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-12 17:33:15 +01:00
Marc Mutz
a27d5be4dc examples: compile w/QT_NO_CAST_FROM_BYTEARRAY, at least on Unix
This is all pretty straight-forward, adding .constData() or
using QString::fromLatin1() instead of QLatin1String().

Change-Id: I984706452db7d0841620a0f64e179906123f3849
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-08 09:58:26 +01:00
Marc Mutz
a03a71e332 examples: use QVector<QPointF> instead of QList<QPointF>
QPointF is in the category of types for which QList
is needlessly inefficient (elements are copy-constructed
onto the heap and held through pointers). Use a vector
instead. This is consistent with the QPainter API.

Change-Id: Id0e910c067a60d12fbc175e7ee7da824834be374
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-08 05:31:40 +01:00