Results 1 to 5 of 5

Thread: QTableView not corectly showing empty fields

  1. #1
    Join Date
    Jan 2006
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTableView not corectly showing empty fields

    Windows XP SP2, OS X 10.4.8
    PostgreSQL 8.1.3
    Short description:
    QTableView isn't showing correctly empty fields "timestamp without time zone " type
    What I did:
    I have a SLOT
    Qt Code:
    1. acceptedmodel=new QSqlQueryModel(this);
    2. acceptedmodel->setQuery("SELECT orders.key, orders.time_order,
    3. orders.phone, orders.address, orders.address_finished,
    4. operators.operator_name, orders.time_driver_lock,
    5. orders.time_driver_wait, orders.time_driver_go,
    6. carting.carting_name, drivers.nickname FROM orders LEFT JOIN carting
    7. ON orders.typecarting=carting.key LEFT JOIN operators ON
    8. operators.key=orders.operator_open LEFT JOIN drivers on
    9. orders.driver=drivers.key WHERE orders.isaccepted=TRUE ORDER BY
    10. time_order;");
    11. if (acceptedmodel->lastError().isValid())
    12. {
    13. QMessageBox::information(this, tr("Qtaxi"),
    14. acceptedmodel->lastError().databaseText());
    15. return;
    16. }
    17. acceptedmodel->setHeaderData(0, Qt::Horizontal, tr("Num"));
    18. acceptedmodel->setHeaderData(1, Qt::Horizontal, tr("Order time"));
    19. acceptedmodel->setHeaderData(2, Qt::Horizontal, tr("Call to"));
    20. acceptedmodel->setHeaderData(3, Qt::Horizontal, tr("Address"));
    21. acceptedmodel->setHeaderData(4, Qt::Horizontal, tr("Go to"));
    22. acceptedmodel->setHeaderData(5, Qt::Horizontal, tr("Order
    23. operator"));
    24. acceptedmodel->setHeaderData(6, Qt::Horizontal, tr("Driver go to"));
    25. acceptedmodel->setHeaderData(7, Qt::Horizontal, tr("Driver wait"));
    26. acceptedmodel->setHeaderData(8, Qt::Horizontal, tr("Driver out"));
    27. acceptedmodel->setHeaderData(9, Qt::Horizontal, tr("Carting"));
    28. acceptedmodel->setHeaderData(10, Qt::Horizontal, tr("Nick"));
    29. acceptedtableView->setModel(acceptedmodel);
    30. acceptedselection=acceptedtableView->selectionModel();
    31. connect(acceptedselection, SIGNAL(currentChanged(const QModelIndex
    32. &, const QModelIndex &)), this, SLOT(SetAcceptedIndex(const
    33. acceptedtableView->resizeColumnsToContents();
    34. }
    To copy to clipboard, switch view to plain text mode 


    What I expected to see:
    when I open form I see then empty fields in database ("timestamp
    without time zone " type), isn't showing correctly in QTableView.
    I see "01.01.-4713 0.00.00", (Russian locale, USA locale isn't showing
    correctly too)


    I have some screenshots, and I can send it to you...

    Does anybody can testing this?

    screenshots



  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 not corectly showing empty fields

    Quote Originally Posted by Sergey B. View Post
    screenshots


    Could you please attach the screenshots directly on the forums?
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView not corectly showing empty fields

    Quote Originally Posted by jpn View Post
    Could you please attach the screenshots directly on the forums?
    Okey.
    Sorry, don't see "manage attachments"
    Attached Images Attached Images

  4. #4
    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 not corectly showing empty fields

    Hmm, I'm not sure, maybe this is a bug in psql plugin/driver? Perhaps you could try subclassing QSqlQueryModel and fixing the date time by hand (in QAbstractItemModel::data()) as a temporary workaround?
    J-P Nurmi

  5. #5
    Join Date
    Jan 2006
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView not corectly showing empty fields


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.