PyQt5 Focus QMainWindow as first window
I am building an application in pyqt, which is called by another application with another graphical interface not built in pyqt. I have a QMainWindow, the problem is that when the boot appears behind the other application, and I do not know how to make it appear with the focus. I try to pass window type in a constructor Qt_WindowType But does not work This is my class class Foo(QMainWindow): def __init__(self, logger): super(Foo, self).__init__() # more code... self.show() if __name__ == '__main__': app = QApplication(sys.argv) ex = ScanGui(logger) sys.exit(app.exec_()) Thx.
Depending on what you are exactly looking for I'd say to have a look in this flag: self.setWindowFlags(Qt.WindowStaysOnTopHint) You can also make use of Modal modality. SetWindowModality instead of WindowStayOnTopHint, and both modal modes (Qt.WindowModal and Qt.ApplicationModal) permit other applications to be on top of your modal window.
Creating Tables with Python and SQLite, no such table
Trying to find all the commas in the list, what is wrong with this?
GCD of numbers of the form 2^i-1
django - render any url with a different base template
Why isn't my django templating working?
python dictionary with one key and multiple values [closed]
Text Game - Morality Tracker/Global variable - Python
How do I initialize and fill a list of lists in Python?
How to get tkinter canvas to dynamically resize to window width?
Handling HTTP Query Parameters
Django-ratings error: “rating value must be a Rating instance, not '100”?
Unset layout from QWidget in pyside
plot gebco data in python basemap
Python MIMEText formatting
builtins.ValueError: 'e' is not in list
WTForms: two forms on the same page?