There is a Qt application. GL-window created into this application by calling XCreateWindow function and I can't edit it. I need put Xwindow in QWidget inside my Qt applications.
In the documentation:
void QWidget::create ( WId window = 0, bool initializeWindow = true,
bool destroyOldWindow = true ) [protected]
Creates a new widget window if the window is 0, otherwise sets the widget ' s window to window.Initializes the window sets the geometry etc.) if initializeWindow is true. If initializeWindow is false, no initialization is performed. This parameter only makes sense if window is a valid window.
...
For verifying the result of function QWidget::create there is the following code:
class ParentWindow : public QWidget
{
Q_OBJECT
public:
ParentWindow(WId id)
{
create(id);
}
};
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QPushButton* button = new QPushButton("MEGA BUTTON");
button->show();
ParentWindow w(button->winId());
w.show();
return a.exec();
}
When application start a single blank window appears. Although expected window containing a button (or to be a button). How can I put X11 window into my QWidget?