Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Unsolved Model / View - data-Funktion "Role"

    German
    3
    4
    283
    Loading More Posts
    • 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.
    • N
      NotYourFan last edited by

      Hey,

      ich wollte mal fragen ob es für "Buttons" auch eine Role für die TableView gibt.
      Es gibt ja "DisplayRole" --> Einfaches Eingabefeld ... dann "CheckStateRole" --> CheckBox ...

      Gibt es auch eine "...Role" für Buttons?

      raven-worx 1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators @NotYourFan last edited by

        @notyourfan said in Model / View - data-Funktion "Role":

        Gibt es auch eine "...Role" für Buttons?

        du meinst die automatisch erstellten Editoren?
        Nein gibt es nicht, Buttons haben auch nicht wirklich was verloren in ItemViews

        Wenn unbedingt notwendig kannst du die Funktionalität aber selbst erstellen in deinem Delegate, welcher via eine MouseArea und einem Loader deinen Button lädt und eine custom Role setzt.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply Reply Quote 0
        • A
          AandO last edited by AandO

          Hi,

          es gibt aber eine Qt::UserRole, die für customized roles benutzt werden kann.

          Qt::UserRole 0x0100 The first role that can be used for application-specific purposes.

          raven-worx 1 Reply Last reply Reply Quote 0
          • raven-worx
            raven-worx Moderators @AandO last edited by raven-worx

            @aando
            das ist der "Marker" für die erste Custom Role. Du kannst jetzt einen beliebigen Wert addieren z.B.
            Er darf einfach nicht niedriger sein als dieser Wert.
            Custom Roles funktionieren natürlich auch nur mit Custom Models ;)

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply Reply Quote 2
            • First post
              Last post