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

New SequenceViewer, fix for column count

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2289 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent f5a4ca88
Branches
Tags
No related merge requests found
...@@ -107,7 +107,7 @@ void SequenceModel::RemoveGfxEntity(gfx::EntityP& entity){ ...@@ -107,7 +107,7 @@ void SequenceModel::RemoveGfxEntity(gfx::EntityP& entity){
int cols_before = this->columnCount(); int cols_before = this->columnCount();
objects_.removeOne(obj); objects_.removeOne(obj);
this->endRemoveRows(); this->endRemoveRows();
int cols = this->columnCount(); int cols = this->GetColumnCount();
if(cols_before>cols){ if(cols_before>cols){
this->max_columns = cols; this->max_columns = cols;
this->beginRemoveColumns(QModelIndex(), cols, cols_before); this->beginRemoveColumns(QModelIndex(), cols, cols_before);
...@@ -116,6 +116,17 @@ void SequenceModel::RemoveGfxEntity(gfx::EntityP& entity){ ...@@ -116,6 +116,17 @@ void SequenceModel::RemoveGfxEntity(gfx::EntityP& entity){
} }
} }
int SequenceModel::GetColumnCount() const{
int cols = 0;
for(int i = 0; i<objects_.size();i++){
int ob_cols = objects_[i]->GetMaxColumnCount();
if(ob_cols>cols){
cols = ob_cols;
}
}
return cols;
}
SequenceViewObject* SequenceModel::GetItem(gfx::EntityP& entity){ SequenceViewObject* SequenceModel::GetItem(gfx::EntityP& entity){
if(entity != NULL){ if(entity != NULL){
for (int i = 0 ; i< objects_.size(); i++){ for (int i = 0 ; i< objects_.size(); i++){
......
...@@ -78,6 +78,7 @@ public slots: ...@@ -78,6 +78,7 @@ public slots:
void SelectionChanged(const QItemSelection& sel, const QItemSelection& desel); void SelectionChanged(const QItemSelection& sel, const QItemSelection& desel);
private: private:
int GetColumnCount() const;
SequenceViewObject* GetItem(gfx::EntityP& entity); SequenceViewObject* GetItem(gfx::EntityP& entity);
BaseViewObject* GetItem(const QModelIndex& index) const; BaseViewObject* GetItem(const QModelIndex& index) const;
QPair<int, BaseViewObject*> GetRowWithItem(int row) const; QPair<int, BaseViewObject*> GetRowWithItem(int row) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment