class login_window : public QWidget { Q_OBJECT protected: bool eventFilter(QObject * watched, QEvent * event); }
bool login_window::eventFilter(QObject * watched, QEvent * event) { if (watched == ui.label_forget_key && event->type() == QEvent::MouseButtonPress) { QMessageBox::information(NULL, "Title", QStringLiteral("忘记密码"), QMessageBox::Cancel ); } else if (watched == ui.label_apply && event->type() == QEvent::MouseButtonPress) { QMessageBox::information(NULL, "Title", QStringLiteral("申请权限"), QMessageBox::Cancel ); } return QWidget::eventFilter(watched, event); }
时间: 2024-12-29 04:40:41