#include #include #include #include #include class SomeDialog : public QDialog { public: SomeDialog( QWidget* parent = Q_NULLPTR ) : QDialog( parent ) { QBoxLayout* l = new QVBoxLayout( this ); l->addWidget( new QLineEdit( this ) ); QPushButton* btn = new QPushButton( "exec", this ); l->addWidget( btn ); connect( btn, &QPushButton::clicked, this, [this]() { SomeDialog* d = new SomeDialog( this ); d->exec(); } ); } }; int main(int argc, char *argv[]) { qputenv( "QT_IM_MODULE", QByteArray( "qtvirtualkeyboard" ) ); QApplication a( argc, argv ); SomeDialog w; w.show(); return a.exec(); }