Change childWidget->windowHandle() to childWidget->internalWinId() in
q_createNativeChildrenAndSetParent() to determine whether should we call
childWidget->winId().
This is because in some circumstances Qt will crash due to accessing
deleted QWidgetWindow object if we use windowHandle(). Think about the
following scenario:
1) create a widget A without parent and add two child widgets B and C to A
2) create a native widget D as the child of B, note that when we set
Qt::WA_NativeWindow attribute to it, its QWidgetWindow will be created
which means its windowHandle() is not null.
3) create a top level widget E as the child of C and show it. This will
make Qt call createWinId() to A and then
q_createNativeChildrenAndSetParent() will be called to create A's native
children recursively and finally make D's QWidgetWindow object become a
child of A's QWidgetWindow object. Please note here that B will not become
a native widget just because at that moment windowHandle() of D is not
null and Qt will not call winId() to its parent B
4) Set A's parent to another widget which has been shown, setParent_sys()
will be called to A and then Qt will call destroy() to A. in destroy() Qt
will try to call destroy() to its children recursively with a condition that
the child has Qt::WA_NativeWindow been set. But D's parent B is not a native
widget right now so B and D is not destroyed. Qt will then deleted the
QWidgetWindow object of A, since E's QWidgetWindow object is a child of
A's QWidgetWindow object, it will also be deleted. Now E hold a deleted
pointer of QWidgetWindow object. This is the source of crash later.
Task-number: QTBUG-35600
Change-Id: I97a20a68e626ee62b15bb4eae580e26f8948923b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
QtWayland uses QtWaylandScanner to generate c++ files which will be
subclassed. This works ok in QtCompositor as it implements the pimple
pattern. However, QtWayland has to expose a library called
QtWaylandClient as a way to create specialized wayland plugins. These
classes don't promise an ABI, and has limited API guarantees, so they
subclass the classes generated by the QtWaylandScanner directly. For
this library to be possible, we have to install the generated files.
Also, it should be possible to use the private API, and that's not
possible without the generated files.
Change-Id: Id55200fe23652587390dabf84ca846e4f39cf70e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Then it's possible to embed native cocoa widgets without crashing.
Task-number: QTBUG-35629
Change-Id: Ic212c36178282b4d090c6ce0470012adc8e0c2bb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
- thread was duplicated
- x86 & ppc are obsolete and don't actually do anything
- incremental was just plain nonsense (it does something entirely
different, and it's better to hide this "feature" from public view)
- resources is basically an implementation detail (it's on by default if
qtcore is used)
Change-Id: I9163af6e8db7988382ccf993d4be280f7faec1f2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
while the dependencies in the manual projects are crappy anyway, it is
still worth to cover the case of the user changing the install paths.
Change-Id: I0a7ca5c8ba660c689d6d7af6b65d878390d6456f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Done-with: Leena Miettinen <riitta-leena.miettinen@digia.com>
Change-Id: I1e031402bc3d857cf29782957e5340e3c82f1ed2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
When we get a WM_CHAR message we do not need to add anything to the key
map as these messages already contain the character code in question.
Task-number: QTBUG-35532
Change-Id: If73993cd873b7c616876b9ba52ceba6b27a6a7b1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Task-number: QTBUG-34749
Corrected link to drag and drop example.
Corrected link to {mandatory fields}
Created target referring to macros for defining plugins
Change-Id: I387a2d9bab428b2eacd8d371f08c72f42f7e2be2
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Do exactly what windows font database does to determine
writingSystems in case of non-truetype fonts.
Task-number: QTBUG-13585
Change-Id: I4a1a48d74c36e403c31f20847cf80295d89a34bc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Most devices that use tslib have the device path defined by
the TSLIB_TSDEVICE env. variable.
Change-Id: I89fc17cb2c7fba7741de2fd348aacd608cb21a2a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
For the linuxfb platform the screen was registered
before its geometry was calculated resulting that
the qpa controller will deal with a screen instance
that has geometry of QRect(0,0,1,1) .
This masks pretty much all the painting and the input.
The fix is to call screen init before registering
the screen instance to the qpa controller.
Change-Id: If84daca6587dc368301b578cdbf7b2a65a56a5b5
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
QMacPasteboardMime is a public class in Qt 4. Qt 5 has
two copies, one public QtMacExtras and an internal
one in the cocoa plugin. This causes a symbol collision
when building statically.
Rename the internal copy to QMacInternalPasteboardMime.
Task-number: QTBUG-35310
Change-Id: I891787b451a0b342ed85aa7196e606bc11623e21
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
The QVarLengthArray inside qlocale_blackberry.cpp was being preallocated with
512 bytes, that means internally it could grow up to 512 bytes using the
stack before switching to the heap, but its actual semantic size was still 0.
After qt_safe_read(... buffer.data() ...) was being called, data was written
to the QVarLengthArray buffer, but its semantic size was still 0, since it was
not resized or anything. This triggered an assertion when buffer[bytes] = '\0'
was assigned, since 'bytes' > buffer.size() ( == 0) despite buffer.capacity()
== 512.
Change-Id: I5503ee9b02413794f67730700fba05a4c194d465
Reviewed-by: Mehdi Fekari <mfekari@blackberry.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
- Explain that values() is unnecessary and causes an extra copy.
- Replace "are fastest" with "are faster".
- Briefly explain the snippet.
Change-Id: Iff1d3a0b6140fca1d78157aeeca3d538c4d78b84
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It is annoying that HB maintains binary compatibility but does not
really care about source compatibility.
Change-Id: Ife7b011919f28527b77858ad8398fe723c65b1b3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Windows 7 and later have LOCALE_SSHORTTIME, which is what we need.
Task-number: QTBUG-33718
Change-Id: I4c3f113d17102a37fb752de56f06b312f27c7887
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Using "default" means "reset to default compiler settings", not "revert
to command-line settings". And even if it did, it's possible some other
headers by the user toggled the settings. We shouldn't affect that.
Task-number: QTBUG-35622
Change-Id: If7c4bd0cc8c210f88ee89e3fa2dd3b7194ad77bb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
When using the visual studio generators, a moc parameters file
for each configuration is generated. The content differs because
the -DQT_NO_DEBUG may be added or not, depending on the configuration.
Change-Id: I52eae536289d451df72df2e4dba709851279694a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Window buffers are currently always created with an alpha channel when
the underlying display supports them. This is the correct thing to to
in order to support translucency. However, the cost is that the
composition manager unconditionally performs blending even when the
use-case in the GUI doesn't make use of it. That is rather expensive,
particularly on hardware which doesn't have extremely efficient
dedicated 2D blitting hardware.
This patch adds inspection of the user's requested window format
and--if no blending is desired--sets an additional Screen window
property which permits Screen to skip blending on the window surface.
Change-Id: I83c100a351a00ef0e8bea1b1d1fec10b7218d1de
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Frank Osterfeld <frank.osterfeld@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Prevents derefence of freed QNetworkConfigurationPrivate pointer in
QConnmanEngine::getConfigurations().
original submitter: Jakub Adam <jakub.adam@jollamobile.com>
Change-Id: Ib915c5a68aeb3196c6ac91c96338ebee9dad30b6
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This allows QNetworkAccessManager::get(..) to make a connection,
instead of failing.
Change-Id: If5af707f7e67946357f5530cac724b223441116a
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
_QNX_SOURCE needs to be defined in order to ensure posix_fallocate gets
declared by the toolkit header files.
Change-Id: Id60fcf9be3c672bd399c4b71541dfa0fcc4060af
Reviewed-by: Frank Osterfeld <frank.osterfeld@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
This will tell QtQuick.Dialogs not to use native windows for dialogs.
Change-Id: Ie2e5878b84a9597e1f730d2cb1ebe2f59be6bc75
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Check q->isTopLevel() before calling setBackingStore() in
QWidgetPrivate::create_sys() to prevent QBackingStore leaking. This is
because QWidget::setBackingStore() will return if isTopLevel() is true and
the newly created QBackingStore object will be leaked.
Change-Id: I2777acd4c317d5019f5b266feae005042026b8be
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Clear custom paper size flag in
QWin32PrintEnginePrivate::updateCustomPaperSize().
Breakage introduced by 3396ba5612 .
Task-number: QTBUG-35500
Change-Id: I7e7708444cd7201af35e0f5d9b16d6c73fee77f6
Reviewed-by: John Layt <jlayt@kde.org>
No need to tie the debug bit to OpenGL 3.0+. xcb is correct
in this respect, let's correct the windows plugin too.
Change-Id: I13ea48de067d3fb61575be8f71b97bb547d8eb02
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
We can't rely on QGuiApplication::topLevelWindows containing top level QWidgets,
because they only exist as actual windows once QWidgetPrivate::create_sys is
called. Thus, make sure to send notifications to all top level widgets, if a
QApplication is being used.
This reverts commit f82ed5b3e30282bb8dc1da321a0d04ad4d463e59.
Task-number: QTBUG-35589
Change-Id: Iac517089af1c22f20094ba6e185d5ed44ebe3d6f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Behavior differs depending on whether the iterator is a value_type*,
or a different class entirely. Ensure that the correct behavior is
used when copying.
Task-number: QTBUG-33997
Change-Id: Ib6db2a3c4a5aa861b851833a7f0ecb855a3e828f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This struct is a specialization for the case that the const_iterator
is a pointer to the value type. Reflect that in the type name.
Change-Id: I0a4ac03840658056285080860baec8313746c71c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>