本文整理汇总了C++中QErrorMessage::exec方法的典型用法代码示例。如果您正苦于以下问题:C++ QErrorMessage::exec方法的具体用法?C++ QErrorMessage::exec怎么用?C++ QErrorMessage::exec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QErrorMessage
的用法示例。
在下文中一共展示了QErrorMessage::exec方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void MainWindow::on_actionQueue2_triggered()
{
if(getRoot() == NULL)
{
QErrorMessage err;
err.showMessage("Root does not exits");
err.exec();
return;
}
space * wp = (space*)getRoot();
if(wp->sublvl == NULL)
{
QErrorMessage err;
err.showMessage("Stars does not exits");
err.exec();
return;
}
star ** st = (star**)wp->sublvl;
int count_star = wp->sublvl_count;
star * max = st[0];
QString result = "Biggest star:";
for(int i = 1;i < count_star;i++)
{
if(st[i]->sublvl_count > max->sublvl_count)
{
max = st[i];
}else if(st[i]->sublvl_count == max->sublvl_count){
if(st[i]->mass > max->mass){
max = st[i];
}
}
}
result += " " + QString::fromStdString(max->name);
QMessageBox::about(this,"Found data",result);
}
示例2: setPresetBehaviour
void CParticleSystemPage::setPresetBehaviour(int index)
{
updateLifeMgtPresets();
if (index == _Node->getPSPointer()->getBehaviourType()) return;
if (index == NL3D::CParticleSystem::SpellFX ||
index == NL3D::CParticleSystem::SpawnedEnvironmentFX)
{
NL3D::CPSLocatedBindable *lb;
if (!_Node->getPSPointer()->canFinish(&lb))
{
_ui.presetBehaviourComboBox->setCurrentIndex(_Node->getPSPointer()->getBehaviourType());
QErrorMessage *errorMessage = new QErrorMessage();
errorMessage->setModal(true);
if (!lb)
{
errorMessage->showMessage(tr("Can't perform operation : the system is flagged with 'No max nb steps' or uses the preset 'Spell FX', "
"and thus, should have a finite duration. Please remove that flag first."));
errorMessage->exec();
}
else
{
errorMessage->showMessage(tr("The system must have a finite duration for this setting! Please check that the following object "
"doesn't live forever or doesn't create a loop in the system :") + QString(lb->getName().c_str()));
errorMessage->exec();
}
delete errorMessage;
return;
}
}
_Node->getPSPointer()->activatePresetBehaviour((NL3D::CParticleSystem::TPresetBehaviour) index);
updateLifeMgtPresets();
updateModifiedFlag();
}
示例3: openvtkclicked
//Function (slot) to read vtk image data
void Application::openvtkclicked()
{
QString temp = QFileDialog::getOpenFileName(this, tr("Open VTK Data File"),"",tr("VTK Data (*.vtk)"));
QFile data(temp);
QString line;
QTextStream in(&data);
in.setCodec("UTF-8");
if (data.open(QFile::ReadOnly))
{
line = in.readLine();
if(line.contains("vtk") == true)
{
do
{
line = in.readLine();
if(line.contains("DATASET") == true)
{
//call for slicers
if(line.contains("STRUCTURED_POINTS") == true)//if dataset is compatible
{
dataset = line;
currentfile = temp;
viewstructuredpointslices(); //calls this function to display slices along axes
showisotog(); //generates isosurface in case, isosurfacing is true
Enableall();
}
else
{
setStatusTip("Unsupported or Invalid Dataset!!");
QErrorMessage errmsg;
errmsg.showMessage(tr("Unsupported or Invalid Dataset!!"));
errmsg.setWindowIcon(QIcon(":/ICONS/Head.jpg"));
errmsg.exec();
}
break;
}
} while (!line.isNull());
}
else
{
this->setStatusTip("Invalid VTK file or file corrupt!!");
QErrorMessage errmsg;
errmsg.showMessage(tr("Invalid VTK file or file corrupt!!"));
errmsg.setWindowIcon(QIcon(":/ICONS/Head.jpg"));
errmsg.exec();
}
data.close();
}
else
this->setStatusTip("File Opening Failed!!");
}
示例4: volumeReconstruction
void MainWindow::volumeReconstruction()
{
std::cout<<"VOLUME RECONSTRUCTION"<<std::endl<<std::endl;
if (!displayWidget->getVolumeImageStack().empty())
{
VolumeReconstructionWidget * volumeReconstruction = new VolumeReconstructionWidget();
if (displayWidget->isVolumeImageStackLoaded){
volumeReconstruction->setVolumeImageStack(displayWidget->getVolumeImageStack());
volumeReconstruction->setTransformStack(displayWidget->getTransformStack());
}
volumeReconstruction->setMainWindow(this);
volumeReconstruction->show();
}
else
{
QErrorMessage errorMessage;
errorMessage.showMessage(
"No volume data loaded, </ br> please data before reconstruct the volume");
errorMessage.exec();
}
}
示例5: checkCalibrationError
void MainWindow::checkCalibrationError()
{
std::cout<<"Check Calibration Error"<<std::endl<<std::endl;
if (!displayWidget->getImageStack().empty())
{
CheckCalibrationErrorWidget* checkCalibrationWidget = new CheckCalibrationErrorWidget();
if (displayWidget->isImageStackLoaded)
checkCalibrationWidget->setImageStack(displayWidget->getImageStack());
else
checkCalibrationWidget->setImage(displayWidget->getImageViewer()->GetInput());
displayWidget->setCalibrationErrorWidget(checkCalibrationWidget);
displayWidget->setProbeFlag(false);
displayWidget->startTracer();
checkCalibrationWidget->setMainWindow(this);
checkCalibrationWidget->show();
}
else
{
QErrorMessage errorMessage;
errorMessage.showMessage(
"No images loaded, </ br> please load an images before checking the calibration");
errorMessage.exec();
}
}
示例6: probeCalibration
void MainWindow::probeCalibration()
{
std::cout<<"Probe Calibration"<<std::endl;
if (!displayWidget->getImageStack().empty())
{
ProbeCalibrationWidget* probeCalibration = new ProbeCalibrationWidget();
if (displayWidget->isImageStackLoaded)
probeCalibration->setImageStack(displayWidget->getImageStack());
else
probeCalibration->setImage(displayWidget->getImageViewer()->GetInput());
displayWidget->setProbeFlag(true);
// get left mouse pressed with high priority
Connections->Connect(displayWidget->getQVTKWidget()->GetRenderWindow()->GetInteractor(),
vtkCommand::LeftButtonPressEvent,
probeCalibration,
SLOT(getCoordinates()));
probeCalibration->setMainWindow(this);
probeCalibration->show();
}
else
{
QErrorMessage errorMessage;
errorMessage.showMessage(
"No images loaded, </ br> please load an images before calibrate the probe");
errorMessage.exec();
}
}
示例7: chatroom_status
void cChatsView::chatroom_status(QString id, bool status, QString reason)
{
qDebug() << "[INFO]cChatsView::chatroom_status-> id:" << id << "status" << status;
if (status)
{
for(int i = 0 ; i < m_chats.count() ; i++)
{//Si ya le hemos creado no hacemos nada
if (m_chats[i]->get_chatId() ==id)
{
qDebug() << "[INFO]cChatsView::chatroom_status-> ya le he creado!:" << m_chats[i]->get_chatId() << "/" << id;
return;
}
}
cChatView* chat = new cChatView(m_pClient,id,id,this);
m_chats.append(chat);
ui->tabWidget->addTab(chat,id);
}
else
{
QErrorMessage errorMessage;
QString msg("No se ha podido conectar al chat:");
msg.append(id);
msg.append(" Reason:");
msg.append(reason);
errorMessage.showMessage(msg);
errorMessage.exec();
}
}
示例8: openWithVTK
void ImageWidget::openWithVTK()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), QDir::currentPath());
if (!fileName.isEmpty()) {
/*
// This code is currently not used because the file is read with vtkImageReader2
// Obtain image information
this->setImageProperties(fileName.toAscii().data(), true);
// set itk image depending on the image type
// if image type is grayscale
if (imageType.compare("scalar") == 0) {
// read the image
typedef itk::ImageFileReader <ImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(fileName.toAscii().data());
reader->Update();
// set the image data provided by the reader
itkImage = reader->GetOutput();
} else {
// if the image is RGB
typedef itk::ImageFileReader <RGBImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(fileName.toAscii().data());
reader->Update();
// set the image data provided by the reader
rgbItkImage = reader->GetOutput();
}
*/
// reads a vtkImage for display purposes
vtkSmartPointer <vtkImageReader2Factory> readerFactory =
vtkSmartPointer <vtkImageReader2Factory>::New();
vtkSmartPointer <vtkImageReader2> reader =
readerFactory->CreateImageReader2(fileName.toAscii().data());
reader->SetFileName(fileName.toAscii().data());
reader->Update();
vtkImage = reader->GetOutput();
this->isFlipped = true;
this->displayImage(vtkImage);
readerFactory = NULL;
reader = NULL;
} else {
QErrorMessage errorMessage;
errorMessage.showMessage("No file specified for loading");
errorMessage.exec();
return;
}
}
示例9: open
void JobEditorWindow::open()
{
try {
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Job"), "", tr("Job (*.job)"));
if ( fileName != NULL ) {
openJob(rsString(fileName.toUtf8().data()));
}
} catch (const exception& e) {
QErrorMessage errorMessage;
errorMessage.showMessage(e.what());
errorMessage.exec();
} catch (...) {
QErrorMessage errorMessage;
errorMessage.showMessage("Unknown error while opening the job file");
errorMessage.exec();
}
}
示例10: errorMessage
void SendEmail::errorMessage(const QString &message)
{
QErrorMessage err (this);
err.showMessage(message);
err.exec();
}
示例11: QMainWindow
JobEditorWindow::JobEditorWindow(QMainWindow *parent) : QMainWindow(parent)
{
ui.setupUi(this);
ui.pipelineWidget->removePage(0);
try {
createActions();
createMenus();
} catch (const exception& e) {
QErrorMessage errorMessage;
errorMessage.showMessage(e.what());
errorMessage.exec();
} catch (...) {
QErrorMessage errorMessage;
errorMessage.showMessage("Unknown error while intializing the application");
errorMessage.exec();
}
currentJobPath = NULL;
currentJob = NULL;
}
示例12: setNoMaxNBSteps
void CParticleSystemPage::setNoMaxNBSteps(bool state)
{
_ui.maxStepsWidget->setEnabled(!state);
if (state == _Node->getPSPointer()->getBypassMaxNumIntegrationSteps()) return;
if (state && !_Node->getPSPointer()->canFinish())
{
QErrorMessage *errorMessage = new QErrorMessage();
errorMessage->setModal(true);
errorMessage->showMessage(tr("The system must have a finite duration for this setting! Please check that."));
errorMessage->exec();
delete errorMessage;
_ui.maxStepsWidget->setEnabled(state);
_ui.noMaxNBStepsCheckBox->setChecked(!state);
return;
}
_Node->getPSPointer()->setBypassMaxNumIntegrationSteps(state);
updateModifiedFlag();
}
示例13: startLogging
/**
* Starts the logging thread to a certain file
*/
void LoggingPlugin::startLogging(QString file)
{
qDebug() << "Logging to " << file;
// We have to delete the previous logging thread if is was still there!
if (loggingThread)
delete loggingThread;
loggingThread = new LoggingThread();
if(loggingThread->openFile(file,this))
{
connect(loggingThread,SIGNAL(finished()),this,SLOT(loggingStopped()));
state = LOGGING;
loggingThread->start();
emit stateChanged("LOGGING");
} else {
QErrorMessage err;
err.showMessage("Unable to open file for logging");
err.exec();
}
}
示例14: fopen
void MainWindow::on_actionSave_2_triggered()
{
if(getRoot() == NULL)
{
QErrorMessage error_mes;
error_mes.showMessage("Node was not create");
error_mes.exec();
return;
}
FILE * f = fopen("STANDART.txt","wb");
if(f == NULL)
{
QErrorMessage err;
err.showMessage("File open error");
err.exec();
return;
}
store((space*)getRoot(),f);
}
示例15: error
void ConnectingDialog::error(QAbstractSocket::SocketError socketError)
{
QErrorMessage *msgD = new QErrorMessage();
QString msg = "Connection error: ";
switch(socketError)
{
case QAbstractSocket::HostNotFoundError:
msg.append("Host not found");
break;
case QAbstractSocket::ConnectionRefusedError:
msg.append("Connection refused");
break;
case QAbstractSocket::RemoteHostClosedError:
msg.append("Remote host closed the connection");
}
msgD->showMessage(msg);
msgD->exec();
reject();
}