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.
Changing output fonts in ipython
TypeError: 'file' object has no attribute '__getitem__'
Data not received by twisted socket connection
python loop dencrementing a variable for every iteration
Histograms: “TypeError, list indices must be integers, not str”
Scipy fmin_slsqp error “failed in converting 8th argument `g' of _slsqp.slsqp to C/Fortran array”
SciPy: n-dimensional interpolation of sparse data
Write a program to display all the anagrams for “abcdef” in Python
Python prime numbers generators in terminal
Python Square function using newton's algorithm
Titles for elements in tkinter
Adding items to a list if it's not a function
Selenium (python): can't switch to iframe (name is dynamically generated)
How to redirect printed value of python script to the linux terminal as a command
Selenuim webdriver fails without notice for ssl error
Unable to locate button element using selenium webdriver