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.
Convert .html file to .docx while retaining style in python
How can debug this code on spyde IDE/python
Bokeh crashes when plotting DataFrame to scatter
Why does a*ad$ match the string “ad”? [duplicate]
convert element and next element in list of strings to date in python
Python Type Hints: Specifying a type to be a List of numbers (ints and/or floats)?
PyQT4: how to add item/subitem to QtTreewidget, remove item through buttons and get the values of subitems
Creating a “snake” counter
Upgrade Python 3.4.3 to Python 3.6.1 in Ubuntu 15.04(64 bit)
Unable to call a method within a schedule job
Python ModuleNotFoundError during gunicorn start
How to add ModelChoice field of django form in template
selenium css_selector struggle
How to sort the data by a keyword of a csv file in Python?
mouse move in python video game