当前位置: 首页>>代码示例>>C++>>正文


C++ QErrorMessage类代码示例

本文整理汇总了C++中QErrorMessage的典型用法代码示例。如果您正苦于以下问题:C++ QErrorMessage类的具体用法?C++ QErrorMessage怎么用?C++ QErrorMessage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QErrorMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CheckCalibrationErrorWidget

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();
    }
}
开发者ID:FubuFabian,项目名称:ThreeViews-MAC,代码行数:29,代码来源:mainwindow.cpp

示例2: QErrorMessage

void NuevoCandidato::terminarCreacion()
{
        QString nombreTemporal;
        QString partidoTemporal;

        nombreTemporal = nombreCandidatoEdit->text();
        partidoTemporal = nombrePartidoEdit->text();

        if((nombreTemporal.isEmpty()) || (partidoTemporal.isEmpty()) || (imagen.isEmpty()))
        {
                QErrorMessage *error = new QErrorMessage();
                error->showMessage("Faltan datos!");
                return;
        }
        else
        {
            this->nombre = nombreTemporal;
            this->partido = partidoTemporal;
            this->guardarCandidato();
            QMessageBox exito;
            exito.setText("candidato añadido satisfactoriamente");
            exito.setWindowTitle ( tr("Confirmacion") );
            exito.exec();
            this->hide();
            this->ventanaAnterior->repaint();
            this->ventanaAnterior->show();
            return;
        }
}
开发者ID:jhonderson,项目名称:Elecciones2010,代码行数:29,代码来源:nuevoCandidato.cpp

示例3: ProbeCalibrationWidget

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();
    }
}
开发者ID:FubuFabian,项目名称:ThreeViews-MAC,代码行数:32,代码来源:mainwindow.cpp

示例4: switch

bool mainWindow::ifErrorsEvaluate(std::pair< int, unsigned int > msg)
{
    QString output;
    switch(msg.first)
    {
	case newParser::FILE_OK:
	    return false;
	case newParser::ERR_1ENTRY_PER_LINE:
	    output = tr("File is wrong!\nLine %1 has 1 entry when it needs two.").arg(msg.second);
	    break;
	case newParser::ERR_3PLUS_ENTRES_PER_LINE:
	    output = tr("File is wrong!\nLine %1 has 3+ entries when it needs two.").arg(msg.second);
	    break;
	case newParser::ERR_MILLIS_SHRUNK:
	    output.reserve(97);
	    output = tr("File is wrong!\nLine %1 shows that the data went back in time\n").arg(msg.second);
	    output += tr("When this never should have happened\n");
	    break;
	case newParser::ERR_TOXIC_CHARACTER:
	    output = tr("File data is wrong!\nLine %1 has a non-number character\n(Use 0-9 (no '-'))").arg(msg.second);
	    break;
	case newParser::FILE_EMPTY:
	    output = tr("The given file was empty");
	    break;
	default:
	    output = tr("Unspecified error in file");
	    break;
    }
    QErrorMessage* out = new QErrorMessage(this);
    out->showMessage(output);
    return true;

    
}
开发者ID:d4nF,项目名称:moth-hamster-wheel,代码行数:34,代码来源:mainWindow.cpp

示例5: qDebug

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();
  }
}
开发者ID:darkjavi,项目名称:corepad,代码行数:28,代码来源:cchatsview.cpp

示例6: tgtAssert

void VolumeIOHelper::loadURL(const std::string& url, VolumeReader* reader) {
    tgtAssert(reader, "null pointer passed");

    try {
        std::vector<VolumeURL> origins = reader->listVolumes(url);
        if (origins.size() > 1) { // if more than one volume listed at URL, show listing dialog
            tgtAssert(volumeListingDialog_, "no volumelistingdialog");
            volumeListingDialog_->setOrigins(origins, reader);
            volumeListingDialog_->show();
        }
        else if (origins.size() == 1) { // load single volume directly
            loadOrigin(origins.front(), reader);
        }
        else {
            LWARNING("No volumes found at URL '" << url << "'");
            QErrorMessage* errorMessageDialog = new QErrorMessage(VoreenApplicationQt::qtApp()->getMainWindow());
            errorMessageDialog->showMessage(QString::fromStdString("No volumes found at '" + url + "'"));
        }
    }
    catch (const tgt::FileException& e) {
        LWARNING(e.what());
        QErrorMessage* errorMessageDialog = new QErrorMessage(VoreenApplicationQt::qtApp()->getMainWindow());
        errorMessageDialog->showMessage(e.what());
    }
}
开发者ID:dragonlet,项目名称:Voreen,代码行数:25,代码来源:volumeiohelper.cpp

示例7: VolumeReconstructionWidget

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();
      }
	
}
开发者ID:FubuFabian,项目名称:ThreeViews-MAC,代码行数:25,代码来源:mainwindow.cpp

示例8: QErrorMessage

void Login::error(QString title, QString messages)
{
    QErrorMessage *message = new QErrorMessage(this);
    message->setWindowTitle(title);
    message->showMessage(messages);
    return;
}
开发者ID:LMS-KING,项目名称:ScholarshipAssessmentSystem,代码行数:7,代码来源:login.cpp

示例9: tr

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;
	}
}
开发者ID:gibbogle,项目名称:vessel-tools,代码行数:59,代码来源:imagewidget.cpp

示例10: err

void SendEmail::errorMessage(const QString &message)
{
    QErrorMessage err (this);

    err.showMessage(message);

    err.exec();
}
开发者ID:ChangChingHan,项目名称:SmtpClient-for-Qt,代码行数:8,代码来源:sendemail.cpp

示例11: QErrorMessage

void MyGL::slot_symEdgeButtonPressed() {
    if (edgeSelection != nullptr) {
        if (edgeSelection->sym != nullptr) {
            edgeSelection = edgeSelection->sym;
        } else {
            QErrorMessage* errorMessageDialog = new QErrorMessage(this);
            errorMessageDialog->setWindowTitle(QString("Error: No sym found!"));
            errorMessageDialog->showMessage(QString("This Half-Edge has no symmetrical edge value"));
        }
    }
}
开发者ID:YoussefV,项目名称:PoorMansMaya,代码行数:11,代码来源:mygl.cpp

示例12: addResistantElement

void ElementsWindow::addResistantElement() {
	if ((_elementsList->count() > 0) && !!_elementsList->currentItem()) {

		Element *currentElement = _properties->getElements()->getElement(_elementsList->currentItem()->text());
		if (!!currentElement) {
			QVector<Element*> elements = _properties->getElements()->getElements();
			QVector<Element*> resistantElements = currentElement->getResistantElements();
			QVector<Element*> vulnerableElements = currentElement->getVulnerableElements();

			removeComponent<Element>(elements, currentElement->getName());
			for(int i = 0; i < resistantElements.size(); i++) {
				removeComponent<Element>(elements, resistantElements.at(i)->getName());
			}
			for (int i = 0; i < vulnerableElements.size(); i++) {
				removeComponent<Element>(elements, vulnerableElements.at(i)->getName());
			}

			QStringList availableElements;
			for (int i = 0; i < elements.size(); i++) {
				availableElements.append(elements.at(i)->getName());
			}

			if (availableElements.size() == 0) {
				QMessageBox::information(0, "No elements available", "There are no more possible elements to select.");
				return;
			}

			bool accepted;
			QString name = QInputDialog::getItem(this, "Add a resistant element to " + currentElement->getName(), "Select an element:", availableElements, 0, false, &accepted);

			if (accepted) {
				if (name == QString()) {
					QErrorMessage *errorDialog = QErrorMessage::qtHandler();
					errorDialog->showMessage("Selected an unknown element.");
					return;
				}

				Element *element = _properties->getElements()->getElement(name);
				try {
					currentElement->addResistantElement(element);
				} catch (ProjectException &e) {
					QMessageBox::critical(this, tr("An unexpected error occurred"), e.what());
					return;
				}

				_resistantList->addItem(name);
				_resistantList->setCurrentRow(_resistantList->count()-1);
			}
		}
	}
}
开发者ID:juniordiscart,项目名称:RPGMaker,代码行数:51,代码来源:ElementsWindow.cpp

示例13: datadir

/***********************************************************
PostManagement
***********************************************************/
QString FileDialogOptionsModel::PostManagement(const QString & selectedfile)
{
	QString outfile;

	// check if choosen file is in the directory data
	QDir datadir(DataDirHandler::getInstance()->GetDataDirPath().c_str());
	if(selectedfile.contains(datadir.absolutePath()))
	{
		outfile = selectedfile;
		outfile = outfile.remove(datadir.absolutePath() + "/");
	}
	else
	{
		//copy the file over
		try
		{
			// get all files with same name
			std::vector<std::string> files;
			QString fpath = selectedfile.section('/', 0, -2 );
			{
				QString filenoext = selectedfile.section('/', -1);
				filenoext = filenoext.section('.', 0, 0);

				FileUtil::ListFilesInDir(fpath.toAscii().data(), files, filenoext.toAscii().data());
			}

			for(size_t curs=0; curs<files.size(); ++curs)
			{
				QString tmp = fpath + "/";
				tmp += files[curs].c_str();
				QString tmp2 = StartingDirectory + "/";
				tmp2 += files[curs].c_str();
				FileUtil::MakeFileCopy(tmp.toAscii().data(), tmp2.toAscii().data());
			}

			QString filename = StartingDirectory + "/" + selectedfile.section('/', -1);
			outfile = filename.section('/', 1);
		}
		catch(...)
		{
			QErrorMessage msgdial;
			msgdial.showMessage ( "Error copying the file to the data directory!" );
			outfile = "";
		}
	}

	return outfile;
}
开发者ID:Rincevent,项目名称:lbanet,代码行数:51,代码来源:treemodel.cpp

示例14: lua_rawgeti

void QLuaLineNumberTextEdit::textChanged()
{
	if(L && stateChangeFunc != LUA_NOREF)
	{
		lua_rawgeti(L, LUA_REGISTRYINDEX, stateChangeFunc);

		if(lua_pcall(L, 0, 0, 0))
		{
			cerr << lua_tostring(L, -1) << endl;
			QErrorMessage* msg = new QErrorMessage(Singleton.mainWindow);
			msg->showMessage( QString(lua_tostring(L, -1)).replace("\n", "<br>") );
			lua_pop(L, lua_gettop(L));
		}
		lua_gc(L, LUA_GCCOLLECT, 0);
	}
}
开发者ID:jasonimercer,项目名称:maglua,代码行数:16,代码来源:QLineNumberTextEdit.cpp

示例15: QErrorMessage

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();
}
开发者ID:Darkhunter,项目名称:Tranquillien-HCRP-Project-using-NeL,代码行数:18,代码来源:particle_system_page.cpp


注:本文中的QErrorMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。