void ServerMonitor::init() { this->serverList = this->reader->getServerList(); Notification notice(); if(notice == NULL){ } std::cout << serverList.size() << std::endl; QVariant data; QVariant port; foreach(data, serverList){ QVariantMap content = data.toMap(); QList<QVariant> ports = content["port"].toList(); foreach (port, ports){ QTimer* timer = new QTimer(this); ThreadPing *tping = new ThreadPing( content["host"].toString(), (quint16) port.toInt()); connect( timer, SIGNAL(timeout()), tping, SLOT(run())); connect( tping,SIGNAL(isAlive(quint16)), SLOT(output(quint16))); connect( tping, SIGNAL(stateChanged(QString)), SLOT(showState(QString))); timer->start( reader->getInterval() * 1000); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); connect(&myProcess, SIGNAL(readyRead()), this, SLOT(showResult())); connect(&myProcess, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(showState(QProcess::ProcessState))); connect(&myProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(showError())); connect(&myProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(showFinished(int, QProcess::ExitStatus))); }
void Launcher_page::initWidget() { p = new QProcess(this); connect(p, SIGNAL(readyRead()), this, SLOT(showResult())); connect(p, SIGNAL(readyReadStandardError()), this, SLOT(showError())); connect(p, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(showState(QProcess::ProcessState))); lbl_wallpaper = new QLabel("添加壁纸路径:"); lbl_wallpaper->setToolTip("需要提前准备小分辨率图片"); le_wallpaper = new QLineEdit(); le_wallpaper->setFixedWidth(500); btn_select_wallper = new QPushButton("选择添加壁纸文件夹"); connect(btn_select_wallper, SIGNAL(clicked(bool)), this, SLOT(btn_wallpaper_choose())); btn_open_wallpaper_dir = new QPushButton(tr("打开源码壁纸文件夹")); connect(btn_open_wallpaper_dir, SIGNAL(clicked(bool)), this, SLOT(btnOpenWallpaperDir())); lbl_icon_site = new QLabel("桌面图标摆放:"); btn_icon_site = new QPushButton("打开配置文件"); btn_icon_site->setFixedWidth(100); btn_icon_site->setToolTip("打开桌面图标设置xml文件"); connect(btn_icon_site, SIGNAL(clicked()), this, SLOT(btn_openWallpaperXml())); lbl_def_wallpaper = new QLabel("默认壁纸:"); lbl_img = new QLabel(); btn_def_wallper = new QPushButton("。。。"); btn_def_wallper->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); lbl_extFiles = new QLabel("额外打包数据:"); le_extFiles = new QLineEdit(); btn_extFiles = new QPushButton("选择壁纸"); hSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Expanding); vSpacer = new QSpacerItem(20, 800, QSizePolicy::Expanding, QSizePolicy::Expanding); scroll = new QScrollArea(); scroll->setWidgetResizable(true); scrollWidget = new QWidget(scroll); scroll->setWidget(scrollWidget); gridLayout = new QGridLayout(scrollWidget); gridLayout->addWidget(lbl_wallpaper, 0, 0); gridLayout->addWidget(le_wallpaper, 0, 1); gridLayout->addWidget(btn_select_wallper, 0, 2); gridLayout->addWidget(btn_open_wallpaper_dir, 0, 3); gridLayout->addItem(hSpacer, 0, 4); gridLayout->addWidget(lbl_icon_site, 1, 0); gridLayout->addWidget(btn_icon_site, 1, 1); gridLayout->addItem(vSpacer, 2, 0); vLayout = new QVBoxLayout(this); vLayout->addWidget(scroll); }
bool FindStatesTab::findNext() { Q_ASSERT(model_.get() != 0); if (!filtered_model_.get()) { Selection filter = model_->states() & selector_->selection(); filtered_model_ = model_->filter_states(filter); filtered_model_->rewind(); } for (;;) { State_model* s = filtered_model_->next_state(); if (s != nullptr) { model_ = model_->set_range(s->begin, model_->max_time()); emit showState(s); return true; } return false; } }
/** * Sets up the general page of the dialog. */ void ObjectNodeDialog::setupGeneralPage() { QStringList types; types << i18n("Central Buffer") << i18n("Data Store") << i18n("ObjectFlow"); ObjectNodeWidget::ObjectNodeType type = m_pObjectNodeWidget->objectNodeType(); KVBox *page = new KVBox(); pageItemGeneral = new KPageWidgetItem( page, i18n("General") ); pageItemGeneral->setHeader(i18n("General Properties")); pageItemGeneral->setIcon( Icon_Utils::DesktopIcon(Icon_Utils::it_Properties_General) ); addPage( pageItemGeneral ); m_GenPageWidgets.generalGB = new QGroupBox( i18nc("properties group title", "Properties"), (QWidget *)page ); QGridLayout * generalLayout = new QGridLayout( m_GenPageWidgets.generalGB ); generalLayout->setSpacing( spacingHint() ); generalLayout->setMargin( fontMetrics().height() ); QString objType; if (type < types.count()) { objType = types.at((int)type); } else { uWarning() << "type of ObjectNodeWidget is out of range! Value = " << type; } Dialog_Utils::makeLabeledEditField( m_GenPageWidgets.generalGB, generalLayout, 0, m_GenPageWidgets.typeL, i18n("Object Node type:"), m_GenPageWidgets.typeLE, objType ); m_GenPageWidgets.typeLE->setEnabled( false ); Dialog_Utils::makeLabeledEditField( m_GenPageWidgets.generalGB, generalLayout, 1, m_GenPageWidgets.nameL, i18n("Object Node name:"), m_GenPageWidgets.nameLE ); Dialog_Utils::makeLabeledEditField( m_GenPageWidgets.generalGB, generalLayout, 2, m_GenPageWidgets.stateL, i18nc("enter state label", "State :"), m_GenPageWidgets.stateLE ); m_GenPageWidgets.stateL->hide(); m_GenPageWidgets.stateLE->hide(); m_GenPageWidgets.bufferRB = new QRadioButton( i18n("&Central Buffer"),(QWidget *)page); generalLayout->addWidget( m_GenPageWidgets.bufferRB ); m_GenPageWidgets.dataRB = new QRadioButton( i18n("&Data Store "),(QWidget *)page); generalLayout->addWidget( m_GenPageWidgets.dataRB ); m_GenPageWidgets.flowRB = new QRadioButton( i18n("&Object Flow"),(QWidget *)page); generalLayout->addWidget( m_GenPageWidgets.flowRB ); if (type == ObjectNodeWidget::Flow) { showState(); } connect(m_GenPageWidgets.bufferRB,SIGNAL(clicked()),this,SLOT(slotHideState())); connect(m_GenPageWidgets.dataRB,SIGNAL(clicked()),this,SLOT(slotHideState())); connect(m_GenPageWidgets.flowRB,SIGNAL(clicked()),this,SLOT(slotShowState())); ObjectNodeWidget::ObjectNodeType newType = m_pObjectNodeWidget->objectNodeType() ; m_GenPageWidgets.bufferRB->setChecked(newType == ObjectNodeWidget::Buffer); m_GenPageWidgets.dataRB->setChecked (newType == ObjectNodeWidget::Data); m_GenPageWidgets.flowRB->setChecked (newType == ObjectNodeWidget::Flow); m_GenPageWidgets.docGB = new QGroupBox( i18n( "Documentation"), (QWidget *)page ); QHBoxLayout * docLayout = new QHBoxLayout( m_GenPageWidgets.docGB ); docLayout->setSpacing( spacingHint() ); docLayout->setMargin( fontMetrics().height() ); m_GenPageWidgets.docMLE = new KTextEdit( m_GenPageWidgets.docGB ); m_GenPageWidgets.docMLE->setText( m_pObjectNodeWidget->documentation() ); docLayout->addWidget( m_GenPageWidgets.docMLE ); if (type != ObjectNodeWidget::Buffer && type != ObjectNodeWidget::Data && type != ObjectNodeWidget::Flow) { m_GenPageWidgets.nameLE->setEnabled( false ); m_GenPageWidgets.nameLE->setText( "" ); } else m_GenPageWidgets.nameLE->setText( m_pObjectNodeWidget->name() ); }
void ListPlanner::prepareState(int index) { showState(index); mHand->findInitialContact(200); }