python


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.

Related Links

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?

Categories

HOME
xbox-live
actionscript
matplotlib
mainframe
search-engine
phonegap-cli
value
file-io
subquery
contact-form-7
x11
wysiwyg
onsen-ui2
mod-pagespeed
titan
redux-observable
ip-camera
ng2-dragula
cvs2svn
sonarqube-msbuild-runner
hhvm
tcpclient
explode
source-maps
profile
novnc
cgal
pcre
aurelia-binding
invoke-command
jboss5.x
getjson
division
node-horseman
remote-server
openshift-enterprise
zero
flex4.5
bayesian-networks
mediawiki-extensions
productivity
spring-bean
cppunit
encapsulation
3scale
uiviewpropertyanimator
decompress
opencpu
rxvt
polar-coordinates
festival
uistackview
ruby-2.0
pagekit
lemoon
unity5.3
visual-studio-code
calibration
rspec3
scrollspy
gmaps4rails
tcpreplay
and-operator
ibmsbt
facebook-wall
argument-passing
exiv2
gamepad
installshield-2009
argb
nuspec
mozart-mvc
pitch
mpmovieplayer
unions
hashalgorithm
newsstand-kit
django-nose
windows-live-id
pivotal-crm
pureftpd
exitstatus
quick-search
delegatecommand
communicationexception
longjmp

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App