Results 1 to 12 of 12

Thread: QScrollArea - how use it in QT Creator?

  1. #1
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QScrollArea - how use it in QT Creator?

    Hello!

    How can I use QScrollArea in QT Creator? I'm putting it on my MainWindow and putting inside it some objects but scroll bars doesn't work when objects are bigger ten scroll area.

    thanks in advance
    best regards
    Tomasz

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QScrollArea - how use it in QT Creator?

    some code would be helpful. Or can you re-frame your question

  3. #3
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QScrollArea - how use it in QT Creator?

    I don't have any code yet. I've just took 'Scroll Area' from 'Containers', put it on my window, an then put some stuff (like buttons) inside Scroll Area. Should I set some property to make it work? Other containers like 'Tab Widget' don't need any code.

    thanks in advance
    best regards
    Tomasz

  4. #4
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QScrollArea - how use it in QT Creator?

    oh i did not realize you are using qt designer for it. The scrollarea can only have one one widget inside it. you want many widgets, so you should make a custom widget and put that inside the scrollarea. sorry i dont work with designer.

  5. The following user says thank you to nish for this useful post:

    Tomasz (6th September 2010)

  6. #5
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QScrollArea - how use it in QT Creator?

    But even with one widget like Label or something else It doesn't work (widget inside is bigger then scroll area to see scrolling effect).

    thanks in advance
    best regards
    Tomasz

  7. #6
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QScrollArea - how use it in QT Creator?

    widget inside is bigger then scroll area to see scrolling effect
    you mean to say that the widget is bigger than the scrollarea and still the scrollbar doesnt come up? or the vice-versa?

  8. #7
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QScrollArea - how use it in QT Creator?

    Yes, widget inside is bigger, and scrollbar doesn't come up.

  9. #8
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QScrollArea - how use it in QT Creator?

    Use layouts

  10. The following user says thank you to tbscope for this useful post:

    Tomasz (6th September 2010)

  11. #9
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QScrollArea - how use it in QT Creator?

    I't works! Thanks! One more question about QScrollArea - how can I change width of scrolling bar? How should style sheet look like?

    thanks in advance
    best regards
    Tomasz

  12. #10
    Join Date
    Jun 2010
    Posts
    142
    Thanks
    11
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QScrollArea - how use it in QT Creator?

    And as a reminder, you should ALWAYS use layouts for EVERYTHING, because they align everything perfectly, even if the user has a different theme/font size.

  13. #11
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QScrollArea - how use it in QT Creator?

    Ok. But what about changing style of scroll bar? I want to change its width. How should my code look?

    thanks in advance
    best regards
    Tomasz

  14. #12
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QScrollArea - how use it in QT Creator?

    take a look at the documentation for QStyle and QStylesheets

Similar Threads

  1. Replies: 2
    Last Post: 10th March 2008, 20:16
  2. QScrollArea
    By ToddAtWSU in forum Qt Programming
    Replies: 5
    Last Post: 13th December 2007, 17:20
  3. QScrollArea
    By sabeesh in forum Qt Programming
    Replies: 7
    Last Post: 2nd November 2007, 10:33
  4. QScrollArea ?
    By whitefurrows in forum Qt Programming
    Replies: 2
    Last Post: 27th July 2007, 22:15
  5. QScrollArea
    By merry in forum Qt Programming
    Replies: 12
    Last Post: 20th June 2007, 13:05

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.