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

New SequenceViewer, fix doubleclick on titlerow

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2329 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent d8ba33f2
No related branches found
No related tags found
No related merge requests found
......@@ -40,10 +40,10 @@ SequenceModel::SequenceModel(QObject *parent)
{
this->beginInsertRows(QModelIndex(),this->rowCount(),this->rowCount());
BaseViewObject* title = new BaseViewObject(this);
TitleRow* title_row = new TitleRow(this);
Painter* p = new BackgroundPainter(this);
TitleRow* title_row = new TitleRow(title);
Painter* p = new BackgroundPainter(title_row);
title_row->InsertPainter(p);
p = new TickPainter(this);
p = new TickPainter(title_row);
title_row->InsertPainter(p);
title->InsertRow(0,title_row);
objects_.append(title);
......
......@@ -77,10 +77,11 @@ Qt::ItemFlags TitleRow::Flags(int column) const
void TitleRow::DoubleClicked(int column)
{
if(this->parent()){
SequenceModel* model = qobject_cast<SequenceModel*>(this->parent()->parent());
int rows = model->rowCount()-1;
QItemSelection add = QItemSelection(model->index(1,column),model->index(rows,column));
model->SelectionChanged(add,QItemSelection());
if(SequenceModel* model = qobject_cast<SequenceModel*>(this->parent()->parent())){
int rows = model->rowCount()-1;
QItemSelection add = QItemSelection(model->index(1,column),model->index(rows,column));
model->SelectionChanged(add,QItemSelection());
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment