Merhabalar,
Aşağıdaki gibi bir sorguyu iki kolon şeklinde gösteren kod var:
Anlamadığım ;
coilView->horizontalHeader()->length()
satırında length() kısmında hata veriyor. Hata mesajı
/// HATA //
/home/mucip/QtProg/KurdakKantarYonetim/mainwindow.cpp:27: error: invalid use of incomplete type ‘class QHeaderView’
coilView->setMinimumWidth(coilView->horizontalHeader()->length()); ^~
/////
Anlamadım doğrusu. Platform ile mi alakalı bilemedim. Wİn ortamında pek ses etmiyordu. Debian bir de 5.13 deneyeyim dedim ama elimizde patladı valla... :(
QTableView *coilView = new QTableView(this); //create the tableview
ui->cBKullanici->setView(coilView); //set it to the comboBox before making changes
coilView->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); //fine tuning of some options
coilView->setSelectionMode(QAbstractItemView::SingleSelection);
coilView->setSelectionBehavior(QAbstractItemView::SelectRows);
coilView->setAutoScroll(false);
ui->cBKullanici->setModel(modelTableKullanici); //set the model
coilView->resizeColumnsToContents(); //resise to content after setting model (needs data)
coilView->resizeRowsToContents();
coilView->setMinimumWidth(coilView->horizontalHeader()->length()); //to have a good width on the drop down widget
coilView->verticalHeader()->hide();