Skip to content

Commit

Permalink
Doc: Make widgets snippets a subdirs/lib project
Browse files Browse the repository at this point in the history
Task-number: QTBUG-86497
Pick-to: 5.15
Change-Id: Ia43f9eb3bf8a3d2f6e76a1932179aaa94266540b
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
paulwicking committed Sep 23, 2020
1 parent 270c3dc commit f4ee893
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

#include <QtWidgets>

#include "./customstyle/customstyle.h"
#include "../customstyle/customstyle.h"

void CustomStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option,
QPainter *painter, const QWidget *widget) const
Expand Down
10 changes: 10 additions & 0 deletions src/widgets/doc/snippets/customviewstyle/customviewstyle.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
TEMPLATE = lib
TARGET = widgets_customviewstyle_snippets
QT = core widgets

HEADERS = \
../customstyle/customstyle.h

SOURCES = \
customviewstyle.cpp
../customstyle/customstyle.cpp
6 changes: 6 additions & 0 deletions src/widgets/doc/snippets/filedialogurls/filedialogurls.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TEMPLATE = lib
TARGET = widgets_filedialogurls_snippets
QT = core widgets

SOURCES = \
filedialogurls.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TEMPLATE = lib
TARGET = widgets_graphicssceneadditem_snippets
QT = core widgets

SOURCES = \
graphicssceneadditemsnippet.cpp
15 changes: 8 additions & 7 deletions src/widgets/doc/snippets/graphicsview/graphicsview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QDrag>
#include <QGraphicsSceneMouseEvent>
#include <QGraphicsView>
#include <QMimeData>
#include <QOpenGLWidget>
#include <QPrintDialog>
#include <QPrinter>
#include <QStandardItem>
#include <QtCore/qmimedata.h>
#include <QtGui/qdrag.h>
#include <QtOpenGLWidgets/qopenglwidget.h>
#include <QtPrintSupport/qprintdialog.h>
#include <QtPrintSupport/qprinter.h>
#include <QtWidgets/QGraphicsSceneMouseEvent>
#include <QtWidgets/qdialog.h>
#include <QtWidgets/qgraphicsview.h>

void graphicsview_snippet_main()
{
Expand Down
6 changes: 6 additions & 0 deletions src/widgets/doc/snippets/graphicsview/graphicsview.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TEMPLATE = lib
TARGET = widgets_graphicsview_snippets
QT = core widgets printsupport openglwidgets

SOURCES = \
graphicsview.cpp
7 changes: 7 additions & 0 deletions src/widgets/doc/snippets/mdiarea/mdiarea.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TEMPLATE = lib
TARGET = mdiarea_snippets
QT += printsupport opengl openglwidgets

SOURCES = \
mdiareasnippets.cpp

22 changes: 0 additions & 22 deletions src/widgets/doc/snippets/mdiarea/mdiareasnippets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,3 @@ void addingSubWindowsExample()

mdiArea.show();
}

/*
int main(int argv, char **args)
{
QApplication app(argv, args);
mainWindowExample();
//addingSubWindowsExample();
QAction *act = new QAction(qApp);
act->setShortcut(Qt::ALT + Qt::Key_S);
act->setShortcutContext( Qt::ApplicationShortcut );
QObject::connect(act, &QAction::triggered, qApp, &QApplication::aboutQt);
QWidget widget5;
widget5.show();
widget5.addAction(act);
return app.exec();
}
*/

7 changes: 7 additions & 0 deletions src/widgets/doc/snippets/myscrollarea/myscrollarea.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TEMPLATE = lib
TARGET = myscrollarea_snippets
QT += widgets

SOURCES = \
myscrollarea.cpp

22 changes: 11 additions & 11 deletions src/widgets/doc/snippets/snippets.pro
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
TEMPLATE = lib

TEMPLATE = subdirs
TARGET = widgets_snippets
SUBDIRS =

#! [qmake_use]
QT += widgets
#! [qmake_use]

QT += printsupport opengl openglwidgets

SOURCES += customviewstyle/customviewstyle.cpp \
filedialogurls/filedialogurls.cpp \
graphicssceneadditem/graphicssceneadditemsnippet.cpp \
graphicsview/graphicsview.cpp \
mdiarea/mdiareasnippets.cpp \
myscrollarea/myscrollarea.cpp
contains(QT_BUILD_PARTS, tests) {
SUBDIRS += \
customviewstyle \
filedialogurls \
graphicssceneadditem \
graphicsview \
mdiarea \
myscrollarea
}

load(qt_common)

0 comments on commit f4ee893

Please sign in to comment.