27 #include "../../../../core/translator/Translator.h" 28 #include "../../../../dataaccess/dataset/DataSetType.h" 29 #include "../../../../dataaccess/datasource/DataSource.h" 30 #include "../../../../dataaccess/datasource/DataSourceCatalog.h" 31 #include "../../../../dataaccess/utils/Utils.h" 32 #include "../../../../datatype/Property.h" 33 #include "../../Exception.h" 62 if(role == Qt::DecorationRole)
63 return QVariant(QIcon::fromTheme(
"constraints"));
65 if(role == Qt::DisplayRole)
66 return QVariant(QString(
"constraints"));
73 QMenu* m =
new QMenu(parent);
75 QAction* aOpenProperties = m->addAction(tr(
"&Open constraints"));
77 connect(aOpenProperties, SIGNAL(triggered()),
this, SLOT(openProperties()));
84 if(!children().empty())
92 return Qt::NoItemFlags;
97 if(parent() ==
nullptr)
103 if(parentItem ==
nullptr)
108 if(dt.get() ==
nullptr)
114 if(dt->getPrimaryKey() !=
nullptr)
117 const std::size_t nuks = dt->getNumberOfUniqueKeys();
119 for(std::size_t i = 0; i < nuks; ++i)
122 const std::size_t nccs = dt->getNumberOfCheckConstraints();
124 for(std::size_t i = 0; i < nccs; ++i)
130 if(parent() ==
nullptr)
135 if(parentItem ==
nullptr)
140 if(dt.get() ==
nullptr)
146 return (dt->getPrimaryKey() !=
nullptr) ||
147 (dt->getNumberOfUniqueKeys() != 0) ||
148 (dt->getNumberOfCheckConstraints() != 0);
A class that represents a unique key in a TreeModel.
boost::shared_ptr< DataSetType > DataSetTypePtr
A class that represents a check-constraint in a TreeModel.
A class that represents a dataset in a TreeModel.
static te::dt::TimeDuration dt(20, 30, 50, 11)
A class that represents a primary key in a TreeModel.
A class used to group the set of constraints of a dataset in a TreeModel.