Replace substring functions that return QString
with corresponding functions that return QStringRef.
Change-Id: I3c485f89352a1ee66076fba74fd486da9349c354
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This is a runtime setting, as the user's freetype version can differ from
the developer's, and freetype already safely handles it internally when
not available.
Task-number: QTBUG-55345
Change-Id: I26e73728196d60ae26e5f1919ecd0dadac393890
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
As per Core Foundation ownership conventions, we
should release 'source', which is a copy, and not
'langRef', which is a reference. This has shown
to lead to crashes in some occasions.
Change-Id: I2e59b8d62aac13bc60dc013c1ea621850132c719
Task-number: QTBUG-48772
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Instead of guessing which styles we have available (always bold/italic)
register the ones we actually find.
Change-Id: I57380d0417411456a3037f8769440e7b43517e0e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Since headersFrame is a reference to a vector's element, clearing this
vector before accessing headersFrame.flags is not a good idea, must be
done later.
Change-Id: I80eee0761ac1cad580e979be9371ec7588a694ac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Setting END_HEADERS flag on a HEADERS frame means we do not have
CONTINUATION frame(s). So do NOT set it too early, only if we
fit into a single frame.
Change-Id: I891a2db227cee59e4eacfe7c2f18b431cd85fe47
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Use Q_NULLPTR in all public headers
Task-number: QTBUG-45291
Change-Id: Ib294deb3c210a9a186448cbf9656af7a09fea2c1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
... and mark the library with QT_NO_FOREACH.
Change-Id: I4924f1419f470b5fa92bb2f3fdefa745b65957f7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Fix the occurrences where the wrong classes are mentioned.
Change-Id: Ia291af77f0f454a39cab93e7376a110c19a07771
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Change-Id: I5a6937545561c51add0d48a618b1921cf9201c4b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
NSMenu has autoenableItems set to true by default, and
we keep it this way in Qt. This means that NSMenuItem's
enabled property is basically ignored and therefore
QCocoaMenuItem::syncModalState() is wrong.
What is also wrong, is syncModalState()'s name in both
QCocoaMenuItem and QCocoaMenu. Indeed, this function's
role should be to ensure that the enabled state is
properly propagated down the menu hierarchy, whether
the reason is being in the context of a modal dialog
or the parent menu having been disabled by the app.
Notice that the latter case is specially needed when
a menubar menu is explicitly disabled.
Therefore, we introduce a separate flag for the parent
enabled state in order to avoid polluting the app-set
enabled state flag. This is done in both QCocoaMenu
and QCocoaMenuItem.
In the case of QCocoaMenuItem, these two flags define
whether an NSMenuItem is enabled state conjointly, and
set from -[QCocoaMenuDelegate validateMenuItem:]. The
rest of the logic remains as before. Similar logic is
used in QCocoaMenu::isEnabled().
In addition, the presence of the second flag allows us
to show disabled submenus in the same fashion native
Cocoa applications do. This means, the submenu item
itself remains enabled, allowing to show the submenu
popup where all its menu items will appear disabled.
Bonus change: merged all the bool flags into a bitfield
and made the compiler happy about the ivar reordering
in QCocoaMenu and QCocoaMenuItem's constructor.
Task-number: QTBUG-54698
Task-number: QTBUG-55121
Change-Id: Ie156cb3aa57a519103908ad4605f7b43c57e5aef
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Change-Id: I619ef88ea05a6bcfb6908dc18d9de7daa9113392
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
These auto tests were trying to not create native dialogs, but setting
the QFileDialog::DontUseNativeDialog option is too late to control the
creation of the platform helper. It is already created at construction
time, unless Qt::AA_DontUseNativeDialogs is set.
Task-number: QTBUG-55276
Task-number: QTBUG-55281
Change-Id: Icf474e97059ac03a5fa01bd3a17f07203da5770a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
No matter if Qt::AA_DontUseNativeDialogs was set, both QFileDialog and
QColorDialog were always unconditionally creating the platform helper
at construction time:
QFooDialog()
-> QFooDialogPrivate::init()
-> QFooDialogPrivate::platformFooHelper()
-> QDialogPrivate::platformHelper()
Only QFontDialog had the platformHelper() calls guarded with
canBeNativeDialog(). => Move the canBeNativeDialog() check inside
QDialogPrivate::platformHelper() where the platform helper
instance is created.
Task-number: QTBUG-55276
Change-Id: I84b595fbd009c70a3a1976ddbb32a835270c5203
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Even though GtkColorChooser provides a "color-activated" signal, it
does not get emitted whenever the selection in the dialog changes, but
only when a color is activated in a sense that the dialog is accepted.
Switch to the "notify::rgba" signal to get proper live notifications
of the selection changes.
Task-number: QTBUG-55298
Change-Id: I39ab798764c8b42a998d75c56605948eaf154dcd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
A workaround for the missing currentFontChanged() signal was added in
130f43c. Now we can remove the improper emission on accept, because by
using the "notify::font" signal gives proper notifications whenever the
current font selection in the dialog changes.
Task-number: QTBUG-55298
Change-Id: Id9a4f32a92f0be8f466a0a0587bb2acd4c9056f7
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
plugins.qmltypes should never be built into resources, but always
deployed on the file system so Qt Creator can read it.
Task-number: QTBUG-52297
Task-number: QTBUG-52299
Task-number: QTBUG-52940
Change-Id: Ieadb82bcb71dd4fb769fa0b7d15ec74e12ce7b42
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The DirectWrite font we get when converting the GDI font
does not respect the stretch we have set, as this is an attribute
of the text layout in DirectWrite and not the font description.
To compensate for this, we scale advances and glyphs in the
engine if the stretch is different from 100%.
[ChangeLog][QtGui][Windows] Fixed stretch when combined with either
no or vertical hinting preference or a device pixel ratio different
from 1.
Task-number: QTBUG-54494
Change-Id: Icc06d1457191782d1a281c99da2da3081a82c542
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
QImage may have a null d-pointer, and convertToFormat_helper was the
only method not protected against it.
Change-Id: Ibfe5b139e3922f2a0c8284c6ae1932c2150efc66
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The Parallels 3D hardware acceleration does not seem to play nice with
Qt Creator when switching between tabs that have OpenGL Qt Quick Content
and those that have just raster widget content. QWidgetBackingstore has
the ability to switch how content is flushed depending on if the
SwitchableWidgetComposition capability is available. Previously for XCB
it was always enabled, but should be disabled when using the GLX
integration for the Parallels VM.
Change-Id: I42e41456e0873f6780f5d0333dbfaaf8fcce4a5e
Task-number: QTCREATORBUG-16742
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The platform is not supported since Qt 5.7
Task-number: QTBUG-55331
Change-Id: I3a6027661c2d597158999fe9665e76b1db18a9de
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
They were masked by the pointless user-defined copy special member
functions, which we cannot remove because it would change the way
the iterators are passed by value into functions, on some platforms.
Add a reminder for Qt 6 to fix the issue for good.
Change-Id: I039093894db4a4e5e4bbf94fb346fd90311316c0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- add Q_DECLARE_TYPEINFO for types held in Qt containers (incl. QVariant)
- port Q_FOREACH to C++11 range-for
- port uses of inefficient QLists to QVector
Fixes errors pointed out by my tree's static checks.
Change-Id: I7176b4b12ed47ed23166857bd127c459ea2a48d5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The only difference between the sample widget sets was:
- widgets << new QLabel("TESTING TESTING");
+ widgets << new QLabel("<b>TESTING TESTING</b>");
I chose the latter, because it's the more complex example
and neither the hoverColors nor focusColors tests suggest
the boldness of the text matters.
Part of port away from Q_FOREACH.
Change-Id: I9a928de4e781b96ad00a8c9515977c35ebfa6c24
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Defined out-of-line, not exported, not used anywhere in QtGui,
so it can be removed.
Change-Id: Ib049bad7d02e5412c063965cd81c8d95e1c1c183
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The clientRect might be empty when creating a window of zero size. The
side effect of a division by zero is that matrix transformation fails
and hence the swapchain gets into an invalid state.
Change-Id: Idbaed72deadb7b87052ac27e194a40d1810e6f7a
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This allows overriding the INSTALL_ROOT with the Xcode generator.
Change-Id: Ifb894bdbf9764918f76428fb32d9af68914853f6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
These tests use helpers, which are not supported on UIKit platforms.
Change-Id: I51447754dba2cd2547be05c3767e4ff3b6b5a671
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This example uses QProcess which is not available on UIKit platforms.
Change-Id: I126d20369ccf307579a60956de7769e92e17548a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This fixes the examples build on UIKit platforms in
examples/dbus/pingpong where there are two Xcode projects and the build
therefore cannot disambiguate between the two.
Change-Id: Ic8b808c1ddf3565bb9861a487eab6854ec177184
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
qtPrepareTool() must be called outside a build pass, as it protects
against concurrent wrapper creation by omitting it during build passes.
Change-Id: I7cf080cf78d1099e4893a204ea40d8c6bc63af58
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
MakefileGenerater::Compiler is larger than a void*, so holding
it in QList is horribly inefficient.
Fix by using QVector instead.
Change-Id: I9ea173271caf9b4995d311c3864c6967da049380
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
It's empty, but non-trivial, thus preventing move special member
functions from being generated by the compiler (now that qmake
is compiled as C++11, too).
The default ctor was also empty - removed, too.
Change-Id: I714db524f681f1fc250d21926245757e97351e87
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Has a few too many fields for defining a member-swap
(which would be required to mark it shared).
Change-Id: Iecbeec9e60a9884cb4a984c58cb192918cef799d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Fix warning:
QtCore: WARNING: qtbase/src/corelib/kernel/qdeadlinetimer_p.h does not have the "We mean it." warning
Amends change 12eacc3bab
Change-Id: Ibb8fd25cee0249380996ae271200055e131d359b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Prevent events being received on the widget during its destruction
phase.
Task-number: QTBUG-55112
Change-Id: I0d990fc69eee06b7e5af3845aa3f7627e3e3d5b9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Explain in terms of CSIDL_ values and update the sample locations.
Task-number: QTBUG-55065
Change-Id: I15ddf32555d43cffae66d98c6ac12d62a98d5e6d
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
It seems there is a configure test which should enable it.
This reverts commit 7e4f0ad961.
Change-Id: I39c594e5e779732d2f5954b42e266a1eaa1be3f0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
When adding color font support to the Freetype engine, we added
a special case to some functions based on the assumption that
color fonts do not contain the latin alphabet. The reason for
the assumption is that color fonts are currently most popular
for emojis and the most popular ones on Linux did not contain
the latin alphabet. But there is nothing special about color
fonts making them less likely to contain latin characters
than other fonts especially made for non-latin writing systems.
If we want an additional fallback when the x character is
not available, this should be implemented for all font engines
and font types.
Change-Id: I1c4aa28d49c38ba7a416c1cae50a1d1c09cbda41
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: jian liang <jianliang79@gmail.com>
The short-cuts in qdrawhelper's qt_alphargbblit_argb32 expects the
alpha value of the A32 glyphs to be 0xff.
Since the alpha value is not otherwise used, set it to that.
The reported image format is also changed to RGB32, matching
coretext and windows fontengines, and expected by the OpenGL
paintengine.
Change-Id: I0873156d716566f7f1634249155b6c9983a3d0de
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Due to how invalid model indices are handled in Qt, child() is unsuitable
for general purpose usage. In particular you can never get a top level
item in the model because the root model index by definition hasn't got
a pointer to the model it belongs.
That makes child() useless for anything but tree models (and even there
you'd need to special case your code anyhow).
[ChangeLog][QtCore][QModelIndex] QModelIndex::child has
been deprecated due to its lack of generality.
Use model->index(row, column, index) instead.
[ChangeLog][QtCore][QPersistentModelIndex] QPersistentModelIndex::child has
been deprecated due to its lack of generality.
Use model->index(row, column, index) instead.
Change-Id: Ice73c17133aaf71355fa2af1eacfe64da01bd456
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>