Access QML elements within PySide2 [duplicate] - python

This question already has answers here:
Simple button click connection to python function
(1 answer)
several questions about QML and PySide2
(1 answer)
How to connect Python and QML with PySide2?
(1 answer)
Closed 2 years ago.
I am completely new to QML and PySide2. I am working on a desktop application where I want to make the UI using QML and connect it with PySide2. I saw some onlne documentation but was not able to find much about it. For an example, if I am creating a simple button using QML how can I access the button in PySide2.

Related

How to change a QLabel in OyQt5 during execution [duplicate]

This question already has answers here:
In PyQt, what is the best way to share data between the main window and a thread
(1 answer)
Background thread with QThread in PyQt
(7 answers)
Example of the right way to use QThread in PyQt?
(3 answers)
Closed 3 months ago.
I wat to make an small python GUI in order to monitor the status of some services, to simplify it I want to see a green circle when the service is running and a red one when it is not
I have this piece of code to load a pixmap into a QLabel
self.m2w_state = QLabel(self)
running_icon = QPixmap('green.png')
self.m2w_state.setPixmap(running_icon)
self.m2w_state.resize(running_icon.width(), running_icon.height())
self.m2w_state.move(40, 50)
But now I'm trying to change this during execution from green to red. I tried in the same thread and the GUI got stuck, so I tried using a different thread, but an error appears saying that I cannot change the property from a different thread
How is the way to do that?

What is the standard when it comes to multiple pages in PyQT? [duplicate]

This question already has answers here:
Load whole *ui file in an frame/widget of another *.ui file
(1 answer)
PyQt: How to switch widgets in QStackedWidget
(5 answers)
Creating a custom widget in PyQT5
(2 answers)
Closed 3 years ago.
I am making a simple app and was wondering what the standard is for multiple windows when using Qt Designer and python.
I need to be able to have functional back and next buttons which will take me to the previous screen like in simple .exe installers.
I do not want to use the tab widget.
I have tried using the stacked widget but when using layouts on my first screen it gets inserted into the grid layout.

PyQt4 : Linking buttons to functions [duplicate]

This question already has an answer here:
PyQt : Linking buttons to functions in my program
(1 answer)
Closed 6 years ago.
So I have this GUI that has 2 empty text spots to fill and a "Run" button
I want to make it that the 2 empty text spots go to values in the program and the run button will run the python "Main" program ..
How can i do that ?
You need to have a look at the documentation for PyQt signals and slots. Normally, when you install PyQt you also install some great examples. Walk through the code and it will teach you a lot (search your filesystem for "qtdemo" or standarddialogs.py).
New-style signals and slots
Old-style signals and slots
Here's a snippet from standarddialogs.py:
self.saveFileNameButton = QPushButton("QFileDialog.get&SaveFileName()")
...
self.saveFileNameButton.clicked.connect(self.setSaveFileName)
...
def setSaveFileName(self):

Easy way to create GUI in python [duplicate]

This question already has answers here:
Is there a GUI design app for the Tkinter / grid geometry? [closed]
(3 answers)
Closed 6 years ago.
I have tried using Tkinter but it is not so easy to create Attractive GUI application.Is there an application or online website where I can use Drag and Drop approach to create GUI Interface in python.or some other easy way Also reply with some Intutive references or tutorial if possible.
Pyqt seems like a good option here. It's a cross platform GUI framework that comes with qt designer, an applicatiom that let's you build GUIs by dragging and dropping widgets on a canvas.
Here's a basic tutorial you can follow. There's also a series of videos included with imformation on how to download and install pyqt

Python open window and set parent insensitive [duplicate]

This question already has an answer here:
PyGObject and glade send window to the front
(1 answer)
Closed 8 years ago.
I am currently building an application with python 2.7 with Gtk3+.
I want to open a window on top of another window. If the second window is visible, the parent one should not be clickable.
So the behaviour should be the same like opening a dialog window.
What is the best way to achieve this?
You need to use the property window.set_transient_for(parent_window)
This post may help you if you are using glade.

Categories