Results 1 to 6 of 6

Thread: Problem with QTableView

  1. #1
    Join Date
    Feb 2008
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Problem with QTableView

    Hi,

    Here is a piece of (pseudo) code from my application
    Qt Code:
    1. model = new QSqlTableModel();
    2. model->setTable(tables->currentText());
    3. model->setFilter("id=2");
    4. model->select();
    5.  
    6. view = new QTableView();
    7. view->setModel(model);
    8.  
    9. /*model->setTable(tables->currentText());
    10.   model->setFilter("id=3");
    11.   model->select();*/
    To copy to clipboard, switch view to plain text mode 
    Problem is : when last section of example is commented in, view will show wrong number of lines. If first select returns one row, and second also one, then view shows two lines : one is containing last result and second is just empty row.
    Problem goes away if setTable is not used second time, but there is nowhere said, that setTable is forbidden to use twice.

    PS: second select is after "view->setModel(model);" because in real application it is called in slot, not in same method as first select and view/model creation.

    A Qt bug?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with QTableView

    Which version of Qt are you using?

  3. #3
    Join Date
    Feb 2008
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with QTableView

    forgot about that,

    Qt 4.3.3
    on Gentoo Linux, database used MySql

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with QTableView

    Check if tasktracker contains any entries relevant to the problem.

  5. #5
    Join Date
    Feb 2008
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with QTableView

    Already tried, but going one more time to that, maybe missed one.

  6. #6
    Join Date
    Feb 2008
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with QTableView

    Finally, got this problem accepted as a bug

    http://trolltech.com/developer/task-...1&method=entry

Similar Threads

  1. QTableView selection problem
    By aiprober in forum Qt Programming
    Replies: 12
    Last Post: 9th June 2008, 11:55
  2. problem in printing QTableView
    By miguel_mark in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2008, 08:19
  3. Problem: QThead and QTableview
    By ederbs in forum Qt Programming
    Replies: 5
    Last Post: 9th November 2007, 10:17
  4. QTableView Performance Problem on Windows
    By umitoz in forum Qt Programming
    Replies: 1
    Last Post: 31st August 2007, 16:47
  5. QTableView multiline problem
    By ramazangirgin in forum Qt Programming
    Replies: 3
    Last Post: 3rd August 2007, 10:02

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.