Results 1 to 4 of 4

Thread: Suggestions Anyone:QTableView Grid

  1. #1
    Join Date
    Jan 2007
    Posts
    38
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Suggestions Anyone:QTableView Grid

    I have created a QDialog on top of which i have a QTableView, and a few buttons.

    I would like to know what controls the size of the grid in the view.

    I would like to have the width of the grid be the same size as the view's frame at all times (even as the view is being resized ie. being pulled at one end by the mouse cursor {see image attached}).

    Meaning if the grid is in the so called client geometry of the view, i want the client geometry and the frame geometry of the table view to be equal.

    I was thinking of subclassing the table view and probably calling setgeometry() within resizeEvent; at the risk of infinite recursion . Could that work?

    Do i need to subclass QItemDelegate, or QabstractItemDelegate?

    I am just trying to find a way to get it done, any suggestions are welcomed.

    A bmp image is included in the zip attached, so everyone can get a graphical feel for what i'm taking about.

    Thanks very much for your attention.
    Attached Files Attached Files
    Last edited by locus; 23rd January 2007 at 07:36. Reason: spelling error

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Suggestions Anyone:QTableView Grid

    This is where layouts enter the picture. Let a layout resize your grid.

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Suggestions Anyone:QTableView Grid

    QHeaderView is responsible for resizing columns. You can access it through QTableView::horizontalHeader(). Depending on how you want it to act, you can play with:
    J-P Nurmi

  4. The following user says thank you to jpn for this useful post:

    locus (23rd January 2007)

  5. #4
    Join Date
    Jan 2007
    Posts
    38
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Re: Suggestions Anyone:QTableView Grid

    hey jpn,

    Thanks man,

    I'm checking it out now.

Similar Threads

  1. Replies: 4
    Last Post: 11th September 2006, 14:13
  2. How do I layout in a Grid?
    By DPinLV in forum Qt Tools
    Replies: 7
    Last Post: 10th August 2006, 01:37
  3. Dynamic grid layout
    By eriwik in forum Qt Programming
    Replies: 1
    Last Post: 12th June 2006, 15:19
  4. How do I move a widget inside a grid Layout
    By barnabyr in forum Newbie
    Replies: 1
    Last Post: 8th May 2006, 23:23
  5. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45

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.