Results 1 to 2 of 2

Thread: custom QColumnView, some questions

  1. #1
    Join Date
    Sep 2008
    Posts
    43
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default custom QColumnView, some questions

    Hey all

    (1)I want the column thats being created when user clicks and item into the first Column of QColumnView to have a widget that;ll include labels and stuff...

    I tried to do this by reimplementing the QColumnView just like the documentations says.

    heres my class on my .h file
    Qt Code:
    1. class MyColumn : public QColumnView
    2. {
    3. Q_OBJECT
    4. public:
    5. QAbstractItemView * createColumn ( const QModelIndex & index );
    6. };
    To copy to clipboard, switch view to plain text mode 

    here's the sample code in my .cpp file
    Qt Code:
    1. QAbstractItemView * MyColumn::createColumn ( const QModelIndex & index )
    2. {
    3. QFrame *frame = new QFrame();
    4. frame->setMinimumSize(250,300);
    5. frame->setMaximumSize(250,300);
    6.  
    7. //return QColumnView::createColumn(frame);
    8. //return frame;
    9. return MyColumn::createColumn(frame);
    10.  
    11. }
    To copy to clipboard, switch view to plain text mode 

    and of course this gives me errors

    oh and i have one more question.
    (2) id like the vertical scrollbar that the first column has to be shown in the right end of QColumnView widget and when the user clicks an item the scrollbar to move in the left just when the items text is over so that the new column will fit in the space after the first column, without the need to create a second horizontal scrollbar in the bottom.

    I hope ive made myself clear, thanks for any help

  2. #2
    Join Date
    Sep 2008
    Posts
    43
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: custom QColumnView, some questions

    lol ok, ive managed to create a simple pushbutton and show it in the last column using setPreviewWidget() without the need for a custom QColumnView... lol.....

Similar Threads

  1. Replies: 12
    Last Post: 5th July 2009, 16:03
  2. Some questions about custom style
    By charlse in forum Qt Programming
    Replies: 0
    Last Post: 2nd April 2009, 09:54
  3. Replies: 2
    Last Post: 16th May 2008, 14:39
  4. Replies: 2
    Last Post: 15th February 2008, 01:21
  5. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 15:38

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.