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. Choosing another default item in the list
Forum Updated to NodeBB v4.3 + New Features

Choosing another default item in the list

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 1.6k 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.
  • G Offline
    G Offline
    godbod
    wrote on last edited by
    #1

    Hello everyone,

    When we first create a Listview, the default selected Item is the first one. How can I manage to have another Item selected by default or no Item at all ?

    Thanks.

    L'imagination est tout, c'est l’aperçu des futures attractions de la vie.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      godbod
      wrote on last edited by
      #2

      I am feeling like weird... all my questions remain unsolved.

      L'imagination est tout, c'est l’aperçu des futures attractions de la vie.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jake007
        wrote on last edited by
        #3

        Hi!

        QListView inhertis from QAbstractItemView, which has selectionModel(). In it there is _clearSelection() _method.

        So this should do:
        @myTreeView->selectionModel()->clearSelection()@

        Note: I haven't tested the code.


        Code is poetry

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Macro
          wrote on last edited by
          #4

          I think this link can help you "Handling Selections in Item Views":http://doc.qt.digia.com/4.4/model-view-selection.html

          Thanks & Regards..

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Macro
            wrote on last edited by
            #5

            [quote author="Jacques" date="1351597709"]I am feeling like weird... all my questions remain unsolved.[/quote]

            Be patient. Everyone will not respond immediately... :-)

            1 Reply Last reply
            0
            • G Offline
              G Offline
              godbod
              wrote on last edited by
              #6

              Thank you all. I'll read it.

              L'imagination est tout, c'est l’aperçu des futures attractions de la vie.

              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