PDA

View Full Version : Copy and print in QDialog



bismitapadhy
29th July 2009, 08:14
I created a QDialog which contains a QTreeView and copy and print QToolbar Button.

How can i copy and print the Qtreeview content on clicking respective button.
print function is only there for editor or document how can i do for a dialog.

wysota
29th July 2009, 08:19
It doesn't matter whether you are in a dialog or not. There is no out-of-the-box printing support for tree-views. You need to open a painter on the printer object and paint all the items of your treeview to the painter. Alternatively you can render the looks of the widget using QWidget::render() but that's probably not what you want.