void MainWindow::funS() { QLabel* l = new QLabel; l->setWindowTitle("Fun"); l->setFixedSize(765, 500); QObject::connect( this, SIGNAL( closeSignal() ), l, SLOT( close() ) ); QRect rect(l->contentsRect()); QPainter painter; QImage resultImage(rect.size(), QImage::Format_ARGB32_Premultiplied); painter.begin(&resultImage); painter.setCompositionMode(QPainter::CompositionMode_SourceOver); painter.eraseRect(rect); painter.drawImage(rect, resultImage); painter.end(); painter.begin(&resultImage); painter.setCompositionMode(QPainter::CompositionMode_Darken); for(int i = 0; i < 765; i++) { if(i<256) painter.setPen(QPen(QColor(255, i, 0), 1)); else if(i < 512) painter.setPen(QPen(QColor(511-i, 255, i-256), 1)); else painter.setPen(QPen(QColor(i-512, 765-i, 255), 1)); painter.drawLine(i, 0, i, 500); } painter.setCompositionMode(QPainter::CompositionMode_SourceOver); painter.drawImage(rect, resultImage); painter.end(); l->setPixmap(QPixmap::fromImage(resultImage)); l->show(); QObject::connect( this, SIGNAL( closeSignal() ), l, SLOT( close() ) ); }
int GLWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QGLWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: clicked(); break; case 1: selectedRobot(); break; case 2: closeSignal((*reinterpret_cast< bool(*)>(_a[1]))); break; case 3: toggleFullScreen((*reinterpret_cast< bool(*)>(_a[1]))); break; case 4: robotTurnedOnOff((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break; case 5: moveRobot(); break; case 6: resetRobot(); break; case 7: selectRobot(); break; case 8: moveCurrentRobot(); break; case 9: resetCurrentRobot(); break; case 10: moveBall(); break; case 11: changeCameraMode(); break; case 12: yellowRobotsMenuTriggered((*reinterpret_cast< QAction*(*)>(_a[1]))); break; case 13: blueRobotsMenuTriggered((*reinterpret_cast< QAction*(*)>(_a[1]))); break; case 14: switchRobotOnOff(); break; case 15: moveRobotHere(); break; case 16: moveBallHere(); break; case 17: lockCameraToRobot(); break; case 18: lockCameraToBall(); break; default: ; } _id -= 19; } return _id; }
/** * Adds a QDialog to set force to nodes */ Dialog_Add_Force::Dialog_Add_Force(interfaces::ControlCenter* c, main_gui::GuiInterface *gui) : main_gui::BaseWidget(0, c->cfg, "Dialog_Add_Force"), pDialog( new main_gui::PropertyDialog(0)), mainGui(gui) { control = c; pDialog->setAttribute(Qt::WA_DeleteOnClose); pDialog->setWindowTitle(tr("Apply Force")); pDialog->setPropCallback(dynamic_cast<main_gui::PropertyCallback*>(this)); QObject::connect(pDialog, SIGNAL(closeSignal()), this, SLOT(closeDialog())); control->nodes->getListNodes(this->getNodeListPtr()); std::map<QString, QVariant> attr; attr.insert(pair<QString, QVariant>(QString("decimals"), 9)); attr.insert(pair<QString, QVariant>(QString("singleStep"), 0.1)); QStringList enumNames; for (unsigned int i = 0; i <myNodes.size(); i++) enumNames << QString::fromStdString(myNodes[i].name); node = pDialog->addGenericProperty("../Node", QtVariantPropertyManager::enumTypeId(), QVariant(1), NULL, &enumNames); vector_x = pDialog->addGenericProperty("../Vector/x", QVariant::Double, 1.0, &attr); vector_y = pDialog->addGenericProperty("../Vector/y", QVariant::Double, 0.0, &attr); vector_z = pDialog->addGenericProperty("../Vector/z", QVariant::Double, 0.0, &attr); magnitude = pDialog->addGenericProperty("../Magnitude [N]", QVariant::Double, 10, &attr); }
void MainWindow::createPictureWidget() { pictureWidget = new TPictureWidget(0); pictureWidget->setAttribute(Qt::WA_DeleteOnClose); connect(pictureWidget, SIGNAL(closeSignal()), this, SLOT(closePictureWidgetSlot())); connect(pictureWidget, SIGNAL(needNextPicture(IPictureEditor*&)), this, SLOT(getNextPicture(IPictureEditor *&))); connect(pictureWidget, SIGNAL(changed()), this, SLOT(changedSlot())); connect(this, SIGNAL(closeSignal()), pictureWidget, SLOT(close())); pictureWidget->show(); }
LoginForm::LoginForm(QWidget* parent) : QDialog(parent) { login = new QLineEdit; password = new QLineEdit; password->setEchoMode(QLineEdit::Password); nick = new QLineEdit; loginStatus = new QLabel; startLogin = new QPushButton(tr("Login")); isAutoLogin = new QCheckBox(tr("Auto-login?")); isForumLogin = new QCheckBox(tr("Uruchie account?")); QVBoxLayout* main = new QVBoxLayout; QHBoxLayout* loginLine = new QHBoxLayout; QHBoxLayout* passwordLine = new QHBoxLayout; QHBoxLayout* nickLine = new QHBoxLayout; QHBoxLayout* checkLink = new QHBoxLayout; loginLine->addWidget(new QLabel(tr("Login:"******"Password:"******"Your nickname:"))); nickLine->addWidget(nick); checkLink->addWidget(isAutoLogin); checkLink->addWidget(isForumLogin); main->addLayout(loginLine); main->addLayout(passwordLine); main->addLayout(nickLine); main->addLayout(checkLink); main->addWidget(loginStatus); main->addWidget(startLogin); setLayout(main); setModal(true); setWindowTitle(tr("Enter your forum login")); connect(startLogin, SIGNAL(pressed()), this, SLOT(doLogin())); QSettings settings("eNoise", "UeNclient"); login->setText(settings.value("LastSessionLogin").toString()); password->setText(settings.value("LastSessionPassword").toString()); nick->setText(settings.value("LastSessionNick").toString()); isAutoLogin->setCheckState((settings.value("IsAutoLogin").toBool()) ? Qt::Checked : Qt::Unchecked); if(settings.value("IsForumLogin").isNull()) isForumLogin->setCheckState(Qt::Checked); else isForumLogin->setCheckState((settings.value("IsForumLogin").toBool()) ? Qt::Checked : Qt::Unchecked); connect(this, SIGNAL(closeSignal()), (uenclient*)parent, SLOT(closeThroughtTray())); connect(&manager, SIGNAL(finished(QNetworkReply*)), SLOT(requestFinish(QNetworkReply*))); ((uenclient*)parent)->autoLogin->setChecked(isAutoLogin->checkState() == Qt::Checked); connect(isAutoLogin, SIGNAL(toggled(bool)), ((uenclient*)parent)->autoLogin, SLOT(setChecked(bool))); #ifndef NDEBUG qDebug() << "[UENDEBUG] " << "Init login form finished"; #endif }
void MainWindow::recordSlot(QString from) { QWidget* record = RecordFactory::CreateRecord(from); ui.scrollArea->setWidget(record); WidgetFactory::SetCurrentWidget(WidgetFactory::Record); connect(record, SIGNAL(closeSignal()), this, SLOT(homeSlot())); connect(record, SIGNAL(reportSignal()), this, SLOT(reportSlot())); connect(record, SIGNAL(changeSignal(QString)), this, SLOT(changeSlot(QString))); }
/* Constructor */ FilterWin::FilterWin() : QStackedWidget(NULL) { setWindowTitle(QString("Moviesoap Filter Editor")); filterFrame = new FilterFrame(this); addWidget(filterFrame); modFrame = new ModFrame(this); addWidget(modFrame); blackoutFrame = new BlackoutFrame(this); addWidget(blackoutFrame); concludePreviewButton = new ConcludePreviewButton(QString("Conclude Preview Button"), this); // connect(concludePreviewButton, SIGNAL(clicked()), this, SLOT(concludePreview())); connect(concludePreviewButton, SIGNAL(closeSignal()), this, SLOT(concludePreview())); }
/** * returns paintViewPort **/ nmc::DkPluginViewPort* DkNikonPlugin::getViewPort() { if (!viewport) { // >DIR: dummy viewport [4.7.2014 markus] viewport = new DkNikonViewPort(); } if (!maidFacade) { QMainWindow* mainWindow = getMainWindow(); maidFacade = new MaidFacade(mainWindow); if (maidFacade->init()) { if (!camControls) { // get last location QSettings settings; int dockLocation = settings.value("camControlsLocation", Qt::RightDockWidgetArea).toInt(); camControls = new DkCamControls(maidFacade, tr("Camera Controls")); if (mainWindow) mainWindow->addDockWidget((Qt::DockWidgetArea)dockLocation, camControls); connect(camControls, SIGNAL(updateImage(QImage)), getViewPort(), SIGNAL(loadImage(QImage))); connect(camControls, SIGNAL(loadFile(QFileInfo)), getViewPort(), SIGNAL(loadFile(QFileInfo))); connect(camControls, SIGNAL(closeSignal()), getViewPort(), SIGNAL(closePlugin())); } camControls->setVisible(true); } else { QMessageBox warningDialog(mainWindow); warningDialog.setWindowTitle(tr("MAID Library could not be opened")); warningDialog.setText(tr("The MAID library could not be opened. Camera controls will be disabled.")); warningDialog.setIcon(QMessageBox::Warning); warningDialog.setStandardButtons(QMessageBox::Ok); warningDialog.setDefaultButton(QMessageBox::Ok); warningDialog.show(); warningDialog.exec(); return 0; } } return viewport; }
void MainWindow::showRS() { if( view->currentIndex().isValid() ) { int row = view->currentIndex().row(); PeopleFull p; model->getRecShow(p, row); PeopleShowWidget *pShowW; pShowW = new PeopleShowWidget(); pShowW->setPeopleFull(p); pShowW->show(); QObject::connect( this, SIGNAL( closeSignal() ), pShowW, SLOT( close() ) ); } }
void VirtualJoystickPlugin::menuAction(int action, bool checked) { (void) checked; switch (action) { case 1: if (!joystick) { joystick = new JoystickWidget(); gui->addDockWidget((void*)joystick); joystick->setMaxSpeed(12.0); connect(joystick, SIGNAL(newSpeed(double, double)), this, SLOT(newSpeed(double, double))); connect(joystick, SIGNAL(hideSignal()), this, SLOT(hideWidget())); connect(joystick, SIGNAL(closeSignal()), this, SLOT(closeWidget())); } else {
void MainWindow::closeEvent(QCloseEvent *event) { closeBS(); emit( closeSignal() ); if(view) delete view; if(openBase) delete openBase; if(closeBase) delete closeBase; if(createBase) delete createBase; if(clearBase) delete clearBase; if(addRecord) delete addRecord; if(deleteRecord) delete deleteRecord; if(editRecord) delete editRecord; if(showRecord) delete showRecord; if(selectRecord) delete selectRecord; if(diagram) delete diagram; if(buttonGroupLeft) delete buttonGroupLeft; if(buttonGroupRight) delete buttonGroupRight; if(mainLayout) delete mainLayout; if(box) delete box; event->accept(); }
void CameraConfigurator::menuAction(int action, bool checked) { (void)checked; switch(action) { case 1: if (myWidget != NULL && myWidget->pDialog) { myWidget->pDialog->close(); delete myWidget; myWidget = NULL; } myWidget = new CameraConfiguratorGUI(control); mainGui->addDockWidget((void*)myWidget->pDialog); myWidget->show(); std::vector<CameraConfig*>::iterator iter; myMutex.lock(); for(iter=cameras.begin(); iter!=cameras.end(); ++iter) myWidget->addCamera((*iter)); myMutex.unlock(); connect(myWidget->pDialog, SIGNAL(closeSignal()), this, SLOT(closeWidget())); break; } }
DialogControllers::DialogControllers(interfaces::ControlCenter *c, main_gui::GuiInterface *gui) : main_gui::BaseWidget(0, c->cfg, "DialogControllers"), pDialog(new main_gui::PropertyDialog(NULL)), mainGui(gui) { control = c; filled = false; oldFocus = NULL; pDialog->setAttribute(Qt::WA_DeleteOnClose); pDialog->setWindowTitle(tr("Controllers")); pDialog->setPropCallback(dynamic_cast<main_gui::PropertyCallback*>(this)); QObject::connect(pDialog, SIGNAL(closeSignal()), this, SLOT(closeDialog())); pDialog->setViewButtonVisibility(false); pDialog->setViewMode(main_gui::TreeViewMode); pDialog->clearButtonBox(); addButton = pDialog->addGenericButton("Add", this, SLOT(on_add_controller())); removeButton = pDialog->addGenericButton("Remove", this, SLOT(on_remove_controller())); pDialog->addGenericButton("New", this, SLOT(on_new_controller())); pDialog->addGenericButton("Nodes", this, SLOT(on_nodes_selection())); pDialog->addGenericButton("Sensors", this, SLOT(on_sensors_selection())); pDialog->addGenericButton("Motors", this, SLOT(on_motors_selection())); removeButton->hide(); addButton->hide(); control->controllers->getListController(&allControllers); for (unsigned int i = 0; i<allControllers.size(); i++) { QtVariantProperty *tmp = pDialog->addGenericProperty("../"+allControllers[i].name, QtVariantPropertyManager::groupTypeId(), 0); allControllers_p.push_back(tmp); ControllerHandler *den = new ControllerHandler(tmp, allControllers[i].index, pDialog, control, ControllerTree::EditMode); allDialogs.push_back(den); } filled = true; }
SceneGraphWidget::SceneGraphWidget(const SceneObject& object, QWidget* parent) : DockWidget(object, parent) { setWindowTitle(tr("Scene Graph")); treeView = new SceneGraphView(this); setWidget(treeView); setFocusProxy(treeView); viewModel = new SceneGraphViewModel(treeView); treeView->setModel(viewModel); #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0)) treeView->setExpandsOnDoubleClick(false); #endif treeView->header()->hide(); connect(treeView, SIGNAL(activated(const QModelIndex&)), this, SLOT(itemActivatedSlot(const QModelIndex&))); connect(treeView, SIGNAL(collapsed(const QModelIndex&)), this, SLOT(itemCollapsedSlot(const QModelIndex&))); connect(treeView, SIGNAL(expanded(const QModelIndex&)), this, SLOT(itemExpandedSlot(const QModelIndex&))); connect(Document::document, SIGNAL(updatedSceneGraph()), this, SLOT(updateObject())); connect(Document::document, SIGNAL(closeSignal()), SLOT(closeTreeSlot())); connect(Document::document, SIGNAL(restoreLayoutSignal()), SLOT(restoreLayoutSlot())); connect(Document::document, SIGNAL(writeLayoutSignal()), SLOT(writeLayoutSlot())); }
void MainWindow::reportSlot() { //ReportFactory *rf = new ReportFactory(); //QWidget *report = rf->CreateReport(); QWidget *report = ReportFactory::CreateReport(); ui.scrollArea->setWidget(report); WidgetFactory::SetCurrentWidget(WidgetFactory::Report); //关闭报表 connect(report, SIGNAL(closeSignal()), this, SLOT(homeSlot())); //病案库 connect(report, SIGNAL(recordSignal()), this, SLOT(recordSlot())); //采集图像 connect(report, SIGNAL(cameraSignal()), this, SLOT(cameraSlot())); //处理图像 connect(report, SIGNAL(imageSignal()), this, SLOT(imageSlot())); //新建清空图片label connect(report, SIGNAL(newSignal()), this, SLOT(changeSlot())); FileCentre *fc = FileCentre::GetInstance(); QString path = fc->GetRecordPath(); changeSlot(path); }
void CTabDockWidget::closeEvent(QEvent*) { emit closeSignal(false); }
void GLWidget::closeEvent(QCloseEvent *event) { emit closeSignal(false); }
void LoginForm::closeEvent(QCloseEvent* event) { emit closeSignal(); }
void CStatusWidget::closeEvent(QEvent*) { emit closeSignal(false); }
void MainWindow::closeEvent(QCloseEvent *) { emit closeSignal(); }
void DkCamControls::closeEvent(QCloseEvent* event) { closeMaid(); emit closeSignal(); }
void DialogDistance::closeEvent(QCloseEvent *event) { (void)event; emit closeSignal(this); }