YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
itemsignalhandler.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6#include "itemsignalhandler.h"
7#include "arrow.h"
8#include "sourceportitem.h"
10
11ItemSignalHandler::ItemSignalHandler(QObject *parent) : QObject(parent),
12 parentItem(nullptr),
13 type(ModuleItemType)
14{}
15
16ItemSignalHandler::ItemSignalHandler(QGraphicsItem *it,ItemType type,QObject *parent) : QObject(parent)
17{
18 parentItem = (QGraphicsItem*)it;
19 this->type = type;
20}
21
22void ItemSignalHandler::newConnectionRequested(QPointF p, QGraphicsItem *it)
23{
24 emit requestNewConnection(p,it);
25}
26
27void ItemSignalHandler::newConnectionAdded(QPointF p, QGraphicsItem *it)
28{
29 emit addNewConnection(p,it);
30}
31
33{
34 emit connectctionSelected(it);
35}
36
38{
39 emit moduleSelected(it);
40}
41
43{
44 emit applicationSelected(it);
45}
46
47
49{
50 if(parentItem && type == ArrowLabelItemType){
51 ((Label*)parentItem)->currentComboTextChanged(text);
52 }
53}
54
55
57{
58 if(parentItem && type == SourcePortItemType){
59 ((SourcePortItem*)parentItem)->editingFinished();
60 }
61 if(parentItem && type == DestinationPortItemType){
62 ((DestinationPortItem*)parentItem)->editingFinished();
63 }
64}
void onConnectionSelected(QGraphicsItem *it)
void requestNewConnection(QPointF, QGraphicsItem *it)
void applicationSelected(QGraphicsItem *it)
void moduleSelected(QGraphicsItem *it)
void onApplicationSelected(QGraphicsItem *it)
void addNewConnection(QPointF, QGraphicsItem *it)
void newConnectionRequested(QPointF, QGraphicsItem *it)
void newConnectionAdded(QPointF, QGraphicsItem *it)
void onModuleSelected(QGraphicsItem *it)
ItemSignalHandler(QObject *parent=NULL)
void connectctionSelected(QGraphicsItem *it)
void onConnectionComboChanged(QString)
Definition arrow.h:74
ItemType
Definition commons.h:17
@ SourcePortItemType
Definition commons.h:17
@ ModuleItemType
Definition commons.h:17
@ DestinationPortItemType
Definition commons.h:17
@ ArrowLabelItemType
Definition commons.h:17