Commit Graph

281 Commits

Author SHA1 Message Date
Thomas Hartmann
02c110e989 Prevent easing example warnings.
examples/widgets/animation/easing was spitting out a lot of
"QEasingCurve: Invalid tcb curve" warnings.
The reason was that in case of the TCP curve we do not provide
defaults.

The function createEasingCurve() now provides reasonable values
for the custom curves to show what is possible and how to use them.

Change-Id: I880d8d0f0ce2872ce2019f7d2e000f4c4ce136e2
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2012-11-23 17:04:00 +01:00
David Schulz
dae8d2505d QtBase: examples/widgets/graphicsview/ codestyle
Change-Id: I501066b5eb5a1557d510e0ec20b5270e8c12704a
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-23 17:04:00 +01:00
David Schulz
cbf3771e86 QtBase: examples/widgets/painting code style
Change-Id: I3d3c6f3bae20ac8383279437f8f89c92195a704f
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-23 17:04:00 +01:00
David Schulz
ab0a007cb3 QtBase: examples/widgets/itemviews code style
Change-Id: I78a7745f7dc3add3fd7780220118d1b35b50a941
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-22 13:56:25 +01:00
David Schulz
78a239bc6d QtBase: examples/widgets/itemviews/addressbook codestyle
Change-Id: I710d67018351c34ef14ac30edcca81aba7ff5ad3
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-22 08:24:26 +01:00
Mitch Curtis
3249439b20 Remove warnings from qtbase.
geometryengine.cpp: In member function 'void
GeometryEngine::drawCubeGeometry(QGLShaderProgram*)':
geometryengine.cpp:159:93:  warning: cast to pointer from integer of
different sie [-Wint-to-pointer-cast] geometryengine.cpp:167:95:
warning: cast to pointer f rom integer ofdifferent size
[-Wint-to-pointer-cast]
benchmarking.cpp: In member function 'void TestBenchmark::multiple()':
benchmarking.cpp:85:9: warning: variable 'result' set but not used
[-Wunused-but-set-variable]
benchmarking.cpp: In member function 'void TestBenchmark::series()':
benchmarking.cpp:120:9: warning: variable 'result' set but not used
[-Wunused-but-set-variable]
qstandarditemmodel.cpp:2717:45: warning: unused variable 'd'
[-Wunused-variable]
qxcbconnection.cpp: In member function 'xcb_timestamp_t
QXcbConnection::getTimestamp()': qxcbconnection.cpp:930:40: warning:
suggest  parentheses around assignment used as truth value
[-Wparentheses]
tst_qguiapplication.cpp: In constructor
'BlockableWindow::BlockableWindow()':  tst_qguiapplication.cpp:340:9:
warning:'BlockableWindow::enters' will be initialized after [-Wreorder]
tst_qguia pplication.cpp:339:9: warning 'int BlockableWindow::leaves'
[-Wreorder] tst_qguiapplication.cpp:342:12:  waring: when initialized
here [-Wreorder]
tst_qsqltablemodel.cpp:570:10: warning: unused parameter 'value'
[-Wunused-parameter]
tst_qabstractitemview.cpp:1546:8: warning: unused parameter 'index'
[-Wunused-parameter]

Change-Id: I49c88547182e4669cfde2c2536403fc5573ca2da
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-11-21 18:23:59 +01:00
Mitch Curtis
91abfd521a Clean up diagramscene example's toolbutton icons.
Remove artefacts from pointer.png.

Replace several PNGs with images without artefacts (used FreeSerif as
the font).

Stopped scaling images up in MainWindow::createColorToolButtonIcon.

Change-Id: I7adf2deea73b89c631d39d575804e8d3f58c9fe1
Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
2012-11-21 16:36:50 +01:00
Friedemann Kleint
626283740f Fix building of examples.
- Correct install path of widget examples to contain widgets
  directory in target tree.
- Add missing resources.

Task-number: QTBUG-27977

Change-Id: If4cb117998892b0b165d7678367553d3a7553b91
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2012-11-21 16:36:50 +01:00
David Schulz
78c374865e QtBase: examples/widgets/layouts coding style
Change-Id: I4340c1fcbb467bf3c2ace3b4bd4b042fe9521c35
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-21 16:36:50 +01:00
Eskil Abrahamsen Blomfeldt
0dc61c4216 Merge branch 'newdocs'
Added prepare_docs to qt_build_config.prf (it was added
directly in configure in the source branch)

Conflicts:
	configure
	tools/configure/configureapp.cpp

Change-Id: I1337c69fc62b1c934e3e39b4409e4857440c9db8
2012-11-20 10:12:44 +01:00
Shawn Rutledge
cd34da5426 Rename all QWindow properties that have "window" in them
windowTitle, windowModality, windowIcon and so on are named that way
to be similar to the ones in QWidget.  However QQuickWindow inherits
all of the declared properties, and we would like to have shorter
property names in QML.  If you are working with a Window then it's
obvious the title property is the window title.  Unfortunately,
there must be patches in many other modules which depend on this one.
In order to avoid the need to merge them all at the same time,
there is also patch https://codereview.qt-project.org/#change,39001
which temporarily adds backwards-compatible accessors, which can be
removed after the other modules are able to build without them.

We should not rename windowState to state, because in QML, state
usually drives the state machine for animation transitions etc.
(although QWindow is not an Item, a user might get confused about it).

Related patches are
https://codereview.qt-project.org/#change,39001
https://codereview.qt-project.org/#change,37764
https://codereview.qt-project.org/#change,37765
https://codereview.qt-project.org/#change,37766
https://codereview.qt-project.org/#change,37762

Change-Id: Ie4424ec15fbdef6b29b137f90a2ae33f173edd21
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-11-07 21:26:08 +01:00
Miikka Heikkinen
227accf0a3 Fix hellowindow example generating excess timers
The example was creating a new timer on every expose event, which
quickly leads into massive excess of timeout signals.

Fixed by only creating one timer.

Task-number: QTBUG-27836
Change-Id: Ia6ed1bd9575e296f4c6c5b12509095e4d5c016dd
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-11-05 15:16:06 +01:00
Jerome Pasion
c808dd2745 Merge branch 'master' of ssh://codereview.qt-project.org/qt/qtbase into newdocs
Change-Id: I7e6cee190a341901dfbf8effb54ebccb91bf7a17
2012-11-02 14:41:27 +01:00
Jan Arve Saether
c360fbcd6c Do the actual removal of the Soft Keys API and related code
In addition to the actual removal of the softkeys API in QAction,
this commit removes some enums related to the softkeys feature:
  Qt::WA_MergeSoftkeys
  Qt::WA_MergeSoftkeysRecursively

It also removes some "zombie" enums:
  Qt::WindowSoftkeysVisibleHint = 0x40000000,
  Qt::WindowSoftkeysRespondHint = 0x80000000,

  (The only implementation that used these were removed when
  qapplication_s60.cpp and qwidget_s60.cpp were removed.)

Change-Id: Ib6fc6d543def4757383d5f19256199d9d190c614
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-29 20:27:27 +01:00
Tor Arne Vestbø
6e5818f2bb Merge remote-tracking branch 'gerrit/master' into newdocs
Change-Id: I10cf9f915c602c8e5a0e7d7c9e17b7bc5ca00640
2012-10-26 12:28:53 +02:00
Jan Arve Saether
db97d35557 Move validators example from qtdoc repo to qtbase repo
old path in qtdoc repo:
doc/src/examples/widgets-validators.qdoc

Change-Id: Ibf6cad9e7525fff3360cd0b99ce0911b864dea1d
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2012-10-24 11:34:40 +02:00
Jan Arve Saether
294dbc7bfd Use \annotatedlist for list of examples instead of "manual links"
Change-Id: Id945fd35f5eb6a6d11156d4a1356f99cc49405e2
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2012-10-24 09:41:42 +02:00
Jan Arve Saether
2b6edec5c2 Doc: Added landing-, examples- and C++ class list-page to qtwidgets
It seems this is the pattern to follow:
landing page:    qtwidgets-index.html
examples page:   qtwidgets-examples.html
class list page: qtwidgets-module.html

Change-Id: I3e5459fe650178e0398cb43181b594c0f12a170e
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2012-10-19 17:42:14 +02:00
Gatis Paeglis
4c41cb48d0 Modularize drag and drop documentation
- Move dnd docs and examples out of QtDoc module to gui library in QtBase
- Remove info related to Motif dnd since Qt5 doesn't implement it

Change-Id: Id7eb4eb422f4294a36dd92709ce3007903371f03
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2012-10-19 17:35:51 +02:00
Oliver Wolff
c5b766638a Fixed cube opengl example
Proper variable initialization should fix crashs and black screens for
that example.

Task-number: QTBUG-27281
Task-number: QTBUG-27021
Change-Id: I538f233ea3c2faf6c1864c46be0d03828e92a110
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-10-17 04:19:15 +02:00
Friedemann Kleint
fbd10a401f Use organization name "QtProject" in examples.
Change-Id: Ibbe9517ccf81d25eccbdff98f7cfe8ff6ec485d2
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-16 15:29:15 +02:00
Sergio Ahumada
e488d0f4da Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: I66d941a5fa7ed8046a3498686432450018a8dfaa
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-15 10:18:31 +02:00
Sergio Ahumada
6343a46bc5 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: Ia683171b30b5bf7cedb56cc3087b4b68644a3da1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-15 08:13:55 +02:00
Jerome Pasion
dc0d5bf387 Doc: Removed references to stale links.
The links are from the qt-webpages.qdoc and no longer exist.

Change-Id: I8329032215fa77811117e2767bae745795b209cb
Reviewed-by: Martin Smith <martin.smith@digia.com>
2012-10-13 05:51:19 +02:00
Friedemann Kleint
c4840d55ea Fix missing return in QtOpenGl/paintedwindow example.
Change-Id: I17da0e93bb7c1b0cdbb5b76035ec913cbc616608
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-13 05:51:19 +02:00
Stephen Kelly
43325a23f3 Delete the QVariant ctors taking global Qt enum values.
They have unexpected results in Qt 5 (the Qt::GlobalColor one works
as expected in Qt 4, but was removed in Qt 5):

 QVariant v = QVariant(Qt::red);
 qDebug() << v; // QVariant(int, 7)
 v = Qt::red;
 qDebug() << v; // QVariant(int, 7)

The correct way is to use:

 QVariant v = QVariant::fromValue(QColor(Qt::red));

The deleted constructors are the ones for which there is a class
with an implicit constructor taking the enum, and that class is
a built-in metatype.

QLocale::Language and QKeySequence::StandardKey would also fit
the description, but I can't include the header for QKeySequence
as it is in QtGui, and I don't want to include the qlocale header
in qvariant.h. Putting a QLocale::Language is probably very
uncommon anyway.

The QTextFormat test is doing the wrong thing, but the result isn't
being tested. Added new tests which fail before the patch.

Change-Id: Ia38a0784990f4d40ff7457a86daf58aabd4964eb
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-10-10 08:45:22 +02:00
Joerg Bornemann
43ea715418 remove superfluous include from echoplugin example
Change-Id: I8a53c5e628e43796d7f4b53c311dd4d200527262
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2012-10-08 17:21:15 +02:00
Samuel Rødal
9b201853ad Made cube example not use glActiveTexture.
We're setting the default texture unit anyway, and glActiveTexture would
require resolving through QOpenGLFunctions.

Task-number: QTBUG-24555
Change-Id: Id8d660baaa1532e7b8e623673f501703c76fac65
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-10-02 10:43:48 +02:00
Friedemann Kleint
c6271071b4 QPA/Windows example: Set proper window flags, titles, names.
Do not leak windows.

Change-Id: I3af29ce597742cbe6444208aa72443c0507819db
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
2012-10-01 10:20:09 +02:00
Samuel Rødal
ccf0669da9 Added QGLPixelBuffer implementation using framebuffer objects.
Instead of having QGLPixelBuffer be a unusable stub implementation we
deprecate it and implement it in terms of QOpenGLFramebufferObject.
Framebuffer objects are anyway the recommended replacement for
pixelbuffers in modern OpenGL, as the context switching overhead is
avoided.

Change-Id: Ia220c358ee92813e87981d297c51d84525010322
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-09-27 18:35:55 +02:00
Joerg Bornemann
9e750d341a fix conflicting Visual Studio project names for Qt examples
Loading examples.sln resulted in a cascade of error messages because
Visual Studio doesn't allow projects of the same name in a solution.
Now using QMAKE_PROJECT_NAME to give the projects distinct names.

Change-Id: Ifd3a00311253e4b234ece936092649ce0f0869d8
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2012-09-27 15:50:14 +02:00
Jens Bache-Wiig
570ae40f57 Remove CDE and Motif styles from qtbase
It is time to clean up some of our legacy code. These styles have
not been actively maintained for a long time and I think it is safe
to say that they should no longer belong as part of the default
distribution of Qt. We dont support any platforms based on CDE with
our source packages.

Note that even if we are removing these styles from the default
distribution of Qt, applications that depend on them
will still be able to bundle the existing (and unmodified) styles
along with their own source code as we are not breaking compatibility.

Change-Id: I1709630c20ba8e8088cd01628628d86856db57a4
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-09-27 15:16:16 +02:00
aavit
d535c910e4 Fix compilation for Qt5: Avoid deprecated API
Change-Id: Iba11d33dd4d81ed1a460dd3237cd1bb9e1ace106
Reviewed-by: Jason Barron <jason.barron@digia.com>
2012-09-26 18:52:14 +02:00
aavit
9e9495b166 Compile fix: Avoid deprecated functions
Change-Id: Ia7592997640d51ed98fdfa1a5e59d35954a0ef61
Reviewed-by: Jason Barron <jason.barron@digia.com>
2012-09-26 18:51:52 +02:00
Samuel Rødal
1dadede8ed Fixed instances of "to to" in qtbase.
Really it should just be "to".

Change-Id: I7d0fff334bac3f0ac78adb8131e3bf3df1f1b242
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-09-24 21:27:51 +02:00
Marc Mutz
6d65b2cc8c Use QStringList::join(QChar) overload where applicable [examples]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: I1d0c9782cc1522d937b930531720e32d4c8f7ce8
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-23 23:30:03 +02:00
Iikka Eklund
be15856f61 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-22 19:20:11 +02:00
Frederik Gladhorn
d1f74b8ddf Move examples to proper location.
Change-Id: Ib808f5d99cb8217f8786411b531fa5bc7fa5250a
Reviewed-by: Martin Smith <martin.smith@digia.com>
2012-09-21 19:59:16 +02:00
Frederik Gladhorn
d16c565ca6 Move opengl/wid/net example docs to proper folders.
Change-Id: I846439a9cf7ad965ed27a00f98dbc4ff97abe73b
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
2012-09-21 19:59:06 +02:00
Jan-Arve Saether
4b664eef64 Doc fix: Fix references to snippets and examples.
Did a recursive search under examples\widgets\doc

search criteria: "\snippet widgets/"
replaced with:   "\snippet "

Change-Id: I795580f8d207088df543edd9ef3b7b76c5e30d69
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
2012-09-20 07:01:48 +02:00
Geir Vattekar
8347d4e0bd Doc: Use QStyledItemDelegate and frameless spinboxes in spinbox delegate example
Task-number: QTBUG-18847
Change-Id: I5347a1028b6f45a60e43fb75f6d362efecb6880b
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Marius Bugge Monsen <marius@cutehacks.com>
Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
2012-09-18 20:59:03 +02:00
Gabriel de Dietrich
ab1f00f6cd Fix tab navigation in windowflags example
Change-Id: Ia0e3087ea60262546cd1a21614591ad3626469d3
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-09-18 17:39:50 +02:00
Gabriel de Dietrich
b1893f7c49 Introducing NoDropShadowWindowHint window flag
Added suppport on QCocoaWindow.

Also we deprecate WA_MacNoShadow since it isn't used anywhere, and updated
the 'windowflags' example app.

Change-Id: Id0b453ba15a23b768b0615838597bca139f507ad
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-09-18 17:39:50 +02:00
Sergio Ahumada
58e2b9c01b examples: Mark ctor's as explicit
Make C++ class constructors that can be used with only one
required argument 'explicit' to minimize wrong use of the class.

Change-Id: Ida9f9c2f0c8608c35b0137b2512a6747afd69515
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-17 22:14:25 +02:00
Geir Vattekar
7ec469e900 Doc: Fix snippet bug in Getting Started Qt
Change-Id: I9c8caabee4c6f6131a69851586ef992138beb211
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
2012-09-13 19:33:08 +02:00
Frederik Gladhorn
e92c1976a6 Fix example includes for qdoc.
Change-Id: Ifa6a99db27ce51529489bf077a839a3107b524d2
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2012-09-11 12:09:47 +02:00
Frederik Gladhorn
999ac7da4c Move gui example doc example images.
Change-Id: I01e0c3d51bcb01c66a3f6c7b2ba95f0c9999f4cb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-09-11 12:09:47 +02:00
Sergio Ahumada
5243999c3c example: minor fix to gettingStarted - part5
Do not compare a QString to "".  Instead use the .isEmpty() method.

Change-Id: Ifda1361b2c288dd590f0294daacdf5e2d9241522
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
2012-09-10 10:40:31 +02:00
Frederik Gladhorn
f67d23d4fc Move tutorials to widgets.
All of these are very QWidget centric.
They cannot properly refer to the
sources without being part of the widget module.

This fixes around 300 qdoc errors.

Change-Id: I5a7c2dbc10f7913f7b088d6a0ac81323b3c287ac
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-09-09 01:18:37 +02:00
Sean Harmer
51d40d7e9b Make gui/math3d classes use float rather than qreal
This corrects the mismatch between using floats for internal storage
and qreal in the API of QVector*D which leads to lots of implicit
casts between double and float.

This change also stops users from being surprised by the loss of
precision when using these classes on desktop platforms and removes
the need for the private constructors taking a dummy int as the final
argument.

The QMatrix4x4 and QQuaternion classes have been changed to use float
for their internal storage since these are meant to be used in
conjunction with the QVector*D classes. This is to prevent unexpected
loss of precision and to improve performance.

The on-disk format has also been changed from double to float thereby
reducing the storage required when streaming vectors and matrices. This
is potentially a large saving when working with complex 3D meshes etc.

This also has a significant performance improvement when passing
matrices to QOpenGLShaderProgram (and QGLShaderProgram) as we no
longer have to iterate and convert the data to floats. This is
an operation that could easily be needed many times per frame.

This change also opens the door for further optimisations of these
classes to be implemented by using SIMD intrinsics.

This needs to be applied in conjunction with

https://codereview.qt-project.org/#change,33548

Task-number: QTBUG-21035
Task-number: QTBUG-20661
Change-Id: I9321b06040ffb93ae1cbd72fd2013267ac901b2e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-07 13:27:38 +02:00