QTableView showing empty fields
Hi All,
The compatible function in the Qt4 would like to know which to show the empty field in the QTableView.
In the Qt3 with the QDataTable I used the function:
dataTable->setNullText("");
==========Code==========================
....
model = new QSqlQueryModel(this);
proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel(model);
model->setQuery(QString(SELECT_ACCOMP_OCCURRENCE).arg(QS tring(globalIdentID)));
model->setHeaderData(2, Qt::Horizontal, QObject::tr("VTR"));
model->setHeaderData(3, Qt::Horizontal, QObject::tr("HIO"));
model->setHeaderData(4, Qt::Horizontal, QObject::tr("HEM"));
this->tableView->setModel(proxyModel);
this->tableView->show();
....
==========End==========================
I did not find nothing in the QTableView to show the empty fields.
Using Qt4 Version: 4.3.0
OS: FreeBSD 7.0-CURRENT
edm.
Re: QTableView showing empty fields
Do you have an open database connection? Did you test the same query in SQL console? Does this output something?
Code:
model
->setQuery
(QString(SELECT_ACCOMP_OCCURRENCE
).
arg(QString(globalIdentID
)));
if (model->lastError().isValid())
qDebug() << model->lastError();
(as proposed by QSqlQueryModel::setQuery() docs)
Re: QTableView showing empty fields
Hi,
Not, the doubt is because the fields in link below are being shown, for query SQL would have to be shown in the QTableView empty, more exactly thus is shown the dates.
http://200.193.29.195/personal/window.png
edm
Re: QTableView showing empty fields
AFAIR somebody has encountered a similar problem in the past and it turned out to be a Qt bug. Check the task tracker or try a newer Qt version.
Re: QTableView showing empty fields
oohhh.... he is bug !!! :crying:
Does not exist a function similar to setNullTex () of the QDataTable to show the empty fields?
I am using the version Qt 4.3.0
Where meeting if the Bug was decided or not?
Thanks, edm
Re: QTableView showing empty fields
I found, was corrected in version 4.3.1.
I go to make the update.
http://trolltech.com/developer/task-...8&method=entry
edm.