7#include <QtGui/qwindow.h>
8#include <QtGui/private/qwindow_p.h>
9#include <QtGui/private/qguiapplication_p.h>
10#include <qpa/qplatformintegration.h>
14#include <QMdiSubWindow>
16#include <QAbstractScrollArea>
19#include <QtCore/qpointer.h>
47 if (!
q->isWindow() && (
q->geometry().bottom() <= 0 ||
q->geometry().right() <= 0))
62 if (
window->parent() ==
nullptr)
65 if (
q->internalWinId()) {
70 bool nativeWidgetSet =
false;
75 || qobject_cast<QMdiSubWindow *>(
p) != 0
78 || qobject_cast<QAbstractScrollArea *>(
p) != 0
82 nativeWidgetSet =
true;
85 p =
p->parentWidget();
96 d->extra->hasWindowContainer =
true;
97 p =
p->parentWidget();
183 if (
auto *widgetWindow = qobject_cast<QWidgetWindow *>(
window)) {
185 if (
flags != Qt::WindowFlags()) {
187 <<
"WindowFlags" <<
flags <<
"will be ignored.";
204 qWarning(
"QWindowContainer: embedded window cannot be null");
208 d->window = embeddedWindow;
209 d->window->installEventFilter(
this);
211 QString windowName =
d->window->objectName();
212 if (windowName.isEmpty())
214 d->fakeParent.setObjectName(windowName +
"ContainerFakeParent"_L1);
216 d->window->setParent(&
d->fakeParent);
217 d->window->parent()->installEventFilter(
this);
245 d->window->removeEventFilter(
this);
246 d->window->destroy();
264 if (ce->child() ==
d->window) {
265 o->removeEventFilter(
this);
266 d->window->removeEventFilter(
this);
300 d->updateUsesNativeWidgets();
301 if (
d->isStillAnOrphan()) {
302 d->window->parent()->removeEventFilter(
this);
303 d->window->setParent(
d->usesNativeWidgets
306 d->fakeParent.destroy();
307 if (
d->window->parent())
308 d->window->parent()->installEventFilter(
this);
310 if (
d->window->parent()) {
311 d->markParentChain();
316 if (
d->window->parent())
320 if (
d->window->parent()) {
323 const auto reason =
event->
reason();
330 d->window->requestActivate();
334#if QT_CONFIG(draganddrop)
376 for (
int i=0;
i<children.
size(); ++
i) {
380 if (wd->
extra && wd->
extra->hasWindowContainer)
389 if (
d->window->parent())
390 d->window->parent()->removeEventFilter(
parent);
391 d->window->setParent(&
d->fakeParent);
392 d->window->parent()->installEventFilter(
parent);
400 if (
d->window->parent()) {
401 d->updateUsesNativeWidgets();
402 d->markParentChain();
407 tld->createTLSysExtra();
410 d->window->parent()->removeEventFilter(
parent);
413 d->fakeParent.destroy();
423 if (
d->window->parent())
432 if (
d->window->parent())
441 if (
d->window->parent())
449#include "moc_qwindowcontainer_p.cpp"
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
Type
This enum type defines the valid event types in Qt.
Type type() const
Returns the event type.
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
The QFocusEvent class contains event parameters for widget focus events.
Qt::FocusReason reason() const
Returns the reason for this focus event.
static QPlatformIntegration * platformIntegration()
static QWindow * focusWindow()
Returns the QWindow that receives events tied to focus, such as key events.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void installEventFilter(QObject *filterObj)
Installs an event filter filterObj on this object.
const QObjectList & children() const
Returns a list of child objects.
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
The QPainter class performs low-level painting on widgets and other paint devices.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
~QWindowContainerPrivate()
QPointer< QWindow > window
void updateUsesNativeWidgets()
bool isStillAnOrphan() const
static QWindowContainerPrivate * get(QWidget *w)
static void parentWasChanged(QWidget *parent)
bool event(QEvent *ev) override
QWindowContainer(QWindow *embeddedWindow, QWidget *parent=nullptr, Qt::WindowFlags f={ })
static void parentWasRaised(QWidget *parent)
QSize minimumSizeHint() const override
static void parentWasMoved(QWidget *parent)
static void parentWasLowered(QWidget *parent)
QWindow * containedWindow() const
static void toplevelAboutToBeDestroyed(QWidget *parent)
bool eventFilter(QObject *, QEvent *ev) override
void minimumHeightChanged(int arg)
void setGeometry(int posx, int posy, int w, int h)
Sets the geometry of the window, excluding its window frame, to a rectangle constructed from posx,...
void minimumWidthChanged(int arg)
Combined button and popup list for selecting options.
@ ActiveWindowFocusReason
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
GLfloat GLfloat GLfloat w
[0]
GLdouble GLdouble GLdouble GLdouble q
#define QT_CONFIG(feature)
Q_GUI_EXPORT QWindowPrivate * qt_window_private(QWindow *window)
void(* qwindowcontainer_traverse_callback)(QWidget *parent)
static void qwindowcontainer_traverse(QWidget *parent, qwindowcontainer_traverse_callback callback)