Results 1 to 7 of 7

Thread: QTableWidget, grid color bug?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2008
    Posts
    17
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTableWidget, grid color bug?

    Hi!

    I use QTableWidget in one of my projects. The desired functioning is: every x seconds show some extended, colored items.

    My problem is, that after I set the background color and extend some items, it works correctly. But when I change aftert x sec the background color and I extend other way the same items, the grid of the previous colored, extended items will be stuck and keep this previous color.

    I tried to extend the whole table to one cell with background color white, and after extend to the other way, but henceforward the grid was stuck to the previous color.

    Other solution could be to set the column width 0, but I've already tried and no effect.

    Any idea, comment, experience?

    Thanks,
    virag

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTableWidget, grid color bug?

    I don't understand, do you need to hide a grid?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Sep 2008
    Posts
    17
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget, grid color bug?

    I need to hide the column lines (grids) between some items.

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTableWidget, grid color bug?

    I think you should write a delegate which will do this.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. #5
    Join Date
    Sep 2008
    Posts
    17
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget, grid color bug?

    1. How do you think this exactly?

    2. I thought the setSpan function with the right parameters is that I've searched. It should be. ("Sets the span of the table element at (row, column) to the number of rows and columns specified by (rowSpanCount, columnSpanCount).")

    I attach a pic about the problem.
    Attached Images Attached Images

  6. #6
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTableWidget, grid color bug?

    try to hide a grid and look what will happen.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  7. #7
    Join Date
    Sep 2008
    Posts
    17
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget, grid color bug?

    Ok, I've found setShowGrid(bool) function, and it works.

    But on the other hand, I think setSpan could be the other good solution. Just I don't understand, how I should use it.

Similar Threads

  1. QComboBox in QTableWidget : display troubles.
    By Nyphel in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2007, 23:29
  2. How to fill the blocks of the Grid one by one?
    By merry in forum Qt Programming
    Replies: 1
    Last Post: 6th June 2007, 12:20
  3. print QTableWidget
    By chak_med in forum Qt Programming
    Replies: 3
    Last Post: 4th November 2006, 18:46
  4. QTableWidget editing question
    By Trasmeister in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 18:46
  5. Replies: 6
    Last Post: 5th March 2006, 21:05

Tags for this Thread

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.