bool CommandDeleteTask::finalize() { if ( !m_success ) { showInformation( tr( "Unable to delete task" ), tr( "Deleting the task failed" ) ); } return m_success; }
void show() { signal(SIGALRM, show); //设置中断信号 showInformation(); showSnake(); refresh(); //刷新真实屏幕 }
void MainWindow::openFile() { if( !fileName.isEmpty() ) { closeFile(); } image = new PngImage(); fileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), "", tr( "PNG file (*.png)" ) ); if( !fileName.isEmpty() ) { switch( image->loadFromFile( fileName ) ) { case PngImage::PngOk : { setStatus( tr( "File://%1" ).arg( fileName ) ); actionClose->setEnabled( true ); showInformation(); drawImage(); break; } case PngImage::NotAPng : { QMessageBox::warning( this, tr( "Error!" ), tr( "Not a PNG file!" ), QMessageBox::Ok ); break; } } } }
ChatDialog::ChatDialog(QWidget *parent) : QDialog(parent) { setupUi(this); lineEdit->setFocusPolicy(Qt::StrongFocus); textEdit->setFocusPolicy(Qt::NoFocus); textEdit->setReadOnly(true); listWidget->setFocusPolicy(Qt::NoFocus); connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed())); #ifdef Q_OS_SYMBIAN connect(sendButton, SIGNAL(clicked()), this, SLOT(returnPressed())); #endif connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed())); connect(&client, SIGNAL(newMessage(QString,QString)), this, SLOT(appendMessage(QString,QString))); connect(&client, SIGNAL(newParticipant(QString)), this, SLOT(newParticipant(QString))); connect(&client, SIGNAL(participantLeft(QString)), this, SLOT(participantLeft(QString))); myNickName = client.nickName(); newParticipant(myNickName); tableFormat.setBorder(0); QTimer::singleShot(10 * 1000, this, SLOT(showInformation())); }
ChatDialog::ChatDialog(QWidget *parent) : QDialog(parent) { setupUi(this); // Meme generator setup lineEdit_2->setFocusPolicy(Qt::StrongFocus); connect(lineEdit_2, SIGNAL(returnPressed()), this, SLOT(memeReturnedPressed())); memeGenLayout->setPixmap(QPixmap(memepath+memefile)); std::default_random_engine rand (100); this->qme =new QEncryption(rand()); this->qmg =new QmemeGeneration(); lineEdit->setFocusPolicy(Qt::StrongFocus); textEdit->setFocusPolicy(Qt::NoFocus); textEdit->setReadOnly(true); listWidget->setFocusPolicy(Qt::NoFocus); connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed())); connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed())); connect(&client, SIGNAL(newMessage(QString,QString)), this, SLOT(appendMessage(QString,QString))); connect(&client, SIGNAL(newParticipant(QString)), this, SLOT(newParticipant(QString))); connect(&client, SIGNAL(participantLeft(QString)), this, SLOT(participantLeft(QString))); myNickName = client.nickName(); newParticipant(myNickName); tableFormat.setBorder(0); QTimer::singleShot(10 * 1000, this, SLOT(showInformation())); }
//! [5] void View::mouseReleaseEvent(QMouseEvent *event) { if (QGraphicsItem *item = itemAt(event->pos())) { if (ImageItem *image = qgraphicsitem_cast<ImageItem *>(item)) showInformation(image); } QGraphicsView::mouseReleaseEvent(event); }
bool CommandModifyTask::finalize() { if (!m_success) { // this might be slightly to little informative: showInformation(tr("Unable to modify task"), tr("Modifying the task failed.")); } return m_success; }
bool ApplicationCore::configure() { if (CONFIGURATION.failure == true) { qDebug() << "ApplicationCore::configure: an error was found within the configuration."; if (!CONFIGURATION.failureMessage.isEmpty()) { showInformation(tr("Configuration Problem"), CONFIGURATION.failureMessage); CONFIGURATION.failureMessage.clear(); } } // load configuration: QSettings settings; settings.beginGroup(CONFIGURATION.configurationName); bool configurationComplete = CONFIGURATION.readFrom(settings); if (!configurationComplete || CONFIGURATION.failure) { qDebug() << "ApplicationCore::configure: no complete configuration found for configuration name" << CONFIGURATION.configurationName; // FIXME maybe move to Configuration::loadDefaults const QString storageDatabaseDirectory = charmDataDir(); const QString storageDatabaseFileRelease = QStringLiteral("Charm.db"); const QString storageDatabaseFileDebug = QStringLiteral("Charm_debug.db"); const QString storageDatabaseRelease = storageDatabaseDirectory + storageDatabaseFileRelease; const QString storageDatabaseDebug = storageDatabaseDirectory + storageDatabaseFileDebug; QString storageDatabase; #ifdef NDEBUG Q_UNUSED(storageDatabaseDebug); storageDatabase = storageDatabaseRelease; #else Q_UNUSED(storageDatabaseRelease); storageDatabase = storageDatabaseDebug; #endif CONFIGURATION.localStorageDatabase = QDir::toNativeSeparators(storageDatabase); ConfigurationDialog dialog(CONFIGURATION, &mainView()); if (dialog.exec()) { CONFIGURATION = dialog.configuration(); CONFIGURATION.writeTo(settings); mainView().show(); } else { qDebug() << "ApplicationCore::configure: user cancelled configuration. Exiting."; // quit(); return false; } } return true; }
void Manager::draw() const { backWorld.draw(); drawAllSprites(); curWorld -> draw(); showInformation(); health -> draw(); magic -> draw(); drawAllEnemies(); if(not isDead){ player -> draw(); }else{ explodingPlayer -> draw(); } drawAllPlanes(); SDL_Flip(screen); }
void AttributesView::showInfo(Torrent *t) { mutex_info.lock(); torrent = t; switch (page_selected) { case 1: showInformation(); break; case 2: showPeers(); break; case 3: showFiles(); break; } mutex_info.unlock(); }
int ChatDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: appendMessage((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2]))); break; case 1: returnPressed(); break; case 2: newParticipant((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 3: participantLeft((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 4: showInformation(); break; default: ; } _id -= 5; } return _id; }
void Display() { glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glPushMatrix(); { CoordiateSystemDrawer(); switch(object) { case linearFunction: linearFunctionDrawer(); break; case quadraticFunction: quadraticFunctionDrawer(); break; case rationalFunction: rationalFunctionDrawer(); break; case cosinusFunction: cosinusFunctionDrawer(); break; case clearScreen: clearScreenFunction(); object = linearFunction; break; } showInformation(); } glPopMatrix(); glFlush(); glutSwapBuffers(); }
BOOL TreeDlg::PreTranslateMessage(MSG *pMsg) { if(TranslateAccelerator(m_hWnd, m_accelTable, pMsg)) { return true; } switch(pMsg->message) { case WM_RBUTTONDOWN: { CTreeCtrl *ctrl = getTreeCtrl(); CPoint p = pMsg->pt; ctrl->ScreenToClient(&p); HTREEITEM item = findTreeItemByPoint(ctrl, p); if(item != NULL) { const String derivation = getDerivation(ctrl, item, 160); showInformation(derivation); return TRUE; } } break; } return __super::PreTranslateMessage(pMsg); }
void TrayIcon::itemActivated(const QSystemTrayIcon::ActivationReason reason) { if (debug) qDebug() << PDEBUG; if (debug) qDebug() << PDEBUG << ":" << "Reason" << reason; switch (reason) { case QSystemTrayIcon::Trigger: showInformation(); break; case QSystemTrayIcon::DoubleClick: mainWindow->showMainWindow(); break; case QSystemTrayIcon::Context: // clear menu before update setContextMenu(0); updateMenu(); break; default: break; } }
void jAddContact::on_buttonInfo_clicked() { emit showInformation(ui.jidName->text()); }