QGIS API Documentation 3.43.0-Master (0cdc48caa8d)
qgsmodelviewtoollink.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmodelviewtoollink.h
3 ----------------------------------
4 Date : January 2024
5 Copyright : (C) 2024 Valentin Buira
6 Email : valentin dot buira at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSMODELVIEWTOOLLINK_H
17#define QGSMODELVIEWTOOLLINK_H
18
19#include "qgis_sip.h"
20#include "qgis_gui.h"
21#include "qgsmodelviewtool.h"
23#include "qgsmodelgraphicitem.h"
24#include <memory>
25
26#define SIP_NO_FILE
27
34class GUI_EXPORT QgsModelViewToolLink : public QgsModelViewTool
35{
36 Q_OBJECT
37
38 public:
42 QgsModelViewToolLink( QgsModelGraphicsView *view SIP_TRANSFERTHIS );
43
44 void modelMoveEvent( QgsModelViewMouseEvent *event ) override;
45 void modelReleaseEvent( QgsModelViewMouseEvent *event ) override;
46 bool allowItemInteraction() override;
47 void activate() override;
48 void deactivate() override;
49
58 void setFromSocket( QgsModelDesignerSocketGraphicItem *socket );
59
60 signals:
65
66 private:
67 std::unique_ptr<QgsModelViewBezierRubberBand> mBezierRubberBand;
68 QgsModelDesignerSocketGraphicItem *mFromSocket = nullptr;
69 QgsModelDesignerSocketGraphicItem *mToSocket = nullptr;
70
71 QgsModelDesignerSocketGraphicItem *mLastHoveredSocket = nullptr;
72
73 /* Used to return to select tool */
74 QPointer<QgsModelViewTool> mPreviousViewTool;
75};
76#endif // QGSMODELVIEWTOOLLINK_H
A mouse event which is the result of a user interaction with a QgsModelGraphicsView.
Abstract base class for all model designer view tools.
virtual void modelMoveEvent(QgsModelViewMouseEvent *event)
Mouse move event for overriding.
virtual bool allowItemInteraction()
Returns true if the tool allows interaction with component graphic items.
virtual void deactivate()
Called when tool is deactivated.
virtual void activate()
Called when tool is set as the currently active model tool.
virtual void modelReleaseEvent(QgsModelViewMouseEvent *event)
Mouse release event for overriding.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53