Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Property with a list as possible values for custom widget?
Forum Updated to NodeBB v4.3 + New Features

Property with a list as possible values for custom widget?

Scheduled Pinned Locked Moved Unsolved General and Desktop
26 Posts 4 Posters 9.5k Views 1 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.
  • P Panoss
    17 Jan 2017, 12:43

    Yes it should, but it doesn't :) !!!

    M Offline
    M Offline
    mrjj
    Lifetime Qt Champion
    wrote on 17 Jan 2017, 12:46 last edited by
    #21

    @Panoss
    Well give it some hours. Maybe a Qt python user know the secret of
    how to have it available.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Panoss
      wrote on 17 Jan 2017, 12:48 last edited by Panoss
      #22

      https://hub.qgis.org/wiki/17/Python_plugin_API_changes_from_18_to_20#Replace-QStringList-with-list

      "Replace QList methods with python list function"

      So both Qlist and QStringList are replaced by list.

      M 1 Reply Last reply 17 Jan 2017, 12:51
      0
      • P Panoss
        17 Jan 2017, 12:48

        https://hub.qgis.org/wiki/17/Python_plugin_API_changes_from_18_to_20#Replace-QStringList-with-list

        "Replace QList methods with python list function"

        So both Qlist and QStringList are replaced by list.

        M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 17 Jan 2017, 12:51 last edited by
        #23

        @Panoss

        But is that no QGIS API ?
        is that the same as
        https://sourceforge.net/projects/pyqt/

        It looks as some other binding. So i Guess that is why its not there.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Panoss
          wrote on 17 Jan 2017, 14:26 last edited by
          #24

          Well now I'm confused, I don't really know.
          I 'll have to 'dig' more.

          1 Reply Last reply
          1
          • P Panoss
            17 Jan 2017, 12:31

            I tried this:

            QList = []
            
            ContainersWidgets = QtCore.pyqtProperty(QList, getContainersWidgets, setContainersWidgets)
            

            But I get an error:
            "ContainersWidgets = QtCore.pyqtProperty(QList, getContainersWidgets, setContainersWidgets)
            TypeError: bytes or ASCII string expected not 'list'"

            It doesn't accept a List, only bytes or ASCII.

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 17 Jan 2017, 14:35 last edited by
            #25

            @Panoss said in Property with a list as possible values for custom widget?:

            QList = []

            Should be

            QList = type([])
            

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            P 1 Reply Last reply 17 Jan 2017, 15:02
            2
            • J jsulm
              17 Jan 2017, 14:35

              @Panoss said in Property with a list as possible values for custom widget?:

              QList = []

              Should be

              QList = type([])
              
              P Offline
              P Offline
              Panoss
              wrote on 17 Jan 2017, 15:02 last edited by Panoss
              #26

              @jsulm said in Property with a list as possible values for custom widget?:

              @Panoss said in Property with a list as possible values for custom widget?:

              QList = []

              Should be

              QList = type([])
              

              You re right!!!
              Now the error is gone!

              But my property doesn't appear in Qt Designer.

              1 Reply Last reply
              0

              21/26

              17 Jan 2017, 12:46

              • Login

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