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. Do these two methods return the same value?
Forum Updated to NodeBB v4.3 + New Features

Do these two methods return the same value?

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 5 Posters 582 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.
  • D Offline
    D Offline
    duncan98
    wrote on last edited by duncan98
    #1
    ui->tablewidget->currentRow();
    ui->tablewidget->currentIndex().row()
    

    They're methods on different objects, but they seem to have the same value, right?

    Ronel_qtmasterR JonBJ 2 Replies Last reply
    0
    • D duncan98
      ui->tablewidget->currentRow();
      ui->tablewidget->currentIndex().row()
      

      They're methods on different objects, but they seem to have the same value, right?

      Ronel_qtmasterR Offline
      Ronel_qtmasterR Offline
      Ronel_qtmaster
      wrote on last edited by
      #2

      @duncan98 yes i think so

      1 Reply Last reply
      0
      • D duncan98
        ui->tablewidget->currentRow();
        ui->tablewidget->currentIndex().row()
        

        They're methods on different objects, but they seem to have the same value, right?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @duncan98
        https://code.woboq.org/kde/qt4/src/gui/itemviews/qtablewidget.cpp.html#_ZNK12QTableWidget10currentRowEv

        int QTableWidget::currentRow() const
        {
            return currentIndex().row();
        }
        

        :)

        D 1 Reply Last reply
        4
        • JonBJ JonB

          @duncan98
          https://code.woboq.org/kde/qt4/src/gui/itemviews/qtablewidget.cpp.html#_ZNK12QTableWidget10currentRowEv

          int QTableWidget::currentRow() const
          {
              return currentIndex().row();
          }
          

          :)

          D Offline
          D Offline
          duncan98
          wrote on last edited by duncan98
          #4

          @JonB
          thanks help,It would be nice if QT were officially available as source code

          JonBJ 1 Reply Last reply
          0
          • D duncan98

            @JonB
            thanks help,It would be nice if QT were officially available as source code

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @duncan98
            Pardon? Of course Qt is "officially available as source code" (you are presumably using the open source version now), so what do you mean?

            D 1 Reply Last reply
            2
            • JonBJ JonB

              @duncan98
              Pardon? Of course Qt is "officially available as source code" (you are presumably using the open source version now), so what do you mean?

              D Offline
              D Offline
              duncan98
              wrote on last edited by
              #6

              @JonB
              What is the reason why I can't see the cpp file source code when I select the source version during installation

              J.HilkJ JonBJ 2 Replies Last reply
              0
              • D duncan98

                @JonB
                What is the reason why I can't see the cpp file source code when I select the source version during installation

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #7

                @duncan98 what do you mean? Did you select sources during installation?

                314c8e20-2eec-48c1-8b69-766132f342df-image.png

                because it is than there:
                b7fffec6-30d9-43e4-99f9-d748ddd00e35-image.png


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                D 1 Reply Last reply
                2
                • D duncan98

                  @JonB
                  What is the reason why I can't see the cpp file source code when I select the source version during installation

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #8

                  @duncan98
                  I don't know, I have never downloaded Qt sources or built Qt, I just use precompiled from Linux. If you are sure you have them you could (a) have a look around in the Qt source tree to make sure they are there and (b) you probably have to tell Creator where they are located. I don't know whether it locates the sources if not built for debug, without that you probably cannot "step into" the source but you may be able to set the editor to let you go into the sources at editing time.

                  1 Reply Last reply
                  0
                  • J.HilkJ J.Hilk

                    @duncan98 what do you mean? Did you select sources during installation?

                    314c8e20-2eec-48c1-8b69-766132f342df-image.png

                    because it is than there:
                    b7fffec6-30d9-43e4-99f9-d748ddd00e35-image.png

                    D Offline
                    D Offline
                    duncan98
                    wrote on last edited by
                    #9

                    @J-Hilk
                    Yes, I thought I would be able to track the source code of the class if I installed the source code component, but I don't seem to be able to, only the header file

                    Pl45m4P 1 Reply Last reply
                    0
                    • D duncan98

                      @J-Hilk
                      Yes, I thought I would be able to track the source code of the class if I installed the source code component, but I don't seem to be able to, only the header file

                      Pl45m4P Offline
                      Pl45m4P Offline
                      Pl45m4
                      wrote on last edited by Pl45m4
                      #10

                      @duncan98 said in Do these two methods return the same value?:

                      but I don't seem to be able to, only the header file

                      You need to add the Qt src path to your QtCreator.

                      QtCreator > Tools > Options > Debugger > Source Path Mapping > Add Qt sources

                      And then put the path to your Qt/<version>/src there.


                      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                      ~E. W. Dijkstra

                      1 Reply Last reply
                      3

                      • Login

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