Beispiel #1
0
/**
* @brief 构造函数
* @param [I] 平台指针
* @param [I] 父指针
* @param [I] 窗口标志
*/
MainWindow::MainWindow(Workbench *wb, QWidget *parent, Qt::WFlags flags)
    : QMainWindow(parent, flags)
    , ui(new Ui::MainWindowClass)
    , m_workbench(wb)
{
    ui->setupUi(this);
    m_messageWidget = MessageWidget::instance();
    m_messageWidget->setParent(this, Qt::Tool);

    QStatusBar *statusBar = this->statusBar();

	{
		QToolButton *button = new QToolButton(statusBar);
		button->setIcon(QApplication::style()->standardIcon(QStyle::SP_FileDialogDetailedView));
		button->setAutoRaise(true);
		connect(button, SIGNAL(clicked()), workbench(), SLOT(showDebugger()));
		statusBar->addPermanentWidget(button);
	}

    // 显示消息按钮
    {
        QToolButton *button = new QToolButton(statusBar);
        button->addAction(m_messageWidget->toggleAction());
        button->setDefaultAction(m_messageWidget->toggleAction());
        button->setAutoRaise(true);
        statusBar->addPermanentWidget(button);
    }
}
Beispiel #2
0
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();
}
StatusBarManager::StatusBarManager(MainWindow *mainWnd)
  : QObject(mainWnd),
    m_mainWnd(mainWnd)
{
    QStatusBar *bar = m_mainWnd->statusBar();
    m_splitter = new NonResizingSplitter(bar);
    bar->insertPermanentWidget(0, m_splitter, 10);
    m_splitter->setChildrenCollapsible(false);
    // first
    QWidget *w = createWidget(m_splitter);
    w->layout()->setContentsMargins(0, 0, 3, 0);
    m_splitter->addWidget(w);
    m_statusBarWidgets.append(w);

    QWidget *w2 = createWidget(m_splitter);
    w2->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
    m_splitter->addWidget(w2);
    // second
    w = createWidget(w2);
    w2->layout()->addWidget(w);
    m_statusBarWidgets.append(w);
    // third
    w = createWidget(w2);
    w2->layout()->addWidget(w);
    m_statusBarWidgets.append(w);

    static_cast<QBoxLayout *>(w2->layout())->addStretch(1);

    QWidget *rightCornerWidget = createWidget(bar);
    bar->insertPermanentWidget(1, rightCornerWidget);
    m_statusBarWidgets.append(rightCornerWidget);
}
MobileVis1MainWindow::MobileVis1MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MobileVis1MainWindow)
{
    ui->setupUi(this);
#ifdef Q_WS_MAEMO_5
    setAttribute(Qt::WA_Maemo5StackedWindow);
#endif

#if  defined (Q_WS_X11)  && !defined (Q_WS_MAEMO5)
    qDebug()  << "Q_WS_X11";
    //http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
    //http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
    ui->ReplayStopButton->setIcon(  QIcon::fromTheme ("media-playback-start") );
    ui->ReplayPauseButton->setIcon(  QIcon::fromTheme ("media-playback-pause") );
    ui->ReplayStopButton->setIcon(  QIcon::fromTheme ("media-playback-stop") );

    ui->DVMicroLeftButton->setIcon( QIcon::fromTheme("media-seek-backward") );
    ui->DVLeftButton->setIcon( QIcon::fromTheme("media-skip-backward") );
#endif

    QStatusBar* sb = statusBar();
    if ( sb )
        sb->hide();

//    grabGesture(Qt::PanGesture);
//    grabGesture(Qt::PinchGesture);
//    grabGesture(Qt::SwipeGesture);


//    swipeGesture = new N900SwipeGesture(this);
//    connect(swipeGesture,SIGNAL(handleSwipe(N900SwipeGesture::SwipeDirection)),
//            this,SLOT(swipe(N900SwipeGesture::SwipeDirection)));
}
Beispiel #5
0
int StatusBar::removeWidget(lua_State * L) // ( QWidget * widget )
{
	QStatusBar* obj = ObjectHelper<QStatusBar>::check( L, 1);
	QWidget* widget = ObjectHelper<QWidget>::check( L, 2);
	obj->removeWidget( widget ) ;
	return 0;
}
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 );
}
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." ) );
}
Beispiel #8
0
MainWindow::MainWindow()
    : QMainWindow(NULL, Qt::Window)
    , EventReceiver(LowestPriority)
{
    setObjectName("mainwnd");
    setAttribute(Qt::WA_AlwaysShowToolTips);
    Q_ASSERT(s_mainWindow == NULL);
    s_mainWindow = this;
    h_lay	 = NULL;
    m_bNoResize = false;

    m_icon = "SIM";
    setWindowIcon(Icon(m_icon));
    setTitle();

//    setIconSize(QSize(16,16));

    m_bar = NULL;

    main = new QWidget(this);
    setCentralWidget(main);

    lay = new QVBoxLayout(main);
    lay->setMargin(0);

    QStatusBar *status = statusBar();
    status->show();
    status->installEventFilter(this);
}
//! Methode zum Setzen / Füllen der Statusleiste
void MainWindow::setStatusBar()
{
  QStatusBar* statusBar = new QStatusBar();
  statusBar->addWidget(new QLabel(tr("Gebiete: ") + QString::number(_DB->allArea()->count()) \
                                  + tr(" | Bewohner: ") + QString::number(_DB->allHabitant()->count())));
  QMainWindow::setStatusBar(statusBar);
}
Beispiel #10
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)
{
  QMenuBar *menuBar;
  QToolBar *mainToolBar;
  QWidget *centralWidget;
  QStatusBar *statusBar;
  if (this->objectName().isEmpty())
      this->setObjectName(QString::fromUtf8("MainWindow"));
  this->resize(400, 300);
  menuBar = new QMenuBar(this);
  menuBar->setObjectName(QString::fromUtf8("menuBar"));
  this->setMenuBar(menuBar);
  mainToolBar = new QToolBar(this);
  mainToolBar->setObjectName(QString::fromUtf8("mainToolBar"));
  this->addToolBar(mainToolBar);
  centralWidget = new QWidget(this);
  centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
  this->setCentralWidget(centralWidget);
  statusBar = new QStatusBar(this);
  statusBar->setObjectName(QString::fromUtf8("statusBar"));
  this->setStatusBar(statusBar);

#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
  this->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0));
#else
  this->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8));
#endif

  QMetaObject::connectSlotsByName(this);
}
Beispiel #11
0
MainWindow::MainWindow()
        : QMainWindow(NULL, "mainwnd",
                      WType_TopLevel | WStyle_Customize |
                      WStyle_Title | WStyle_NormalBorder| WStyle_SysMenu),
        EventReceiver(LowestPriority)
{
    m_grip	 = NULL;
    h_lay	 = NULL;
    m_bNoResize = false;

    SET_WNDPROC("mainwnd");
    m_icon = "ICQ";
    setIcon(Pict(m_icon.c_str()));
    setTitle();

#ifdef WIN32
    pMain = this;
    if (IsWindowUnicode(winId())){
        oldProc = (WNDPROC)SetWindowLongW(winId(), GWL_WNDPROC, (LONG)wndProc);
    }else{
        oldProc = (WNDPROC)SetWindowLongA(winId(), GWL_WNDPROC, (LONG)wndProc);
    }
#endif

    bar = NULL;

    main = new MainWindowWidget(this);
    setCentralWidget(main);

    lay = new QVBoxLayout(main);

    QStatusBar *status = statusBar();
    status->hide();
    status->installEventFilter(this);
}
void QmitkWorkbenchWindowAdvisor::PostWindowCreate()
{
  // very bad hack...
  berry::IWorkbenchWindow::Pointer window = this->GetWindowConfigurer()->GetWindow();
  QMainWindow* mainWindow = static_cast<QMainWindow*>(window->GetShell()->GetControl());

  QMenuBar* menuBar = mainWindow->menuBar();

  QMenu* fileMenu = menuBar->addMenu("&File");

  fileMenu->addAction(new QmitkFileOpenAction(window));
  fileMenu->addSeparator();
  fileMenu->addAction(new QmitkFileExitAction(window));

  berry::IViewRegistry* viewRegistry = berry::PlatformUI::GetWorkbench()->GetViewRegistry();
  const std::vector<berry::IViewDescriptor::Pointer>& viewDescriptors = viewRegistry->GetViews();

  QMenu* viewMenu = menuBar->addMenu("Show &View");

  // sort elements (converting vector to map...)
  std::vector<berry::IViewDescriptor::Pointer>::const_iterator iter;
  std::map<std::string, berry::IViewDescriptor::Pointer> VDMap;

  for (iter = viewDescriptors.begin(); iter != viewDescriptors.end(); ++iter)
  {
    if ((*iter)->GetId() == "org.blueberry.ui.internal.introview")
      continue;
    std::pair<std::string, berry::IViewDescriptor::Pointer> p((*iter)->GetLabel(), (*iter)); 
    VDMap.insert(p);
  }

  QToolBar* qToolbar = new QToolBar;
  
  std::map<std::string, berry::IViewDescriptor::Pointer>::const_iterator MapIter;
  for (MapIter = VDMap.begin(); MapIter != VDMap.end(); ++MapIter)
  {
    berry::QtShowViewAction* viewAction = new berry::QtShowViewAction(window, (*MapIter).second);
    //m_ViewActions.push_back(viewAction);
    viewMenu->addAction(viewAction);
    qToolbar->addAction(viewAction);
  }
  
  mainWindow->addToolBar(qToolbar);

  QStatusBar* qStatusBar = new QStatusBar();

  //creating a QmitkStatusBar for Output on the QStatusBar and connecting it with the MainStatusBar
  QmitkStatusBar *statusBar = new QmitkStatusBar(qStatusBar);
  //disabling the SizeGrip in the lower right corner
  statusBar->SetSizeGripEnabled(false);

  QmitkProgressBar *progBar = new QmitkProgressBar();
  qStatusBar->addPermanentWidget(progBar, 0);
  progBar->hide();
  mainWindow->setStatusBar(qStatusBar);

  QmitkMemoryUsageIndicatorView* memoryIndicator = new QmitkMemoryUsageIndicatorView();
  qStatusBar->addPermanentWidget(memoryIndicator, 0);
}
Beispiel #13
0
int StatusBar::currentMessage(lua_State * L) // const : QString
{
	QStatusBar* obj = ObjectHelper<QStatusBar>::check( L, 1);
	//QString* res = ValueInstaller2<QString>::create( L );
	//*res = obj->currentMessage();
	Util::push( L, obj->currentMessage() );
	return 1;
}
Beispiel #14
0
void CallWindow::initFooter()
{
	leftFooter = new QLabel();
	rightFooter = new QLabel();
	QStatusBar *bar = statusBar();
	bar->addPermanentWidget(leftFooter, 2);
	bar->addPermanentWidget(rightFooter, 2);
}
Beispiel #15
0
void MainWindow::toggledFullScreen(bool val) {
	QMenuBar* pMenuBar = menuBar();
	if ( pMenuBar )
		pMenuBar->setVisible(!val);

	QStatusBar *pStatusBar = statusBar();
	if ( pStatusBar )
		pStatusBar->setVisible(!val);
}
Beispiel #16
0
void db_key::newItem(QString name)
{
	NewKey *dlg = new NewKey(qApp->activeWindow(), name);
	QProgressBar *bar;
	QStatusBar *status = mainwin->statusBar();
	pki_evp *nkey = NULL;
	pki_scard *cardkey = NULL;
	pki_key *key = NULL;

	if (!dlg->exec()) {
		delete dlg;
		return;
	}
	int ksize = dlg->getKeysize();
	if (ksize > 0) {
		if (ksize < 32) {
			QMessageBox::warning(NULL, XCA_TITLE,
				tr("Key size too small !"));
			delete dlg;
			return;
		}
		if (ksize < 1024 || ksize > 8192)
			if (QMessageBox::warning(NULL, XCA_TITLE,
				tr("You are sure to create a key of the size: %1 ?").arg(ksize),
				QMessageBox::Yes | QMessageBox::No) !=
				QMessageBox::Yes)
			{
				delete dlg;
				return;
			}
	}
	mainwin->repaint();
	bar = new QProgressBar();
	status->addPermanentWidget(bar, 1);
	try {
		if (dlg->isToken()) {
			key = cardkey = new pki_scard(dlg->keyDesc->text());
			cardkey->generateKey_card(dlg->getKeyCardSlot(),
						 ksize, bar);
		} else {
			key = nkey = new pki_evp(dlg->keyDesc->text());
			nkey->generate(ksize, dlg->getKeytype(), bar,
				dlg->getKeyCurve_nid());
		}
		key = (pki_key*)insert(key);
		emit keyDone(key->getIntNameWithType());
		createSuccess(key);

	} catch (errorEx &err) {
		delete key;
		mainwin->Error(err);
	}
	status->removeWidget(bar);
	delete bar;
	delete dlg;
}
Beispiel #17
0
void MainWindow::addStatus(QWidget *w, bool)
{
    QStatusBar *status = statusBar();
    w->reparent(status, QPoint());
    statusWidgets.push_back(w);
    status->addWidget(w, true);
    w->show();
    status->show();
    setGrip();
}
Beispiel #18
0
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;
}
Beispiel #19
0
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);
	}
}
Beispiel #20
0
int LuaMainWindow::showStatusText(lua_State *L)
{
	// text, opt. duration ms
	checkAlive( L );
	QStatusBar* b = obj()->statusBar();
	if( lua_gettop(L) > 1 )
		b->message( luaL_checkstring( L, 1 ), luaL_checknumber( L, 2 ) );
	else
		b->message( luaL_checkstring( L, 1 ) );
	return 0;
}
Beispiel #21
0
void MainWindow::addStatus(QWidget *w, bool)
{
    QStatusBar *status = statusBar();
    w->setParent(status);
    w->move(QPoint());
    statusWidgets.push_back(w);
    status->addWidget(w, true);
    w->show();
    status->setSizeGripEnabled(true);
    status->show();
}
/**
 * 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"));
}
Beispiel #23
0
MainWindow::MainWindow()
{
    //
    //  Source code view
    //
    m_textViewers = new QTabWidget(this);
    m_textViewers->setObjectName("Editors");
    m_textViewers->setElideMode(Qt::ElideLeft);
    setCentralWidget(m_textViewers);
    setGeometry(QRect(0, 0, 800, 600));


    m_fileOpenAction = new QAction("Open", this);
    m_quitAction = new QAction("Quit", this);

    //
    //  Menubar
    //
    QMenu *fileMenu = new QMenu(menuBar());
    fileMenu->setTitle(tr("File"));
    fileMenu->addAction(m_fileOpenAction);
    fileMenu->addSeparator();
    fileMenu->addAction(m_quitAction);
    menuBar()->addMenu(fileMenu);

    //
    //  Toolbar
    //
    QToolBar *toolbar = new QToolBar(this);
    toolbar->setObjectName("ToolBar");
    toolbar->addAction(m_fileOpenAction);
    toolbar->addAction(m_quitAction);
    addToolBar(Qt::TopToolBarArea, toolbar);

    //
    //  Statusbar
    //
    QStatusBar *statusbar = new QStatusBar(this);
    statusbar->setObjectName("StatusBar");
    setStatusBar(statusbar);

    show();
    restoreState(settings().value("MainWindow/State").toByteArray());
    setGeometry(settings().value("MainWindow/Geometry").toRect());

    //
    // Connections
    //
    connect(m_fileOpenAction, SIGNAL(triggered()),
            this, SLOT(fileOpen()));
    connect(m_quitAction, SIGNAL(triggered()),
            this, SLOT(close()));
}
Beispiel #24
0
MainWindow::MainWindow()
{
    setUnifiedTitleAndToolBarOnMac( true );

    QStatusBar* status = new QStatusBar( this );
    PlaybackControlsWidget* pcw = new PlaybackControlsWidget( status );

    //FIXME: this code is duplicated in the audioscrobbler app too
    //In order to compensate for the sizer grip on the bottom right
    //of the window, an empty QWidget is added as a spacer.
    QSizeGrip* sg = status->findChild<QSizeGrip *>();
    if( sg ) {
        int gripWidth = sg->sizeHint().width();
        QWidget* w = new QWidget( status );
        w->setFixedWidth( gripWidth );
        status->addWidget( w );
    }

    //Seemingly the only way to get a central widget in a QStatusBar
    //is to add an empty widget either side with a stretch value.
    status->addWidget( new QWidget( status), 1 );
    status->addWidget( pcw );
    status->addWidget( new QWidget( status), 1 );

    setStatusBar( status );

    MainWidget* mw;

    QWidget* w = new QWidget();
    
    new QVBoxLayout( w );
    w->layout()->addWidget(mw = new MainWidget());

    m_messageBar = new MessageBar( this );

    connect(mw, SIGNAL(startRadio(RadioStation)), SIGNAL(startRadio(RadioStation)));

    AuthenticatedUser user;
    connect(user.getFriends(), SIGNAL(finished()), mw, SLOT(onUserGotFriends()));
    connect(user.getTopTags(), SIGNAL(finished()), mw, SLOT(onUserGotTopTags()));
    connect(user.getPlaylists(), SIGNAL(finished()), mw, SLOT(onUserGotPlaylists()));
    connect(user.getRecentStations(), SIGNAL(finished()), mw, SLOT(onUserGotRecentStations()));

    setCentralWidget( w );

    finishUi();

    //todo: bury this:
    menuBar()->addMenu("Normania")->addAction( tr("RQL"), mw, SLOT(rawrql()), QKeySequence(tr("Ctrl+r")) );

    m_messageBar->raise();
}
/**
 * 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));
    }
}
Beispiel #26
0
void MainWindow::CreateStatusbar()
{
    shebei = new QLabel;
    shebei->setText(tr("设备ID:"));
    sbid = new QLabel;
    sbid->setText(m_strDevID);
    kjl = new QLabel;
    kjl->setText(tr("      快精灵"));
    time = new QLabel;
    QDateTime im = QDateTime::currentDateTime();
    QString str = im.toString("yyyy-MM-dd hh:mm:ss");
    time->setText(str);
    QTimer* timTm = new QTimer;
    connect(timTm,SIGNAL(timeout()),this,SLOT(TimeNow()));
    timTm->start(1000);
    jiaoshi = new ClickedLabel;
    jiaoshi->setText(tr("<u>校时</u>"));
    jiaoshi->setEnabled(false);
    m_jiaozhun = new ClickedLabel;
    m_jiaozhun->setText(tr("<u>屏幕校准</u>"));
    connect(m_jiaozhun, SIGNAL(clicked()), this, SLOT(OnJiaoZhun()));
    help = new ClickedLabel;
    help->setText(tr("<u>帮助</u>"));
    connect(help, SIGNAL(clicked()), this, SLOT(OnHelp()));

    QStatusBar* statusBar = this->statusBar();
    statusBar->addWidget(shebei,1);
    statusBar->addWidget(sbid,2);
    statusBar->addWidget(kjl,3);
    statusBar->addWidget(time,4);
    statusBar->addWidget(jiaoshi,5);
    statusBar->addWidget(m_jiaozhun,6);
    statusBar->addWidget(help,7);
}
Beispiel #27
0
void CMainWindow::iniStatusBar()
{
	QStatusBar* bar = statusBar();
	label1 = new QLabel;
	label1->setMinimumSize(200, 25);
	label1->setFrameShadow(QFrame::Sunken);
	label1->setFrameShape(QFrame::WinPanel);
	label2 = new QLabel;	
	label2->setMinimumSize(200, 25);
	label2->setFrameShadow(QFrame::Sunken);
	label2->setFrameShape(QFrame::WinPanel);
	bar->addWidget(label1);
	bar->addWidget(label2);
}
Beispiel #28
0
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__;
}
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." ) );
}
Beispiel #30
0
void MainWindow::init_statusBar()
{
    QStatusBar* bar = ui->statusBar;
    first_statusLabel = new QLabel;
    first_statusLabel->setMinimumSize(150,20);
    first_statusLabel->setFrameShape(QFrame::WinPanel);
    first_statusLabel->setFrameShadow(QFrame::Sunken);
    second_statusLabel = new QLabel;
    second_statusLabel->setMinimumSize(150,20);
    second_statusLabel->setFrameShape(QFrame::WinPanel);
    second_statusLabel->setFrameShadow(QFrame::Sunken);
    bar->addWidget(first_statusLabel);
    bar->addWidget(second_statusLabel);
    first_statusLabel->setText(tr("欢迎使用文本编辑器"));
    second_statusLabel->setText(tr("Lootepad 0.5.8"));
}