52 #include <QtPrintSupport/qtprintsupportglobal.h>
53 #if QT_CONFIG(printdialog)
55 #include <QPrintDialog>
72 layout->addWidget(myWidget);
73 layout->addWidget(myWidget2);
81 #if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printer)
84 printer.setOutputFileName(
"test.pdf");
89 double xscale = printer.pageRect().width() / double(myWidget->
width());
90 double yscale = printer.pageRect().height() / double(myWidget->
height());
93 printer.paperRect().y() + printer.pageRect().height()/2);
104 #if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog)
116 editor->
print(&printer);
The QApplication class manages the GUI application's control flow and main settings.
friend class QPushButton
[1]
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
The QPainter class performs low-level painting on widgets and other paint devices.
bool begin(QPaintDevice *)
void scale(qreal sx, qreal sy)
void translate(const QPointF &offset)
The QPrintDialog class provides a dialog for specifying the printer's configuration.
The QPrinter class is a paint device that paints on a printer.
bool hasSelection() const
The QTextEdit class provides a widget that is used to edit and display both plain and rich text.
QTextCursor textCursor() const
void print(QPagedPaintDevice *printer) const
The QVBoxLayout class lines up widgets vertically.
int width
the width of the window's geometry
int height
the height of the window's geometry
[Window class definition]
GLenum GLenum GLuint GLint GLint GLint yscale
GLenum GLenum GLuint GLint GLint xscale
GLenum GLenum GLenum GLenum GLenum scale
QFileDialog dialog(this)
[1]
QApplication app(argc, argv)
[0]