QDocDatabase provided a way to search for a collection node in
the primary tree only. This was insufficient for use cases where
we want to list groups, C++ classes or QML types in other modules
using the \generatelist or \annotatedlist commands.
This commit does the following changes:
- Add a function to find a collection node across all
trees, use it for generating output for the list commands
and generating C++ class/QML/JS type requisite tables.
- Modify the code for \generatelist command to accept
'qmltypesbymodule' and 'jstypesbymodule' as parameters.
- Modify constness of some functions to enable above
changes.
Change-Id: I3dbdadfd224754db4bdc1602a5ffab9d46c51f00
Reviewed-by: Martin Smith <martin.smith@digia.com>
Add some extra rotations and offsets, to show off the power of
what you can do with a single draw call. Also use QGLWindow instead
of QGLWidget. This improves performance from 23 FPS to 30 FPS on a
4k monitor with integrated Intel graphics.
Change-Id: Iedac1c14cc6057959aa15faaacdf29da91f36ab1
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Replace a lot of c strings with QLatin1String to avoid
utf conversions. Make one constant data structure static to
avoid it being recreated the whole time, and optimize our
tag replacement code.
Change-Id: I6513f3c70781a1bac658cbb3164c45d4cab36f57
Reviewed-by: Martin Smith <martin.smith@digia.com>
We get rid of the last usage of QDom and the old
xml parser in our build tools, and it makes parsing
of index files a lot faster.
Change-Id: Iccf01a4a73cc74a77806470fb4c4625f5331a7be
Reviewed-by: Martin Smith <martin.smith@digia.com>
An attribute is not allowed twice in XML. So change the
associated-property attribute, so that it contains a list
of associated properties is required instead of listing them
a couple of times.
Change-Id: Ibfb21c1a1de5ed39cda2eb29ac318bdbbf0eab4e
Reviewed-by: Martin Smith <martin.smith@digia.com>
This avoids a couple of more string/memory
allocations, giving another 5% speed gain
for qdoc --prepare.
Change-Id: I455f615bb4388d883dca5a8cd31bf50629db23e0
Reviewed-by: Martin Smith <martin.smith@digia.com>
The history state had the limitation that it was hard (or impossible) to
use when more than one default state had to be entered. For example,
using it in a parallel state was impossible without ending up in an
infinite loop.
This patch changes the QHistoryState to only have an initial transition,
and the state selection algorithm is changed accordingly. It also brings
QStateMachine closer to the SCXML standard.
The existing defaultState is implemented on top of the
defaultTransition: when used, a new transition, with the default state as
its target, is set as the defaultTransition.
Task-number: QTBUG-46703
Change-Id: Ifbb44e4f0f26b72e365af4c94753e4483f9850e7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Usually you want to use just QLocale(), and not QLocale::system(). They
are both the same except when the user called QLocale::setDefault()
beforehand.
Change-Id: I2d9b13ac3ffec0005b1d9bf661eccdea276d34b1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Rewrite QDebug operator<<(QDebug d, const QMimeData &mimeData)
to take a pointer and handle 0 values. Change the formatting to the style
commonly used in Qt. Make it static as it is not used anywhere else.
Task-number: QTBUG-47393
Change-Id: I78174e10b75769bf4acd33a894acc0a51e525c39
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reverting change 4db5d3ccd1, since it
introduced two separate regressions:
1. QToolButton would prefer text() over iconText()
2. Actions with a mnemonic would create a shortcut when added to
a tool button.
There is a fundamental problem here, which is impossible to solve
correctly: A menu item with the text "Short&cut" will create a mnemonic,
i.e. it will be triggered by pressing 'c' when the menu is open. However,
a button with the text "Short&cut" will create a shortcut that is triggered
by Alt+C as long as the window has focus. Also, iconText() is used for tool
tips, so it should not contain shortcut related '&'s.
This patch attempts to find a sensible compromise:
1. If the text is set through QAction::setText(), QToolButton will not
create a shortcut, and will not display an underline.
2. Using QAction::setIconText("Short&cut") will create the shortcut.
3. Tooltips will not show any extra '&'s when generated from
text(), but when using setIconText() directly, any '&' characters used
to create shortcuts will also be visible in the tooltip.
Task-number: QTBUG-23396
Task-number: QTBUG-47306
Change-Id: Ieea2fc569807c862ca462349bf91922a4029700f
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
There were two problems:
1. qHash() hashed FaceId::uuid, but op== didn't use it for
determining equality. Thus, x == y => qHash(x) == qHash(y)
might be broken if fileName and uuid have an orthogonal
component, if you excuse my vector analogy.
2. To hash fileName and uuid, it concatenated the two,
causing a temporary QByteArray to be created just for
hashing its contents. That prevented marking qHash()
as nothrow.
Fix by using new QtPrivate::QHashCombine and adding
uuid to the list of fields compared in op==.
Change-Id: I49f2379d514d6d3669929e737562cf6de823127e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
The sources for QSessionManager live under Qt Gui so it doesn't make
sense to include the class under the Qt Widgets doc module.
Task-number: QTBUG-47274
Change-Id: I18b58c2a274bff323c7364cebbb0429a5a3a97d6
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Using the approach we already do for some GLES 3.0 functions we can provide a cross-platform,
cross-GL-GLES wrapper for ES 3.0 and 3.1 functions too.
Applications only have to take extra care about the version requests (context version
and version directives in shader code), the rest of their code can stay the same across
desktop/mobile/embedded, even when ES 3 functions are used.
The new functions are placed to a new subclass which is placed between QOpenGLFunctions
and the internal QOpenGLExtensions. This is necessary because, unlike with QOpenGLFunctions,
there is no guarantee that these functions are always available in all configurations.
When running on desktop OpenGL, we resolve as usual. If the OpenGL version contains the
function in question, either in core or as an extension, it will all just work. This is
handy because it does not rely on 4.x extensions like GL_ARB_ESx_compatibility, and so
ES 3.0 functions will be functional on OpenGL 3.x systems too by just setting a 3.x version
number in the QSurfaceFormat.
We will no longer qFatal on broken systems where the driver returns a 3.0 or 3.1 context without
the corresponding functions present. Instead, we show a warning and gracefully fall back to
resolving as usual, via eglGetProcAddress or similar. For functions that are available in ES2 as
an extension this may just work fine.
Added also an example that runs identically both with OpenGL and OpenGL ES 3 and utilizes some
ES 3.0 features like instanced drawing.
[ChangeLog] Added QOpenGLExtraFunctions providing OpenGL ES 3.0 and 3.1 function wrappers in
a cross-platform manner.
Task-number: QTBUG-46161
Change-Id: I9f929eb61946c35c415b178c4d6ab2c1c958684e
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
A parallel state cannot have an initial state, as all children of the
parallel state will be entered. Setting such an initial state on a
QState marked as ParallelStates would already produce a warning and
ignore the initial state. Now any initial state that has been set before
changing the child-mode to ParallelStates will also produce a warning
and remove the previously set initial state.
Change-Id: Ie5fcd44b03516744f785f2d1880bf806918c44d4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This cuts away another 15% of the running time of
qdoc -prepare.
Change-Id: I81bc32fa191b73fad5d7bd27ff22ac845f83a9ce
Reviewed-by: Martin Smith <martin.smith@digia.com>
This makes generation of the index files 3 times as fast.
Change-Id: I89af86e54d932fa19330f36a33af6ed9ea81461d
Reviewed-by: Martin Smith <martin.smith@digia.com>
This method was probably there in older versions of the specification,
but it is no longer used now. The only caller was in
QStateMachinePrivate::setError, which has been changed to use the newer
methods.
Change-Id: Ic4961990d8d2c902676e63193d3f30ef427e6f0c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
The move special members were inhibited by the presence of
user-defined copy ctor and assignment operator, which we
cannot remove since the class is exported.
Change-Id: I54fe6c28351fe69ca4b75066adb76ea07c959dfe
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The types are either too large or too small for QList, which
only has acceptable performance with movable types of size
= sizeof(void*).
Change-Id: I5a2354e9400baad44095f1eac18d76ef915f6545
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Commit 5c44232122 removed
the functions, but not the docs.
Change-Id: If12ec8a268cf67c7a62ba4f523360e0c79ce63ca
Reviewed-by: Martin Smith <martin.smith@digia.com>
The move special members were inhibited by the presence
of a non-trivial copy constructor/assignment operator
and destructor. Restore them.
While we're at it, move all the special member functions
we should not have defined into an #if QT_VERSION block.
Change-Id: I873a99bfefe03e0fb02676e3431fd51f8c8f0adc
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
They do exactly what the compiler-generated ones would do,
but their presence inhibits the move special member function
from being synthesized.
Change-Id: Ib2046dbcee3c21ac3b5087f41d19e2a4a3e0a54f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Unfortunately, we cannot rely on Q_DECL_EQ_DEFAULT, so I
needed to code the special member functions by hand.
The 'reserved' field is pretty useless, since the
existing ctors didn't initialize it, but just in
case someone finds a way how to store information
in there, deal with the field in the usual way:
set to nullptr in the move ctor and swap in the
move assignment operator.
Change-Id: I15a5f61807cb67deb6e979d4f3e5a260384b20ab
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The move special members were inhibited by the presence of
a user-defined copy ctor, which we cannot remove since the
class is exported.
Change-Id: I7118588b808387f2733d93216c8c3b117666bb9e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Avoids default-constructing two QPersistentModelIndex
instances just to copy-assign to them.
Change-Id: I0f3e04e3d202f58905f74df44d37dba27911a927
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
QTextDocument::find has a behavior that is different from the typical
QRegExp/QRegularExpression behavior where finding a given expression is
always constrained by the paragraph (block), regardless of newline
characters in the expression.
Task-number: QTBUG-21785
Change-Id: Ia6a061c6feb5a19e6b8caa3d8009da5ca31ec422
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Add QTRY_VERIFY2_WITH_TIMEOUT() similar to QTRY_VERIFY_WITH_TIMEOUT()
except that QTRY_VERIFY2() is used below the loop and QTRY_VERIFY2()
based on it.
Add tests to cmptest.
[ChangeLog][QtTest] Added macros QTRY_VERIFY2_WITH_TIMEOUT(), QTRY_VERIFY2()
making it possible to output a message after the timeout has expired.
Change-Id: I587e24f3aeb73542dbf3ccb936a16f2e0806555f
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Literals 1. or 0. have type double, but QGradientStop.first is qreal and
thus can be float depending on platform/configuration, making
qBound call invalid (qBound(0., qreal_value, 1.) for example).
Change-Id: Idab668d417a148bffe2495009ae700de980b73cc
Task-number: QTBUG-47319
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Add a helper class for resolving debug symbols by dynamically
loading dbghelp.dll and try to obtain a symbol at the exception
location and a stack trace by using CaptureStackBackTrace().
The output looks like:
A crash occurred in d:\dev\projects\crashingtest_5d\debug\tst_crashingtesttest.exe.
Exception address: 0x0000000052E2853A
Exception code : 0xc0000005
Nearby symbol : QString::length
Stack:
# 1: windowsFaultHandler() - 0x00007FFE080CACD0
...
# 8: QString::length() - 0x0000000052E28530
[ChangeLog][QtTest] A stack trace will be output on standard error
if a test crashes.
Task-number: QTBUG-47370
Change-Id: I7217e02ec7dc0c96132fe84d1a175d0bed9c5aaf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Crash in qtwidgets.dll when Qt app is used with accessibility tools like
Dragon. Crash due to null pointer dereference.
Task-number: QTBUG-47093
Change-Id: I140196ba44b68dfaf229dd8a8e6031379ea1acac
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Enumeration QSysInfo::MacVersion uses a macro to define
enumeration values. QDoc gets confused about it and
prints a lot of warnings.
Adding the macro to ignored directives does not resolve
the documentation issue completely (enum values still
show up as '?'), but it gets rid of the warnings.
Task-number: QTBUG-43810
Change-Id: Ie4009646a78c62b5f1860d29855d3941e79d9388
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
User gets compiler warnings for plugins if "-Wold-style-cast" is enabled
Change-Id: I142ae2676ca7690c8e8e10c73a4007e85d8f448d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
X server may send RROutputChangeNotify event with null crtc and mode,
when it switches an output mode. Request RROutputInfo to distinguish
this case from the case when the output is explicitly disabled.
Change-Id: I4c2356ec71dbcc8013009ea8a6f46dd11f19d6bb
Task-number: QTBUG-44158
Task-number: QTBUG-46786
Task-number: QTBUG-46822
Reviewed-by: Daniel Vrátil <dvratil@redhat.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
On my system, this fixes the misbehavior of Qt applications when the (only) active screen is
switched, e.g. from an external screen to the laptop.
This behavior is caused by the screen() of widgets to be set to NULL when their screen goes away.
When a new screen comes online, the widgets *should* be told about it, but they are not. The only
place that "maybeSetScreen" is called is when an existing screen changes its geometry, but not
when a screen gets enabled without its geometry being affected in any way (e.g. because it was
just disabled via xrandr, but has been connected all along). This makes sure that "maybeSetScreen"
is also called when a screen gets enabled.
Task-number: QTBUG-47041
Change-Id: Ic72d6beaa544bf9a4efdbea0830b1bc0d6ce5362
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
These macros are not defined unless a desktop or standalone SDK is
installed.
Change-Id: I4c600ddca5944cc5fde310e4fbe0866a7250d36b
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
On Ubuntu 14.04.1 LTS, a file /etc/profile.d/appmenu-qt5.sh appeared,
exporting QT_QPA_PLATFORMTHEME=appmenu-qt5 (application menu theme plugin).
This caused QGenericUnixTheme::createUnixTheme() to return an
instance of QGenericUnixTheme by theme name instead of the appropriate
QKdeTheme, QGnomeTheme.
Fix this by always appending the generic theme name to the list
of available themes and returning it only if the name matches.
Qt 5 applications will now appear correctly themed on Ubuntu,
including theme icons.
Change-Id: I68fcd80a620b74e2af73e938253dba9933816336
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
LGPLv3 refers to it but does not include it in its body.
Change-Id: Ib056b47dde3341ef9a52ffff13eed18cf3504738
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>