DOCS/client_api_examples: qtexample: demonstrate multiple mpv instances

Multiple client API contexts can exist in the same process.
This commit is contained in:
wm4 2015-01-06 11:55:19 +01:00
parent 31e9630788
commit 0488829185
2 changed files with 10 additions and 0 deletions

View File

@ -44,6 +44,10 @@ MainWindow::MainWindow(QWidget *parent) :
connect(on_open, &QAction::triggered, this, &MainWindow::on_file_open);
menu->addAction(on_open);
QAction *on_new = new QAction(tr("&New window"), this);
connect(on_new, &QAction::triggered, this, &MainWindow::on_new_window);
menu->addAction(on_new);
statusBar();
QMainWindow *log_window = new QMainWindow(this);
@ -187,6 +191,11 @@ void MainWindow::on_file_open()
}
}
void MainWindow::on_new_window()
{
(new MainWindow())->show();
}
void MainWindow::append_log(const QString &text)
{
QTextCursor cursor = log->textCursor();

View File

@ -17,6 +17,7 @@ public:
private slots:
void on_file_open();
void on_new_window();
void on_mpv_events();
signals: