Skip to content
Snippets Groups Projects
Commit a667d11f authored by stefan's avatar stefan
Browse files

New SequenceViewer, added tooltips

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2183 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent ce42078b
No related branches found
No related tags found
No related merge requests found
...@@ -78,6 +78,9 @@ const mol::ChainView& SecStrRow::GetChain() const ...@@ -78,6 +78,9 @@ const mol::ChainView& SecStrRow::GetChain() const
QVariant SecStrRow::GetData(int column, int role) const QVariant SecStrRow::GetData(int column, int role) const
{ {
if(column > 0 && column <= this->GetSequence().GetLength()){ if(column > 0 && column <= this->GetSequence().GetLength()){
if (role==Qt::ToolTipRole){
return QVariant(QString(this->chain_.GetResidueByIndex(column-1).GetQualifiedName().c_str()));
}
if (role==Qt::UserRole){ if (role==Qt::UserRole){
QVariant variant; QVariant variant;
variant.setValue(secstr_); variant.setValue(secstr_);
......
...@@ -119,9 +119,7 @@ const PainterList& SequenceModel::GetPainters(const QModelIndex& index) const{ ...@@ -119,9 +119,7 @@ const PainterList& SequenceModel::GetPainters(const QModelIndex& index) const{
pair.second->GetRow(pair.first); pair.second->GetRow(pair.first);
return pair.second->GetRow(pair.first)->GetPainters(); return pair.second->GetRow(pair.first)->GetPainters();
} }
else{ assert(false);
assert(false);
}
} }
QPair<int, ViewObject*> SequenceModel::GetRowWithItem(int row) const{ QPair<int, ViewObject*> SequenceModel::GetRowWithItem(int row) const{
......
...@@ -87,6 +87,9 @@ QVariant SequenceRow::GetData(int column, int role) const ...@@ -87,6 +87,9 @@ QVariant SequenceRow::GetData(int column, int role) const
if (role==Qt::SizeHintRole){ if (role==Qt::SizeHintRole){
return QVariant(this->GetCellSize()); return QVariant(this->GetCellSize());
} }
if (role==Qt::ToolTipRole){
return QVariant(QString(this->sequence_.GetOneLetterCode(column - 1)));
}
} }
return QVariant(); return QVariant();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment