From 8e276783918d25d05eee65fd9eb5510ebcfbecc4 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Fri, 17 Sep 2010 17:15:29 +0200 Subject: Added default value documentation for two variables. Reviewed-by: David Boddie: --- src/corelib/io/qtextstream.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index eab0662..6091ec0 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -3019,8 +3019,8 @@ void QTextStream::setAutoDetectUnicode(bool enabled) } /*! - Returns true if automatic Unicode detection is enabled; otherwise - returns false. + Returns true if automatic Unicode detection is enabled, otherwise + returns false. Automatic Unicode detection is enabled by default. \sa setAutoDetectUnicode(), setCodec() */ @@ -3051,7 +3051,8 @@ void QTextStream::setGenerateByteOrderMark(bool generate) /*! Returns true if QTextStream is set to generate the UTF BOM (Byte Order - Mark) when using a UTF codec; otherwise returns false. + Mark) when using a UTF codec; otherwise returns false. UTF BOM generation is + set to false by default. \sa setGenerateByteOrderMark() */ -- cgit v0.12 From f3a9990f6c46d596b9a53e0cca14c66d58b1dbe3 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Mon, 20 Sep 2010 10:38:09 +0200 Subject: Doc: Added info on QWidget::render to printing docs Task-number: QTBUG-2210 Reviewed-by: David Boddie --- doc/src/painting-and-printing/printing.qdoc | 11 ++++++ doc/src/snippets/widgetprinting.cpp | 54 +++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 doc/src/snippets/widgetprinting.cpp 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 + +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" + -- cgit v0.12 From f5fcf515f73390ce124027335bb74d4a4c5f7b43 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Mon, 20 Sep 2010 11:05:26 +0200 Subject: Doc: Fixing overlapping text problem in columns --- doc/src/template/style/style.css | 1 + 1 file changed, 1 insertion(+) 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%; } -- cgit v0.12 From bed1c8091e5ee5287a2587874840eadcf2b3b5f8 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Wed, 22 Sep 2010 13:54:29 +0200 Subject: Doc: Added a note to qmake INSTALLS docs Task-number: QTBUG-3171 Reviewed-by: David Boddie --- doc/src/development/qmake-manual.qdoc | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v0.12 From 9634e133db1bf50a55ed44b3fe01e49954c80d08 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Thu, 23 Sep 2010 09:30:38 +0200 Subject: Doc: maintainance - fixing grammar and spelling --- doc/src/declarative/examples.qdoc | 2 +- doc/src/getting-started/examples.qdoc | 50 ++++++++++++++--------------- tools/qdoc3/test/qt-html-templates.qdocconf | 4 +-- 3 files changed, 28 insertions(+), 28 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/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/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index b716f7c..44aa918 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -40,7 +40,7 @@ HTML.postheader = "
\n" \ "
  • Qt Topics \n" \ "
      \n" \ "
    • Programming with Qt
    • \n" \ - "
    • Device UI's & Qt Quick
    • \n" \ + "
    • Device UIs & Qt Quick
    • \n" \ "
    • UI Design with Qt
    • \n" \ "
    • Cross-platform and Platform-specific
    • \n" \ "
    • Platform-specific info
    • \n" \ @@ -94,7 +94,7 @@ HTML.postheader = "
      \n" \ "
      \n" \ "
        \n" \ "
      • Programming with Qt
      • \n" \ - "
      • Device UI's & Qt Quick
      • \n" \ + "
      • Device UIs & Qt Quick
      • \n" \ "
      • UI Design with Qt
      • \n" \ "
      • Cross-platform and Platform-specific
      • \n" \ "
      • Platform-specific info
      • \n" \ -- cgit v0.12 From 181f6a4b76a278ded6e402aada657cfda2d3f638 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Fri, 24 Sep 2010 09:30:22 +0200 Subject: Doc: Said that QApplication exits when not able to open X11 display Task-number: QTBUG-13377 Reviewed-by: Jerome Pasion --- src/gui/kernel/qapplication.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 43d5772..e6dc623 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -711,6 +711,12 @@ void QApplicationPrivate::process_cmdline() done. \endlist + \section1 X11 Notes + + If QApplication fails to open the X11 display, it will terminate + the process. This behavior is consistent with most X11 + applications. + \sa arguments() */ -- cgit v0.12 From 4286d8d20eae7b0876acc5afcecebc03cfc2514a Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Fri, 24 Sep 2010 09:33:53 +0200 Subject: Doc: call qApp->precessEvents after QSplashScreen::showMessage Task-number: QTBUG-13734 Reviewed-by: Jerome Pasion --- src/gui/widgets/qsplashscreen.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/widgets/qsplashscreen.cpp b/src/gui/widgets/qsplashscreen.cpp index 8be0cf8..d1fb686 100644 --- a/src/gui/widgets/qsplashscreen.cpp +++ b/src/gui/widgets/qsplashscreen.cpp @@ -186,6 +186,13 @@ void QSplashScreen::repaint() Draws the \a message text onto the splash screen with color \a color and aligns the text according to the flags in \a alignment. + To make sure the splash screen is repainted immediately, you can + call \l{QCoreApplication}'s + \l{QCoreApplication::}{processEvents()} after the call to + showMessage(). You usually want this to make sure that the message + is kept up to date with what your application is doing (e.g., + loading files). + \sa Qt::Alignment, clearMessage() */ void QSplashScreen::showMessage(const QString &message, int alignment, -- cgit v0.12 From 4c0016bd7f177603bab05c2a71cd45e839c11173 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Fri, 24 Sep 2010 16:58:43 +0200 Subject: Added a condition to skip obsolete functions during the threadness check. Reviewed-by: David Boddie Task:QTBUG-13786 --- tools/qdoc3/generator.cpp | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 7f39be2..f1eaddc 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -981,23 +981,26 @@ void Generator::generateThreadSafeness(const Node *node, CodeMarker *marker) NodeList nonreentrant; NodeList::ConstIterator c = innerNode->childNodes().begin(); while (c != innerNode->childNodes().end()) { - switch ((*c)->threadSafeness()) { - case Node::Reentrant: - reentrant.append(*c); - if (threadSafeness == Node::ThreadSafe) - exceptions = true; - break; - case Node::ThreadSafe: - threadsafe.append(*c); - if (threadSafeness == Node::Reentrant) + + if ((*c)->status() != Node::Obsolete){ + switch ((*c)->threadSafeness()) { + case Node::Reentrant: + reentrant.append(*c); + if (threadSafeness == Node::ThreadSafe) + exceptions = true; + break; + case Node::ThreadSafe: + threadsafe.append(*c); + if (threadSafeness == Node::Reentrant) + exceptions = true; + break; + case Node::NonReentrant: + nonreentrant.append(*c); exceptions = true; - break; - case Node::NonReentrant: - nonreentrant.append(*c); - exceptions = true; - break; - default: - break; + break; + default: + break; + } } ++c; } -- cgit v0.12 From 84d278501a19eaccf9a77cccd95ca5d17a2dcd2b Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Fri, 24 Sep 2010 17:50:04 +0200 Subject: Clarified documentation of loadFinished() signal. Reviewed-by:David Boddie Task: QTBUG-10178 --- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index d0c047d..9b97c8b 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -1890,9 +1890,10 @@ InspectorController* QWebPagePrivate::inspectorController() The loadStarted() signal is emitted when the page begins to load.The loadProgress() signal, on the other hand, is emitted whenever an element of the web page completes loading, such as an embedded image, a script, - etc. Finally, the loadFinished() signal is emitted when the page has - loaded completely. Its argument, either true or false, indicates whether - or not the load operation succeeded. + etc. Finally, the loadFinished() signal is emitted when the page contents + are loaded completely, independent of script execution or page rendering. + Its argument, either true or false, indicates whether or not the load + operation succeeded. \section1 Using QWebPage in a Widget-less Environment @@ -3729,7 +3730,7 @@ quint64 QWebPage::bytesReceived() const /*! \fn void QWebPage::loadStarted() - This signal is emitted when a new load of the page is started. + This signal is emitted when a page starts loading content. \sa loadFinished() */ @@ -3748,7 +3749,8 @@ quint64 QWebPage::bytesReceived() const /*! \fn void QWebPage::loadFinished(bool ok) - This signal is emitted when a load of the page is finished. + This signal is emitted when the page finishes loading content. This signal + is independant of script execution or page rendering. \a ok will indicate whether the load was successful or any error occurred. \sa loadStarted(), ErrorPageExtension -- cgit v0.12