Use a range-based for loop instead of index-based access.
Change-Id: Ie43aee540062eec4800f39915ebd42d5a3cae4b3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
CGDisplayCreateImageForRect seems to have a weird behavior when mixing
highDPI and non-highDPI screens since it may take part of the
non-highDPI screen when the highDPI display is at the left or at the
top of the main monitor.
To workaround this issue, we capture the whole screen and then crop the
image to the desired size.
Task-number: QTBUG-47643
Change-Id: Ib2a3850a0a549964c7fe272abb563bd23518c234
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Without any content it was hard to see the window. Put some lipstick on it.
Change-Id: I0fefffb0a4deba7ac91e67a6153a9a27308fe493
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The latter would allow one final resize that would immediately
jump to 300x300.
Change-Id: I566e5e9dc1fb07f748f528f002166a8438344173
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
While both GCC and the GCC compatible clang support this attribute in
general, GCC doesn't support it when targeting macOS, ending up with
errors like these:
error: 'init_priority' attribute is not supported on this platform
This error isn't a property of the platform itself though, since
clang supports the attribute just fine on macOS.
The attribute is only used to work around an issue with dllimport
on windows, so limit its use to that platform, to avoid issues
with it potentially being unsupported on platforms other than
macOS as well.
This fixes compiling with GCC for macOS.
Change-Id: I0235e6365635d73233951566c10ad869b26a0fc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Configuring Qt with -no-feature-ftp cause build to fail.
Change-Id: I47f1cdc400702d0211a9f620c8606983f08fa70c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This reverts commit 71090f0950. Changing
the link was wrong because we do not actually comply with the new RFC.
Task-number: QTBUG-66470
Change-Id: I940917d6763842499b18fffd15147cb93c27b7f4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
They can be, if compiled with -Wl,-pie. Example:
$ file /usr/bin/ping
/usr/bin/ping: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0
And you can't detect via the interpreter, since libraries can have
them too:
$ file /lib64/libc-2.26.so libQt5Core.so.5.11.0
/lib64/libc-2.26.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2
libQt5Core.so.5.11.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.17.0
Change-Id: I940917d6763842499b18fffd15143bb80ce0e531
Reviewed-by: David Faure <david.faure@kdab.com>
Use QT_DEFINE_QPA_EVENT_HANDLER to define
QWindowSystemInterface::handleCloseEvent().
Change-Id: I4f1105f7aa78bdebddfe9062b388eb616e325e31
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Platforms can reimplement this function to control
how non-spontaneous window close is handled.
Make QWindow::close() call this function.
Change-Id: I3da13e6c8519de2af7e54334d8a1e833ce98cba1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QOpenGLProgramBinaryCache::setProgramBinary() should check
GL_LINK_STATUS after glProgramBinary(), but doesn't.
In practice, this means that SDDM is a white screen, and KDE is just
a gray task bar.
So far, Qt tries to check this using its internal ::link() function.
But in case the cached binary fails to load, Qt currently attempts to
link the inexistent program, resulting in a zero-length, fixed
pipeline shader.
Checking this already in ::setProgramBinary() makes the call to
::link() superfluous, so we remove that as well.
Done-with: Max Staudt <mstaudt@suse.com>
Done-with: Michal Srb <msrb@suse.com>
Done-with: Fabian Vogt <fvogt@suse.de>
Task-number: QTBUG-66420
Change-Id: Iabb51d0eb2c0c16bde696efff623e57d15f28d82
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
contains() interprets the regexp as being implicitly
anchored, so the leading part of the path needs to be
explicitly matched.
Change-Id: I1efa07dc99bb2db1717d2a66621899e23c144164
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Do not clear the settings of QHeaderView during layoutChange when the
model is empty and the section count did not change. This will not work
when a section is moved or a section is replaced with a new one during
layoutChange. But since layoutChanged is also called on sorting, this
patch ensures that the settings are not cleared in this case.
This restores the behavior to the same as before 5.9.4.
Task-number: QTBUG-66444
Task-number: QTBUG-65478
Change-Id: I39989cfd45b42e58f49d18ec014d3a941cadb6c9
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
During (re)storing the sections within layoutChanged handling, the
hidden section size was not properly stored which lead to a section
size of 0 when the section was unhided afterwards.
Task-number: QTBUG-66413
Task-number: QTBUG-65478
Change-Id: I0b714c7e0530a1eae82b3bb0e0dc80ed576522d0
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Rename example savegame and its snippets following
a6b697ca13.
Fix:
/qtbase/examples/corelib/serialization/savegame/doc/src/savegame.qdoc:28: warning: Cannot find file 'json/savegame/savegame.pro' or 'json/savegame/savegame.qmlproject'
qtbase/examples/corelib/serialization/savegame/doc/src/savegame.qdoc:98: (qdoc) warning: Cannot find file to quote from: 'json/savegame/level.cpp'
json
qtbase/src/network/ssl/qsslconfiguration.cpp:889: warning: Undocumented parameter 'name' in QSslConfiguration::setBackendConfigOption()
qtbase/src/corelib/tools/qbitarray.cpp:314: warning: No such parameter 'len' in QBitArray::fromBits()
Change-Id: If59512873ca2116b89490927fdbf9ea1d8b237a8
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
Currently there is a bug in Qt regarding the PostgreSQL driver as it
does not correctly escape the table names when constructing queries
internally. Therefore, these tests are marked as expected failures until
the bug itself is fixed in Qt.
Change-Id: I74dadc187f8a08509128dfea27be99787e57ea51
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Properly initialize MedianDouble::values in ctor.
This fixes the following valgrind warnings in the unit test:
Conditional jump or move depends on uninitialised value(s)
at 0x40771E4: addValue (qtconcurrentmedian.h:161)
by 0x40771E4: QtConcurrent::BlockSizeManagerV2::timeAfterUser() (qtconcurrentiteratekernel.cpp:195)
Change-Id: I8c8e297a52caca38cd6191ae2653f2765d387077
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This also accounts for some quirks on the PostgreSQL side:
- Null values for a related table are placed in a different
order when sorted.
- Functions (sum, count) return a different type than other databases
- Using quotes to account for case sensitivity with tables
Task-number: QTBUG-63861
Change-Id: Ib1894fa8d0c77d7045941f7c57be0d0acd8d117e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Private headers not only need the _p suffix, but we also need to mean it
:)
Change-Id: I6028200a872661af34cbf90c77974cc1a22c09c3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
TouchEvent::TouchPoint::pos was not updated in
QGraphicsScenePrivate::updateTouchPointsForItem().
To prevent the transformation being calculated repeatedly for each touch
point member, extract a function genericMapFromSceneTransform()
from genericMapFromScene() returning the transformation and use
that whereever multiple points are transformed.
Add a test, extracting helper functionality from
tst_QGraphicsItem::touchEventPropagation().
In addition, fold tst_QGraphicsScene::checkTouchPointsEllipseDiameters() from
c48f4bde00 into this test, so that
it is testing all transformations.
Task-number: QTBUG-66192
Change-Id: If71886d2c14c4e216f7781ea2f22f1adc444e6cf
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
$$RCC_DIR can be absolute, so simple concatenation with $$OUT_PWD is
bound to fail.
Change-Id: Ibd80c49656c0e03b8a86ebca851af106cced08fb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
- Move ivars into @implementation
- Use instancetype where applicable
- Use dot notation for property access
- Use subscript operator for dictionaries and arrays
- Format selectors consistently
- Use proper style for init methods
- Use generics instead of void pointers where possible
- Use "range for" loops instead of indexing
- Replace or replace IBAction/IBOutlet with void
Change-Id: I1667812a51d4dfe44ae80fe337cb1f4bc9699d92
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-geometry, -title and -icon for xcb did not work if the platform string had
arguments or there were fallback platforms.
Only accept the arguments if xcb is the default platform. I.e. ignore the
arguments if xcb is a fallback.
This now works:
./application -platform "xcb:someArg=value" -title specialXcbTitle
./application -platform "xcb;wayland" -title specialXcbTitle
./application -platform "xcb:someArg=value;wayland" -title specialXcbTitle
But this does not:
./application -platform "wayland;xcb:someArg=value" -title specialXcbTitle
Change-Id: I4ee20b1ed722bc98417a5e75db7d8c98ffcdfcfe
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
[ChangeLog][QtGui] QT_QPA_PLATFORM and the -platform argument now support a
list of platform plugins in prioritized order. Platforms are separated by
semicolons.
The plugins are tried in the order they are specified as long as all preceding
platforms fail gracefully by returning nullptr in the implementation of
QPlatformIntegrationPlugin::create()
This is useful on Linux distributions where the Wayland plugin may be
installed, but is not supported by the current session. i.e. if X11 is running
or if the compositor does not provide a compatible shell extension.
Example usage:
QT_QPA_PLATFORM="wayland;xcb" ./application
or
./application -platform "wayland;xcb"
Task-number: QTBUG-59762
Change-Id: Ia3f034ec522ed6729d71acf971d172da9e68a5a0
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
... and make sure we can build if it's switched off.
Change-Id: I9565a2ce632a861a99e1276f3edf4f0d094b5451
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Duplex doesn't really make sense in the context of printing to pdf,
and the variable was only being used in QCupsPrintEnginePrivate anyway
Change-Id: I801634c56759572825b5c9549d7a1dc92e5697a0
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
First check if the pagesize is one of the known ones before
comparing the page sizes. It's veeeery similar but without
it when running the qprinter tests i get a failure since we
set "Index Card 3x5in" but get back "Photo 3x5in"
Change-Id: I72671231c2abec39e036de829d226784f06e1b41
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Since the PlatformInputContext is shared between test cases, the set commit
string from inputMethod() was otherwise saved and could pollute other tests.
For example on Windows PlatformInputContext::commit() was called when the
QLineEdit was first clicked onto in tst_QLineEdit::testQuickSelectionWithMouse()
and inserted "text" in the middle of the text, rather than starting selection as
intended.
This led to tst_QLineEdit::testQuickSelectionWithMouse() failing on Windows at
first in CI, but then always passing the repeats when it was tested alone.
Task-number: QTBUG-66499
Task-number: QTBUG-66216
Change-Id: Id6bdd263d57fd6d08fb48f013542b55b132907ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
It was added by Sam back in 2007, and we've removed other instances of
the same pattern since then. It doesn't make any sense today.
Change-Id: I0f3cb299e312648fd9dc96c639dab4c77fcb48c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This makes the documentation match the implementation.
-platform overrides QT_QPA_PLATFORM, not the other way around. Similarly
for the other arguments.
Change-Id: Iffaf8bb1134bc57e5b682f37b9cc1a713872ede1
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
The code used to retrieve FTP resource with the path of QUrl as an
absolute URL starting from the root directory. It is not always working
with a relative URL because the root directory and working directory may
be different. Depending on the implementation of FTP server, the
reference directory of a relative URL could be either the root directory
or the working directory.
To resolve it, a new state “ResolvingPath” is added to resolve resource
paths before retrieving. For both GET and PUT operations supported by
QNetworkAccessFtpBackendFactory, the resource will be retrieved via its
URL path. Depending on the prefix of the URL path, the path of working
directory is prepended to the resource path as an absolute path starting
with the working directory.
If a URL path starts with “//” or “/%2F” user-input prefix, the resource
will be retrieved by an absolute path starting with the root
directory. If a path starts with /~/ or the working directory prefix,
its resource will be retrieved from the working directory.
Task-number: QTBUG-25034
Change-Id: I26198af1c0077f51565afd3f96050235c661f063
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>