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

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

Categories

HOME
sharepoint
json
signalr
redis
webrtc
memory-leaks
extract
computer-vision
hana
csvhelper
search-engine
rfc
recyclerview
iis-7.5
tumblr
httpclient
desktop
wicket
cortex-a
tee
uiview
cratedb
jacoco
opera-mini
tree-traversal
backpropagation
google-maps-android-api-2
ghost-inspector
onsen-ui
novnc
philips-hue
switching
image-quality
excel-2013
spring-data-neo4j
chrome-native-messaging
nesc
hibernate-cache
lmdb
android-vpn-service
exponential
oracle-xml-db
geopy
recurrence-relation
service-locator
von-neumann
lego
color-scheme
.net-assembly
axis-labels
strstr
agent
infusionsoft
twiki
encapsulation
email-parsing
amazon-clouddrive
proof
drawingarea
volume
iphone-developer-program
emoticons
teiid
shinyjs
restivejs
audioqueue
multiple-file-upload
nssplitview
spinlock
direct3d12
android-viewholder
app.xaml
unity5.3
evo
windowlistener
qbfc
castle-windsor-3
lines-of-code
google-hadoop
multipleselection
kallithea
tilestache
rhel5
and-operator
x-ua-compatible
sortable
ember-components
snmp4j
aquafold
surrogate-key
colt
funkload
visual-c++-2010-express
nservicebus4
asp.net-mvc-scaffolding
swrl
windows-update
phpsh
mvs
css-tables
qsqltablemodel
javascriptserializer
sunspot-rails
plone-funnelweb
die
text-size
scraperwiki
coff
galaxy-tab
msbuildextensionpack
windows-live-id
for-xml-path
asp.net-routing
scala-2.8
savestate
nt4

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