mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Some cleanup in switching of image source
This commit is contained in:
+6
-4
@@ -55,8 +55,10 @@ void MainWindow::handleSourceItemSelectionChanged()
|
||||
QListWidgetItem* item = sourceList->currentItem();
|
||||
int idx = item->data(Qt::UserRole).toInt();
|
||||
std::cout << "idx=" << idx << std::endl;
|
||||
sourceCanvas->switchImage(idx);
|
||||
sourceCanvas->repaint();
|
||||
setCurrentPaint(idx);
|
||||
sourceCanvas->updateCanvas();
|
||||
//sourceCanvas->switchImage(idx);
|
||||
//sourceCanvas->repaint();
|
||||
destinationCanvas->repaint();
|
||||
}
|
||||
|
||||
@@ -179,8 +181,8 @@ void MainWindow::createLayout()
|
||||
connect(sourceCanvas, SIGNAL(quadChanged()),
|
||||
destinationCanvas, SLOT(updateCanvas()));
|
||||
|
||||
connect(destinationCanvas, SIGNAL(imageChanged()),
|
||||
sourceCanvas, SLOT(updateCanvas()));
|
||||
// connect(destinationCanvas, SIGNAL(imageChanged()),
|
||||
// sourceCanvas, SLOT(updateCanvas()));
|
||||
|
||||
sourceCanvas->setFocusPolicy(Qt::ClickFocus);
|
||||
destinationCanvas->setFocusPolicy(Qt::ClickFocus);
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ private:
|
||||
public:
|
||||
MappingManager& getMappingManager() { return *mappingManager; }
|
||||
int getCurrentPaintId() const { return currentPaintId; }
|
||||
void setPaint(int id)
|
||||
void setCurrentPaint(int id)
|
||||
{
|
||||
currentPaintId = id;
|
||||
}
|
||||
|
||||
+5
-5
@@ -192,11 +192,11 @@ void MapperGLCanvas::paintEvent(QPaintEvent* /* event */)
|
||||
updateGL();
|
||||
}
|
||||
|
||||
void MapperGLCanvas::switchImage(int imageId)
|
||||
{
|
||||
MainWindow::getInstance().setPaint(imageId);
|
||||
emit imageChanged();
|
||||
}
|
||||
//void MapperGLCanvas::switchImage(int imageId)
|
||||
//{
|
||||
// MainWindow::getInstance().setCurrentPaint(imageId);
|
||||
// emit imageChanged();
|
||||
//}
|
||||
|
||||
//QSize MapperGLCanvas::sizeHint() const
|
||||
//{
|
||||
|
||||
Reference in New Issue
Block a user