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


C++ QStatusBar::showMessage方法代码示例

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


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

示例1: addError

void QgsMapToolCapture::addError( QgsGeometry::Error e )
{
  mGeomErrors << e;
  QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );
  if ( !vlayer )
    return;

  if ( !mTip.isEmpty() )
    mTip += "\n";

  mTip += e.what();

  if ( e.hasWhere() )
  {
    QgsVertexMarker *vm =  new QgsVertexMarker( mCanvas );
    vm->setCenter( mCanvas->mapSettings().layerToMapCoordinates( vlayer, e.where() ) );
    vm->setIconType( QgsVertexMarker::ICON_X );
    vm->setPenWidth( 2 );
    vm->setToolTip( e.what() );
    vm->setColor( Qt::green );
    vm->setZValue( vm->zValue() + 1 );
    mGeomErrorMarkers << vm;
  }

  QStatusBar *sb = QgisApp::instance()->statusBar();
  sb->showMessage( e.what() );
  if ( !mTip.isEmpty() )
    sb->setToolTip( mTip );
}
开发者ID:KISRDevelopment,项目名称:QGIS,代码行数:29,代码来源:qgsmaptoolcapture.cpp

示例2: main

int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
	QWidget win;

	QVBoxLayout* mainLayout = new QVBoxLayout();

	// first row
	QHBoxLayout* firstRowLayout = new QHBoxLayout();
	firstRowLayout->addWidget(new QLabel("Label1", &win), 0);
	firstRowLayout->addWidget(new QCheckBox("Flip me", &win), 2);
	firstRowLayout->addWidget(new QPushButton("Push me", &win), 1);
	mainLayout->addLayout(firstRowLayout, 0);
	//
	// second row
	QHBoxLayout* secondRowLayout = new QHBoxLayout();
	secondRowLayout->addWidget(new QLabel("Label2", &win), 0);
	secondRowLayout->addWidget(new QTextEdit("Edit me", &win), 1);
	mainLayout->addLayout(secondRowLayout, 0);

	// button
	QPushButton* clickButton = new QPushButton("Click me", &win);
	mainLayout->addWidget(clickButton, 0, Qt::AlignCenter);

	// status bar
	QStatusBar* statusBar = new QStatusBar(&win);
	statusBar->showMessage("Status text");
	mainLayout->addWidget(statusBar, 0);

	win.setLayout(mainLayout);
	win.show();

	return a.exec();
}
开发者ID:matus-chochlik,项目名称:various,代码行数:34,代码来源:main.cpp

示例3: QComboBox

void
App::loadStatusBar()
{
    //TODO maybe not use a statusbar for this
    QStatusBar *statusBar = _mainwindow->statusBar();
    QStringList players{"Human", "Random", "NegaMax", "NegaMaxWTt", "MTD-f"};

    _whiteCombo = new QComboBox();
    statusBar->addPermanentWidget(_whiteCombo);
    _whiteCombo->addItems(players);
    _whiteCombo->setCurrentIndex(4);
    connect(_whiteCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setWhitePlayer(int)));

    statusBar->addPermanentWidget(new QLabel("White"));

    statusBar->showMessage("Test");

    statusBar->addPermanentWidget(new QLabel("Black"));

    _blackCombo = new QComboBox();
    statusBar->addPermanentWidget(_blackCombo);
    _blackCombo->addItems(players);
    _blackCombo->setCurrentIndex(4);
    connect(_blackCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setBlackPlayer(int)));
}
开发者ID:Ram-Z,项目名称:hexdame,代码行数:25,代码来源:app.cpp

示例4: validateGeometry

void QgsSelectedFeature::validateGeometry( QgsGeometry *g )
{
  QSettings settings;
  if ( settings.value( "/qgis/digitizing/validate_geometries", 1 ).toInt() == 0 )
    return;

  if ( !g )
    g = mGeometry;

  mTip.clear();

  if ( mValidator )
  {
    mValidator->stop();
    mValidator->wait();
    mValidator->deleteLater();
    mValidator = 0;
  }

  mGeomErrors.clear();
  while ( !mGeomErrorMarkers.isEmpty() )
  {
    QgsVertexMarker *vm = mGeomErrorMarkers.takeFirst();
    QgsDebugMsg( "deleting " + vm->toolTip() );
    delete vm;
  }

  mValidator = new QgsGeometryValidator( g );
  connect( mValidator, SIGNAL( errorFound( QgsGeometry::Error ) ), this, SLOT( addError( QgsGeometry::Error ) ) );
  connect( mValidator, SIGNAL( finished() ), this, SLOT( validationFinished() ) );
  mValidator->start();

  QStatusBar *sb = QgisApp::instance()->statusBar();
  sb->showMessage( tr( "Validation started." ) );
}
开发者ID:Nald,项目名称:Quantum-GIS,代码行数:35,代码来源:qgsselectedfeature.cpp

示例5: error

	bool error ( const QXmlParseException & exception )
	{
		int line, col;
		line=exception.lineNumber();
		col=exception.columnNumber();
		QString _error="Line "+QString::number(line)+" Col "+QString::number(col)+": "+exception.message()+" "+svg_file_name;
		
		statusBar->showMessage(_error);
		
		return false;
	}
开发者ID:OpticaMonografia,项目名称:QtOctave,代码行数:11,代码来源:svgcanvas.cpp

示例6: logStatusUpdate

void Application::logStatusUpdate(int & pIdent, QString const & pMessage)
{
	pIdent = ++mLastStatusMessage;

	if (!mStatusBars.empty())
	{
		QStatusBar * lBar = mStatusBars.back();
		lBar->setProperty("last_ident", pIdent);
		lBar->showMessage(pMessage);
	}
}
开发者ID:wakeofluna,项目名称:qlivestream,代码行数:11,代码来源:application.cpp

示例7: validateGeometry

void QgsMapToolCapture::validateGeometry()
{
  QSettings settings;
  if ( settings.value( "/qgis/digitizing/validate_geometries", 1 ).toInt() == 0 )
    return;

  if ( mValidator )
  {
    mValidator->deleteLater();
    mValidator = 0;
  }

  mTip = "";
  mGeomErrors.clear();
  while ( !mGeomErrorMarkers.isEmpty() )
  {
    delete mGeomErrorMarkers.takeFirst();
  }

  QgsGeometry *g = 0;

  switch ( mCaptureMode )
  {
    case CaptureNone:
    case CapturePoint:
      return;
    case CaptureLine:
      if ( size() < 2 )
        return;
      g = new QgsGeometry( mCaptureCurve.curveToLine() );
      break;
    case CapturePolygon:
      if ( size() < 3 )
        return;
      QgsLineStringV2* exteriorRing = mCaptureCurve.curveToLine();
      exteriorRing->close();
      QgsPolygonV2* polygon = new QgsPolygonV2();
      polygon->setExteriorRing( exteriorRing );
      g = new QgsGeometry( polygon );
      break;
  }

  if ( !g )
    return;

  mValidator = new QgsGeometryValidator( g );
  connect( mValidator, SIGNAL( errorFound( QgsGeometry::Error ) ), this, SLOT( addError( QgsGeometry::Error ) ) );
  connect( mValidator, SIGNAL( finished() ), this, SLOT( validationFinished() ) );
  mValidator->start();

  QStatusBar *sb = QgisApp::instance()->statusBar();
  sb->showMessage( tr( "Validation started." ) );
  delete g;
}
开发者ID:redwoodxiao,项目名称:QGIS,代码行数:54,代码来源:qgsmaptoolcapture.cpp

示例8: save

/**
 * Methode qui enregistre le template
 */
void EditTemplateWindow::save(){
    QFile file(QDir::fromNativeSeparators(QDir::homePath()+"/.QFacturation/template.html"));
    if (file.open(QFile::WriteOnly)){
        file.write(templateEdit->toPlainText().toUtf8());
        file.flush();
        file.close();
        QStatusBar *statBar = parent->statusBar();
        statBar->showMessage(trUtf8("Template sauvegardé"), 4000);
    }
    else
        QMessageBox::critical(this,trUtf8("Erreur d'écriture"),trUtf8("Ecriture du template impossible"));
}
开发者ID:Ducatel,项目名称:QFacturation,代码行数:15,代码来源:edittemplatewindow.cpp

示例9: validate

/**
 * Methode permettant de valider un document
 * (redirige vers la page de recherche)
 */
void NewDocumentWindow::validate(){
    int ret = QMessageBox::question(this,trUtf8("Valider le document ?"),trUtf8("La validation d'un document empeche toutes modification ultérieure.<br/>Voulez-vous vraiment valider le document?"),QMessageBox::Yes | QMessageBox::No);

    if (ret == QMessageBox::Yes){
        save();
        Document d(idDocument);
        ValidDocument vd(d);
        vd.save();
        QStatusBar *statBar = parent->statusBar();
        statBar->showMessage(trUtf8("Informations du document sauvegardé et valider"), 4000);
        parent->setCentralWidget(new SearchWindow(parent));
    }
}
开发者ID:Ducatel,项目名称:QFacturation,代码行数:17,代码来源:newdocumentwindow.cpp

示例10: validateGeometry

void QgsMapToolCapture::validateGeometry()
{
  QSettings settings;
  if ( settings.value( "/qgis/digitizing/validate_geometries", 1 ).toInt() == 0 )
    return;

  if ( mValidator )
  {
    mValidator->deleteLater();
    mValidator = 0;
  }

  mTip = "";
  mGeomErrors.clear();
  while ( !mGeomErrorMarkers.isEmpty() )
  {
    delete mGeomErrorMarkers.takeFirst();
  }

  QgsGeometry *g = 0;

  switch ( mCaptureMode )
  {
    case CaptureNone:
    case CapturePoint:
      return;
    case CaptureLine:
      if ( mCaptureList.size() < 2 )
        return;
      g = QgsGeometry::fromPolyline( mCaptureList.toVector() );
      break;
    case CapturePolygon:
      if ( mCaptureList.size() < 3 )
        return;
      g = QgsGeometry::fromPolygon( QgsPolygon() << ( QgsPolyline() << mCaptureList.toVector() << mCaptureList[0] ) );
      break;
  }

  if ( !g )
    return;

  mValidator = new QgsGeometryValidator( g );
  connect( mValidator, SIGNAL( errorFound( QgsGeometry::Error ) ), this, SLOT( addError( QgsGeometry::Error ) ) );
  connect( mValidator, SIGNAL( finished() ), this, SLOT( validationFinished() ) );
  mValidator->start();

  QStatusBar *sb = QgisApp::instance()->statusBar();
  sb->showMessage( tr( "Validation started." ) );
}
开发者ID:KISRDevelopment,项目名称:QGIS,代码行数:49,代码来源:qgsmaptoolcapture.cpp

示例11: readFromConfig

void MainWindow::readFromConfig()
{
    //switchLanguage(NULL);

    /* read saved state */
    readSettings(&settings, false);

    toggleASQLow(ui->checkBox_asq_detectLow->isChecked());
    toggleASQHigh(ui->checkBox_asq_detectHigh->isChecked());

    toggleTransmitPilot(ui->checkBox_transmitter_pilot->isChecked());
    toggleTransmitRds(ui->checkBox_transmitter_rds->isChecked());
    toggleTransmitEnabled(ui->checkBox_transmitter_enabled->isChecked());

    toggleRDSaf(ui->checkBox_rds_useaf->isChecked());
    toggleRDSfifo(ui->checkBox_rds_fifo->isChecked());
    toggleRDSPSVisibility(ui->spinBox_rds_ps_msgs->value());
    UpdateRDSRTFileEnabled(ui->checkBox_rds_title_file->isChecked());
    UpdateRDSRTPlusEnabled();
    //updateHTTPListener();

    createLanguageMenu();
    ui->actionSelect_Language->setMenu(languageMenu);

    setupTrayIcon();
    SetWindowMode(!ui->checkBox_mini_mode->isChecked());
    SetAudioCompLimPresetByParams();

    /* actions for querier */
    if(ui->checkBox_rds_time->isChecked()) {
        querier->rdsInterval = ui->spinBox_rds_time_int->value() * 1000;
    }

    /* try to connect */
    toggleConnection(false, false);
    if(ui->checkBox_sw_autoconnect->isChecked())
        querier->timer.start();
    else {
        QStatusBar *status = statusBar();
        status->showMessage(tr("Default config editing mode..."));
        status->show();
    }

    this->adjustSize();
    this->resize(1,1);
    this->updateGeometry();

    qDebug() << __FUNCTION__;
}
开发者ID:ghostro,项目名称:fmstick,代码行数:49,代码来源:mainwindow.cpp

示例12: updateValue

 void updateValue(const QPointF& position) {
   if (!frame.isEmpty()) {
     QPointF xy = position*1.0/scale;
     
     size_t x = floor(xy.x());
     if (x >= frame.getWidth())
       x = frame.getWidth()-1;
       
     size_t y = floor(xy.y());
     if (y >= frame.getHeight())
       y = frame.getHeight()-1;
     
     std::stringstream stream;
     stream << "(" << x << ", " << y << "): " << frame(x, y);
     
     statusBar.showMessage(stream.str().c_str());
   }
 }
开发者ID:abhinavkssk,项目名称:libseekthermal,代码行数:18,代码来源:view.cpp

示例13: save

/**
 * Methode permettant de sauvegarder le document
 */
void NewDocumentWindow::save(){
    Document d;
    if(idDocument==-1)
        d=Document();
    else
        d=Document(idDocument);

    d.m_idCustomer=customerName->currentIndex()+1;

    if(reglementMode->currentText()==trUtf8("Cheque"))
        d.m_payment=Document::Cheque;
    else if(reglementMode->currentText()==trUtf8("Espece"))
        d.m_payment=Document::Especes;
    else
        d.m_payment=Document::Virement;

    if(documentType->currentText()==trUtf8("Facture"))
        d.m_docType=Document::Facture;
    else
         d.m_docType=Document::Devis;

    d.m_tva=documentTva->value();

    d.save();
    idDocument=d.getId();

    ProductDocument::removeAllByIdDocument(idDocument);

    for(int i=0;i<productModel->rowCount();i++){
        int prodId=productModel->item(i,0)->text().toInt();
        int quantity=productModel->item(i,2)->text().toInt();
        QString reduction=productModel->item(i,5)->text();

        d.addProduct(prodId,quantity,reduction);
    }

    d.save();
    QStatusBar *statBar = parent->statusBar();
    statBar->showMessage(trUtf8("Informations du document sauvegardé"), 4000);
    parent->setCentralWidget(new SearchWindow(parent));

}
开发者ID:Ducatel,项目名称:QFacturation,代码行数:45,代码来源:newdocumentwindow.cpp

示例14: validateProduct

/**
 * Methode (Slot) qui va mettre a jour les infos du produit
 * (creation d'un nouveau produit ou mise a jour du produit)
 */
void NewProductWindow::validateProduct(){
    if(idProduct==-1){
        // creation d'un nouveau produit
        Product p;
        p.name=name->text();
        p.description=description->text();
        p.price=price->value();
        p.save();
    }
    else{
        // mise a jour d'un produit
        Product p(idProduct);
        p.name=name->text();
        p.description=description->text();
        p.price=price->value();
        p.save();
        p.updateDocumentPrice();
    }

    QStatusBar *statBar = parent->statusBar();
    statBar->showMessage(trUtf8("Informations produit sauvegardé"), 4000);
    clean();
}
开发者ID:Ducatel,项目名称:QFacturation,代码行数:27,代码来源:newproductwindow.cpp

示例15: addError

void QgsSelectedFeature::addError( QgsGeometry::Error e )
{
  mGeomErrors << e;
  if ( !mTip.isEmpty() )
    mTip += "\n";
  mTip += e.what();

  if ( e.hasWhere() )
  {
    QgsVertexMarker *marker = new QgsVertexMarker( mCanvas );
    marker->setCenter( mCanvas->mapRenderer()->layerToMapCoordinates( mVlayer, e.where() ) );
    marker->setIconType( QgsVertexMarker::ICON_X );
    marker->setColor( Qt::green );
    marker->setZValue( marker->zValue() + 1 );
    marker->setPenWidth( 2 );
    marker->setToolTip( e.what() );
    mGeomErrorMarkers << marker;
  }

  QStatusBar *sb = QgisApp::instance()->statusBar();
  sb->showMessage( e.what() );
  sb->setToolTip( mTip );
}
开发者ID:Nald,项目名称:Quantum-GIS,代码行数:23,代码来源:qgsselectedfeature.cpp


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