add doubleclick titlebar

This commit is contained in:
likehomedream 2023-12-19 09:38:22 +08:00
parent 96d5c572de
commit 1e24fbd300
2 changed files with 11 additions and 0 deletions

View File

@ -146,3 +146,12 @@ void TitleBar::setGoHomeBtn(bool isable)
} }
} }
void TitleBar::mouseDoubleClickEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
toggleMaximize();
}
QWidget::mouseDoubleClickEvent(event);
}

View File

@ -26,6 +26,8 @@ public:
signals: signals:
void gohomesignal(); // 声明自定义信号 void gohomesignal(); // 声明自定义信号
void savePathUpdate(const QString& filePath); void savePathUpdate(const QString& filePath);
protected:
void mouseDoubleClickEvent(QMouseEvent *event);
private: private:
bool m_ismaximized; bool m_ismaximized;
QToolButton *m_optionbtn = nullptr; // 菜单选项 QToolButton *m_optionbtn = nullptr; // 菜单选项