Skip to content

Commit

Permalink
fix: fix focus fields in dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
daxartio committed Jun 23, 2024
1 parent 2edb04e commit 03abf98
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sportorg/gui/dialogs/bib_dialog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging

from PySide6 import QtCore
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QDialog, QDialogButtonBox, QFormLayout, QLabel, QLineEdit

Expand Down Expand Up @@ -62,6 +63,8 @@ def apply_changes():
self.button_cancel.clicked.connect(cancel_changes)
self.layout.addRow(button_box)

QtCore.QTimer.singleShot(0, self.item_bib_or_name.setFocus)

self.show()

def show_person_info(self):
Expand Down
3 changes: 3 additions & 0 deletions sportorg/gui/dialogs/rent_cards_dialog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging

from PySide6 import QtCore
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QDialog, QDialogButtonBox, QFormLayout, QLabel, QTextEdit

Expand Down Expand Up @@ -52,6 +53,8 @@ def apply_changes():
self.button_cancel.clicked.connect(cancel_changes)
self.layout.addRow(button_box)

QtCore.QTimer.singleShot(0, self.item_cards.setFocus)

self.show()

def apply_changes_impl(self):
Expand Down
2 changes: 2 additions & 0 deletions sportorg/gui/dialogs/search_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def init_ui(self):
self.layout.addWidget(self.item_serach)
self.layout.addWidget(button_box)

QtCore.QTimer.singleShot(0, self.item_serach.setFocus)

self.retranslate_ui()

self.show()
Expand Down

0 comments on commit 03abf98

Please sign in to comment.