Results 1 to 2 of 2

Thread: How to disable scroll bars in QPrintPreviewWidget?

  1. #1
    Join Date
    Jan 2014
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default How to disable scroll bars in QPrintPreviewWidget?

    Hi All,

    I am creating a customized print preview dialog.
    In my dialog I am using QPrintPreviewWidget.
    I am able to show my print preview. In case if the preview has multiple pages then a scrollbar comes up.
    I need to disable the scroll bars which is provided by QPrintPreviewWidget. Any idea how to do this?
    Sorry if this is a silly doubt, I am new to QT thats why.... :-)

    Regards,
    R Manu

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,677
    Thanks
    13
    Thanked 1,596 Times in 1,524 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to disable scroll bars in QPrintPreviewWidget?

    It is not directly exposed so you have to use QObject introspection to find the scroll area inside the preview widget:
    Qt Code:
    1. QAbstractScrollArea *area = m_printPreview->findChild<QAbstractScrollArea*>();
    2. if (area) {
    3. area->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    4. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Scroll bars in scroll area not comming in scroll area
    By aurora in forum Qt Programming
    Replies: 3
    Last Post: 4th January 2012, 07:50
  2. Scroll bars in scroll area not comming
    By aurora in forum Qt Programming
    Replies: 3
    Last Post: 27th December 2011, 20:56
  3. Replies: 3
    Last Post: 1st January 2011, 17:00
  4. scroll bars are not appearing
    By Cruz in forum Qt Programming
    Replies: 4
    Last Post: 10th September 2010, 18:26
  5. QScrollArea's Scroll Bars
    By ToddAtWSU in forum Qt Programming
    Replies: 5
    Last Post: 19th September 2006, 14:27

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.