Results 1 to 3 of 3

Thread: QTablaView::hiderow(int ) won't work

  1. #1

    Default QTablaView::hiderow(int ) won't work

    Qt Code:
    1. model = new QSqlTableModel;
    2.  
    3. model->setTable("clientcategory");
    4. model->select();
    5.  
    6. ui->tableView->setModel(model);
    7.  
    8. ui->tableView->hideRow(0);
    To copy to clipboard, switch view to plain text mode 

    Does't really hide that row?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QTablaView::hiderow(int ) won't work

    Sure it does.

    Now try to explain what you expected to see, what you actually saw, and why you think they are different.

  3. #3

    Default Re: QTablaView::hiderow(int ) won't work

    ups I put it wrong, I wanted to say when a tableview is attached to combobox, suppose like this:
    Qt Code:
    1. model->setTable("legaltype");
    2. model->select();
    3. QTableView *view1;
    4. view1 = new QTableView;
    5. ui->combobox->setModel(model);
    6. ui->combobox->setView(view1);
    7. view1->hideColumn(0);
    8. ;
    To copy to clipboard, switch view to plain text mode 

    first column is hidden (index 0). The height of a drop-down table becomes the size of a combobox height itself (no matter the size of combobox height), so that only Column Headers are visible... and this happens only when the firsts (0 index) column is hidden. For any other column hidden everything goes fine.

Similar Threads

  1. QT QSS ui work
    By davejh in forum Jobs
    Replies: 2
    Last Post: 12th May 2010, 16:31
  2. Qt cant work with opencv
    By danics in forum Qt Programming
    Replies: 3
    Last Post: 7th March 2010, 11:09
  3. Why does this not work?
    By lnxusr in forum Newbie
    Replies: 8
    Last Post: 18th December 2009, 18:53
  4. Replies: 2
    Last Post: 13th December 2009, 20:27
  5. Replies: 3
    Last Post: 15th January 2008, 12:11

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
  •  
Qt is a trademark of The Qt Company.