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

Convert .html file to .docx while retaining style in python
How can debug this code on spyde IDE/python
Bokeh crashes when plotting DataFrame to scatter
Why does a*ad$ match the string “ad”? [duplicate]
Rabbitmq design
convert element and next element in list of strings to date in python
Python Type Hints: Specifying a type to be a List of numbers (ints and/or floats)?
PyQT4: how to add item/subitem to QtTreewidget, remove item through buttons and get the values of subitems
Creating a “snake” counter
Upgrade Python 3.4.3 to Python 3.6.1 in Ubuntu 15.04(64 bit)
Unable to call a method within a schedule job
Python ModuleNotFoundError during gunicorn start
How to add ModelChoice field of django form in template
selenium css_selector struggle
How to sort the data by a keyword of a csv file in Python?
mouse move in python video game

Categories

HOME
plsql
ibm-watson-cognitive
nlp
sed
windows-7
ocaml
zend-framework2
iis-7.5
ext.net
criteria
cockroachdb
webmethods
symfony2-easyadmin
glpk
aspell
zoomcharts
eclipselink
jive
excel-2010
piwik
profile
activepython
geopandas
positioning
pygooglechart
getjson
expand
web-audio-api
rhomobile
threshold
jquery-cycle2
hashcat
swagger-editor
issue-tracking
deepstream.io
brute-force
wsadmin
ical-dotnet
microdata
android-maps-v2
filepath
azure-availability-set
w3-total-cache
nsjsonserialization
number-theory
ti-basic
pluck
hpcc
teiid
festival
keycode
nsfetchedresultscontrolle
sql-server-administration
windows-azure-pack
packagemaker
firepath
gitweb
uiprogressview
remoteapp
dac
axes
loopj
spservices
acm
insertion-sort
base32
twython
leadtools-sdk
ffprobe
bridge
swift2.1
hg-git
c++-actor-framework
alphablending
grunt-contrib-concat
alpha-transparency
argument-passing
zipalign
winrt-httpclient
baucis
onselect
qss
marmalade-edk
web-safe-fonts
unions
dashcode
hadoop-plugins
camtasia
file-encodings
jquery-ui-button
visual-studio-2010-beta-2
lazy-c++
gears
divx
rd





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