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. Aceed to an element of listView

Aceed to an element of listView

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 3 Posters 882 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I must aceed to the first element of the list:
    I tried :
    ui->listView->setCurrentIndex(0);
    but it doesn't want int

    VRoninV 1 Reply Last reply
    0
    • ? A Former User

      I must aceed to the first element of the list:
      I tried :
      ui->listView->setCurrentIndex(0);
      but it doesn't want int

      VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Can you clarify what you mean by "aceed"?

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      ? 1 Reply Last reply
      0
      • VRoninV VRonin

        Can you clarify what you mean by "aceed"?

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @VRonin I want to obtain the name of the first element of listView

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by VRonin
          #4

          qDebug() << ui->listView->model()->index(0,0).data();

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          ? 1 Reply Last reply
          3
          • VRoninV VRonin

            qDebug() << ui->listView->model()->index(0,0).data();

            ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            @VRonin said in Aceed to an element of listView:

            ui->listView->model()->index(0,0).data();

            It said to me "invalid"

            mrjjM 1 Reply Last reply
            0
            • ? A Former User

              @VRonin said in Aceed to an element of listView:

              ui->listView->model()->index(0,0).data();

              It said to me "invalid"

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @vale88
              Hi
              maybe you call that before you put data i model or something similar?

              VRoninV ? 2 Replies Last reply
              4
              • mrjjM mrjj

                @vale88
                Hi
                maybe you call that before you put data i model or something similar?

                VRoninV Offline
                VRoninV Offline
                VRonin
                wrote on last edited by
                #7

                The other option is you are using setIndexWidget. In that case we can't be friends until you redeem your soul.

                "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                ~Napoleon Bonaparte

                On a crusade to banish setIndexWidget() from the holy land of Qt

                1 Reply Last reply
                2
                • mrjjM mrjj

                  @vale88
                  Hi
                  maybe you call that before you put data i model or something similar?

                  ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  @mrjj no I call this after

                  ? 1 Reply Last reply
                  0
                  • ? A Former User

                    @mrjj no I call this after

                    ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #9

                    @vale88 I solved thanks

                    mrjjM 1 Reply Last reply
                    0
                    • ? A Former User

                      @vale88 I solved thanks

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @vale88
                      what was wrong then?
                      Its good to tell solution as we all learn from it :)

                      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