Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Portuguese
  4. QtableView obter o conteúdo da 1ª coluna
Forum Updated to NodeBB v4.3 + New Features

QtableView obter o conteúdo da 1ª coluna

Scheduled Pinned Locked Moved Unsolved Portuguese
2 Posts 1 Posters 723 Views
  • 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.
  • Carlos MoreschiC Offline
    Carlos MoreschiC Offline
    Carlos Moreschi
    wrote on last edited by
    #1

    Olá,
    Tenho uma QtableView e quando clico em cada linha, gostaria de obter o valor do conteúdo da 1ª coluna.
    Obrigado
    Moreschi
    contato@qualidademundial.com.br

    1 Reply Last reply
    0
    • Carlos MoreschiC Offline
      Carlos MoreschiC Offline
      Carlos Moreschi
      wrote on last edited by
      #2

      void Infokap::on_ListaAniversarios_clicked(const QModelIndex &index)
      {
      int linha;
      linha=ui->ListaAniversarios->currentIndex().row() ;

       QTableView * tmp = new QTableView();
       tmp->setSelectionBehavior(QAbstractItemView::SelectRows);
      
       QString Nfoto = ui->ListaAniversarios->model()->data(ui->ListaAniversarios->model()->index(linha,0)).toString();
      
       //ui->wfoto->setText(Nfoto);
      
       QPixmap logocanal("K:/rh-fotos/"+QString(Nfoto));
       ui->lb_foto->setPixmap(logocanal);
      

      }

      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