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. QTableView
Forum Updated to NodeBB v4.3 + New Features

QTableView

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 4 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.
  • Christian EhrlicherC Offline
    Christian EhrlicherC Offline
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #4

    Just connect the signal with a slot in PrincipalFrm and do what you're doing in on_tableView_clicked()

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    1 Reply Last reply
    1
    • lincolnL Offline
      lincolnL Offline
      lincoln
      wrote on last edited by
      #5

      Hi, you know I did what you said, but when I want to connect the currentChanged signal, it just does not appear, which is what I'm doing wrong.

      QObject::connect(ui->tableView, &QTableView::    ,this,[&](){
      
            QMessageBox::information(this,qApp->applicationName(),"Mensaje");
          });
      

      Solitary wolf

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #6

        Hi,

        Do you mean there's no auto-completion ? If so, that shouldn't stop you, write the name of the signal. If you make any mistake in it, the compilation will fail.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • lincolnL Offline
          lincolnL Offline
          lincoln
          wrote on last edited by
          #7

          the problem is not the auto completed, the problem is that the currentChanged () signal does not appear, when putting the four points, only one eslot appears and a function with the same name of the signal.

          Solitary wolf

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #8

            Well, that sounds like the auto-complete feature malfunctioning. But again, that's just a helper. Write the signal name and go on with your application.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            2
            • lincolnL Offline
              lincolnL Offline
              lincoln
              wrote on last edited by
              #9

              Well, what I can say is that I have not achieved anything yet, and the truth is that I'm tired of searching and not getting an answer, thanks anyway.

              Solitary wolf

              jsulmJ 1 Reply Last reply
              0
              • lincolnL lincoln

                Well, what I can say is that I have not achieved anything yet, and the truth is that I'm tired of searching and not getting an answer, thanks anyway.

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #10

                @lincoln Did you try to write

                QObject::connect(ui->tableView, &QTableView::currentChanged, this,[&](){
                
                      QMessageBox::information(this,qApp->applicationName(),"Mensaje");
                    });
                

                ?
                There is nothing to search, you just need to write what was already suggested...

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

                1 Reply Last reply
                2
                • lincolnL Offline
                  lincolnL Offline
                  lincoln
                  wrote on last edited by lincoln
                  #11

                  @jsulm said in QTableView:

                  QMessageBox::information(this,qApp->applicationName(),"Mensaje");

                  I already did that and when I do I get this error.
                                                               
                  semmantic issue
                  55:49: error 'currentChanged' is a protected member of 'QTableView'
                  qtableview.h: 176: 10: note: declared protedted here

                  note:

                  I attached an image with the screenshot of the error that I get, thanks.![alt text](0_1552319875912_error.png image url)

                  Solitary wolf

                  1 Reply Last reply
                  0
                  • Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #12

                    @Christian-Ehrlicher said in QTableView:

                    QAbstractItemView::currentChanged()

                    Ah, you have to go through the selectionModel, sorry

                    connect(ui->tableView->selectionModel, &QItemSelectionModel::currentChanged, ...)

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    1 Reply Last reply
                    1
                    • lincolnL Offline
                      lincolnL Offline
                      lincoln
                      wrote on last edited by
                      #13

                      deluxe brother, thank you already solved my problem, greetings.

                      Solitary wolf

                      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