Results 1 to 5 of 5

Thread: New button in PrintPreview

  1. #1
    Join Date
    Feb 2009
    Posts
    29
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default New button in PrintPreview

    Hi,
    Can i add a new tool button in the QPrintPreviewDialog??

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: New button in PrintPreview

    You can use QPrintPreviewWidget to create your own custom dialog. QPrintPreviewDialog uses QPrintPreviewWidget internally.

  3. #3
    Join Date
    Feb 2009
    Posts
    29
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: New button in PrintPreview

    you mean we need to write a new class derived from QPrintPreviewWidget?
    i need all the buttons currently available in dialog and then need to add a new button. so is there any simple method to add the button?
    If possible, can u please show me an example?

  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: New button in PrintPreview

    You can subclass the dialog, access its layouts and add widgets to it.
    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
    Apr 2010
    Posts
    15
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: New button in PrintPreview

    You may easy add button to QPrintPreviewDialog by following

    QAction *act = new QAction("aaa",this);
    QList<QToolBar *> list = preview.findChildren<QToolBar *>();
    list.at(0)->addAction(act);

Similar Threads

  1. button background color when it is clicked
    By navi1084 in forum Qt Programming
    Replies: 4
    Last Post: 9th December 2008, 15:02
  2. button with backgr and icon using stylesheets
    By s_p_t10 in forum Qt Programming
    Replies: 0
    Last Post: 7th May 2008, 20:19
  3. problem about mouse button events
    By vql in forum Qt Programming
    Replies: 1
    Last Post: 29th April 2008, 10:14
  4. question about button
    By narumi in forum Newbie
    Replies: 2
    Last Post: 21st January 2008, 05:44
  5. Push button double click
    By curtisw in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2006, 16:40

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.