diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/declarative/examples.qdoc | 2 | ||||
-rw-r--r-- | doc/src/development/qmake-manual.qdoc | 3 | ||||
-rw-r--r-- | doc/src/getting-started/examples.qdoc | 50 | ||||
-rw-r--r-- | doc/src/painting-and-printing/printing.qdoc | 11 | ||||
-rw-r--r-- | doc/src/snippets/widgetprinting.cpp | 54 | ||||
-rwxr-xr-x | doc/src/template/style/style.css | 1 |
6 files changed, 95 insertions, 26 deletions
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc index 9929cfe..3f075bb 100644 --- a/doc/src/declarative/examples.qdoc +++ b/doc/src/declarative/examples.qdoc @@ -28,7 +28,7 @@ /*! \page qdeclarativeexamples.html \title QML Examples and Demos - \brief Building UI's with QML + \brief Building UIs with QML \ingroup all-examples diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index f4becf8..754b8ad 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -1602,6 +1602,9 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 36 + Note that \c qmake will skip files that are executable. If you need to install + executable files, you can unset the files' executable flags. + \target LEXIMPLS \section1 LEXIMPLS diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index e8c85e6..a5f3446 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -273,7 +273,7 @@ \page examples-painting.html \ingroup all-examples \title Painting Examples - \brief How to use the Qt painting system + \brief How to use the Qt painting system. \image painting-examples.png @@ -303,7 +303,7 @@ \page examples-richtext.html \ingroup all-examples \title Rich Text Examples - \brief Using the document-oriented rich text engine + \brief Using the document-oriented rich text engine. \image richtext-examples.png @@ -324,7 +324,7 @@ \page examples-desktop.html \ingroup all-examples \title Desktop Examples - \brief Integrating your Qt application with your favorite desktop + \brief Integrating your Qt application with your favorite desktop. \image desktop-examples.png @@ -371,7 +371,7 @@ \page examples-threadandconcurrent.html \ingroup all-examples \title Threading and Concurrent Programming Examples - \brief Threading and concurrent programming in Qt + \brief Threading and concurrent programming in Qt. \image thread-examples.png @@ -409,7 +409,7 @@ \page examples.tools.html \ingroup all-examples \title Tools Examples - \brief Using Qt's containers, iterators, and other tool classes + \brief Using Qt's containers, iterators, and other tool classes. \image tool-examples.png @@ -445,7 +445,7 @@ \page examples-network.html \ingroup all-examples \title Network Examples - \brief How to do network programming in Qt + \brief How to do network programming in Qt. \image network-examples.png @@ -482,7 +482,7 @@ \page examples-ipc.html \ingroup all-examples \title IPC Examples - \brief Inter-Process Communication with Qt + \brief Inter-Process Communication with Qt. \image ipc-examples.png @@ -497,7 +497,7 @@ \page examples-opengl.html \ingroup all-examples \title OpenGL Examples - \brief Accessing OpenGL from Qt + \brief Accessing OpenGL from Qt. \image opengl-examples.png @@ -529,7 +529,7 @@ \page examples-openvg.html \ingroup all-examples \title OpenVG Examples - \brief Accessing OpenVG from Qt + \brief Accessing OpenVG from Qt. \image opengl-examples.png @@ -548,7 +548,7 @@ \page examples-multimedia.html \ingroup all-examples \title Multimedia Examples - \brief Audio, video, and Phonon with Qt + \brief Audio, video, and Phonon with Qt. \image phonon-examples.png @@ -595,7 +595,7 @@ \page examples-sql.html \ingroup all-examples \title SQL Examples - \brief Accessing your SQL database from Qt + \brief Accessing your SQL database from Qt. \image sql-examples.png @@ -623,7 +623,7 @@ \page examples-xml.html \ingroup all-examples \title XML Examples - \brief Using XML with Qt + \brief Using XML with Qt. \image xml-examples.png XML @@ -658,7 +658,7 @@ \page examples-designer.html \ingroup all-examples \title Qt Designer Examples - \brief Using Qt Designer to build your UI + \brief Using Qt Designer to build your UI. \image designer-examples.png QtDesigner @@ -681,7 +681,7 @@ \page examples-uitools.html \ingroup all-examples \title UiTools Examples - \brief Using the QtUiTools module + \brief Using the QtUiTools module. \image uitools-examples.png UiTools @@ -695,7 +695,7 @@ \page examples-linguist.html \ingroup all-examples \title Qt Linguist Examples - \brief Using Qt Linguist to internationalize your Qt application + \brief Using Qt Linguist to internationalize your Qt application. \image linguist-examples.png @@ -713,7 +713,7 @@ \page examples-script.html \ingroup all-examples \title Qt Script Examples - \brief Using the Qt scripting environment + \brief Using the Qt scripting environment. \image qtscript-examples.png QtScript @@ -740,7 +740,7 @@ \page examples-webkit.html \ingroup all-examples \title WebKit Examples - \brief Using WebKit in your Qt application + \brief Using WebKit in your Qt application. \image webkit-examples.png WebKit @@ -779,7 +779,7 @@ \page examples-helpsystem.html \ingroup all-examples \title Help System Examples - \brief Adding interactive help to your Qt application + \brief Adding interactive help to your Qt application. \image assistant-examples.png HelpSystem @@ -800,7 +800,7 @@ \page examples-statemachine.html \ingroup all-examples \title State Machine Examples - \brief Using Qt's finite state machine classes + \brief Using Qt's finite state machine classes. \image statemachine-examples.png StateMachine @@ -824,7 +824,7 @@ \page examples-animation.html \ingroup all-examples \title Animation Framework Examples - \brief Doing animations with Qt + \brief Doing animations with Qt. \image animation-examples.png Animation @@ -844,7 +844,7 @@ \page examples-touch.html \ingroup all-examples \title Touch Input Examples - \brief Using Qt's touch input capability + \brief Using Qt's touch input capability. Support for touch input makes it possible for developers to create extensible and intuitive user interfaces. @@ -861,7 +861,7 @@ \page examples-gestures.html \ingroup all-examples \title Gestures Examples - \brief Gesture programming examples + \brief Gesture programming examples. The API of the gesture framework is not yet finalized and still subject to change. @@ -875,7 +875,7 @@ \page examples-dbus.html \ingroup all-examples \title D-Bus Examples - \brief Using D-Bus from Qt applications + \brief Using D-Bus from Qt applications. \list \o \l{dbus/dbus-chat}{Chat} @@ -892,7 +892,7 @@ \page examples-embeddedlinux.html \ingroup all-examples \title Qt for Embedded Linux Examples - \brief Using Qt in Embedded Linux + \brief Using Qt in Embedded Linux. \image qt-embedded-examples.png QtEmbedded @@ -912,7 +912,7 @@ \page examples-activeqt.html \ingroup all-examples \title ActiveQt Examples - \brief Using ActiveX from Qt applications + \brief Using ActiveX from Qt applications. \image activeqt-examples.png ActiveQt diff --git a/doc/src/painting-and-printing/printing.qdoc b/doc/src/painting-and-printing/printing.qdoc index 62c8192..97cd92f 100644 --- a/doc/src/painting-and-printing/printing.qdoc +++ b/doc/src/painting-and-printing/printing.qdoc @@ -136,6 +136,17 @@ used is constructed using the form of the constructor that accepts a QPaintDevice argument. + \section1 Printing Widgets + + To print a widget, you can use the QWidget::render() function. As mentioned, + the printer's resolution is usually higher than the screen resolution, so you + will have to scale the painter. You may also want to position the widget on the + page. The following code sample shows how this may look. + + \snippet doc/src/snippets/widgetprinting.cpp 0 + + This will center the widget on the page and scale it so that it fits the page. + \section1 Printing from Complex Widgets Certain widgets, such as QTextEdit and QGraphicsView, display rich content diff --git a/doc/src/snippets/widgetprinting.cpp b/doc/src/snippets/widgetprinting.cpp new file mode 100644 index 0000000..b3d5b7c --- /dev/null +++ b/doc/src/snippets/widgetprinting.cpp @@ -0,0 +1,54 @@ + +#include <QtGui> + +class Window : public QWidget +{ + Q_OBJECT + +public: + Window() { + myWidget = new QPushButton("Print Me"); + connect(myWidget, SIGNAL(clicked()), this, SLOT(print())); + + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(myWidget); + setLayout(layout); + } + +private slots: + void print() { + QPrinter printer(QPrinter::HighResolution); + + printer.setOutputFileName("test.pdf"); + +//! [0] + QPainter painter; + painter.begin(&printer); + double xscale = printer.pageRect().width()/double(myWidget->width()); + double yscale = printer.pageRect().height()/double(myWidget->height()); + double scale = qMin(xscale, yscale); + painter.translate(printer.paperRect().x() + printer.pageRect().width()/2, + printer.paperRect().y() + printer.pageRect().height()/2); + painter.scale(scale, scale); + painter.translate(-width()/2, -height()/2); + + myWidget->render(&painter); +//! [0] + } + +private: + QPushButton *myWidget; +}; + +int main(int argv, char **args) +{ + QApplication app(argv, args); + + Window window; + window.show(); + + return app.exec(); +} + +#include "main.moc" + diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index b60aa41..51c4f7e 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -898,6 +898,7 @@ margin-left:10px; min-width:250px; line-height: 1.2; + min-width:100%; } |