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.
xlwings UDFS: how to set PythonPath/ UDF_Modules correctly?
Python: Numpy Array : cant access/reference to a numpy array from another class
how to delete entire row in csv file and save changes on same file?
Load multiple Django environments in sequence
Chromedriver: How to disable Google Chrome Helper
Read an Image with the Headerpart
How to store the output of type function in python and use it in 'if' condition? [closed]
OpenCV-Python VideoCapture only loads part of video
make bouncing turtle with python
How to count rows that share a unique field in pandas
Why I take slises wrong? [closed]
could not find tesseract for python 3.4
Grouping similar files and transferring into a list but in a dynamic way without user input common_text
mmap write followed by flush does not seem to write to disk
Insert paragraph from Python Flask to HTML
How to share an instance variable among different classes in Python