Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Looking for info on QML ListView engines/delegates from Python script
Forum Updated to NodeBB v4.3 + New Features

Looking for info on QML ListView engines/delegates from Python script

Scheduled Pinned Locked Moved Solved Qt for Python
7 Posts 3 Posters 961 Views 2 Watching
  • 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.
  • B Offline
    B Offline
    bundito
    wrote on last edited by
    #1

    I did this all the time when I was an active KDE contributor (now semi-retired), but they have a bunch of custom classes to make some of these things easier.

    I can't find anything about a data engine in Python connecting to a PySide2 list. Can anyone point me in the right direction? I'm much happier coding my interfaces in QML than regular widget code.

    Thanks.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you give more details about what you mean by data engine ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      B 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Can you give more details about what you mean by data engine ?

        B Offline
        B Offline
        bundito
        wrote on last edited by
        #3

        @SGaist said in Looking for info on QML ListView engines/delegates from Python script:

        Hi,

        Can you give more details about what you mean by data engine ?

        Essentially bit of code that iterates or creates a list of items and forwards them to the QML layout. Typically, you'd format them in QML as a ComboBox or a stack of Rectangles containing your items (probably with checkboxes). As the QML changed - box checked or ComboBox item selected - the QML would signal that back to the underlying script (i.e. main.py) to effect the change.

        B 1 Reply Last reply
        0
        • B bundito

          @SGaist said in Looking for info on QML ListView engines/delegates from Python script:

          Hi,

          Can you give more details about what you mean by data engine ?

          Essentially bit of code that iterates or creates a list of items and forwards them to the QML layout. Typically, you'd format them in QML as a ComboBox or a stack of Rectangles containing your items (probably with checkboxes). As the QML changed - box checked or ComboBox item selected - the QML would signal that back to the underlying script (i.e. main.py) to effect the change.

          B Offline
          B Offline
          bundito
          wrote on last edited by
          #4

          Here are the KDE API pages if they help you understand what I'm talking about. It's a sort of model/view concept.

          https://api.kde.org/frameworks/plasma-framework/html/classPlasma_1_1DataSource.html

          https://api.kde.org/frameworks/plasma-framework/html/classPlasma_1_1DataModel.html

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bundito
            wrote on last edited by
            #5

            @Denni-0 said in Looking for info on QML ListView engines/delegates from Python script:

            Are you talking about the Q-Model series of classes? Aka like a Model View of a data table

            Ah-hah. Yes. I was so accustomed to the helper classes KDE used that I couldn't recall the proper Qt name. So, thanks for jogging my failing memory.

            Anyway... does PySide2/Qt4Py have support for these handy techniques?

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bundito
              wrote on last edited by
              #6

              @Denni-0 said in Looking for info on QML ListView engines/delegates from Python script:

              Yeah Qt5 and its children PySide2 and PyQt5 all support the Model View concept if you go here https://doc.qt.io/qt-5/classes.html and do a search either on QAbstract or just Model you can see all of them

              Thanks, @Denni-0. I appreciate your help (this is twice now), even if you're making me realize just how rusty I actually am.

              I'll try not to bug you guys with every blank spot in my brain...

              Thanks.

              1 Reply Last reply
              0
              • B Offline
                B Offline
                bundito
                wrote on last edited by
                #7

                @Denni-0 said in Looking for info on QML ListView engines/delegates from Python script:

                still yes if you could perhaps try to find the answer first ;) that might help you more than us feeding you fish every now and again

                I couldn't agree more. I've been on enough forums in my years to know that rule. My problem here was that I couldn't recall the proper Qt name for this mechanism. And I think most people would agree that the entirety of the Qt documentation is quite a huge amount of information, and it's easy to get into a loop between related pages. :-)

                Now I just have to solve a Python part of my project and I'll be making headway again.

                1 Reply Last reply
                0

                • Login

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