Results 1 to 8 of 8

Thread: Centering QPushButton within a QTableWidget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2010
    Posts
    122
    Thanks
    62
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Wink Centering QPushButton within a QTableWidget

    Does anyone know how to center a QPushButton within a QTableWidget.
    I need to create a dynamic set of menu icons in a grid, with scrollbars for
    content that may be off screen. The QTableWidget seems to work to some
    extent, but interested if others think a better Qt list class would be better.

    Attached is a sample screenshot. I want the pushbuttons to be centered
    within the larger grid size of the table.

    I have left the grid lines on for reference, but these will be removed in practice.

    Do the text alignment flags work here, or is a delegate required, or perhaps a derivative
    of QTableWidget.
    Attached Images Attached Images

Similar Threads

  1. Using QPushButton in QTableWidget
    By arpspatel in forum Qt Programming
    Replies: 2
    Last Post: 1st September 2010, 00:26
  2. Can QPushButton be put into a QTableWidget cell?
    By ShaChris23 in forum Newbie
    Replies: 4
    Last Post: 1st September 2010, 00:18
  3. Centering a QCheckBox in a TableView
    By scarleton in forum Qt Programming
    Replies: 2
    Last Post: 6th July 2010, 15:13
  4. How to centering the checkbox in qtableview
    By nemesisqp in forum Qt Programming
    Replies: 1
    Last Post: 8th April 2010, 17:22
  5. Centering a window
    By dwarnold45 in forum Newbie
    Replies: 1
    Last Post: 30th March 2010, 07:43

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.