1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

feat: Add middle mouse clicked signal for GenericChatroom

This commit is contained in:
Diadlo 2017-11-23 19:49:35 +03:00
parent 8b4240776c
commit 65fc1dc266
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
2 changed files with 9 additions and 5 deletions

View File

@ -186,11 +186,14 @@ void GenericChatroomWidget::activate()
void GenericChatroomWidget::mouseReleaseEvent(QMouseEvent* event)
{
if (event->button() == Qt::LeftButton)
if (event->button() == Qt::LeftButton) {
emit chatroomWidgetClicked(this);
else
} else if (event->button() == Qt::MiddleButton) {
emit middleMouseClicked();
} else {
event->ignore();
}
}
void GenericChatroomWidget::enterEvent(QEvent*)
{

View File

@ -69,11 +69,12 @@ public slots:
signals:
void chatroomWidgetClicked(GenericChatroomWidget* widget);
void newWindowOpened(GenericChatroomWidget* widget);
void middleMouseClicked();
protected:
virtual void mouseReleaseEvent(QMouseEvent* event) override;
virtual void enterEvent(QEvent* e) override;
virtual void leaveEvent(QEvent* e) override;
void mouseReleaseEvent(QMouseEvent* event) override;
void enterEvent(QEvent* e) override;
void leaveEvent(QEvent* e) override;
QPoint dragStartPos;