Results 1 to 4 of 4

Thread: QTableView->QDockWidget

  1. #1
    Join Date
    Jan 2006
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default QTableView->QDockWidget

    Hello,

    How can i add a QTableView in a QDockWidget?

    Thx
    Last edited by ogre; 1st February 2006 at 14:34.

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: QTableView->QDockWidget

    i think you must add QTableWidget that bound with your QTableView

  3. #3
    Join Date
    Jan 2006
    Location
    India
    Posts
    115
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTableView->QDockWidget

    Quote Originally Posted by ogre
    Hello,

    How can i add a QTableView in a QDockWidget?

    Thx
    Just as you would add any other widget! Any more hints?

  4. #4
    Join Date
    Jan 2006
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QTableView->QDockWidget

    ok,
    i've got it.

    Qt Code:
    1. QDockWidget *dock = new QDockWidget(tr("Model"), this);
    2. dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
    3.  
    4. lb = new QTableView(dock);
    5. Tab_Model *delegate = new Tab_Model;
    6. lb->setModel(m);
    7.  
    8. dock->setMaximumWidth( 327 );
    9. dock->setWidget(lb);
    10. addDockWidget(Qt::RightDockWidgetArea, dock);
    To copy to clipboard, switch view to plain text mode 

    thx

Similar Threads

  1. Replies: 3
    Last Post: 29th January 2009, 09:38
  2. QTableView in ui with model/delegate
    By tpf80 in forum Qt Programming
    Replies: 7
    Last Post: 7th November 2008, 00:00
  3. QTableView
    By dragon in forum Qt Programming
    Replies: 0
    Last Post: 22nd September 2008, 17:53
  4. make QTableView work as a multi-column list view
    By wesley in forum Qt Programming
    Replies: 1
    Last Post: 11th March 2008, 15:43
  5. Multi-line messages in QTableView
    By Conel in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2006, 14:49

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.