Results 1 to 2 of 2

Thread: QScrollBar within a QMessageBox

  1. #1
    Join Date
    Jan 2008
    Location
    Germany
    Posts
    80
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QScrollBar within a QMessageBox

    Hi,

    I would like to use a QMessageBox in order to display the content of a txt file.
    I am wondering if there is a possibility to activate an horizontal and/or a vertical scrollbar if the text from the file exceeds certain limits ?

    This is my current code:

    Qt Code:
    1. void
    2. MainWindow::credits() {
    3. QFile file(":/credits.txt");
    4.  
    5. if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
    6. return;
    7.  
    8. QMessageBox credits(QString("My Application"),file.readAll(),
    9. QMessageBox::NoIcon,
    10. QMessageBox::NoButton,
    11. QMessageBox::NoButton,
    12. this
    13. );
    14.  
    15. credits.exec();
    16.  
    17. file.close();
    18. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: QScrollBar within a QMessageBox

    I guess detailedText property of QMessageBox will help you to perform what you want..?

Similar Threads

  1. customizing QScrollbar
    By MarkoSan in forum Qt Programming
    Replies: 7
    Last Post: 15th October 2009, 18:51
  2. QGraphicsView and QScrollBar
    By paolom in forum Qt Programming
    Replies: 3
    Last Post: 2nd October 2009, 08:19
  3. QScrollbar color
    By ntp in forum Qt Programming
    Replies: 0
    Last Post: 28th August 2008, 17:59
  4. QScrollbar stylesheet
    By GuS in forum Qt Programming
    Replies: 34
    Last Post: 4th December 2007, 16:12
  5. Customizing QScrollBar
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 2nd February 2006, 18:01

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.