27 #include "../../../../common/Translator.h"
28 #include "../../../../dataaccess/dataset/PrimaryKey.h"
29 #include "../../Exception.h"
34 #include <QtGui/QMenu>
35 #include <QtGui/QWidget>
56 if(role == Qt::DecorationRole)
57 return QVariant(QIcon::fromTheme(
"primarykey"));
59 if(role == Qt::DisplayRole)
60 return QVariant(m_pk->getName().c_str());
67 QMenu* m =
new QMenu(parent);
69 QAction* aOpenPK = m->addAction(tr(
"&Open primary key"));
71 connect(aOpenPK, SIGNAL(triggered()),
this, SLOT(openPrimaryKey()));
78 if(!children().empty())
86 return Qt::NoItemFlags;
91 const std::size_t nproperties = m_pk->getProperties().size();
93 for(std::size_t i = 0; i < nproperties; ++i)
99 return !m_pk->getProperties().empty();
bool canFetchMore() const
A class that represents a primary key in a TreeModel.
It describes a primary key (pk) constraint.
QMenu * getMenu(QWidget *parent=0) const
QVariant data(int column, int role) const
Qt::ItemFlags flags() const
te::da::PrimaryKey * getPrimaryKey() const
A class that represents a dataset in a TreeModel.
bool setData(const QVariant &value, int role=Qt::EditRole)
PrimaryKeyItem(te::da::PrimaryKey *pk, AbstractDataSourceTreeItem *parent)
Constructor.