Results 1 to 1 of 1

Thread: scrollbar not working in Q3ScrollView...

  1. #1
    Join Date
    Nov 2008
    Posts
    52
    Qt products
    Qt4
    Platforms
    Windows

    Default scrollbar not working in Q3ScrollView...

    I am using QT 4.4.3 .In Q3ScrollView scrollbars will automatically come if contents size is greater than the viewable area.But this didn't happen.so I used sv->setVScrollBarMode(Q3ScrollView::AlwaysOn); as follows:

    Qt Code:
    1. Q3ScrollView* sv = new Q3ScrollView(this);
    2. sv->setGeometry(0,0,110,600);
    3. sv->setVScrollBarMode(Q3ScrollView::AlwaysOn);
    4. QWidget *widget = new QWidget(sv->viewport());
    5. QVBoxLayout *layout = new QVBoxLayout(widget);
    6.  
    7. QLabel* child1 = new QLabel("CHILD", widget);
    8.  
    9. child1->setPixmap(QPixmap(":/trolltech/examples/graphicsview/portedcanvas/img1.png"));
    10. child1->setGeometry(2,2,90,620);
    To copy to clipboard, switch view to plain text mode 

    After doing this the scrollbar appeared but scrolling was not happening.The scrollbar appeared as shown in the image below:
    Attached Images Attached Images
    Last edited by sh123; 12th February 2009 at 13:34. Reason: reformatted to look better

Similar Threads

  1. Scrollbar not working fine way
    By santosh.kumar in forum Qt Programming
    Replies: 0
    Last Post: 15th April 2008, 04:58
  2. GraphicsView/GraphicsScene: scrollbar policy Qt::ScrollBarAsNeeded
    By Pieter from Belgium in forum Qt Programming
    Replies: 4
    Last Post: 21st March 2007, 13:15
  3. about scrollbar style
    By qtopiahooo in forum Qt Programming
    Replies: 1
    Last Post: 25th January 2007, 13:34

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
  •  
Qt is a trademark of The Qt Company.