Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML with PySide2
Qt 6.11 is out! See what's new in the release blog

QML with PySide2

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 390 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pratik Tayshete
    wrote on last edited by
    #1

    Hi
    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.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ckk2018
      wrote on last edited by
      #2

      I'm new to QML too and I wish that I could help you~
      To make a QML Button connect to a python method, you can follow these below:
      1.Create a class that contains a python method decorated by "PySide2.QtCore.Slot";
      qml_btn_1.png

      2.Register the object of the class as a root context property;
      qml_btn_2.png

      3.Then you can call the python method in qml file.
      qml_btn_3.png

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved