src/mainwindow.cpp

changeset 104
cd4df75924b7
parent 103
94719518e310
child 105
6ca6e8c647d4
equal deleted inserted replaced
103:94719518e310 104:cd4df75924b7
210 }); 210 });
211 this->ui->tabs->addTab(document, modelName); 211 this->ui->tabs->addTab(document, modelName);
212 this->ui->tabs->setCurrentWidget(document); 212 this->ui->tabs->setCurrentWidget(document);
213 document->restoreSplitterState(this->documentSplitterState); 213 document->restoreSplitterState(this->documentSplitterState);
214 connect(document, &Document::splitterChanged, this, &MainWindow::handleDocumentSplitterChange); 214 connect(document, &Document::splitterChanged, this, &MainWindow::handleDocumentSplitterChange);
215 connect(document, &Document::mouseClick, this, &MainWindow::canvasMouseReleased);
215 } 216 }
216 217
217 void MainWindow::runSettingsEditor() 218 void MainWindow::runSettingsEditor()
218 { 219 {
219 SettingsEditor settingsEditor{&this->settings, this->defaultKeyboardShortcuts, this}; 220 SettingsEditor settingsEditor{&this->settings, this->defaultKeyboardShortcuts, this};
409 void MainWindow::canvasMousePressed(QMouseEvent *event) 410 void MainWindow::canvasMousePressed(QMouseEvent *event)
410 { 411 {
411 412
412 } 413 }
413 414
414 void MainWindow::canvasMouseReleased(QMouseEvent *event) 415 void MainWindow::canvasMouseReleased(const Canvas::MouseClickInfo& info)
415 { 416 {
416 BaseTool::MouseEventData eventData;
417 eventData.ev = event;
418 // Qt::KeyboardModifiers keymods;
419 // bool mouseMoved;
420 // Qt::MouseButtons releasedButtons;
421 if (this->selectedTool != nullptr) 417 if (this->selectedTool != nullptr)
422 { 418 {
423 this->selectedTool->mouseReleased(eventData); 419 this->selectedTool->mouseClick(info);
424 } 420 }
425 } 421 }
426 422
427 void MainWindow::canvasMouseDoubleClicked(QMouseEvent* event){} 423 void MainWindow::canvasMouseDoubleClicked(QMouseEvent* event){}
428 void MainWindow::canvasMouseMoved(QMouseEvent*){} 424 void MainWindow::canvasMouseMoved(QMouseEvent*){}

mercurial