Changeset - 7c897d022dae
[Not reviewed]
Hasan Yavuz Ă–ZDERYA - 9 years ago 2017-01-02 15:21:47
hy@ozderya.net
plotmanager handles model reset
1 file changed with 8 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/plotmanager.cpp
Show inline comments
 
@@ -93,6 +93,14 @@ PlotManager::PlotManager(QWidget* plotAr
 
    {
 
        connect(_infoModel, &QAbstractItemModel::dataChanged,
 
                this, &PlotManager::onChannelInfoChanged);
 

	
 
        connect(_infoModel, &QAbstractItemModel::modelReset,
 
                [this]()
 
                {
 
                    onChannelInfoChanged(_infoModel->index(0, 0), // start
 
                                         _infoModel->index(_infoModel->rowCount()-1, 0), // end
 
                                         {}); // roles ignored
 
                });
 
    }
 
}
 

	
 
@@ -121,8 +129,6 @@ void PlotManager::onChannelInfoChanged(c
 

	
 
    for (int ci = start; ci <= end; ci++)
 
    {
 
        qDebug() << "ci:" << ci << "curves.size:" << curves.size() << "plotWidgets.size:" << plotWidgets.size();
 

	
 
        QString name = topLeft.sibling(ci, ChannelInfoModel::COLUMN_NAME).data(Qt::EditRole).toString();
 
        QColor color = topLeft.sibling(ci, ChannelInfoModel::COLUMN_NAME).data(Qt::ForegroundRole).value<QColor>();
 
        bool visible = topLeft.sibling(ci, ChannelInfoModel::COLUMN_VISIBILITY).data(Qt::CheckStateRole).toBool();
0 comments (0 inline, 0 general)