Results 1 to 6 of 6

Thread: QTableView showing empty fields

  1. #1
    Join Date
    Sep 2006
    Location
    Rio de Janeiro, Brazil
    Posts
    44
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default 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.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default 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?
    Qt Code:
    1. model->setQuery(QString(SELECT_ACCOMP_OCCURRENCE).arg(QString(globalIdentID)));
    2. if (model->lastError().isValid())
    3. qDebug() << model->lastError();
    To copy to clipboard, switch view to plain text mode 
    (as proposed by QSqlQueryModel::setQuery() docs)
    J-P Nurmi

  3. #3
    Join Date
    Sep 2006
    Location
    Rio de Janeiro, Brazil
    Posts
    44
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default 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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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.

  5. #5
    Join Date
    Sep 2006
    Location
    Rio de Janeiro, Brazil
    Posts
    44
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QTableView showing empty fields

    oohhh.... he is bug !!!

    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

  6. #6
    Join Date
    Sep 2006
    Location
    Rio de Janeiro, Brazil
    Posts
    44
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default 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.

Similar Threads

  1. QTableView not corectly showing empty fields
    By Sergey B. in forum Qt Programming
    Replies: 4
    Last Post: 15th June 2007, 08:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.