1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-25 04:38:01 +00:00
mpv/DOCS/client_api_examples/qtexample.h
wm4 38976703ca DOCS/client_api_examples: qtexample: use queued signals
Use queued signals instead of QEvent for the wakeup notification. This
is slightly nicer, and reduces the chance that the event (QEvent::User)
could clash with other code using the same event.

Also switch to modern connect() syntax.
2014-12-30 22:40:25 +01:00

37 lines
555 B
C++

#ifndef QTEXAMPLE_H
#define QTEXAMPLE_H
#include <QMainWindow>
#include <mpv/client.h>
class QTextEdit;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_file_open();
void on_mpv_events();
signals:
void mpv_events();
private:
QWidget *mpv_container;
mpv_handle *mpv;
QTextEdit *log;
void append_log(const QString &text);
void create_player();
void handle_mpv_event(mpv_event *event);
};
#endif // QTEXAMPLE_H