diff options
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qdrawutil.cpp | 20 | ||||
-rw-r--r-- | src/widgets/styles/qproxystyle.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 30 | ||||
-rw-r--r-- | src/widgets/styles/qstyleoption.cpp | 8 | ||||
-rw-r--r-- | src/widgets/styles/qstylepainter.cpp | 8 | ||||
-rw-r--r-- | src/widgets/styles/qstyleplugin.cpp | 6 |
6 files changed, 37 insertions, 37 deletions
diff --git a/src/widgets/styles/qdrawutil.cpp b/src/widgets/styles/qdrawutil.cpp index 15788e34f5..5c1d0ce098 100644 --- a/src/widgets/styles/qdrawutil.cpp +++ b/src/widgets/styles/qdrawutil.cpp @@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded line: - \snippet doc/src/snippets/code/src_gui_painting_qdrawutil.cpp 0 + \snippet code/src_gui_painting_qdrawutil.cpp 0 \sa qDrawShadeRect(), qDrawShadePanel(), QStyle */ @@ -199,7 +199,7 @@ void qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2, Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded rectangle: - \snippet doc/src/snippets/code/src_gui_painting_qdrawutil.cpp 1 + \snippet code/src_gui_painting_qdrawutil.cpp 1 \sa qDrawShadeLine(), qDrawShadePanel(), qDrawPlainRect(), QStyle */ @@ -300,7 +300,7 @@ void qDrawShadeRect(QPainter *p, int x, int y, int w, int h, Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded panel: - \snippet doc/src/snippets/code/src_gui_painting_qdrawutil.cpp 2 + \snippet code/src_gui_painting_qdrawutil.cpp 2 \sa qDrawWinPanel(), qDrawShadeLine(), qDrawShadeRect(), QStyle */ @@ -471,7 +471,7 @@ void qDrawWinButton(QPainter *p, int x, int y, int w, int h, Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded panel: - \snippet doc/src/snippets/code/src_gui_painting_qdrawutil.cpp 3 + \snippet code/src_gui_painting_qdrawutil.cpp 3 \sa qDrawShadePanel(), qDrawWinButton(), QStyle */ @@ -507,7 +507,7 @@ void qDrawWinPanel(QPainter *p, int x, int y, int w, int h, Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a plain rectangle: - \snippet doc/src/snippets/code/src_gui_painting_qdrawutil.cpp 4 + \snippet code/src_gui_painting_qdrawutil.cpp 4 \sa qDrawShadeRect(), QStyle */ @@ -566,7 +566,7 @@ void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &c, Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded line: - \snippet doc/src/snippets/code/src_gui_painting_qdrawutil.cpp 5 + \snippet code/src_gui_painting_qdrawutil.cpp 5 \sa qDrawShadeRect(), qDrawShadePanel(), QStyle */ @@ -605,7 +605,7 @@ void qDrawShadeLine(QPainter *p, const QPoint &p1, const QPoint &p2, Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded rectangle: - \snippet doc/src/snippets/code/src_gui_painting_qdrawutil.cpp 6 + \snippet code/src_gui_painting_qdrawutil.cpp 6 \sa qDrawShadeLine(), qDrawShadePanel(), qDrawPlainRect(), QStyle */ @@ -642,7 +642,7 @@ void qDrawShadeRect(QPainter *p, const QRect &r, Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded panel: - \snippet doc/src/snippets/code/src_gui_painting_qdrawutil.cpp 7 + \snippet code/src_gui_painting_qdrawutil.cpp 7 \sa qDrawWinPanel(), qDrawShadeLine(), qDrawShadeRect(), QStyle */ @@ -703,7 +703,7 @@ void qDrawWinButton(QPainter *p, const QRect &r, Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded panel: - \snippet doc/src/snippets/code/src_gui_painting_qdrawutil.cpp 8 + \snippet code/src_gui_painting_qdrawutil.cpp 8 \sa qDrawShadePanel(), qDrawWinButton(), QStyle */ @@ -730,7 +730,7 @@ void qDrawWinPanel(QPainter *p, const QRect &r, Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a plain rectangle: - \snippet doc/src/snippets/code/src_gui_painting_qdrawutil.cpp 9 + \snippet code/src_gui_painting_qdrawutil.cpp 9 \sa qDrawShadeRect(), QStyle */ diff --git a/src/widgets/styles/qproxystyle.cpp b/src/widgets/styles/qproxystyle.cpp index 5bcd83a6ea..80124872a6 100644 --- a/src/widgets/styles/qproxystyle.cpp +++ b/src/widgets/styles/qproxystyle.cpp @@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE The following example shows how to override the shortcut underline behavior on any platform: - \snippet doc/src/snippets/code/src_gui_qproxystyle.cpp 1 + \snippet code/src_gui_qproxystyle.cpp 1 Warning: The \l {QCommonStyle} {common styles} provided by Qt will respect this hint, because they call QStyle::proxy(), but there is diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index d78a2ee2fb..b4f24acf84 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -107,7 +107,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C QApplication::setStyle() function. It can also be specified by the user of the application, using the \c -style command-line option: - \snippet doc/src/snippets/code/src_gui_styles_qstyle.cpp 0 + \snippet code/src_gui_styles_qstyle.cpp 0 If no style is specified, Qt will choose the most appropriate style for the user's platform or desktop environment. @@ -133,7 +133,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C For example, if you want to draw a focus rectangle on your widget, you can write: - \snippet doc/src/snippets/styles/styles.cpp 1 + \snippet styles/styles.cpp 1 QStyle gets all the information it needs to render the graphical element from QStyleOption. The widget is passed as the last @@ -154,15 +154,15 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C combines a QStyle, a QPainter, and a QWidget. This makes it possible to write - \snippet doc/src/snippets/styles/styles.cpp 5 + \snippet styles/styles.cpp 5 \dots - \snippet doc/src/snippets/styles/styles.cpp 7 + \snippet styles/styles.cpp 7 instead of - \snippet doc/src/snippets/styles/styles.cpp 2 + \snippet styles/styles.cpp 2 \dots - \snippet doc/src/snippets/styles/styles.cpp 3 + \snippet styles/styles.cpp 3 \section1 Creating a Custom Style @@ -190,16 +190,16 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C function, so we need to reimplement that function. We need the following class declaration: - \snippet doc/src/snippets/customstyle/customstyle.h 0 + \snippet customstyle/customstyle.h 0 To draw its up and down arrows, QSpinBox uses the PE_IndicatorSpinUp and PE_IndicatorSpinDown primitive elements. Here's how to reimplement the drawPrimitive() function to draw them differently: - \snippet doc/src/snippets/customstyle/customstyle.cpp 2 - \snippet doc/src/snippets/customstyle/customstyle.cpp 3 - \snippet doc/src/snippets/customstyle/customstyle.cpp 4 + \snippet customstyle/customstyle.cpp 2 + \snippet customstyle/customstyle.cpp 3 + \snippet customstyle/customstyle.cpp 4 Notice that we don't use the \c widget argument, except to pass it on to the QWindowStyle::drawPrimitive() function. As mentioned @@ -211,9 +211,9 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C information, be careful to ensure that it isn't 0 and that it is of the correct type before using it. For example: - \snippet doc/src/snippets/customstyle/customstyle.cpp 0 + \snippet customstyle/customstyle.cpp 0 \dots - \snippet doc/src/snippets/customstyle/customstyle.cpp 1 + \snippet customstyle/customstyle.cpp 1 When implementing a custom style, you cannot assume that the widget is a QSpinBox just because the enum value is called @@ -233,7 +233,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C QApplication::setStyle() static function before creating the QApplication object: - \snippet snippets/customstyle/main.cpp using a custom style + \snippet customstyle/main.cpp using a custom style You can call QApplication::setStyle() at any time, but by calling it before the constructor, you ensure that the user's preference, @@ -252,7 +252,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C automatically. To use your new style with existing applications, simply start the application with the following argument: - \snippet doc/src/snippets/code/src_gui_styles_qstyle.cpp 1 + \snippet code/src_gui_styles_qstyle.cpp 1 The application will use the look and feel from the custom style you implemented. @@ -306,7 +306,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C We include a small example where we customize the drawing of item backgrounds. - \snippet doc/src/snippets/customviewstyle.cpp 0 + \snippet customviewstyle.cpp 0 The primitive element PE_PanelItemViewItem is responsible for painting the background of items, and is called from diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index 0b0c6e2393..1da5d786c7 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE The following code snippet shows how to use a specific QStyleOption subclass to paint a push button: - \snippet doc/src/snippets/qstyleoption/main.cpp 0 + \snippet qstyleoption/main.cpp 0 In our example, the control is a QStyle::CE_PushButton, and according to the QStyle::drawControl() documentation the @@ -85,7 +85,7 @@ QT_BEGIN_NAMESPACE For safety, you can use qstyleoption_cast() to ensure that the pointer type is correct. For example: - \snippet doc/src/snippets/qstyleoption/main.cpp 4 + \snippet qstyleoption/main.cpp 4 The qstyleoption_cast() function will return 0 if the object to which \c option points is not of the correct type. @@ -3240,7 +3240,7 @@ QStyleOptionViewItem::QStyleOptionViewItem(int version) Example: - \snippet doc/src/snippets/qstyleoption/main.cpp 4 + \snippet qstyleoption/main.cpp 4 \sa QStyleOption::type, QStyleOption::version */ @@ -3958,7 +3958,7 @@ QStyleHintReturnVariant::QStyleHintReturnVariant() : QStyleHintReturn(Version, T Example: - \snippet doc/src/snippets/code/src_gui_styles_qstyleoption.cpp 0 + \snippet code/src_gui_styles_qstyleoption.cpp 0 \sa QStyleHintReturn::type, QStyleHintReturn::version */ diff --git a/src/widgets/styles/qstylepainter.cpp b/src/widgets/styles/qstylepainter.cpp index b15b9d1a38..ff7db79009 100644 --- a/src/widgets/styles/qstylepainter.cpp +++ b/src/widgets/styles/qstylepainter.cpp @@ -65,13 +65,13 @@ QT_BEGIN_NAMESPACE Example using QStyle directly: - \snippet doc/src/snippets/styles/styles.cpp 1 + \snippet styles/styles.cpp 1 Example using QStylePainter: - \snippet doc/src/snippets/styles/styles.cpp 0 - \snippet doc/src/snippets/styles/styles.cpp 4 - \snippet doc/src/snippets/styles/styles.cpp 6 + \snippet styles/styles.cpp 0 + \snippet styles/styles.cpp 4 + \snippet styles/styles.cpp 6 \sa QStyle, QStyleOption */ diff --git a/src/widgets/styles/qstyleplugin.cpp b/src/widgets/styles/qstyleplugin.cpp index 74c29f39c8..b36ffcf181 100644 --- a/src/widgets/styles/qstyleplugin.cpp +++ b/src/widgets/styles/qstyleplugin.cpp @@ -83,10 +83,10 @@ QT_BEGIN_NAMESPACE The style key is usually the class name of the required style. Note that the keys are case insensitive. For example: - \snippet doc/src/snippets/qstyleplugin/main.cpp 0 + \snippet qstyleplugin/main.cpp 0 \codeline - \snippet doc/src/snippets/qstyleplugin/main.cpp 1 - \snippet doc/src/snippets/qstyleplugin/main.cpp 2 + \snippet qstyleplugin/main.cpp 1 + \snippet qstyleplugin/main.cpp 2 \sa keys() */ |