Skip to content

Commit 419c184

Browse files
committed
basic documentation
1 parent 5dcc794 commit 419c184

File tree

5 files changed

+47
-42
lines changed

5 files changed

+47
-42
lines changed

src/mainscene.h

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,30 @@ class State;
3333

3434
namespace GUI {
3535

36+
//! Graphics scene
3637
class MainScene : public QGraphicsScene
3738
{
3839
Q_OBJECT
3940

4041
public:
41-
MainScene( QObject *parent );
42+
MainScene( QObject *parent ); //!< Value constructor
4243
~MainScene() override = default; //{ qDebug() << Q_FUNC_INFO; }
4344

44-
void mousePressEvent( QGraphicsSceneMouseEvent *event) override;
45-
void mouseMoveEvent( QGraphicsSceneMouseEvent *event) override;
46-
void mouseReleaseEvent( QGraphicsSceneMouseEvent *event) override;
47-
void keyPressEvent( QKeyEvent *event) override;
45+
protected:
46+
void mousePressEvent( QGraphicsSceneMouseEvent *event) override; //!< Handle mouse press event
47+
void mouseMoveEvent( QGraphicsSceneMouseEvent *event) override; //!< Handle mouse moce event
48+
void mouseReleaseEvent( QGraphicsSceneMouseEvent *event) override; //!< Handle mouse release event
49+
void keyPressEvent( QKeyEvent *event) override; //!< Handle key press event
4850

49-
void removeAllItems();
50-
void addGraphicItems( const State *s);
51+
public:
52+
void removeAllItems(); //!< Remove all graphics from the scene but not an optional background imge
53+
void addGraphicItems( const State *s); //!< Add graphics from state to scene
5154

52-
void export_view_as_svg( QString &fileName);
53-
void export_view_as_pdf( QString &fileName);
55+
void export_view_as_svg( QString &fileName); //!< Export the current view as scalabel vector graphics
56+
void export_view_as_pdf( QString &fileName); //!< Export the current view in portable document format
5457

55-
static QPen scribblePen() { return s_scribblePen; }
56-
static void setScribblePen( const QPen & p) { s_scribblePen = p; }
58+
static QPen scribblePen() { return s_scribblePen; } //!< Get the scribble pen
59+
static void setScribblePen( const QPen & p) { s_scribblePen = p; } //!< Set the scribble pen
5760

5861
private:
5962
std::unique_ptr<QAction> actionExportSaveAs;
@@ -70,9 +73,9 @@ class MainScene : public QGraphicsScene
7073
static QPen s_scribblePen;
7174

7275
Q_SIGNALS:
73-
void signalCmdAddStroke( QPainterPath * );
74-
void signalCmdDeleteSelection();
75-
void signalUndoLastAction();
76+
void signalCmdAddStroke( QPainterPath * ); //!< Command: add a stroke, reasoning, and adjustment
77+
void signalCmdDeleteSelection(); //!< Command: delete selected items and reasoning
78+
void signalUndoLastAction(); //!< Command: und last action
7679
};
7780

7881
} // namespace GUI

src/mainview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ MainView::MainView( QGraphicsScene *scene, QWidget *parent ) : QGraphicsView (pa
5050
}
5151

5252

53-
//! zoom in or out via mouse wheel
53+
5454
void MainView::wheelEvent( QWheelEvent *event )
5555
{
5656
// restricted zooming [0.1, 10]

src/mainview.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,34 @@
2222
#include <QAction>
2323
#include <QGraphicsView>
2424
#include <QDebug>
25-
#include <QStatusBar>
25+
// #include <QStatusBar>
2626

2727
#include <memory>
2828

2929
#include "global.h"
3030

3131
namespace GUI {
3232

33+
//! Graphics view
3334
class MainView :public QGraphicsView
3435
{
3536
Q_OBJECT
3637

3738
public:
38-
MainView( QGraphicsScene *scene, QWidget *parent);
39+
MainView( QGraphicsScene *scene, QWidget *parent); //!< Value constructor
3940
~MainView() override { //qDebug() << Q_FUNC_INFO;
4041
}
4142

42-
std::unique_ptr<QAction> actionCopyScreenshotToClipboard{};
43-
std::unique_ptr<QAction> actionCopySvgToClipboard{};
44-
std::unique_ptr<QAction> actionCopyPdfToClipboard{};
45-
std::unique_ptr<QAction> actionToggleShowBackgroundTiles;
46-
std::unique_ptr<QAction> actionZoomIn;
47-
std::unique_ptr<QAction> actionZoomOut;
43+
std::unique_ptr<QAction> actionCopyScreenshotToClipboard{}; //!< Copy screenshot to clipboard
44+
std::unique_ptr<QAction> actionCopySvgToClipboard{}; //!< Copy scalable vector graphics to clipboard
45+
std::unique_ptr<QAction> actionCopyPdfToClipboard{}; //!< Copy portable document format to clipboard
46+
std::unique_ptr<QAction> actionToggleShowBackgroundTiles; //!< Toggle visibility of background tiles
47+
std::unique_ptr<QAction> actionZoomIn; //!< Zoom in [+]
48+
std::unique_ptr<QAction> actionZoomOut; //!< Zoom out [-]
4849

4950
protected:
50-
void wheelEvent( QWheelEvent *event) override;
51-
void drawForeground( QPainter *painter, const QRectF &) override;
52-
// void paintEvent( QPaintEvent *event) override {}
51+
void wheelEvent( QWheelEvent *event) override; //!< Zoom via mouse wheel
52+
void drawForeground( QPainter *painter, const QRectF &) override; //!< Plot the organization name
5353

5454
private:
5555
const double lod_max = 100.0;
@@ -70,7 +70,7 @@ class MainView :public QGraphicsView
7070
static bool s_showBackgroundTiles;
7171

7272
Q_SIGNALS:
73-
void signalShowStatus( const QString & s);
73+
void signalShowStatus( const QString & s); //!< Send message to status bar
7474
};
7575

7676
} // namespace GUI

src/mainwindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class FormatTool;
3838
class MainView;
3939

4040

41+
//! Main window
4142
class MainWindow : public QMainWindow
4243
{
4344
Q_OBJECT

src/qformattool.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ class QSpinBox;
3535

3636
namespace GUI {
3737

38+
//! Format tool
3839
class FormatTool : public QDialog {
3940

4041
Q_OBJECT
4142

4243
public:
43-
FormatTool( const QString &title, QWidget *);
44-
FormatTool( const FormatTool &) = delete;
45-
FormatTool & operator= ( FormatTool ) = delete;
44+
FormatTool( const QString &title, QWidget *); //!< Value constructor
45+
FormatTool( const FormatTool &) = delete; //!< Copy constructor
46+
FormatTool & operator= ( FormatTool ) = delete; //!< Copy assignment constructor
4647
~FormatTool() override;
4748

4849
private:
@@ -67,20 +68,20 @@ class FormatTool : public QDialog {
6768
std::unique_ptr<QDialogButtonBox> m_buttonBox;
6869

6970
Q_SIGNALS:
70-
void signalColorChanged( const QColor &);
71-
void signalMarkerSizeChanged( int);
72-
void signalLineWidthChanged( int);
73-
void signalLineStyleChanged( int);
71+
void signalColorChanged( const QColor &); //!< Color changed
72+
void signalMarkerSizeChanged( int); //!< Marker size changed
73+
void signalLineWidthChanged( int); //!< Line width changed
74+
void signalLineStyleChanged( int); //!< Line style changed
7475

7576
public Q_SLOTS:
76-
void showColorDialog();
77-
void slotUpdateColor( const QColor & col);
78-
void updateLineWidth( int w) { Q_EMIT signalLineWidthChanged(w); }
79-
void updateLineStyle( int s) { Q_EMIT signalLineStyleChanged(s); }
80-
void updateMarkerSize( int s) { Q_EMIT signalMarkerSizeChanged(s); }
81-
82-
void slotDiscard() { } // TODO
83-
void slotApply();
77+
void showColorDialog(); //!< Show color dialog
78+
void slotUpdateColor( const QColor & col); //!< Update color
79+
void updateLineWidth( int w) { Q_EMIT signalLineWidthChanged(w); } //!< Update line widt
80+
void updateLineStyle( int s) { Q_EMIT signalLineStyleChanged(s); } //!< Update line style
81+
void updateMarkerSize( int s) { Q_EMIT signalMarkerSizeChanged(s); } //!< Update marker size
82+
83+
void slotDiscard() { } //!< slot discard dialog
84+
void slotApply(); //!< alot apply selection
8485
};
8586

8687
} // namespace GUI

0 commit comments

Comments
 (0)