diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 73e860b5da7..9c1f5d595d2 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -410,7 +410,7 @@ QFileDialog::~QFileDialog() For instance: - \snippet filedialogurls.cpp 0 + \snippet filedialogurls/filedialogurls.cpp 0 The file dialog will then look like this: diff --git a/src/widgets/doc/snippets/customviewstyle.cpp b/src/widgets/doc/snippets/customviewstyle/customviewstyle.cpp similarity index 100% rename from src/widgets/doc/snippets/customviewstyle.cpp rename to src/widgets/doc/snippets/customviewstyle/customviewstyle.cpp diff --git a/src/widgets/doc/snippets/filedialogurls.cpp b/src/widgets/doc/snippets/filedialogurls/filedialogurls.cpp similarity index 100% rename from src/widgets/doc/snippets/filedialogurls.cpp rename to src/widgets/doc/snippets/filedialogurls/filedialogurls.cpp index 4b73a6c8180..f269ad3f20f 100644 --- a/src/widgets/doc/snippets/filedialogurls.cpp +++ b/src/widgets/doc/snippets/filedialogurls/filedialogurls.cpp @@ -48,8 +48,8 @@ ** ****************************************************************************/ -#include #include +#include int loadFileDialog() { diff --git a/src/widgets/doc/snippets/graphicssceneadditemsnippet.cpp b/src/widgets/doc/snippets/graphicssceneadditem/graphicssceneadditemsnippet.cpp similarity index 100% rename from src/widgets/doc/snippets/graphicssceneadditemsnippet.cpp rename to src/widgets/doc/snippets/graphicssceneadditem/graphicssceneadditemsnippet.cpp index 0ce135dc63e..3d5c172dca8 100644 --- a/src/widgets/doc/snippets/graphicssceneadditemsnippet.cpp +++ b/src/widgets/doc/snippets/graphicssceneadditem/graphicssceneadditemsnippet.cpp @@ -48,10 +48,10 @@ ** ****************************************************************************/ -#include -#include #include +#include #include +#include class CustomScene : public QGraphicsScene { diff --git a/src/widgets/doc/snippets/graphicsview.cpp b/src/widgets/doc/snippets/graphicsview/graphicsview.cpp similarity index 100% rename from src/widgets/doc/snippets/graphicsview.cpp rename to src/widgets/doc/snippets/graphicsview/graphicsview.cpp index 37947b4a359..29187ba326b 100644 --- a/src/widgets/doc/snippets/graphicsview.cpp +++ b/src/widgets/doc/snippets/graphicsview/graphicsview.cpp @@ -47,14 +47,14 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include +#include #include +#include #include -#include #include +#include #include -#include -#include -#include void graphicsview_snippet_main() { diff --git a/src/widgets/doc/snippets/graphicsview_snippet.cpp b/src/widgets/doc/snippets/graphicsview/graphicsview_snippet.cpp similarity index 100% rename from src/widgets/doc/snippets/graphicsview_snippet.cpp rename to src/widgets/doc/snippets/graphicsview/graphicsview_snippet.cpp diff --git a/src/widgets/doc/snippets/mdiareasnippets.cpp b/src/widgets/doc/snippets/mdiarea/mdiareasnippets.cpp similarity index 100% rename from src/widgets/doc/snippets/mdiareasnippets.cpp rename to src/widgets/doc/snippets/mdiarea/mdiareasnippets.cpp diff --git a/src/widgets/doc/snippets/myscrollarea.cpp b/src/widgets/doc/snippets/myscrollarea/myscrollarea.cpp similarity index 100% rename from src/widgets/doc/snippets/myscrollarea.cpp rename to src/widgets/doc/snippets/myscrollarea/myscrollarea.cpp diff --git a/src/widgets/doc/snippets/snippets.pro b/src/widgets/doc/snippets/snippets.pro index 5267f85f540..da920191279 100644 --- a/src/widgets/doc/snippets/snippets.pro +++ b/src/widgets/doc/snippets/snippets.pro @@ -4,11 +4,11 @@ TARGET = widgets_snippets QT += widgets printsupport -SOURCES += customviewstyle.cpp \ - filedialogurls.cpp \ - graphicssceneadditemsnippet.cpp \ - graphicsview.cpp \ - mdiareasnippets.cpp \ - myscrollarea.cpp +SOURCES += customviewstyle/customviewstyle.cpp \ + filedialogurls/filedialogurls.cpp \ + graphicssceneadditem/graphicssceneadditemsnippet.cpp \ + graphicsview/graphicsview.cpp \ + mdiarea/mdiareasnippets.cpp \ + myscrollarea/myscrollarea.cpp load(qt_common) diff --git a/src/widgets/doc/src/graphicsview.qdoc b/src/widgets/doc/src/graphicsview.qdoc index 46a68adc56f..b942d532dff 100644 --- a/src/widgets/doc/src/graphicsview.qdoc +++ b/src/widgets/doc/src/graphicsview.qdoc @@ -89,7 +89,7 @@ descending stacking order (i.e., the first returned item is topmost, and the last item is bottom-most). - \snippet graphicsview.cpp 0 + \snippet graphicsview/graphicsview.cpp 0 QGraphicsScene's event propagation architecture schedules scene events for delivery to items, and also manages propagation between items. If @@ -120,7 +120,7 @@ enable OpenGL support, you can set a QOpenGLWidget as the viewport by calling QGraphicsView::setViewport(). - \snippet graphicsview.cpp 1 + \snippet graphicsview/graphicsview.cpp 1 The view receives input events from the keyboard and mouse, and translates these to scene events (converting the coordinates used @@ -327,7 +327,7 @@ Here is an example of how to implement zoom and rotate slots in a subclass of QGraphicsView: - \snippet graphicsview_snippet.cpp 2 + \snippet graphicsview/graphicsview_snippet.cpp 2 The slots could be connected to \l{QToolButton}{QToolButtons} with \l{QAbstractButton::autoRepeat}{autoRepeat} enabled. @@ -347,7 +347,7 @@ a QPainter to either of the rendering functions. This example shows how to print the whole scene into a full page, using QPrinter. - \snippet graphicsview.cpp 3 + \snippet graphicsview/graphicsview.cpp 3 The difference between the scene and view rendering functions is that one operates in scene coordinates, and the other in view coordinates. @@ -358,7 +358,7 @@ is to render the exact contents of the viewport using the provided painter. - \snippet graphicsview.cpp 4 + \snippet graphicsview/graphicsview.cpp 4 When the source and target areas' sizes do not match, the source contents are stretched to fit into the target area. By passing a @@ -384,7 +384,7 @@ so in mousePressEvent() or mouseMoveEvent(), you can get the originating widget pointer from the event. For example: - \snippet graphicsview.cpp 5 + \snippet graphicsview/graphicsview.cpp 5 To intercept drag and drop events for the scene, you reimplement QGraphicsScene::dragEnterEvent() and whichever event handlers your @@ -443,7 +443,7 @@ Example: - \snippet graphicsview.cpp 6 + \snippet graphicsview/graphicsview.cpp 6 \section2 Item Groups diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index f2ff658d3bd..a428329a451 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -5362,7 +5362,7 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool Example: - \snippet graphicssceneadditemsnippet.cpp 0 + \snippet graphicssceneadditem/graphicssceneadditemsnippet.cpp 0 Since Qt 4.6, this function is not called anymore unless the QGraphicsView::IndirectPainting flag is given as an Optimization diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index ce319564ac9..d80dafcce6b 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -372,7 +372,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C We include a small example where we customize the drawing of item backgrounds. - \snippet customviewstyle.cpp 0 + \snippet customviewstyle/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/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index 6bc88f129dd..720a9f908a9 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -127,13 +127,13 @@ QT_BEGIN_NAMESPACE QWidget::move(). When the area contents or the viewport size changes, we do the following: - \snippet myscrollarea.cpp 1 + \snippet myscrollarea/myscrollarea.cpp 1 When the scroll bars change value, we need to update the widget position, i.e., find the part of the widget that is to be drawn in the viewport: - \snippet myscrollarea.cpp 0 + \snippet myscrollarea/myscrollarea.cpp 0 In order to track scroll bar movements, reimplement the virtual function scrollContentsBy(). In order to fine-tune scrolling diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index 1176ed7c944..76d41c393b5 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -51,7 +51,7 @@ applications, but can also be placed in any layout. The following code adds an area to a main window: - \snippet mdiareasnippets.cpp 0 + \snippet mdiarea/mdiareasnippets.cpp 0 Unlike the window managers for top-level windows, all window flags (Qt::WindowFlags) are supported by QMdiArea as long as the flags @@ -1950,7 +1950,7 @@ void QMdiArea::activatePreviousSubWindow() \note Once the subwindow has been added, its parent will be the \e{viewport widget} of the QMdiArea. - \snippet mdiareasnippets.cpp 1 + \snippet mdiarea/mdiareasnippets.cpp 1 When you create your own subwindow, you must set the Qt::WA_DeleteOnClose widget attribute if you want the window to be