Return a struct instead. This frees parse() of an assumption that -1
is an error value and leaves one in/out argument. Made this last an
actual pointer argument instead of a non-const ref. Shuffled the
remaining arguments so that this in/out is last and the offset into it
at which it gets modified is immediately before it. Removed a
spurious qdoc comment in the process.
Change-Id: I7d980e70a7711b1d706151eedce956fe2093e48e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Some private methods were conditioned on QT_NO_TEXTDATE but called
(without #if-ery) by methods conditioned on QT_NO_DATESTRING; and
various private methods without #if-ery were only called by methods
within. Consolidate to #if methods all on QT_NO_DATESTRING.
Change-Id: I1dd18037e4e7407c07041036cc5b871b7d693016
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The serialization of date-times understood time-zones (indicated by a
't' in a format string) but the parsing didn't (so viewed the 't' as a
literal element in the format string, not matched by the actual zone
it needs to parse), although some tests expected it to.
This made round-trip testing fail.
Implemented parsing of time-zones.
Re-enabled the formerly failing tests.
[ChangeLog][QtCore][QDateTime] Added support for parsing of time-zones.
Task-number: QTBUG-22833
Change-Id: Iddba7dca14cf9399587078d4cea19f9b95a65cf7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
The formatting of times in Norwegian has changed to use colon rather
than dot between hours, minutes and seconds:
http://cldr.unicode.org/index/downloads/cldr-30#TOC-Other
tst_QLocale gets a matching revision.
Change-Id: I35a16080def5fbadd62144a0b44be8110b9be29b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.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>
This fixes the following warnings when building qmake:
Makefile:359: warning: overriding commands for target `qrandom.o'
Makefile:335: warning: ignoring old commands for target `qrandom.o'
Change-Id: I2c7abbe095862303c1969a70f61b8a57009d44ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It calls toLower() on it, and the existence of two strings in scope
has already caused some latent bug where sizes of the two were mixed.
Taking by value means we can use the rvalue-version of toLower().
While that does not guarantee no allocations, we can make sure that at
least in QKeySequence::assign(), we hand in unshared data, by using
std::move().
Change-Id: Ic4a18486a6f4528eba36109dec1a47082cf57055
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit complements commit 3dcc075f4a
for Qt 5.10.
Change-Id: I7814054a102a407d876ffffd14b6a16182f159e2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The test was never loading images from a valid path, and thus never
had any fullfill the base option which meant nothing was tested.
Making it work revealed that the Format option on BMP formats doesn't
predict semi-transparent files.
Change-Id: I7035a0f63ebfbce940ce7a17a6142cf177480798
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The type-cast to int for qle_signedbitfield was wrong for all cases
where width + pos != 32. The class is currently only used two places
though, both where that happen to apply.
Change-Id: I108c565b75c9f29dd49b5e2e39f84910d17ead85
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
it contains no code.
Change-Id: Ie8a43abb2db3d040f7046206adf2bf555960dd9c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
these are not meant to be deployed, so the install hack should skip
them.
Task-number: QTBUG-42830
Change-Id: I870499dca2cfea87bf0048f019d651ce9cc5d788
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
while it's mildly insane that we auto-generate install targets to start
with, we can at least refrain from doing so if there is one already.
as it happens, this removes the need for excluding the qt build
explicitly.
Task-number: QTBUG-38452
Change-Id: I74d5df447fba525fa79896c9be2c71d82bc2c6ce
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
our binary packages come without many sql drivers, because they have
proprietary dependencies we cannot ship. not every user wants to build
all of qt from scratch, so it makes sense to make it possible to
"enrich" the existing installation by compiling just the drivers. to
enable this, the drivers' configuration must be independent. but note
that it's still not possible to configure a single driver - the entire
sqldrivers directory is configured at once.
a side effect of this is that the availability of the sql plugins
cannot be made known with publicFeatures any more, because there is no
associated module pri file to put that information into. that should be
made inconsequential by making qtHaveModule() work for plugins.
Task-number: QTBUG-58372
Change-Id: Ibdebe3199688a57f93cea82dc15623081d1280f5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
It indirectly includes X.h with LSBFirst and MSBFirst macros.
Use XCB_IMAGE_ORDER_LSB_FIRST and XCB_IMAGE_ORDER_MSB_FIRST
macros instead and remove unneeded XCB_USE_XLIB guards.
Change-Id: Ic24c9605d0a627253f2793f9feab6c6e19dcda08
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
(cherry picked from commit 538b9f504c)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
FAIL! : tst_QWidget::restoreVersion1Geometry(geometry.dat) Compared values are not the same
Actual (((widget.pos()))): QPoint(90,90)
Expected (expectedPosition): QPoint(100,100)
Loc: [tst_qwidget.cpp(3193)]
Remove the previously added QSKIP since this test now passes.
Task-number: QTBUG-26421
Task-number: QTBUG-46116
Change-Id: Ieff474a8a69c14a0df231a9a587aee02df4e8ea7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
qwindowsdirect2ddevicecontext.cpp:92:105: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'HRESULT {aka long int}' [-Werror=format=]
qWarning("%s: EndDraw failed: %#x, tag1: %lld, tag2: %lld", __FUNCTION__, hr, tag1, tag2);
Change format to long and cast argument to long for extra safety
(should some obscure MinGW header define another type).
Change-Id: I7e6cb8ea1e5c27ef104b162ced9a696ab252fd8d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
UWP only allows clipboard access when the app is active and has focus.
Task-number: QTBUG-60900
Change-Id: Ia69642740d894106875cef77adf48e934bae9c87
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
[ChangeLog][QtCore][QProcess] Added support for standard channel
redirection using setStandard{Input|Output|Error}File to
QProcess::startDetached.
Task-number: QTBUG-2058
Task-number: QTBUG-37656
Change-Id: Iafb9bd7899f752d0305e3410ad4dcb7ef598dc79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In FileDialogPanel::options(), QFileDialog::DontUseCustomDirectoryIcons
was set when the "Don't use custom directory icons" box wasn't checked.
Change-Id: I6e9d9b41cf91f4abcc98c02bed44675908a8391d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Makes pure Qt applications integrate better when those fonts don't
match the general fonts.
Change-Id: Ic06e8595efc44f0c6649cf364e751c4c714cda93
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This was originally enabled in the mkspecs for 64-bit QNX 7.0.0
but that broke when the qtConfig change was made. It looks like
qtConfig shouldn't be used in the platform mkspecs. I suspect
the stack-protector changes were left out of the 32-bit mkspecs
so that 6.6.0 builds wouldn't be affected.
Ignore the stack-protector/stack-protector-all possibility since
it isn't possible to access it without a command line option.
Specifying both options doesn't even make sense since
stack-protector-all encompasses stack-protector.
For now, leave out command line control of this feature.
Task-number: QTBUG-59644
Change-Id: I99323216be5b592dd2c3bef6d22da195764a6e65
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
QX11Info class from the Qt X11 Extras module is documented in
qx11info_x11.cpp, and it needs to be parsed.
Change-Id: I32e8415d93e67dbf16267d4af63979c1db0870b0
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Scan CLDR for {,kilo,mega,giga,tera,peta,exa}byte forms and their IEC
equivalents, providing SI and IEC defaults when missing (which all of
IEC are) in addition to the usual numeric data. Extrapolate from any
present data (e.g. French's ko, Mo, Go, To imply Po, Eo and, for IEC,
Kio, Mio, etc.), since CLDR only goes up to tera. Propagate this data
to QLocale's database ready for use by QLocale::formattedDataSize().
Change-Id: Ie6ee978948c68be9f71ab784a128cbfae3d80ee1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
When QDateTimeParser learns to parse zones, it'll need to know the
valid range of offsets.
Change-Id: I44cd88a140ebaf6a2b98b0f9a1be0cbc7a35bae4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The implementation did a validity check on data it then gave to
constructors that repeat the validity checks; so do the construction
first and use the cheaper instance isValid() methods instead.
Fixed local callers (but not QDateTimeEditPrivate::stepBy, the only
other caller) to actually attend to the return value; if the attempt
to set a field fails, it probably means the min is too low, or max too
high; and comparing the modified date-time against global min and max
makes no sense if it hasn't been revised anyway.
Change-Id: If4505c43c92e247445dcd10ac436b775c3ead4da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Two more ways line numbers were making it through.
Corrected a doc-string to tell nearer to the truth.
Change-Id: I946aaeb936d47fffe50d7ec15e2524992cc9e428
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Document that the saved output is used by tst_selftests.cpp and use a
crude parse of it to get the list of subdirs that it actually tests.
Change-Id: I73023228c9e547f965b7749dd66de7ef09c3815e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Extract a helper function to read the setting and use that
in file dialogs and tray icon.
Task-number: QTBUG-60593
Change-Id: I03cf1e45611690a128bf2cc17eba5dff23b86969
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
It may crash on (probably a bit broken)
qtbase/src/printsupport/dialogs/qpagesetupwidget.ui
Change-Id: Ibca95a3d8aa4899adbc952aee7b46621ac888c6a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Release builds of applications that used Qt configured with "link time
code generation" crashed (memory access violation), when calling
GetInternalFormatInfo in Context::initCaps.
It looks like this is a compiler problem that can be avoided by not
using a reference for the return value.
Task-number: QTBUG-55718
Change-Id: Ic1fb95d7b518a49859f41c819e860864387a8d3c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
QPA is modeled on the assumption that the cursor is a property
of the window and therefore sets the override cursors on all windows.
However, on macOS and Windows, the cursor is set per application (or
screen). On these platforms, the per window cursor setting needs
to be emulated which is a source of bugs especially for override
cursors.
Add new virtuals to QPlatformCursor allowing to set override
cursors which can be implemented by directly setting the cursor
on those platforms.
Task-number: QTBUG-40122
Task-number: QTBUG-61133
Change-Id: I31d6a927128d22bb1620a8ace35988c0e126236e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>