QModelIndex current = ui->tableView->currentIndex(); qDebug() << ui->tableView->model()->data(ui->tableView->model()->index(current.row(),0),0);
#include "mainwindow.h"#include "ui_mainwindow.h"#include <QWidget>#include <QDialog>namespace Ui {class Form6;}class Form6 : public QDialog{ Q_OBJECT public:void setValue(QVariant &); explicit Form6(QDialog *parent = 0); ~Form6();
void MainWindow::setValue(QVariant &){QModelIndex current = ui->tableView->currentIndex();ui->comboBox->addItem((ui->tableView->model()->data(ui->tableView->model()->index(current.row(),0),0)).toString());}
D:\project qt new\untitled\untitled33\form6.cpp:63: ошибка: no 'void MainWindow::setValue(QVariant&)' member function declared in class 'MainWindow'
void Form6::setValue(QVariant &){QModelIndex current = ui->tableView->currentIndex();ui->comboBox->addItem((ui->tableView->model()->data(ui->tableView->model()->index(current.row(),0),0)).toString());}
tableView
D:\project qt new\untitled\untitled33\form6.cpp:65: ошибка: 'class Ui::Form6' has no member named 'tableView'
ui->tableView->model()->data(ui->tableView->model()->index(current.row(),0),0);
void MainWindow::on_pushButton_3_clicked(){ QModelIndex current = ui->tableView->currentIndex(); qDebug() << ui->tableView->model()->data(ui->tableView->model()->index(current.row(),0),0); Form6 *w6 = new Form6 ; w6->exec();}