PDA

View Full Version : New button in PrintPreview



febil
8th May 2009, 06:31
Hi,
Can i add a new tool button in the QPrintPreviewDialog??

munna
8th May 2009, 07:18
You can use QPrintPreviewWidget to create your own custom dialog. QPrintPreviewDialog uses QPrintPreviewWidget internally.

febil
8th May 2009, 08:02
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?

wysota
8th May 2009, 08:29
You can subclass the dialog, access its layouts and add widgets to it.

aliks-os
16th March 2015, 10:09
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);