void Login::onRegisterClicked() { //take the user to the registeration page Register *reg = new Register(); this->hide(); reg->show(); }
void Login::on_register_2_clicked() //注册 { Register *reg = new Register(); reg->setWindowTitle("注册"); reg->setModal(true); reg->show(); connect(this, SIGNAL(sendDatabaseToRegister(QSqlDatabase)), reg, SLOT(recvDatabaseFromLogin(QSqlDatabase))); emit sendDatabaseToRegister(db); }
bool Login::eventFilter(QObject *obj, QEvent *event) { if (obj == Login::ui->register_label) { if (event->type() == QEvent::MouseButtonRelease) { //随便判断什么事件都可以了 Register *r = new Register(); this->close(); r->show(); return true; } else { return false; } } else { return Login::eventFilter(obj, event); } }
void Schedule::registerForm() { Register *registerContact = new Register(this); registerContact->show(); }