Window::Window() { m_shouldDisplayFeather = true; std::cout<<"Initializing Mallard main window "; glWidget = new GLWidget; m_tools = new ToolBox; m_barbEdit = new BarbEdit(this); m_renderEdit = new RenderEdit(this); glWidget->setInteractContext(m_tools); m_brushControl = new BrushControl(glWidget->brush(), this); m_featherEdit = new FeatherEdit(this); FeatherExample::FeatherLibrary = glWidget; m_timeControl = new TimeControl(this); glWidget->setPlayback(m_timeControl); m_sceneEdit = new SceneEdit(glWidget, this); addToolBar(m_tools); setCentralWidget(glWidget); setWorkTitle(tr("untitled")); createActions(); createMenus(); connect(m_tools, SIGNAL(contextChanged(int)), this, SLOT(receiveToolContext(int))); connect(m_tools, SIGNAL(contextChanged(int)), m_brushControl, SLOT(receiveToolContext(int))); connect(m_tools, SIGNAL(actionTriggered(int)), this, SLOT(receiveToolAction(int))); connect(m_tools, SIGNAL(stateChanged(int)), this, SLOT(receiveToolState(int))); connect(m_brushControl, SIGNAL(brushChanged()), glWidget, SLOT(receiveBrushChanged())); connect(m_brushControl, SIGNAL(paintModeChanged(int)), glWidget, SLOT(receivePaintMode(int))); connect(glWidget, SIGNAL(sceneNameChanged(QString)), this, SLOT(setWorkTitle(QString))); connect(glWidget, SIGNAL(sendMessage(QString)), this, SLOT(showMessage(QString))); connect(m_featherEdit, SIGNAL(textureLoaded(QString)), glWidget, SLOT(receiveFeatherEditBackground(QString))); connect(m_featherEdit, SIGNAL(featherAdded()), glWidget, SLOT(receiveFeatherAdded())); connect(glWidget, SIGNAL(sendFeatherEditBackground(QString)), m_featherEdit, SLOT(receiveTexture(QString))); connect(m_timeControl, SIGNAL(currentFrameChanged(int)), glWidget, SLOT(updateOnFrame(int))); connect(m_featherEdit->uvView(), SIGNAL(selectionChanged()), m_barbEdit->barbControl(), SLOT(receiveSelectionChanged())); connect(glWidget, SIGNAL(featherSelectionChanged()), m_barbEdit->barbControl(), SLOT(receiveSelectionChanged())); connect(m_featherEdit->uvView(), SIGNAL(shapeChanged()), m_barbEdit->barbView(), SLOT(receiveShapeChanged())); connect(glWidget, SIGNAL(renderResChanged(QSize)), m_renderEdit, SLOT(resizeRenderView(QSize))); connect(glWidget, SIGNAL(renderEngineChanged(QString)), m_renderEdit, SLOT(setRenderEngine(QString))); connect(glWidget, SIGNAL(renderStarted(QString)), m_renderEdit, SLOT(startRender(QString))); connect(m_renderEdit, SIGNAL(cancelRender()), glWidget, SLOT(receiveCancelRender())); connect(m_barbEdit->barbControl(), SIGNAL(shapeChanged()), glWidget, SLOT(receiveBarbChanged())); connect(glWidget, SIGNAL(sceneOpened()), m_sceneEdit, SLOT(reloadScene())); connect(m_sceneEdit->model(), SIGNAL(cameraChanged()), glWidget, SLOT(receiveCameraChanged())); std::cout<<"Ready\n"; statusBar()->showMessage(tr("Ready")); }
int Canvas2D::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = SupportCanvas2D::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: cancelRender(); break; case 1: filterImage(); break; default: ; } _id -= 2; } return _id; }
void RenderEdit::reject() { emit cancelRender(); QDialog::reject(); }
void RenderEdit::keyPressEvent(QKeyEvent *e) { if(e->key() == Qt::Key_Q) emit cancelRender(); QDialog::keyPressEvent(e); }