Results 1 to 10 of 10

Thread: How to add horizontal and verticle scroll bar to the QDialog?

  1. #1
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default How to add horizontal and verticle scroll bar to the QDialog?

    How to add horizontal and verticle scroll bar to the QDialog? if the values in the qdialog goes downwards or rightwards. so that the scrollbar should appear automatically?

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to add horizontal and verticle scroll bar to the QDialog?

    On QDialog put QScrollArea and all widgets put on this area.

  3. #3
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to add horizontal and verticle scroll bar to the QDialog?

    I have tried doing that.. But nothing happens.. here is the code
    Qt Code:
    1. scroll = new QScrollArea();
    2. scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded)
    3. scroll->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded)
    4. scroll->setParent(this);
    5. scroll-> setVisible(true);
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to add horizontal and verticle scroll bar to the QDialog?

    Your scroll area has no content currently.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to add horizontal and verticle scroll bar to the QDialog?

    Is there anything to do with the above code provided?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to add horizontal and verticle scroll bar to the QDialog?

    What did you put in the scroll area? Is there anything at all? Did you put the scroll area in your widget's layout?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to add horizontal and verticle scroll bar to the QDialog?

    I couldnt get your point. Could you give me a change in the above code i want to make.. I am just creating QLabel at run time.. How to put the QLabel and the whole QDialog inside the QScrollArea()

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to add horizontal and verticle scroll bar to the QDialog?

    Did you even read the example in QScrollArea docs? Do you see the differences between your code and the code of the example? Do you understand how QScrollArea works?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to add horizontal and verticle scroll bar to the QDialog?

    I have used the same code, but i am getting some exceptions out there

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to add horizontal and verticle scroll bar to the QDialog?

    So fix your errors.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 3rd August 2011, 01:14
  2. Horizontal scroll bar on QTreeView
    By LynneV in forum Qt Programming
    Replies: 7
    Last Post: 9th November 2010, 21:05
  3. Resizing QTableView to eliminate horizontal scroll bar?
    By russford in forum Qt Programming
    Replies: 7
    Last Post: 18th March 2010, 07:21
  4. Vertical scroll bar, but resizable horizontal content
    By minimoog in forum Qt Programming
    Replies: 0
    Last Post: 14th January 2009, 20:51
  5. ListWidget horizontal scroll.
    By patrick772goh in forum Qt Tools
    Replies: 3
    Last Post: 17th July 2007, 07:32

Tags for this Thread

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.