@@ -59,7 +59,6 @@ AnalyzerContainer::AnalyzerContainer(QWidget *parent)
|
|||||||
context_menu_framerate_(new QMenu(tr("Framerate"), this)),
|
context_menu_framerate_(new QMenu(tr("Framerate"), this)),
|
||||||
group_(new QActionGroup(this)),
|
group_(new QActionGroup(this)),
|
||||||
group_framerate_(new QActionGroup(this)),
|
group_framerate_(new QActionGroup(this)),
|
||||||
visualisation_action_(nullptr),
|
|
||||||
double_click_timer_(new QTimer(this)),
|
double_click_timer_(new QTimer(this)),
|
||||||
ignore_next_click_(false),
|
ignore_next_click_(false),
|
||||||
current_analyzer_(nullptr),
|
current_analyzer_(nullptr),
|
||||||
@@ -88,7 +87,6 @@ AnalyzerContainer::AnalyzerContainer(QWidget *parent)
|
|||||||
group_->addAction(disable_action_);
|
group_->addAction(disable_action_);
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
// Visualisation action gets added in SetActions
|
|
||||||
|
|
||||||
double_click_timer_->setSingleShot(true);
|
double_click_timer_->setSingleShot(true);
|
||||||
double_click_timer_->setInterval(250);
|
double_click_timer_->setInterval(250);
|
||||||
@@ -98,26 +96,11 @@ AnalyzerContainer::AnalyzerContainer(QWidget *parent)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerContainer::SetActions(QAction *visualisation) {
|
|
||||||
visualisation_action_ = visualisation;
|
|
||||||
context_menu_->addAction(visualisation_action_);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AnalyzerContainer::mouseReleaseEvent(QMouseEvent *e) {
|
void AnalyzerContainer::mouseReleaseEvent(QMouseEvent *e) {
|
||||||
|
|
||||||
if (engine_->type() != Engine::EngineType::GStreamer && engine_->type() != Engine::EngineType::Xine) return;
|
if (engine_->type() != Engine::EngineType::GStreamer && engine_->type() != Engine::EngineType::Xine) return;
|
||||||
|
|
||||||
if (e->button() == Qt::LeftButton) {
|
if (e->button() == Qt::RightButton) {
|
||||||
if (ignore_next_click_) {
|
|
||||||
ignore_next_click_ = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Might be the first click in a double click, so wait a while before actually doing anything
|
|
||||||
double_click_timer_->start();
|
|
||||||
last_click_pos_ = e->globalPos();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (e->button() == Qt::RightButton) {
|
|
||||||
context_menu_->popup(e->globalPos());
|
context_menu_->popup(e->globalPos());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,16 +110,6 @@ void AnalyzerContainer::ShowPopupMenu() {
|
|||||||
context_menu_->popup(last_click_pos_);
|
context_menu_->popup(last_click_pos_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerContainer::mouseDoubleClickEvent(QMouseEvent*) {
|
|
||||||
|
|
||||||
if (engine_->type() != Engine::EngineType::GStreamer && engine_->type() != Engine::EngineType::Xine) return;
|
|
||||||
|
|
||||||
double_click_timer_->stop();
|
|
||||||
ignore_next_click_ = true;
|
|
||||||
|
|
||||||
if (visualisation_action_) visualisation_action_->trigger();
|
|
||||||
}
|
|
||||||
|
|
||||||
void AnalyzerContainer::wheelEvent(QWheelEvent *e) {
|
void AnalyzerContainer::wheelEvent(QWheelEvent *e) {
|
||||||
emit WheelEvent(e->delta());
|
emit WheelEvent(e->delta());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ signals:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mouseReleaseEvent(QMouseEvent*);
|
void mouseReleaseEvent(QMouseEvent*);
|
||||||
void mouseDoubleClickEvent(QMouseEvent*);
|
|
||||||
void wheelEvent(QWheelEvent *e);
|
void wheelEvent(QWheelEvent *e);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@@ -93,7 +92,6 @@ signals:
|
|||||||
QList<QAction*> actions_;
|
QList<QAction*> actions_;
|
||||||
QAction *disable_action_;
|
QAction *disable_action_;
|
||||||
|
|
||||||
QAction *visualisation_action_;
|
|
||||||
QTimer *double_click_timer_;
|
QTimer *double_click_timer_;
|
||||||
QPoint last_click_pos_;
|
QPoint last_click_pos_;
|
||||||
bool ignore_next_click_;
|
bool ignore_next_click_;
|
||||||
|
|||||||
Reference in New Issue
Block a user