#include class Window : public QMainWindow { Q_OBJECT public: Window(); }; #include #include #include #include #include Window::Window() { this->resize(800, 600); auto part = KPluginFactory::instantiatePlugin(KPluginMetaData(QStringLiteral("konsolepart")), this).plugin; Q_ASSERT(part); setCentralWidget(part->widget()); TerminalInterface *interface = qobject_cast(part); interface->showShellInDir(QDir::home().path()); connect(part, &QObject::destroyed, this, &QObject::deleteLater); } int main(int argc, char **argv) { QApplication::setApplicationName(QStringLiteral("tetest")); QApplication app(argc, argv); Window *window = new Window(); window->show(); return app.exec(); } #include "terminal_test.moc"