Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.15.10, 6.6.3
-
None
Description
The following Qt program cannot set the sub-window position under wayland.
#include <QApplication>
#include <QWidget>
#include <QDialog>
#include <QPushButton>
#include <QVBoxLayout>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget mainWindow;
mainWindow.setWindowTitle("Main Window");
mainWindow.resize(600,600);
QPushButton openButton("Open QDialog");
QVBoxLayout layout(&mainWindow);
layout.addWidget(&openButton);
QDialog dialog(&mainWindow);
dialog.setWindowTitle("QDialog");
dialog.resize(200, 100);
// dialog.hide();
QObject::connect(&openButton, &QPushButton::clicked, [&dialog,&openButton ,&mainWindow]()
{ QPoint point = QPoint(openButton.geometry().x(), openButton.geometry().y() + openButton.geometry().height() + 50); dialog.move(mainWindow.mapToGlobal(point)); // dialog.move(50,50); dialog.show(); });
mainWindow.show();
return app.exec();
}
Already read the upstream discussion on "Can't set a position for the top-level window":
https://gitlab.freedesktop.org/wayland/wayland/-/issues/183
Is there any way to set the position of QDialog when the current QDialog is used as a child window (setting its parent); just like in X11;
Or whether it is necessary to set the sub-window position with the support of the protocol upstream;