diff options
Diffstat (limited to 'examples/widgets/doc/imagecomposition.qdoc')
-rw-r--r-- | examples/widgets/doc/imagecomposition.qdoc | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/examples/widgets/doc/imagecomposition.qdoc b/examples/widgets/doc/imagecomposition.qdoc index e1b7ac2d15..3f06f377b4 100644 --- a/examples/widgets/doc/imagecomposition.qdoc +++ b/examples/widgets/doc/imagecomposition.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example widgets/painting/imagecomposition + \example painting/imagecomposition \title Image Composition Example The Image Composition example lets the user combine images @@ -41,7 +41,7 @@ \e butterfly.png and \e checker.png that are embedded within \e imagecomposition.qrc. The file contains the following code: - \quotefile widgets/painting/imagecomposition/imagecomposition.qrc + \quotefile painting/imagecomposition/imagecomposition.qrc For more information on resource files, see \l{The Qt Resource System}. @@ -51,21 +51,21 @@ private slots, \c chooseSource(), \c chooseDestination(), and \c recalculateResult(). - \snippet widgets/painting/imagecomposition/imagecomposer.h 0 + \snippet painting/imagecomposition/imagecomposer.h 0 In addition, \c ImageComposer consists of five private functions, \c addOp(), \c chooseImage(), \c loadImage(), \c currentMode(), and \c imagePos(), as well as private instances of QToolButton, QComboBox, QLabel, and QImage. - \snippet widgets/painting/imagecomposition/imagecomposer.h 1 + \snippet painting/imagecomposition/imagecomposer.h 1 \section1 ImageComposer Class Implementation We declare a QSize object, \c resultSize, as a static constant with width and height equal to 200. - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 0 + \snippet painting/imagecomposition/imagecomposer.cpp 0 Within the constructor, we instantiate a QToolButton object, \c sourceButton and set its \l{QAbstractButton::setIconSize()}{iconSize} @@ -74,7 +74,7 @@ QPainter::CompositionMode, \a mode, and a QString, \a name, representing the name of the composition mode. - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 1 + \snippet painting/imagecomposition/imagecomposer.cpp 1 The \c destinationButton is instantiated and its \l{QAbstractButton::setIconSize()}{iconSize} property is set to @@ -82,7 +82,7 @@ are created and \c{resultLabel}'s \l{QWidget::setMinimumWidth()} {minimumWidth} is set. - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 2 + \snippet painting/imagecomposition/imagecomposer.cpp 2 We connect the following signals to their corresponding slots: \list @@ -94,40 +94,40 @@ is connected to \c chooseDestination(). \endlist - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 3 + \snippet painting/imagecomposition/imagecomposer.cpp 3 A QGridLayout, \c mainLayout, is used to place all the widgets. Note that \c{mainLayout}'s \l{QLayout::setSizeConstraint()}{sizeConstraint} property is set to QLayout::SetFixedSize, which means that \c{ImageComposer}'s size cannot be resized at all. - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 4 + \snippet painting/imagecomposition/imagecomposer.cpp 4 We create a QImage, \c resultImage, and we invoke \c loadImage() twice to load both the image files in our \e imagecomposition.qrc file. Then, we set the \l{QWidget::setWindowTitle()}{windowTitle} property to "Image Composition". - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 5 + \snippet painting/imagecomposition/imagecomposer.cpp 5 The \c chooseSource() and \c chooseDestination() functions are convenience functions that invoke \c chooseImage() with specific parameters. - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 6 + \snippet painting/imagecomposition/imagecomposer.cpp 6 \codeline - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 7 + \snippet painting/imagecomposition/imagecomposer.cpp 7 The \c chooseImage() function loads an image of the user's choice, depending on the \a title, \a image, and \a button. - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 10 + \snippet painting/imagecomposition/imagecomposer.cpp 10 The \c recalculateResult() function is used to calculate amd display the result of combining the two images together with the user's choice of composition mode. - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 8 + \snippet painting/imagecomposition/imagecomposer.cpp 8 The \c addOp() function adds an item to the \c operatorComboBox using \l{QComboBox}'s \l{QComboBox::addItem()}{addItem} function. This function @@ -135,31 +135,31 @@ rectangle is filled with Qt::Transparent and both the \c sourceImage and \c destinationImage are painted, before displaying it on \c resultLabel. - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 9 + \snippet painting/imagecomposition/imagecomposer.cpp 9 The \c loadImage() function paints a transparent background using \l{QPainter::fillRect()}{fillRect()} and draws \c image in a centralized position using \l{QPainter::drawImage()}{drawImage()}. This \c image is then set as the \c{button}'s icon. - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 11 + \snippet painting/imagecomposition/imagecomposer.cpp 11 The \c currentMode() function returns the composition mode currently selected in \c operatorComboBox. - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 12 + \snippet painting/imagecomposition/imagecomposer.cpp 12 We use the \c imagePos() function to ensure that images loaded onto the QToolButton objects, \c sourceButton and \c destinationButton, are centralized. - \snippet widgets/painting/imagecomposition/imagecomposer.cpp 13 + \snippet painting/imagecomposition/imagecomposer.cpp 13 \section1 The \c main() Function The \c main() function instantiates QApplication and \c ImageComposer and invokes its \l{QWidget::show()}{show()} function. - \snippet widgets/painting/imagecomposition/main.cpp 0 + \snippet painting/imagecomposition/main.cpp 0 */ |