Added method MainWindow::updateAll() to update the canvases

This commit is contained in:
Tats
2013-12-08 11:54:39 -05:00
parent 3517b7a71d
commit 8caab2875b
2 changed files with 16 additions and 9 deletions
+12 -9
View File
@@ -71,8 +71,7 @@ void MainWindow::handleSourceItemSelectionChanged()
removeCurrentMapping();
// Update canvases.
sourceCanvas->update();
destinationCanvas->update();
updateAll();
//sourceCanvas->switchImage(idx);
//sourceCanvas->repaint();
//destinationCanvas->repaint();
@@ -83,12 +82,12 @@ void MainWindow::handleLayerItemSelectionChanged()
std::cout << "shape selection changed" << std::endl;
QListWidgetItem* item = layerList->currentItem();
uint idx = item->data(Qt::UserRole).toUInt();
std::cout << "idx=" << idx << std::endl;
Mapping::ptr mapping = mappingManager->getLayerById(idx)->getMapping();
setCurrentPaint(mapping->getPaint()->getId());
setCurrentMapping(mapping->getId());
sourceCanvas->update();
destinationCanvas->update();
updateAll();
//sourceCanvas->switchImage(idx);
//sourceCanvas->repaint();
//destinationCanvas->repaint();
@@ -99,8 +98,7 @@ void MainWindow::handleLayerItemChanged(QListWidgetItem* item)
uint layerId = item->data(Qt::UserRole).toUInt();
Layer::ptr layer = mappingManager->getLayerById(layerId);
layer->setVisible(item->checkState() == Qt::Checked);
sourceCanvas->update();
destinationCanvas->update();
updateAll();
}
void MainWindow::handleLayerIndexesMoved()
@@ -115,8 +113,7 @@ void MainWindow::handleLayerIndexesMoved()
mappingManager->reorderLayers(newOrder);
sourceCanvas->update();
destinationCanvas->update();
updateAll();
}
//void MainWindow::handleSourceSelectionChanged(const QItemSelection& selection)
@@ -682,6 +679,12 @@ void MainWindow::clearWindow()
// TODO: implement clearWindow()
}
void MainWindow::updateAll()
{
sourceCanvas->update();
destinationCanvas->update();
}
QString MainWindow::strippedName(const QString &fullFileName)
{
return QFileInfo(fullFileName).fileName();
+4
View File
@@ -156,6 +156,10 @@ public:
_hasCurrentMapping = false;
}
public slots:
void updateAll();
public:
// Constants.
static const int DEFAULT_WIDTH = 1600;