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

Django Haystack and Elasticsearch Error Using rebuild_index
Can't keep a total of numbers in python
replace if else with a for loop
Panda3D - Setting date
decoding json in python
Python debugging, stop at particular output
Why an avi file can not be opened in OpenCV-Python
Can't compile msgpack Python extension under windows
Python sockets for a n-players game
HTMLParser or urllib2 unicode issue
How to stop PyCharm inserting spaces for fine alignment when reformating code?
Install NLTK with IronPyton for VS2012
pip install won't install on my machine
Integrating using scipy.integrate.simps
Problems with django and virtualenv
Returning when any Future in a list finishes

Categories

HOME
python
ajax
crystal-reports
oauth
warnings
ncurses
windows-store-apps
tomcat7
codeeffects
diagram
google-classroom
packer
x11
pjsip
data-analysis
react-leaflet
datagrip
bootstrap-popover
derived
jpeg2000
flexlm
boolean-expression
styles
nmake
k2
remove-method
restfb
tflearn
cronet
scalajs-react
python-textprocessing
pipelinedb
spring-data-neo4j
owl-api
chrome-native-messaging
vegan
encase
graph-databases
spreedly
nodeclipse
vsts-package-management
npm-publish
axis-labels
duktape
viewgroup
knockout-3.0
sgmlreader
pinvoke
jgraph
udev
crystal-reports-8.5
tcserver
google-maps-ios
modelattribute
qos
gradle-script-kotlin
firepath
gameanalytics
gradle-release-plugin
aerogear
qt-linguist
magento-1.4
web-essentials
void
loose-typing
hateoas
persistence.xml
intellitest
enyo
wikitext
prezto
sparse-file
rspec3
chaining
django-1.6
inputaccessoryview
tcpreplay
qtestlib
power-law
planetary.js
level
picat
phpdocx
magic-numbers
late-static-binding
visual-c++-2010-express
sslexception
dig
haskell-platform
prng
maven-ear-plugin
moq-3
cadisplaylink
maven-ant-tasks
nintendo
scraperwiki
email-spec
camtasia
winverifytrust
iphone-sdk-3.2
graph-layout
project-lifecycle

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