Change-Id: I1972da2ead51274771ff24b4c506c2b581ee6abe
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
There are plenty of other examples showing how to use QStateMachine
Task-number: QTBUG-60635
Change-Id: I82300b2a0f4e7733f08579a2aa9b548cb7d87efa
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The vast majority is actually switched to QRandomGenerator::bounded(),
which gives a mostly uniform distribution over the [0, bound)
range. There are very few floating point cases left, as many of those
that did use floating point did not need to, after all. (I did leave
some that were too ugly for me to understand)
This commit also found a couple of calls to rand() instead of qrand().
This commit does not include changes to SSL code that continues to use
qrand() (job for someone else):
src/network/ssl/qsslkey_qt.cpp
src/network/ssl/qsslsocket_mac.cpp
tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
They are not updated after switching tabs. Thus they can be enabled even
when no entry is selected: select an entry on the current tab and then
switch to an empty tab.
Emit AddressWidget::selectionChanged() signal after changing the current tab
to update these actions.
Change-Id: I00da15ed6c3d3839210ae3ffbe1436e234695522
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Introduce nullptr and replace foreach with new C++11 range based for
loops. Minor fixups of signals, file dialog usage.
Apply the same changes to the ItemViews/puzzle example since it
shares parts of the code with DragAndDrop/puzzle. Make some
changes to both examples to that the diff of the two becomes
small for easier comparison.
Task-number: QTBUG-60635
Change-Id: I8af824229ebac24d6ec151eae92176d227695490
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Introduce Contact struct to store contact data and use it
instead of QPair<QString, QString>. Proper naming really
clarifies the code.
Task-number: QTBUG-60635
Change-Id: Ibfb421dfc854accc382212b0da46e7aafc0d528a
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
- new screenshot with more up-to-date graphical look
- deleted itemviews-editabletreemodel.png from old folder
doc/src/images
- deleted unnecessary item in qtwidgets.qdocconf
Task-number: QTBUG-60635
Change-Id: I9b82fa027347fb0fd7adb86038abd32853e68c3a
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Use the new configure system consistently.
Task-number: QTBUG-63429
Change-Id: I6668ba9fde09492f3e60e614103e18e88783d0c4
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Introduce nullptr and override. Change the ready/valid columns to
use check marks. Right-align the numerical columns. Add a shortcut
to refresh. Sort by path, making sure the root volume is first.
Task-number: QTBUG-60635
Change-Id: I74cda7647f544902aaf4d2a0ab76986f1523aa6f
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Add context menu providing:
"Escape Selection" Apply QRegularExpression::escape() to selection
"Paste from Code" Paste from C++
"Copy to Code" (for completeness)
Task-number: QTBUG-60635
Change-Id: Iee15c2243c7d0435b623dde4a1b26249aecd0553
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Changes internal data-size and pointer calculations
to qssize_t.
Adds new sizeInBytes() accessor to read byte size, and
marks the old one deprecated.
Task-number: QTBUG-50912
Change-Id: Idf0c2010542b0ec1c9abef8afd02d6db07f43e6d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Calling the class-method dotProduct(x, x) in order to then take its
square root is a clumsy way to obfuscate x.length() - and lacks its
efforts (clumsy though they are) to limit rounding issues.
Change-Id: I1dc1f38764651bc70c0620e286cb5625f505ddbf
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Especially in examples, where we should show off our convenience
functions, prefer calling these functions over doing arithmetic with
M_PI (or approximations thereto) and 180 (give or take simple
factors). This incidentally documents what's going on, just by the
name of the function used (and reveals at least one place where
variables were misnamed; the return from atan is in radians, *not*
degrees).
Task-number: QTBUG-58083
Change-Id: I6e5d66721cafab423378f970af525400423e971e
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Use M_PI (and friends), where possible, in favor of hand-coded
approximations of various (in)accuracies. Where that's not available
(e.g. fragment shaders), use the same value that qmath.h uses for
M_PI, for consistency. Replaced math.h with qmath.h in places that
defined a fall-back in case math.h omits it (it's not in the C++
standard, although M_PI is in POSIX); or removed this entirely where
it wasn't used.
Reworked some code to reduce the amount of arithmetic needed, in the
process; e.g. pulling common factors out of loops. Revised an
example's doc to not waste time talking about using a six-sig-fig
value for pi (which we no longer do) - it really wasn't relevant, or
anything to be proud of; nor did the doc mention its later use.
Task-number: QTBUG-58083
Change-Id: I5a31e3a2b6a823b97a43209bed61a37b9aa6c05f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It should be easier to translate sizes in bytes to human-readable
strings consistently rather than having to repeat this code (and the
string translations) in various places. The FileDialog in QtQuick.Controls
has a use for this, too.
[ChangeLog][QtCore][QLocale] Added QLocale::formattedDataSize() for
formatting quantities of bytes as kB, MB, GB etc.
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I27bca146c3eba90fa7a5d52ef6626ce85723e3f0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There is no visible cursor on iOS, so updating the image is a waste
of time. Removing this does in fact speed up rendering of the strokes.
Change-Id: If958fabeefd4273644707277d4a084855d415bb1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
It was backwards from the expected value, consistently on iOS and xcb.
It was already that way in 5.6, and we don't document which way
is clockwise. So it seems to be just the example which is wrong.
Change-Id: Ibbdadc2ae240017abc87439a2694fb5fbd3d07f8
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Each stroke is a polygon (quadrilateral) connecting the previous
tablet event point to the current one. Previously we used the same
width for both ends of the stroke, so rapid changes in pressure caused
steps in the stroke width. Now it is tapered from one end to the other.
Change-Id: I909a2e85334a1a6e20fd28ee4babf6825da36612
Reviewed-by: Andy Shaw <andy.shaw@qt.io>