Unlike higher scopes (like scope 4, admin-local, which the last commit
used), scopes 1 and 2 require a scope in order to bind, even if some
operating systems are lenient. So test that we are able to bind to them
and do bind properly.
Change-Id: Ifb5969bf206e4cd7b14efffd14fba153eab965b9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Binding without an interface and expecting the OS to select something is
not supported in all OSes. On FreeBSD, I keep getting EADDRNOTAVAIL. So
modify our test to only join, leave and send to multicast groups with an
interface selection.
With this, all tests either pass or are skipped for me on Linux,
FreeBSD, and macOS. On Windows, this revealed an inconsistency in
behavior, which this commit adds a workaround for.
Change-Id: Ifb5969bf206e4cd7b14efffd14fb6815456494d2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Putting parentheses around the call to (std::numeric_limits<T>::min)()
works, but the trick cannot apply to the min() function declaration on
the same line. So we really need to #undef.
I hope no one after the 1990s still needs these macros.
Task-number: QTBUG-65414
Change-Id: I39332e0a867442d58082fffd15024f8edb293311
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
It hasn't been necessary for a long time now to write the recursive
file-find function manually. It has just been an obscurely documented
feature of QDirIterator for far too long.
Demonstrate the new QLocale::formattedDataSize() function.
Also sync up the qdoc description of this example with the recent changes.
Change-Id: I9c2bb15bb5ec353d38181b160f0be198774cbea2
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The FreeBSD kernel treats them specially, just like link-local (that's
probably why it calls them "interface-local" instead of "node-local").
So instead let's use a random address, which will avoid multiple
tst_qudpsocket, when run on the same network at the same time,
receiving each other's datagrams. It could happen, considering this test
has an 800-second timeout limit.
Change-Id: Ifb5969bf206e4cd7b14efffd14fb592a3166547e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This is not an official feature of the networking stacks and does not
work portably across operating systems. So just stop trying to do that.
This was failing reliably (not flaky!) with IPv6 on FreeBSD and
Windows. For IPv4, Windows apparently accepts 239.255.0.0/16 but not
other addresses, so remove IPv4 too.
Change-Id: Ifb5969bf206e4cd7b14efffd14fb682c2839e95d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This removes at least one special-case we had to have, in Android's lack
of /etc/mnttab. Bionic's _PATH_MOUNTED is already /proc/mounts.
Change-Id: I9407dcf22de6407c83b5fffd14fedc638586d0f9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This fixes only those that look fixable. There are a number of errors in
the online documentation that look like qdoc tool bugs, like missing
functions (operator==) and documentation text that does not exist in the
source code. This fixes:
- QRandomGenerator(System) constructor showing up
- Links for C++ reference documentation not showing up as links
Change-Id: I9e2892cb6c374e93bcb7fffd14fe21db5a6969d9
Reviewed-by: Martin Smith <martin.smith@qt.io>
It's the right thing to do, as we're in 2017, not 1997. Also, this takes
care to indicate that QAbstractSocket::MulticastTtlOption makes sense
mostly for IPv4, even though it's implemented for both families. In
IPv4, it's used to indicatae the scope, whereas in IPv6 it's stored in
bits 12-15 of the address.
Task-number: QTBUG-46046
Change-Id: I9741f017961b410c910dfffd14ffaabe0a2024d8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Instead of allocating the full backing store size for
the transparency layer, we make sure we only allocate
exactly as much as needed by the scrollbar.
Change-Id: I55c3172fe3dd2a1f3fd46828463497f9f35cb1ae
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This one fell off the truck while we were removing
HITheme calls. We add it back by simply rendering a
BLACK RIGHT-POINTING TRIANGLE character.
We also fix smaller issues, such as not displaying
any shortcut related to a submenu action — this is
simply not a thing. The spacing between the menu
item's text and the submenu indicator has also been
slightly improved.
Change-Id: I6c768a5506a5eb9528b0dd76acd52b561266d67b
Task-number: QTBUG-64405
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Fixes the fallback painting used with complex transforms to be able to
handle color bitmap fonts which can't be converted to a path.
Change-Id: Id2851607f673b8fc1aea63f92043d0cdebc0fb9d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This is necessary for WebEngine at configure time, to be able to query
which of the sanitizers was enabled in order to report unsupported
combinations.
Task-number: QTBUG-64726
Change-Id: I72f8efe4bed3e14114f885bdae16650f1f23b24b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
- Edited gettingstartedqt.qdoc
- update .pro files
- replaced snippet statements by \quotefromfile
- removed second version of notepad.h and notepad.cpp
that were made only for quoting snippets
(\quotefromfile reads from the program code)
- show current filename in header of window
- added checking routine on filename in Save method
Task-number: QTBUG-63984
Change-Id: I5298d761763a4dfeb705a1d9b77354be853ada88
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Makes sure the ARGB32PM that is painted on always have a defined alpha.
Task-number: QTBUG-55645
Change-Id: Ifcf5fcc2127d255518eca4763845a197da6c7914
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Qt requests full resolution OpenGL surfaces by default.
However, when running as a VMware guest it looks like
the OS silently creates low-resolution surfaces.
This is not possible to detect using the standard NSWindow
APIs for converting to backing coordinates or for
reading the backing scale factor. The result of this
is that Qt will incorrectly display one quarter of
the window content only.
Fall back to detecting if the OpenGL renderer is the
Apple software renderer, which it will be on VMware.
Cancel the high-resolution surface request if this
is the case. This needs to be done while we have a
valid OpenGL context.
Task-number: QTBUG-62357
Change-Id: I33bf12b3bb0408249e6d66e0a8ca86b044bea781
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
For multi text-item texts we should render the text decoration at the
same position as the text-item part is, and not always from the
beginning of the line.
Task-number: QTBUG-60422
Change-Id: I9aa58fc164122ad1fae9716b8b18bdfbbbd778a9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
In QWindowPrivate::applyCursor(), do not apply override cursors
when the platform supports QPlatformCursor::OverrideCursor.
Complements b05d1c2ebf.
Task-number: QTBUG-65001
Change-Id: Ie84cc30ad99b22e037aae829a2ce847ec4bf900f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Override cursors were not restored when nested or in a dual
monitor setups.
The default cursor stored in QWindowsCursor::m_overriddenCursor
was clobbered by subsequent calls to QWindowsCursor::setOverrideCursor().
This caused for example the wait cursor to remain active when
switching to Help Mode in Qt Creator. Add a check preventing that.
Make the variable static so that it is shared between the cursors
of multiple screens.
Amends b05d1c2ebf.
Task-number: QTBUG-65001
Change-Id: Iead5804d317f73dedd78d22c1c85c62b5349ab83
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This change allows services using QAndroidService to function properly.
A service using a plain QCoreApplication is still affected.
The original code uses postfix decrement, causing an off-by-one error in
reference counting, which, in turn, fails to properly release a semaphore.
Fix by using deref() instead, which is also more readable, and consistent
with the use of ref() elsewhere in the code.
Task-number: QTBUG-64728
Change-Id: I99b59307638d619506c594f86de6d7d202d755f2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Change 28666d167a simplified
QProcess::start{Process,Detached} by using findExecutable() instead of
using execvp, but this introduced an unintended side effect when the
PATH environment variable isn't set. It turns out that most libc have a
default fallback in that situation, which we didn't apply.
This commit applies the default directly to findExecutable(), which
seems sensible.
[ChangeLog][QtCore][QProcess] Fixed a regression that made QProcess be
unable to find executables when the PATH environment variable on some
Unix systems wasn't set. This behavior should not be relied upon since
many systems do not have sensible fallback values for PATH.
[ChangeLog][QtCore][QStandardPaths] findExecutable() will now apply the
default value for the PATH environment variable (as returned by the
POSIX confstr(3) function or found in <paths.h>) if the variable
isn't set in the environment.
Task-number: QTBUG-65076
Change-Id: I9407dcf22de6407c83b5fffd14feda6c1f509210
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Not doing so might break the connection. We have had similar
issues before, e.g. QTBUG-45312.
Change-Id: I95f15d24773fc92b052578bd72d1ba264d0a5f63
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Uli Schlachter <psychon@znc.in>
Since 5.10, QIODevice resets the error string on opening. So, we should
set the error code to UnknownSocketError accordingly.
Change-Id: I0dd314788ffc182d6837f9d06b51e41d6de59d7e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Test fails to start on FreeBSD:
FAIL! : tst_QUdpSocket::initTestCase() 'networkSession->waitForOpened(30000)' returned FALSE. ()
Loc: [/usr/home/tjmaciei/src/qt/qt5/qtbase/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp(234)]
This commit is basically a revert of the Qt 4.8 commit
a951fb79139498774d021759d0466b4b2ff50e68. FORCE_SESSION was only used by
manual testing, as the commit message said
> 8. For manual testing, added the FORCE_SESSION macro to test behaviour
> of UDP sockets when they have an explicit network session associated
So I doubt it has been tested recently.
Change-Id: Ifb5969bf206e4cd7b14efffd14fb569ebf53497b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Android Marshmellow intentionally forbids use of hard links. See
https://code.google.com/archive/p/android-developer-preview/issues/3150
However, instead of using EPERM or another error code that indicates the
hard linking operation itself has a problem but there are no other
problems, Android developers stupidly chose to use EACCES, an errno code
that only indicates permission problems.
In any case, since the call will never succeed, we shouldn't even try.
Task-number: QTBUG-64103
Change-Id: I9e2892cb6c374e93bcb7fffd14fc5d1082bd60a3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
src/corelib/global/qrandom.cpp:915: warning: Cannot find 'bounded(...)' in '\fn' qreal QRandomGenerator::bounded(qreal highest)
src/corelib/tools/qstring.cpp:774: warning: Command '\snippet (//! [qCompareStrings-QSV-QSV])' failed at end of file 'qstring/main.cpp'
src/corelib/tools/qstring.cpp:5281: warning: Cannot find 'qTrimmed(...)' in '\fn' QStringView qTrimmed(QStringView s)
src/corelib/tools/qstring.cpp:5281: warning: Cannot find 'qTrimmed(...)' in '\fn' QLatin1String qTrimmed(QLatin1String s)
src/corelib/global/qrandom.h:171: warning: No documentation for 'QRandomGenerator::System'
src/corelib/global/qrandom.h:105: warning: No documentation for 'QRandomGenerator::bounded(double highest)'
src/corelib/global/qrandom.h:84: warning: No documentation for 'QRandomGenerator::generate64()'
src/corelib/global/qrandom.h:77: warning: No documentation for 'QRandomGenerator::generate()'
src/corelib/global/qrandom.cpp:799: warning: No such parameter 'sseq' in QRandomGenerator::seed()
src/corelib/global/qrandom.cpp:1096: warning: Can't link to 'operator()()'
src/corelib/tools/qstring.cpp:8982: warning: Can't link to 'qStartsWith()'
src/corelib/tools/qstring.cpp:9203: warning: Can't link to 'qTrimmed()'
src/corelib/tools/qstring.cpp:4798: warning: Can't link to 'qConvertToLatin1()'
src/corelib/tools/qstring.cpp:4825: warning: Can't link to 'qConvertToLocal8Bit()'
src/corelib/tools/qstring.cpp:4928: warning: Can't link to 'qConvertToUcs4()'
src/corelib/tools/qstring.cpp:4884: warning: Can't link to 'qConvertToUtf8()'
Change-Id: I5c7c89b230d3d1de8a679c10833319a470a44e80
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Wacom stylus proximity detection had stopped working: it was not
detecting which type of tool is in use, so all stylus types
acted as a generic drawing stylus.
Selecting XI_PropertyEvent on a root window fixes the problem.
There is nothing in the XI2 specification that says that this
property would not be supported on non-root windows. Possibly
it is bug in the X server. Anyways, selecting XI_PropertyEvent
on a root window in this case actually is better. Property event
contains a global state information, there is nothing window
specific in it, so there is no need to select it for every native
sub-window.
It is worth noting that XI_HierarchyChanged also seems to work
only when selected on the root window (according to my testing
results). And on XI2 author's blog post about XI_HierarchyChanged
it says [1]:
"These events are sent to all windows, so it doesn't really
matter where you register. The traditional approach is to
register on the root window."
This kind of further confirms that it might be bug in X Server's
implementation.
[1] http://who-t.blogspot.no/2009/06/xi2-recipies-part-2.html
Task-number: QTBUG-64911
Change-Id: I8582675bf835239932e23f4596966dc167495e30
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The code checked on QFileInfo::size() whether the file had any content.
The check failed for NTFS symbolic links since QFileInfo::size() returns 0
for them. Workaround by using QFile::size() instead.
Task-number: QTBUG-64121
Change-Id: I303414b5a560d1ed8fbc53d969e53f9e2899ae5c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Although the items were enabled for a dialog's menubar they were not
appearing as such because Cocoa will query the menu item's target to see
if it has a worksWhenModal selector. Therefore to ensure that the menu
item will be enabled, we need to add this selector to our delegate and
return YES from it when the window for the menubar is the dialog.
Task-number: QTBUG-44584
Change-Id: Ic62dc027d563069d2f5c2b7bf9810184bd76de39
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
qwindowsxpstyle.cpp(289,35): warning: Signature is not normalized. Use void* instead of void * [-Wclazy-connect-not-normalized]
qwindowsxpstyle.cpp(292,35): warning: Signature is not normalized. Use void* instead of void * [-Wclazy-connect-not-normalized]
Change-Id: I773530452c0837c5066f9174c25ae37e57086e76
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
ApplicationInfo.dataDir holds "/data/user/0" (Blackberry PRIV running
Android 6.0.1), which is in fact a soft link to "/data/data". This
directory is used as a prefix for various Qt environment variables,
including QML2_IMPORT_PATH, which in turn is used for resolving QML
type URIs, looking up Qt Quick Controls 2 styles, and so on. The QML
engine is not happy with "/data/data" and "/data/user/0" being wildly
mixed for QML types in the same module. Use the canonical path instead
to avoid such conflicts.
Change-Id: I1fd45736728ee662942d7ef48c3fbc553981c59b
Task-number: QTBUG-64868
Reviewed-by: Lars Knoll <lars.knoll@qt.io>