As OpenBSD ships its own X11, linker errors occur when not explicitly
adding the X11R6/lib dir to rpath dirs.
Change-Id: I75991e9d7de115d2d212a017d9c8f9aa93cecc27
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
When replacing each copy of one text with a copy of another, we do so
in batches of 1024; if we get more than one batch, we need to keep a
copy of the sought text and replacement if they're part of the string
we're modifying, for use in later batches.
Also do the replacements in full batches of 1024, not 1023 (which left
the last entry in an array unused); marked some related tests as
(un)likely; and move some repeated code out into a pair of little
local functions to save duplcation.
Those new functions can also serve replace_helper(); and it can shed a
const_cast and some conditioning of free() by using them the same way
replace() now does. (There was also one place it still used the raw
after, rather than the replacement copy; which could have produced
errors if memcpy were to exercise its right to assume no overlap in
arrays. This error is what prompted me to notice all of the above.)
Added tests. The last error proved untestable as my memcpy is in fact
as fussy as memmove. The first two tests added were attempts to get a
failure out of it. The third did get a failure, but also tripped over
the problem in replace() itself. Added to an existing test function
and renamed it to generally cover extra tests for replace.
Change-Id: I9ba6928c84ece266dbbe52b91e333ea54ab6d95e
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Also skip doing a += 0 when we had to test whether the relevant rhs
was zero anyway (because we want to ++ there instead of +=ing).
Change-Id: Ibd5f21eb9aaf410b09c9db8450b2d61618e628fc
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
In Qt, null QStrings compare equal to empty ones, so add an explicit
check that the corresponding hash values are identical, too.
Ditto for QByteArray.
Change-Id: I190fc95a765305928d9b6b0e4955433865b6b247
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QScopedPointer deletes with delete, but a pointer returned from
new[] needs to be deleted with delete[].
Fix by using QVarLengthArray instead of QScopedPointer(new TCHAR[]).
Change-Id: I2f1f252379a9ac1ee919901b5efcec9cec31261e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The default ctor never initializes m_nstz but calls init with
[NSTimeZone systemTimeZone].name. Init (re)sets m_nstz _only_
if this ianaId is in [NSTimeZone knownTimeZoneName], which is not guaranteed
(a good example is "US/Pacific" that can be returned by systemTimeZoneId() -
the similar problem is described in [*]. Set m_nstz to nil in ctor,
so if 'init' fails we still have a valid (nil) pointer.
[*] http://stackoverflow.com/questions/19819268/convert-ios-localtimezone-to-a-knowntimezone.
Task-number: QTBUG-54330
Change-Id: I68917926350aad3158d44a06f06721f25b3fdb74
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The const qualification prevented toUpper() etc from
calling the rvalue overloads of the corresponding QString
functions. Since resolved() always returns a non-shared
object, the rvalue overloads can re-use the object's
capacity for storing their result, saving up to one memory
allocation per QStringBuilderCommon::to*() invocation.
Change-Id: Ica97fcd906cdd949ffe56055654578b93407e2d3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Because the QMenu::aboutToShow() signal is emitted
way after -[QCocoaMenuDelegate menu:updateItem:
atIndex:shouldCancel:], we miss the opportunity to
attach the submenu to the menu item.
The solution is to track the "open" state of the
NSMenu. Then, if any submenu item gets added while
the NSMenu is open, then we immediately attach the
native item to the menu.
Change-Id: I1f3a84ed3832520344da07e06cb3483ad6bd4ffd
Task-number: QTBUG-54633
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
It is possible for a screen to be disconnected while it is doing an
update of the available screens. Therefore before returning the pointer
to the screen then it should be rechecked that the index is still within
the range of available screens.
Change-Id: Iaa08070e79a72cb309d8a24cea786a5dccf6b719
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Formatting of values needs to be fast since QTestlib always
pessimistically formats the values passed to QCOMPARE even if
they match.
Speeds up tst_qrect by factor 1.5..2.
Task-number: QTBUG-38890
Change-Id: I3627db77a305a46c1d51a14c04b88db8018faa60
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
when qtbase is configured with -fontconfig and -system-freetype.
This fix is necessary after 060e0f6628.
Used the same approach as in 16864c42d6.
Change-Id: Idece0dc11d89e38266c95de1769be751c06324ef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
When QAccessible::uniqueId was called, it would call QHash::key(),
which has linear time performance. This can cause application
slowdown if a big number of QAccessibleInterface Ids have to be found.
The patch adds an additional QHash to keep track of the inverse
relationship from QAccessibleInterface pointers to their Ids.
Change-Id: I975e3dc0e6c628e2ea701323d8b87184ad133cfb
Task-number: QTBUG-54491
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
On OpenBSD, the system compiler shipped is still gcc 4.2.1 but for proper
C++11 support in Qt, QtCreator and Qt-based projects we need to use
the compilers provided in ports/packages which have the binaries renamed
to eg++/egcc. Therefore, redefine the variables from g++-base.conf to
use the newer compilers.
Change-Id: Ic8ea1c5d2c2c0263dad5ae85c8c747bcd3985b7d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Non-top level raster windows still have screen windows associated
with them though they are not intended to be visible.
This causes problems if they have children (as they do when QGLWidgets
are used) since their children will also not be visible.
So, if we have a window with a parent, force them to post but set the
transparency to discard so they remain invisible.
This allows the example hellogl_es2 to run correctly.
Change-Id: I67e24dc59b29ce789376498c2477349fa50020e1
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
I don't think fae8ee8b42 was enough. I've
started getting small fonts in Qt Creator under some other
circumstances.
Change-Id: I1cc7601489634e96833cfffd1456caea823aa84a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This is always true on the versions we currently support.
Change-Id: I1aecbbd1f41e0f4f03b380358cd762ca00bb1e97
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The condition
iconType != kGenericApplicationIcon
is never false, therefore we will never execute
the else statement. Consequently, overlyaIcon
will always be null.
This was triggered by the deprecation of
ProcessSerialNumber related APIs since 10.9.
Change-Id: If9eec1d2cc6e7e5b0c5323d4550f0c823a5eb0d8
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
QLineEdit::setText() emits QLineEdit::textChanged(), which is
connected to QComboBox::editTextChanged(). When a user slot
connected to editTextChanged() sets QComboBox::editable to
false, the line edit will be deleted in setEditable() and
when control returns to QComboBoxPrivate::setCurrentIndex(),
the formerly non-null 'lineEdit' has changed to nullptr,
leading to a nullptr dereference when attempting to set the
completionPrefix on lineEdit->completer().
Fix by re-checking 'lineEdit' after returning from the
QLineEdit::setText() call.
Add a test.
Task-number: QTBUG-54191
Change-Id: I94154796cfde73fb490f8471c48b9d6f62825a92
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
These expressions only work because they contain no non-parenthesized
commas and an int literal is last.
Fix by wrapping only the integer literal in Q_(U)INT64_C.
Change-Id: I6b8e508b6c7c022f4b3342f65c26aab89ce17702
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A static_cast never returns nullptr unless its argument
already was nullptr. But we dereferenced 'event' already
by the time we reach this code, so the if is always true.
Fix by removing the temporary variable.
Change-Id: Ia869d37eda74f0bcdd616e1f57f429cc86e9e525
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
sync() is unconditionally declared in the QGuiApplication header, but
the definition was under QT_NO_SESSIONMANAGER guards.
This commit moves the definition of sync() outside of
the QT_NO_SESSIONMANAGER guards, since the sync code has nothing to do
with session management.
[ChangeLog][QtGui][QGuiApplication] Fixed a bug that would cause
QGuiApplication::sync() to be left undefined for Qt builds without
session management support.
Change-Id: Ieb46f7c90c9193e89469126170117d9df672f4cb
Task-number: QTBUG-51703
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If a palette is set on the application object and the user does
something to trigger a theme change, i.e. connects via remote desktop
or logs out and in again, then it will cause Qt to render incorrectly.
Therefore we should only update the palette from the new theme if we
don't have our own already set.
Task-number: QTBUG-52962
Change-Id: I4e2288efd82ad98b698cc09f26ad188064ec7b2a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Otherwise, float numbers are formatted using a decimal comma
in German, causing huge diffs and failures.
Change-Id: Icd85a293d0564cac6be244eb0793611920d0c89c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
FreeBSD < 10 doesn't have the LLINDEX macro either in net/if_dl.h, so besides
OpenBSD yet another condition to declare the LLINDEX macro for systems where
it isn't present does make it more complicated than replacing its usage with
the actual code.
Change-Id: I7e8ef3e265564526e05ec3115f9fa765d399f045
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
1) In general it's unsafe to let exceptions propagate through Qt code,
so document that.
2) Add a note that overriding notify() makes sense only in Qt 5, in Qt 6
it's going away.
3) The advice applies also to applications not using QApplication, but
just QCoreApplication.
Change-Id: I4f6e74c53da757faf2eeaa9de226ceba55c52536
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
(QT_VERSION % 0xffff00) is useless for now, as QT_VERSION < 0x1000000
(for now). The author of this code probably meant to use bitwise-AND.
But even that is unnecessary as the right shift discards the lower 8
bits anyway.
Change-Id: Ie585843cfb684bc3b6e3fffd145d533b05288dfc
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
... and reject invalid ones. There was one error: we accepted schemes
starting with pluses, dashes and dots.
Change-Id: Ie585843cfb684bc3b6e3fffd145cfe12227ec4ad
Reviewed-by: David Faure <david.faure@kdab.com>
This fixes the 2. of QTBUG-52108
Change-Id: Id887f470c7822f6b264d6b739e8658d9809f6609
Task-numer: QTBUG-52108
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
If QMainWindow::GroupedDragging is enabled and there are QDockWidgetGroupWindow,
we should still show actions for these QDockWidgets in the context menu
Addresses point 4. of QTBUG-52108
Task-number: QTBUG-52108
Change-Id: I11ae401c4fe15e213b0f26e7579634e2062e953c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This will allow dropping of files from Qt applications to applications
like Skype, which only accept "text/plain", but not "text/uri-list" or
"text/x-moz-url".
Task-number: QTBUG-53238
Change-Id: I01bca5c8e20647cedfc9323f542ab07f0cc48658
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
A Qt5 program writing a null QTime() using setVersion(QDataStream::Qt_3_3),
and then a Qt3 program reading that, would lead to a weird QTime,
with isNull=false, isValid=false, hour=1193, minute=2, second=47, ms=295.
This commit restores interoperability, by writing out the expected value
(0) for a null QTime rather than the -1 value used by Qt4 and Qt5.
Change-Id: Icde468a8f6fc9434ef7018296725819b44d672af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Be explicit on how to check whether parsing succeeds.
Change-Id: I44f408cb6e5a830826b84dfb3a8af331f03e58cc
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
NetBSD is heavily dependent on using rpath, so we need to add the
lib dir QMAKE_LIBDIR and QMAKE_LIBDIR_X11 to QMAKE_RPATHDIR
explicitly to avoid linker errors. See http://www.netbsd.org/docs/elf.html
for more info.
Change-Id: I225143d5e2d9a125060b14e3a8a7953927d63b33
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
1) To describe a protocol version we should use an "ordinary" name,
not use the values out of the QSsl::SslProtocol enum.
2) Say that we support the latest stable TLS version (1.2, not 1.0).
3) Fix a statement about which protocol is the default one.
Change-Id: I18732914d55060a0c3920f7082f986c262a71ded
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
10586 reflects Update 1, which is the mininum supported version for many
months, hence reflext this in the manifest template as well.
There are additional features (like drag and drop) which require and
even later SDK version. However, they do not reflect the minimum.
Change-Id: I6d71dc499c928ed98c8a25283e0b53994317bb00
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Restore code path returning the resource pixmap for platforms
that do not have themes in QCommonStyle.
Amends change b657496a0b.
Task-number: QTBUG-54425
Change-Id: I764408622b825b86afbe7ccf37e1498d3efb3850
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
It could be reached when QT_BOOTSTRAPPED was defined.
Change-Id: I632d6f908a3bcbde81a6ebbadcaf2800dfe1449d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>