Version: 9.16.0
SchemaDirLinksItem.cxx
Go to the documentation of this file.
1// Copyright (C) 2006-2026 CEA, EDF
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
21#include "SchemaLinkItem.hxx"
22#include "SchemaModel.hxx"
23#include "QtGuiContext.hxx"
24#include "GuiEditor.hxx"
25
26#include <QIcon>
27#include <cassert>
28
29//#define _DEVDEBUG_
30#include "YacsTrace.hxx"
31
32using namespace std;
33using namespace YACS::ENGINE;
34using namespace YACS::HMI;
35
36SchemaDirLinksItem::SchemaDirLinksItem(SchemaItem *parent, QString label, Subject* subject)
37 : SchemaItem(parent, label, subject)
38{
39 _itemDeco.replace(YLabel, QIcon("icons:folder_cyan.png"));
40}
41
43{
44 DEBTRACE("SchemaDirLinksItem::addTypeItem");
46 int nbsons = childCount();
47 model->beginInsertRows(modelIndex(), nbsons, nbsons);
48 SchemaItem *item = new SchemaLinkItem(this,
49 subject->getName().c_str(),
50 subject);
51 model->endInsertRows();
52}
53
54Qt::ItemFlags SchemaDirLinksItem::flags(const QModelIndex &index)
55{
56 //DEBTRACE("SchemaDirLinksItem::flags");
57 return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
58}
59
60QVariant SchemaDirLinksItem::editionWhatsThis(int column) const
61{
62return "<p>Links between ports or nodes under that block level appears in this folder.\n" \
63 "You can add data links (between ports) and control links (between nodes) " \
64 "by drag from origin (out node or out port) to destination (in node or in port) " \
65 "either in 2D graphic view or tree view. <a href=\"modification.html#create-a-link\">More...</a></p>";
66}
67
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
YACS::HMI::SchemaModel * getSchemaModel()
static QtGuiContext * getQtCurrent()
void addLinkItem(Subject *subject)
virtual Qt::ItemFlags flags(const QModelIndex &index)
virtual QVariant editionWhatsThis(int column) const
QModelIndex modelIndex(int column=0)
Definition: SchemaItem.cxx:253
QList< QVariant > _itemDeco
Definition: SchemaItem.hxx:78
virtual int childCount() const
Definition: SchemaItem.cxx:111
virtual std::string getName()