diff --git a/include/dialogs/CreateRoom.h b/include/dialogs/CreateRoom.h index 9609518..46edebd 100644 --- a/include/dialogs/CreateRoom.h +++ b/include/dialogs/CreateRoom.h @@ -22,6 +22,7 @@ signals: protected: void paintEvent(QPaintEvent *event) override; + void showEvent(QShowEvent *event) override; private: void clearFields(); diff --git a/include/dialogs/InviteUsers.h b/include/dialogs/InviteUsers.h index 236a255..41e6236 100644 --- a/include/dialogs/InviteUsers.h +++ b/include/dialogs/InviteUsers.h @@ -19,6 +19,7 @@ public: protected: void paintEvent(QPaintEvent *event) override; + void showEvent(QShowEvent *event) override; signals: void closing(bool isLeaving, QStringList invitees); diff --git a/include/dialogs/JoinRoom.h b/include/dialogs/JoinRoom.h index 0c3f918..5919f08 100644 --- a/include/dialogs/JoinRoom.h +++ b/include/dialogs/JoinRoom.h @@ -18,6 +18,7 @@ signals: protected: void paintEvent(QPaintEvent *event) override; + void showEvent(QShowEvent *event) override; private: FlatButton *confirmBtn_; diff --git a/src/dialogs/CreateRoom.cc b/src/dialogs/CreateRoom.cc index 2b2fd7f..0bda0d0 100644 --- a/src/dialogs/CreateRoom.cc +++ b/src/dialogs/CreateRoom.cc @@ -152,3 +152,11 @@ CreateRoom::paintEvent(QPaintEvent *) QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } + +void +CreateRoom::showEvent(QShowEvent *event) +{ + nameInput_->setFocus(); + + QFrame::showEvent(event); +} diff --git a/src/dialogs/InviteUsers.cc b/src/dialogs/InviteUsers.cc index 2204245..d46ca17 100644 --- a/src/dialogs/InviteUsers.cc +++ b/src/dialogs/InviteUsers.cc @@ -147,3 +147,11 @@ InviteUsers::invitedUsers() const return users; } + +void +InviteUsers::showEvent(QShowEvent *event) +{ + inviteeInput_->setFocus(); + + QFrame::showEvent(event); +} diff --git a/src/dialogs/JoinRoom.cc b/src/dialogs/JoinRoom.cc index 59e1748..51f7d53 100644 --- a/src/dialogs/JoinRoom.cc +++ b/src/dialogs/JoinRoom.cc @@ -59,3 +59,11 @@ JoinRoom::paintEvent(QPaintEvent *) QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } + +void +JoinRoom::showEvent(QShowEvent *event) +{ + roomInput_->setFocus(); + + QFrame::showEvent(event); +}