Results 1 to 4 of 4

Thread: Issue with QComboBox for QTableView horizontalHeader

  1. #1
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Issue with QComboBox for QTableView horizontalHeader

    I've implemented a QTableView based on this:

    http://blog.qt.io/blog/2014/04/11/qt...a-qheaderview/


    and the implementation referenced in the associated comments.

    The result is a tableView where the horizontal header is a set of QComboBoxes. My specific code initializes the content of the boxes does some other custom stuff like disabling items in the boxes when they are the currentItem in boxes associated other columns.

    It all works, except that the contents of the boxes don't show up unless a section is resized or the table is horizontally scrolled.

    If I resize a section with the mouse, its box and all the boxes associated with columns to the right "get fixed". But those to the left remain empty. Like the sectionResized handler is doing the magic.

    My subClassed combobox has handlers for signals sectionResized() and sectionMoved(), just like the reference article suggests. As a workaround, I've tried calling them from code after the tableView has been constructed. But, that doesn't fix the problem.

    Also, I've tried calling resizeSection(int,int) from code, but for some reason the sectionResized() handler never gets called. (Both sectionResized and sectionMoved handlers get call properly when I use the mouse to resize or scroll).

    I've tried adding update() and show() many places, but those don't seem to have any affect.

    It's been driving me crazy. I'd be happy with a work-around with just doing something in code that does what I'm doing with a mouse!

  2. #2
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Issue with QComboBox for QTableView horizontalHeader

    Still no solution to this. I'm going to have to try something else.

  3. #3
    Join Date
    Jul 2012
    Posts
    244
    Thanks
    27
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Issue with QComboBox for QTableView horizontalHeader

    Can you give a minimal compilable example that shows the problem?

    Try hiding and reshowing the header.

  4. #4
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Issue with QComboBox for QTableView horizontalHeader

    hiding and reshowing the header didn't fix the issue.

    Yes, I'll work on a minimal compilable example.
    Thanks,

    Dave Thomas

Similar Threads

  1. Replies: 1
    Last Post: 14th September 2010, 16:26
  2. Replies: 5
    Last Post: 29th June 2010, 11:58
  3. QComboBox Issue
    By ToddAtWSU in forum Qt Programming
    Replies: 3
    Last Post: 21st August 2008, 12:16
  4. QWizard, QComboBox and registerField() issue
    By RThaden in forum Qt Programming
    Replies: 1
    Last Post: 27th May 2008, 12:18
  5. Resizing QTableView's horizontalHeader
    By Jimmy2775 in forum Qt Programming
    Replies: 4
    Last Post: 20th December 2006, 00:14

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.