Using an iterator is not a good idea since the generateInnerNode can
end up adding new items to the childrenNode list and thus the iterator becomes invalid
Without this patch i was getting this trace in valgrind
==19251== Invalid read of size 8
==19251== at 0x474350: Generator::generateInnerNode(InnerNode*) (generator.cpp:1018)
==19251== by 0x4A422D: HtmlGenerator::generateTree() (htmlgenerator.cpp:276)
==19251== by 0x4AC369: processQdocconfFile(QString const&) (main.cpp:515)
==19251== by 0x40B894: main (main.cpp:669)
==19251== Address 0x943c1c0 is 0 bytes after a block of size 32 free'd
==19251== at 0x4C2C72E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19251== by 0x51676F2: QListData::realloc(int) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.0)
==19251== by 0x51677EE: QListData::append(int) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.0)
==19251== by 0x439BAB: QList<Node*>::append(Node* const&) (qlist.h:533)
==19251== by 0x4B46B3: InnerNode::addChild(Node*) (node.cpp:1262)
==19251== by 0x4B48DC: Node::Node(Node::Type, InnerNode*, QString const&) (node.cpp:179)
==19251== by 0x4B539F: InnerNode::InnerNode(Node::Type, InnerNode*, QString const&) (node.cpp:1193)
==19251== by 0x4B54EB: DocNode::DocNode(InnerNode*, QString const&, Node::SubType, Node::PageType) (node.cpp:1608)
==19251== by 0x4C0C5E: QDocDatabase::findQmlModule(QString const&) (node.h:535)
==19251== by 0x497EEA: HtmlGenerator::generateQmlRequisites(QmlClassNode*, CodeMarker*) (htmlgenerator.cpp:2005)
==19251== by 0x4995B9: HtmlGenerator::generateDocNode(DocNode*, CodeMarker*) (htmlgenerator.cpp:1533)
==19251== by 0x474508: Generator::generateInnerNode(InnerNode*) (generator.cpp:1010)
==19251== by 0x474372: Generator::generateInnerNode(InnerNode*) (generator.cpp:1019)
==19251== by 0x4A422D: HtmlGenerator::generateTree() (htmlgenerator.cpp:276)
==19251== by 0x4AC369: processQdocconfFile(QString const&) (main.cpp:515)
==19251== by 0x40B894: main (main.cpp:669)
Change-Id: I7a6ae0a689ea5edddacf7f27f9dce95b26a441df
Reviewed-by: Martin Smith <martin.smith@digia.com>
d040681b6f added support for aligning the
test results for easier side-by-side comparison of the actual and
expected values. However, it didn't take into account multibyte strings.
That is, we would see:
FAIL! tst_testcase::testcase: Compared values are not the same
Actual (QString("é")): F0O
Expected (expected) : FOO
We use mbstowcs (multibyte string to wide char string) that calculates
the length in wide chars of the output string. That's roughly equivalent
to QString::fromLocal8Bit(string).toUcs4().size().
Change-Id: Ic2649951c50e05143da32a7fbef00a01e385c542
Reviewed-by: Jason McDonald <macadder1@gmail.com>
toHexRepresentation is used in QTest::toString(), whose results are
deallocated with free(). So we shouldn't allocate with new[].
Change-Id: I3e9d35b3f28a1b9bfe740a13b5daa414b67853c6
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
When one window loses focus because another window got it, the reason
should not be Qt::OtherFocusReason. If it is ActiveWindowFocusReason
or PopupFocusReason, any QtQuick text elements that were in the
window which lost focus will not deselect any selected text.
Task-number: QTBUG-36292
Change-Id: I4630f74e6aacd928284cedab6ed711c95b24bff7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Warning C4786 has been removed from MSVC2013.
Warning C4231 has been removed since MSVC2003 .net.
Added #ifdef statements to only suppress these warnings when the
compiler versions supports them.
Change-Id: I47d6116bc02cdeef6b2172be0b09d105af9d0059
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This makes sure that we don't think a mouse area at position 0, 0
contains the mouse on startup.
Task-number: QTBUG-36191
Change-Id: I68a8aed195531f506372ef465734661069b60f57
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Dwarf-2 is treated as deprecated (at best) by llvm, and does not support
a lot of C++ language features. Most notably, it does not support
namespaces and template parameters. By not specifying the dwarf version,
the compiler can decide which version to use.
Change-Id: Ic32f9101c4db0f06a8ace8f5e04af9236d01598e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
If XPThemeData::noContent is set to true, the SpinBox from
QtQuickControls renders with transparent background, which is being
workarounded by simply adding white rectangle inside the QQC SpinBox,
which in turn breaks other themes.
This works in normal widget's QStyle because the spinbox there
is drawn with a frameless QLineEdit, which fills the background.
Setting XPThemeData::noContent to false for QtQuick items only makes the
QQC SpinBox render correctly with Windows Vista style.
Change-Id: I3229a2582dd1cad95c77e0961aaef502a8c6159a
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Some comparison operators comparing to const char *
where not implemented correctly.
Task-number: QTBUG-34024
Change-Id: Idbdc64c8ed93e88d9f2b2f55213bc785b33cb543
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Symptom of the error is garbled text in Qt Quick 2, and the
fix has been confirmed to be enabling the texture resize workaround.
Task-number: QTBUG-34984
Change-Id: If6f621b43120c7913cbd33ab326c52ad6e2599bc
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Do not rely on sprintf_s being declared/defined. This also fixes
deployment to Windows XP.
See https://chromium-review.googlesource.com/#/c/182975/ for a similar
commit proposed upstream.
Task-number: QTBUG-36242
Change-Id: I520e2f61aeab34963e7a57baafd413c7db93f110
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Added push and pop pragma warning statements. Suppression of warnings
should not propagate to user code. Therefore, suppression of warnings
is restricted to the file where it is used.
Change-Id: Ib7973cbc0205ebbe75e002d035e44fd9b447460f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Added a define to suppress MSVC warning “C4996:
This function or variable may be unsafe.”
If the code is really "unsafe" then it is unsafe on
other platforms as well; so fixing these warnings just
for MSVC builds, would clutter the code and wouldn't help
in fixing issues that might exist on other platforms.
Using the same functions across all supported platforms
keeps the code clean and helps in writing code that is
safe across all platforms.
Change-Id: I470072eda4f8174bb911567ef3f061a3582ba449
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It need to be copied.
Task-number: QTBUG-35887
Change-Id: Ia165e6a8f9dc23733e53e11f9e1e98bf54e7dd20
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Values from different enums were compared.
Change-Id: I2faf73976e4b24abbdc915e8445256fe7a5be5bd
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
the newly added mac examples use it, so it needs to be grounded.
a more generic solution would be clearing out QMAKE_EXTRA_COMPILERS, but
many prf files will be loaded after us, possibly nullifying our effort.
Task-number: QTBUG-35680
Change-Id: I3aba7595898baac14bd41e9fae2ff24507187c6a
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
The documentation implies that cd() and cdUp() functions return false if
the new directory is not readable, but that is not the case. It is an
obvious mistake in the documentation, because cd'ing into a nonreadable
directory is perfectly valid.
Provided also with a test to verify that cd() actually returns true with
nonreadable directories.
Change-Id: I4aa3e859b35c64266df510a203574e3701aea77c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If the QPA supports threaded pixmaps, don't print out a message warning
the user about painting a pixmap in the non-main thread.
Likewise, if the QPA supports threaded OpenGL, don't print out a warning
when the user is about to paint on OpenGL from a non-main thread.
Change-Id: I5b4928ee49b1d6c1b638b036fade12dc794258df
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Data::allocate(0) returns a pointer to read-only memory, updating d->size
will segfault. The safety check for this exists in all other QVector ctors
already.
Change-Id: Ida0fe4182de56ee62c7f91e8652cfafbfd7b8410
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The normalize function don't do well it's job.
Given a path like that, the regexp "/[^/]+/.." will match 3 times
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2
[ ][ ][ ]
The second match is wrong as it will remove /../..
Use sub instead of gsub which only remove one match at the time.
Change-Id: I0657bc603e521c9e53b9f50d2481dce184b64bad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Adding std:: to pow() to make it compile for BlackBerry 10.
Change-Id: I9ab3cc626eb2ba872c09df33cdb820b50d075428
Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We get EGL_BAD_ACCESS from eglMakeCurrent() on this device, and
only on this device, so we simply work around it by disabling
the threaded render loop.
[ChangeLog][Android] Add workarounds for OpenGL bugs on Samsung
Galaxy Tab 3.
Task-number: QTBUG-34984
Change-Id: I309881f8317473ff87aea2f92d0f6f1b898342d3
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
The code assumed that CGImageForProposedRect would return a sensible
sized image, but that can return basically any size (depending on the
NSImage's image representations). In the case of the bug report this is
a 1024x1024 pixmap when requesting a pixmap of size 64x64 and larger.
Make sure that we return a pixmap of the exact requested size.
For this, themeHint must also return sizes in device coordinates.
Task-number: QTBUG-35009
Change-Id: Iaae11023bab6d4122815ca4010aab6967dfb18a0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
The front-end functions in the QTest namespace are declared static
inline, so the compiler can complain. Make it not do so.
Change-Id: I4036c85010e02ef22a8071ed05e49173dfc64729
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Since now in Qt5 the moc does full macro substitution, it needs to handle
the defines passed is command argument, even if they span over multiple
tokens, or if they do not have any token.
Example:
moc '-DCOMPLEX=QVector<int>' '-DEMPTY=' foo.h
[ChangeLog][moc] Fixed passing -D of a macro defined to something more
complex than a single identifier.
Task-number: QTBUG-33668
Change-Id: Ie8131de215f1659a24af4778d52ee40cda19759f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
The patch reduces amount of allocations during
string parsing by using QStringRef. The operation
is safe as neither QDate nor QTime uses QString as
a storage type
Change-Id: Ib9f40d86e8e420653ac4fe8ba883d554331ffc32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Qt since approximately 4.4 has set the verify callback on both the SSL
store and the SSL context. Only the latter is actually needed. This is
normally not a problem, but openssl prior to 1.0.2 uses the verify
code to find the intermediate certificates for any local certificate
that has been set which can lead to verification errors for the local
certificate to be emitted.
Task-number: QTBUG-33228
Task-number: QTBUG-7200
Task-number: QTBUG-24234
Change-Id: Ie4115e7f7faa1267ea9b807c01b1ed6604c4a16c
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Set Window usage prior to use the framebuffer.
For OpenGL windows set OpenGL usage and for
normal painting set it to native usage.
Some QNX libscreen implementations don't set
usage automatically, so we must set this explicitly.
Task-number: QTBUG-35912
Change-Id: I5154c0bcf9c65ef6d47af6a1cf8f17765ccf51dd
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Vladimir Minenko <vminenko@rim.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
The HB face caching mechanism introduced in 227e9a40cf
wasn't complete due that fact that HB-NG doesn't parse the entire
font table at once but rather references a table on-demand.
This incompleteness caused a crash in case the engine doesn't
get cached or when it removed from the cache and then re-used.
Task-number: QTBUG-36099
Change-Id: I7816836107655ce7cf6eb9683bb5dc7f892f9cd1
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Michael Krasnyk <michael.krasnyk@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
This change makes a regression.
This reverts commit a79f8a3a67.
Task-number: QTBUG-36033
Change-Id: Ibcb19cd8631f85c81433c9625bbbf280404db1c4
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
... at least not like that.
We still need to find a way for the popup to receive and process key
events on its own, instead of depending on other layers inside Qt.
This would make Qt Quick control's PopupWindow implementation much
simpler, for example.
Revert "Cocoa: Allow popups to grab mouse and keyboard"
This reverts commit a25e6528d3.
Task-number: QTBUG-35820
Task-number: QTBUG-35904
Change-Id: Ica10529308ab25938397c16b9c1e1ce6cbd8f247
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Documentation URLs no longer use module names in path. Also, the
pages discussing installation from source have been renamed.
Change-Id: I135dc527ec9170eab62b0ffd1f4a80cdd834e186
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
This otherwise crashed:
QCommandLineOotion opt("with=equals");
parser.isSet(opt);
Can't write a unit test because it produces a warning.
Change-Id: Ifc67f20bb4b16b96d93dffbe4e82e6cc8a17584d
Reviewed-by: David Faure <david.faure@kdab.com>
This header is used by qevdevmousehandler.cpp, so it's not a bad idea
to check that it exists as early as here. Apparently, FreeBSD's Linux
support has linux/input.h, so the "evdev" test was passing and then
the build would fail later.
Task-number: QTBUG-36205
Change-Id: Iab9788350a9f4c90d355524769a7a396679fd218
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
update-mime-database does not exist, so there is no point in
trying to build this test.
Change-Id: Id60f2f8fc3af33d3f7ae2fb4f1042356b60f6596
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com>
This fixes QtQuick key handling not propagating key events beyond the
specific onXPressed handlers, due to erroneously thinking those exist,
when signal spy callbacks are present.
Considering signal spies for isSignalConnected() goes back to 87239ef6 in
Qt4, and seems to be there just due to this code being based on activate(),
where this check obviously makes sense.
Change-Id: Iad41e42a8d3ee2a16a55be7d1a7cdc51484981ce
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Right now /dev/fb0 is hardcoded. This is not ideal. Therefore
QT_QPA_EGLFS_FB is introduced. This environment variable can be set to
a different framebuffer device. Once it is set, eglfs will use the
specific device. This is similar to linuxfb's fb=... plugin parameter.
The actual behavior depends on the board-specific implementations.
For now only iMX6 has real support. It extracts the index from the
device name as bind the EGL display to the corresponding framebuffer
using the vendor-specific fbGetDisplayByIndex(). Other hooks can
follow suit later on.
With this patch eglfs is at least on par with linuxfb, meaning that,
if the board supports it, different apps can run on different screens.
Task-number: QTBUG-36113
Change-Id: Ia3c88bd06e108bc668433e3c5c3fce34a5a0e73d
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
When building with debug, all SLOT or SIGNAL macros will
expand to a function call, and then function will call
QThreadData::current(), which will set
QCoreApplication::theMainThread if it has not already been
done. Since Qt Widgets has these macros in the static
initialization of the library, we would register the
Android main thread as the main thread of Qt, which would
mean that the actual application object was created on
a different thread than the main thread. This caused warnings
to appear, and also triggered a race condition which
caused widget applications to sometimes show a black screen
instead of content on startup when run with the OpenGL plugin.
Task-number: QTBUG-35048
Change-Id: Ie8979f5e7cd5662f8d7dd276de9f94f27cc120b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's common to check the Android API level at runtime to determine
what functionality is available. This change provides a convenient
way to get the Android SDK version (API level) from c++.
Change-Id: I88f65ae87e0fa8ac0affefffbd1b1bba855c9f46
Reviewed-by: BogDan Vatra <bogdan@kde.org>
storePixel<QPixelLayout::BPP32> would have been called by
storePixels<QPixelLayout::BPP32> but that function has an overload that
uses memcpy instead. So it's really unused.
Found by Clang 3.4.
Change-Id: I661804e273486d3469221fdd362a24cd77cfb8a7
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>