Results 1 to 3 of 3

Thread: Centering a QCheckBox in a TableView

  1. #1
    Join Date
    Jun 2010
    Location
    Cincinnati, Ohio, USA
    Posts
    92
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question Centering a QCheckBox in a TableView

    I was having some issues getting the TableView to display a QCheckBox and have it interact correctly. Low and behold the issue was that I never implemented the set on the model. For anyone else having issues, I tweaked the querymodel example to have a selected field, here is the complete code:

    querymodel..zip

    Q: How does one go about getting the QCheckBox to be centered in the TableView?

    Sam

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Centering a QCheckBox in a TableView

    Delegates, I guess

  3. #3
    Join Date
    Jun 2010
    Location
    Cincinnati, Ohio, USA
    Posts
    92
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Wink Re: Centering a QCheckBox in a TableView

    Well, there are two reasons I posted the code, in order of importance:
    1. So others can see exactly how to use the Checked State in a table with the sql query model
    2. So others can tinker with the code to figure the correct way of center the check box rather then just guessing.

Similar Threads

  1. Vertical centering of a QTextEdit
    By miwarre in forum Newbie
    Replies: 4
    Last Post: 5th October 2015, 05:01
  2. How to centering the checkbox in qtableview
    By nemesisqp in forum Qt Programming
    Replies: 1
    Last Post: 8th April 2010, 17:22
  3. Centering a window
    By dwarnold45 in forum Newbie
    Replies: 1
    Last Post: 30th March 2010, 07:43
  4. Centering An Icon In A QTableWidgetItem?
    By mclark in forum Qt Programming
    Replies: 3
    Last Post: 14th November 2007, 23:11
  5. centering combobox text
    By illuzioner in forum Qt Programming
    Replies: 4
    Last Post: 30th May 2007, 14:06

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.