Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Add QComboBox to QPrintPreviewDialog toolbar



  • Hi all,

    I have created a QPrintPreviewDialog as below code.

    @ void showPrintPreview()
    {
    AppSettings settings;
    QPrinter printer;
    QPrintPreviewDialog preview( &printer );
    printer.setOrientation(settings.printerPaperOrientation());
    printer.setPaperSize(settings.printerPaperSize());
    connect(&preview,SIGNAL(paintRequested(QPrinter*)),this,SLOT(drawViewOnPrinter(QPrinter*)));
    preview.resize(1000,1000);
    preview.exec();
    }@

    Now I need to change the displaying document in preview according to the selection of user. So I think to add a QComboBox to the toolbar of QPrintPreviewDialog.

    1) Can anybody tell me is it possible?

    1. If possible I would like to know best way of doing that.

    Thank you all.. waiting for helping hand..



  • If this way not possible can anybody suggest a solution.. :)

    Thank you..



  • You may try to use QPrintPreviewWidget and build your own dialog


Log in to reply