Results 1 to 7 of 7

Thread: Scrollbar in the container

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Scrollbar in the container

    Hi,
    Well going forward with this requirement,in all the reference material also I could find was a situation where there was only single widget and the scroll bar was applied to whole window, my requirement is a little different , I need scroll bar for only half of the visible area, for e.g. my window is divided in to 2 panels and I want a scroll bar only in the right hand side panel, provided the text in the panel is large. I am trying by using a widget for right hand panel and then applying QScrollArea, but no luck so far. Can anybody please help me ?

    Thanks
    Anju

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Scrollbar in the container

    I am trying by using a widget for right hand panel and then applying QScrollArea, but no luck so far.
    What widget are u using ? Most of the display widgets have scrollbars added automatically when needed. Whats ur case, and why do you need to explicitly apply QScrollArea ??

  3. #3
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Scrollbar in the container

    I am using a widget as a container for many QPushbuttons and I need scrollbars because the number of buttons can increase dynamically

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Scrollbar in the container

    Am not sure if thats possible in a straight way. I can think of 3 ways to accomplish the same -

    1) Use chevrons, the small inverted arrows which show a menu to choose from. You might see them in Word or some other application

    2) Use QListview and implement your own items to behave like a pusbutton. Or in simple case just change the cursor on hover event and make the list item work as a link/button. Be sure u use IConView for the list

    3) In Qt 4.4 you can add widgets to QGraphicsView. This might help your case if you are bent on using QPushButton . QGraphicsView is derived from QAbstractScrollArea, so it will have scrollbars as u need them.

    4) Make your own scrollbar for your widget. But why reinvent the wheel

  5. #5
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Scrollbar in the container

    well, I still do not think that problem is so complex , so as to think of these alternate ways, It was a simple problem of putting a scroll bar, which according to the QT literature should be simple enough and using the examples, I could apply the scrollbar on the whole window as such, I think I am missing a very crucial link in this problem, but never mind thanks for your ideas aamer

    Regards
    anju

  6. #6
    Join Date
    Jul 2008
    Location
    Bangalore
    Posts
    10
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Platforms
    Unix/X11

    Default Re: Scrollbar in the container

    Hi
    You cant put Scroll bar Untill u use proper layout.
    So u set layout after u set the scrollbars.

  7. #7
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Scrollbar in the container

    Might be , this thread helps you

Similar Threads

  1. QScrollarea events transferring to scrollbar
    By babu198649 in forum Qt Programming
    Replies: 15
    Last Post: 6th September 2013, 22:33
  2. ScrollBar inside QTreeWidget is Blurring on Scrolling
    By santosh.kumar in forum Qt Programming
    Replies: 0
    Last Post: 11th April 2008, 14:33
  3. Treeview scrollbar not updating when inserting rows
    By Khal Drogo in forum Qt Programming
    Replies: 11
    Last Post: 29th November 2007, 13:13
  4. GraphicsView/GraphicsScene: scrollbar policy Qt::ScrollBarAsNeeded
    By Pieter from Belgium in forum Qt Programming
    Replies: 4
    Last Post: 21st March 2007, 13:15
  5. 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.