The output didn't previously make clear that the datum was invalid.
It's now explicitly invalid. At the same time, use QDebug's space()
and nospace() methods to make spacing choices explicit.
Revised a QDate test to match.
Change-Id: I4699f5897530b4caa31c22fdb07de149832b30f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Separate the part varying between tests from the common form of all
the tests, so the reader can see the common pattern and know for sure
that there's not a typo or copy-and-paste glitch.
Change-Id: I3145a26ab42c104eb27756d906ac87f937024bad
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The angles in question were in radians, not degrees;
we get them from std::atan().
Change-Id: Ifd60efbd975997ffca02e45ae884fb75e59806b4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
macOS hasn't had SC_ScrollBarAddLine and SC_ScrollBarAddLine
since 10.7, when transient scrollbars first appeared.
We also make the warning message a bit more informative.
Change-Id: Idef4684162456d9bc274eea77908a6afe24fa0f5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Addresses drawing, hit testing, subcontrol rects and one metric.
Also fixes the knob width on hovered transient scrollbars. Since Cocoa
won't help for this (and never will), we do it manually.
For non-transient scrollbars, no more HITheme. That's why we're doing
this after all. It also comes with its own small hack; see how we darken
the knob when hovered.
We had to de-intertwine the logic with QSlider in drawComplexControl(),
which now gets its own full case CC_Slider statements. QSlider will be
addressed next.
Task-number: QTBUG-49585
Change-Id: Iced58d52fff0c11866bdf6eb562dbab36c8f3ef2
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
With 4183475080, Qt fails to build if
qmake is unable to detect the compiler's default include and
library search paths. Clang on non-Darwin systems was missing working
code for the detection.
Unlike GCC, Clang on its own does not print the library search paths
when called with the -v option.
On Darwin, the -Wl,-v option will reach ld64, which will print those paths.
However, neither GNU ld nor gold will print anything useful with just
-v. GNU ld has a --verbose option that does print some search paths, but
those are not the ones used when ld is invoked (via collect2) by GCC or
Clang, so it can't be used.
To make Clang print its library search paths one can use
-print-search-dirs, which however doesn't print include search paths. So
amend the existing code in order to make a second call to clang on
non-Darwin systems. This second call is used for library path detection,
and fixes the build on non-Darwin (tested on Linux).
Change-Id: Ic858f908ee1a2e0eb307abb074daee0ded38abd5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Delegating the border painting to qDrawPlainRect ensures that there are
no off-by-one pixel issues.
Task-number: QTBUG-61845
Change-Id: I732795e048cbc2e5b279782e9a19700884f8bc40
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The panel drawing helpers have code drawing shadows that relies
on working with integer coordinates and one pixel lines, which causes
artifacts when Qt High DPI scaling is in effect.
Add code that checks for device pixel ratio != 1 and in that
case reverts out the Qt High DPI scaling transformation and scales
the parameters so that the drawing code used device
pixels.
Task-number: QTBUG-58611
Task-number: QTBUG-59116
Change-Id: I8402044f3fd4dfcd349b31c573dcad12ae1f609f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Exclude popups among other non-applicable windows types
from resizing in WM_DPICHANGED.
When resizing was enabled for non-fixed size windows
by c854fc5a6b
it turned out that context menus were truncated
when moving an application from a high resolution
to a low resolution monitor.
Factor out a function to check for the applicable window types.
Amends 886ce572d6,
c854fc5a6b.
Task-number: QTBUG-55510
Change-Id: I16fee07f3e11828848ec71cdceadff958cedb13a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It is considered slightly faster than the default mode[1],
but on Windows it causes trouble when aborting the build,
it leaves behind zero-sized object files which cause link
error. See discussion in the bug-make mailing list[2].
[1] https://stackoverflow.com/a/1512947/764870
[2] http://lists.gnu.org/archive/html/bug-make/2017-06/msg00066.html
Change-Id: I7aa0b328a8c743fdfe9b0aece02b329066515076
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
If several Makefiles are used in the same directory (for example, for
multiple projects in the same directory or different build configurations),
they all reference the same object_script, which is obviously wrong.
Change-Id: I9b499ceb6b6bd6058f54b452fa44bfb2313eec26
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Subtract the viewport margins from the contentsRect in
QCommonListViewBase::updateHorizontal/VerticalScrollBar(). This
affects list views in icon mode and list mode / ScrollPerPixel.
Task-number: QTBUG-61383
Change-Id: I6f2f7951ac9344ac21cef1eba061780d130e2467
Reviewed-by: David Faure <david.faure@kdab.com>
Doesn't affect our current builds since it's just a marker for the
linker on what sections should be merged. Unless you're mixing
namespaced and non-namespaced static builds into one executable.
Change-Id: Ia53158e207a94bf49489fffd14c7bc294fccf8f9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The pixmap may be set in QWizardPrivate::updateLayout() if there's a
side widget or a watermark. If neither exists, then no pixmap is set and
this would cause a crash.
Task-number: QTBUG-61423
Change-Id: Ia53158e207a94bf49489fffd14c80dd93415dd0f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Code like:
QElapsedTimer timer;
timer.start();
QTest::qWait(30);
QVERIFY(timer.elapsed() >= 30);
is failing, because qWait sleeps in increments of 10 ms and the last
chunk may be off by less than one millisecond, so we end up sleeping too
little and thus returning before 30 ms have elapsed.
This matches the QElapsedTimer::elapsed() code that rounds down:
return nsecsElapsed() / Q_INT64_C(1000000);
Task-number: QTBUG-61741
Change-Id: Ic3a088f9f08a4fd7ae91fffd14cea4a91d3f51a8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
[ChangeLog][QtCore][QLocale] Fixed the conversion of QTime to string
form and parsing from string form to always treat the value as the
decimal fraction of the seconds component. That is, the string format
".z" produces/parses ".2" for 200 milliseconds and ".002" for 2
milliseconds. Use of "z" or "zzz" is discouraged outside decimal
fractions to avoid surprises.
Task-number: QTBUG-53565
Change-Id: Ia19de85ad35e4eb7bb95fffd14792caf9b4a5156
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QWindowsFileSystemWatcherEngine uses one change notification
per directory to watch directories or files within that
directory. Adding files and their directories in a sequence
caused the value in QWindowsFileSystemWatcherEngineThread::HandleForDirHash
to be overwritten.
Relax the check for the flags (watcher attributes) to use >= and recreate
the change notification of a directory should its flags be insufficient.
This triggers when a file is added after its directory since files
require more attributes.
Task-number: QTBUG-61792
Change-Id: I371a72f1934fa82c53aaf84beb907825031f1c81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We can offload this to QGuiApplication, just like the geometry of the
QWindow is set. This ensures that all platforms behave the same, and
that the documentation of QPlatformWindow::setGeometry is adhered.
Change-Id: I19dbc32cb4fb146d716ec289c28030a547d3afaa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Fixed crash on QCoreApplication::translate() call from qqmlThread while
QCoreApplication::{install,remove}Translator() is called from the GUI
thread.
[ChangeLog][QtCore][QCoreApplication] Calling
QCoreApplication::translate() is now thread-safe.
Task-number: QTBUG-57095
Change-Id: Ie5340a42040a829f311c01332e05d4bbaf60462c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Qt has two APIs to intercept native events today:
- QAbstractEventDispatcher::installNativeEventFilter()
- Q{Window|Widget}::nativeEvent()
On macOS we only implemented one of them, the native event filter code
path, by calling filterNativeEvent from the Cocoa event dispatcher.
We now also propagate the native event to the corresponding QWindow,
and QWidget if applicable.
It would be nice if there was only one Qt API for this, or at least
only one codepath for platform plugins to care about, but since the
event filter might catch more event types than gets delivered to the
window, we probably need both code paths going forward.
Task-number: QTBUG-40116
Change-Id: I0796bd62a2b7c08b2eaaf6f15db8088e9703af02
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Icb3794f37c929019de1e997e15f7d975492224c2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
In a multi-monitor setup, when the main display is turned off or
disconnected, all remaining monitors have their hMonitor handle
changed. Qt did not store these updated handles, which led to not
posting the WindowScreenChanged event when a window was moved
to a different DPI-scaled display, leading to e.g. improperly
scaled popup menus.
The fix consists in updating the hMonitor handles whenever a new
monitor is connected or disconnected.
Change-Id: Id2ca2c128510d9ff3e9746eb33e86dce8f6c4c83
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This case is not supported by the Mac HIG, so we need to improvise
some colors that look better than those used in document mode.
Change-Id: I9858be468680303fdf65e17aa10ca1f90718b236
Task-number: QTBUG-61092
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Covers non-document mode, tab icon, and adds a more
useable interface. Some parts are still missing, like
tab orientation and long tab titles.
Task-number: QTBUG-61092
Change-Id: Idbda84f513e3ff7f87fa04ae4476b11bd8bb6bf2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Clear the known times when we write to it and always refresh for the
Access time.
Change-Id: I8d96dea9955d4c749b99fffd14cd6c03b4253197
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
CMake gained support for running AUTOMOC on generated headers,
so we need to mark them with SKIP_AUTOMOC since we're generating
moc files for those already. Otherwise we get duplicated symbols.
Change-Id: Iabd387832cfc74809fc5e6ff4782f4fc83cc07d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Stephen Kelly <steveire@gmail.com>
Add a margin to the window geometry.
Task-number: QTBUG-61595
Change-Id: I12c557d7cfb1fe954a9845848c0777817c4cbf27
Reviewed-by: Thomas Sondergaard <thomas@sondergaard.cc>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This protects against the file having been renamed or deleted. We'll
still operate on the open file, regardless the name it may have on the
filesystem.
Change-Id: I1eba2b016de74620bfc8fffd14cca85cfd672e6d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It's not dangling only because of QFileSystemMetaData's construction:
the nativeFilePath() function returns a member variable. Since
QByteArray COWs, the pointer that we stored would not be freed.
But this was dangerous, since any change to the "entry" variable could
cause it to invalidate the member variable and the pointer to become
dangling. This line is only as old as this entire file is.
Change-Id: I8d96dea9955d4c749b99fffd14cda4d8e2cc5e5b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The deserialized user type is now shown to the user to figure which
QMetaType registration is missing.
Change-Id: I4b7624827e479b1bea67065ce3542183b7355165
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Move all the logic into socket.pri and clean-up source
code. Build local socket/server only if feature 'localserver'
was enabled.
Task-number: QTBUG-61672
Change-Id: I9f9d1a262df4bb020c8706c7cb5a66b926e0240f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The MSDN documentation says that it's a date that reflects the item
type, giving an example the date a photo was taken (probably as stored
in the EXIF metadata).
Change-Id: I8d96dea9955d4c749b99fffd14cd7616cc0da545
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Fix a number of issues that caused polygons to not always be drawn
fully connected.
Ensures the original lastPixel is set when drawing closed polygons,
ensure we don't round away from the original starting point, and add
handling of edges that need to be rounded half a pixel sideways to line
up with endpoints.
Task-number: QTBUG-27053
Change-Id: Ib51ee5623a629996af51a0967096383f04e91e2f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
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>