Results 1 to 4 of 4

Thread: Scroll bars in scroll area not comming

  1. #1
    Join Date
    Oct 2011
    Posts
    160
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default Scroll bars in scroll area not comming

    Hi all,
    Using Qt designer i created a Scroll area, and in run, dynamically adding widgets inside it...
    But unfortunately, widgets are added but scroll bar not coming...Because of this only few widgets are visible....

    I searched in forum, many r unresolved problems...
    Please help me to sort out my problem
    this is the code....
    Qt Code:
    1. void MainWindow::on_pushButton_clicked()
    2. {
    3. QLabel *label =new QLabel;
    4. label->setText("hello");
    5. ui->verticalLayout->addWidget(label,10);
    6.  
    7.  
    8. }
    To copy to clipboard, switch view to plain text mode 

    i set scroll bar policy as always on....
    Last edited by aurora; 27th December 2011 at 11:22.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Scroll bars in scroll area not comming

    The sample code is useless! What is ui->verticalLayout? And calling ui->scrollArea->widgetResizable(); is superfluous.

  3. #3
    Join Date
    Oct 2011
    Posts
    160
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Scroll bars in scroll area not comming

    Quote Originally Posted by Lykurg View Post
    The sample code is useless! What is ui->verticalLayout? And calling ui->scrollArea->widgetResizable(); is superfluous.
    adding widget into layout, which is inside scrollarea....
    Sorry Lykurg, i'm first time using this scroll area.....confused very much...please help me...
    Last edited by aurora; 27th December 2011 at 11:40.

  4. #4
    Join Date
    Apr 2009
    Location
    Italy
    Posts
    70
    Thanks
    23
    Thanked 15 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Scroll bars in scroll area not comming

    Calling scrollArea->widgetResizable() is useless indeed, but calling scrollArea->setWidgetResizable(true) might be a good idea (call it just after you create the scroll area)

    Also, you can play with QScrollArea::setSizePolicy() (inherited from QWidget)

Similar Threads

  1. Replies: 3
    Last Post: 1st January 2011, 17:00
  2. scroll bars are not appearing
    By Cruz in forum Qt Programming
    Replies: 4
    Last Post: 10th September 2010, 18:26
  3. scroll bars in QTabWidget--i don't want them
    By jhowland in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2010, 09:12
  4. Replies: 1
    Last Post: 11th June 2009, 06:49
  5. QScrollArea's Scroll Bars
    By ToddAtWSU in forum Qt Programming
    Replies: 5
    Last Post: 19th September 2006, 14:27

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.