您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ timeout函数代码示例

51自学网 2021-06-03 08:50:59
  C++
这篇教程C++ timeout函数代码示例写得很实用,希望能帮到您。

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

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

示例1: QMainWindow

UIYabause::UIYabause( QWidget* parent )	: QMainWindow( parent ){	mInit = false;   search.clear();	searchType = 0;	// setup dialog	setupUi( this );	toolBar->insertAction( aFileSettings, mFileSaveState->menuAction() );	toolBar->insertAction( aFileSettings, mFileLoadState->menuAction() );	toolBar->insertSeparator( aFileSettings );	setAttribute( Qt::WA_DeleteOnClose );#ifdef USE_UNIFIED_TITLE_TOOLBAR	setUnifiedTitleAndToolBarOnMac( true );#endif	fSound->setParent( 0, Qt::Popup );	fVideoDriver->setParent( 0, Qt::Popup );	fSound->installEventFilter( this );	fVideoDriver->installEventFilter( this );	// Get Screen res list	getSupportedResolutions();	// fill combo driver	cbVideoDriver->blockSignals( true );	for ( int i = 0; VIDCoreList[i] != NULL; i++ )		cbVideoDriver->addItem( VIDCoreList[i]->Name, VIDCoreList[i]->id );	cbVideoDriver->blockSignals( false );	// create glcontext	mYabauseGL = new YabauseGL( this );	// and set it as central application widget	setCentralWidget( mYabauseGL );	// create log widget	teLog = new QTextEdit( this );	teLog->setReadOnly( true );	teLog->setWordWrapMode( QTextOption::NoWrap );	teLog->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );	teLog->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOn );	mLogDock = new QDockWidget( this );	mLogDock->setWindowTitle( "Log" );	mLogDock->setWidget( teLog );	addDockWidget( Qt::BottomDockWidgetArea, mLogDock );	mLogDock->setVisible( false );	// create emulator thread	mYabauseThread = new YabauseThread( this );	// create hide mouse timer	hideMouseTimer = new QTimer();	// connectionsdd	connect( mYabauseThread, SIGNAL( requestSize( const QSize& ) ), this, SLOT( sizeRequested( const QSize& ) ) );	connect( mYabauseThread, SIGNAL( requestFullscreen( bool ) ), this, SLOT( fullscreenRequested( bool ) ) );	connect( mYabauseThread, SIGNAL( requestVolumeChange( int ) ), this, SLOT( on_sVolume_valueChanged( int ) ) );	connect( aViewLog, SIGNAL( toggled( bool ) ), mLogDock, SLOT( setVisible( bool ) ) );	connect( mLogDock->toggleViewAction(), SIGNAL( toggled( bool ) ), aViewLog, SLOT( setChecked( bool ) ) );	connect( mYabauseThread, SIGNAL( error( const QString&, bool ) ), this, SLOT( errorReceived( const QString&, bool ) ) );	connect( mYabauseThread, SIGNAL( pause( bool ) ), this, SLOT( pause( bool ) ) );	connect( mYabauseThread, SIGNAL( reset() ), this, SLOT( reset() ) );	connect( hideMouseTimer, SIGNAL( timeout() ), this, SLOT( hideMouse() ));	// Load shortcuts	VolatileSettings* vs = QtYabause::volatileSettings();	QList<QAction *> actions = findChildren<QAction *>();	foreach ( QAction* action, actions )	{		if (action->text().isEmpty())			continue;		QString text = vs->value(QString("Shortcuts/") + action->text(), "").toString();		if (text.isEmpty())			continue;		action->setShortcut(text);	}	// retranslate widgets	QtYabause::retranslateWidget( this );	QList<QAction *> actionList = menubar->actions();	for(int i = 0;i < actionList.size();i++) {		addAction(actionList.at(i));	}	restoreGeometry( vs->value("General/Geometry" ).toByteArray() );	mYabauseGL->setMouseTracking(true);	setMouseTracking(true);	showMenuBarHeight = menubar->height();	translations = QtYabause::getTranslationList();}
开发者ID:GPDP2,项目名称:yabause,代码行数:85,


示例2: Background

PageTimers::PageTimers (QWidget *parent)    : Background (parent), edit_mode (false){    QGridLayout *layout = new QGridLayout (this);    layout->setMargin (0);    layout->setSpacing (0);    {	digital_timer = new DigitalTimer (this);	connect (digital_timer, SIGNAL (enterEditModeRequested ()), this, SLOT (enterEditModeDigitalTimerPressed ()));	connect (digital_timer, SIGNAL (leaveEditModeRequested ()), this, SLOT (leaveEditMode ()));	layout->addWidget (digital_timer, 1, 1);    }    {	analog_timer = new AnalogTimer (this);	connect (analog_timer, SIGNAL (clearAlarms ()), this, SLOT (clearCurrentAlarms ()));	connect (analog_timer, SIGNAL (enterEditModeRequested ()), this, SLOT (enterEditModeAnalogTimerPressed ()));	connect (analog_timer, SIGNAL (leaveEditModeRequested ()), this, SLOT (leaveEditMode ()));	connect (analog_timer, SIGNAL (pressed ()), this, SIGNAL (analogTimerPressed ()));	connect (analog_timer, SIGNAL (released ()), this, SIGNAL (analogTimerReleased ()));	connect (analog_timer, SIGNAL (slide ()), this, SIGNAL (analogTimerSlide ()));	connect (analog_timer, SIGNAL (zeroTimeReached ()), this, SIGNAL (zeroTimeReached ()));	layout->addWidget (analog_timer, 2, 1);    }    layout->setColumnStretch (0, 15);    layout->setColumnStretch (1, 50);    layout->setColumnStretch (2, 15);    layout->setRowStretch (0, 2);    layout->setRowStretch (1, 40);    layout->setRowStretch (2, 40);    layout->setRowStretch (3, 10);    layout->setRowStretch (4, 2);    #if 0 // Link with Reference    {	QHBoxLayout *hlayout = new QHBoxLayout ();	hlayout->addStretch (1);	QPushButton *add_timer_button = new QPushButton ("Add timer", this);	connect (add_timer_button, SIGNAL (clicked ()), this, SIGNAL (switchToPageDishSelect ()));	hlayout->addWidget (add_timer_button);	hlayout->addStretch (1);	layout->addLayout (hlayout);	add_timer_button->hide ();    }#endif        connect (this, SIGNAL (pressed ()), this, SLOT (leaveEditMode ()));    updateContent ();    update_timer.setInterval (100);    update_timer.setSingleShot (false);    update_timer.start ();    leave_edit_mode_timer.setSingleShot (false);    connect (&leave_edit_mode_timer, SIGNAL (timeout ()), this, SLOT (leaveEditMode ()));    connect (analog_timer, SIGNAL (lmb_pressed ()), &leave_edit_mode_timer, SLOT (stop ()));    connect (digital_timer, SIGNAL (lmb_pressed ()), &leave_edit_mode_timer, SLOT (stop ()));    connect (analog_timer, SIGNAL (userIsAlive ()), this, SLOT (restartTirednessTimer ()));    connect (digital_timer, SIGNAL (userIsAlive ()), this, SLOT (restartTirednessTimer ()));    connect (analog_timer, SIGNAL (lmb_released ()), this, SLOT (startTirednessTimer ()));    connect (digital_timer, SIGNAL (lmb_released ()), this, SLOT (startTirednessTimer ()));}
开发者ID:BrandyMint,项目名称:KitchenTimer,代码行数:67,


示例3: QMainWindow

MainWindow::MainWindow(QWidget *parent) :    QMainWindow(parent),    ui(new Ui::MainWindow){    ui->setupUi(this);    m_resizeColumns = true;    //停止显示结果,初始值false    m_stop_ShowResult = false;    this->GotResultFileNum = 0;    //状态栏--label    msgLabel = new QLabel(this);    msgLabel->setMinimumSize(msgLabel->sizeHint());    msgLabel->setStyleSheet("background: transparent");    //    msg2Label = new QLabel(this);    msg2Label->setMinimumSize(msgLabel->sizeHint());    msg2Label->setStyleSheet("background: transparent");    //状态栏--progressBar    msgProgressBar = new QProgressBar(this);    msgProgressBar->setMinimumSize(msgProgressBar->sizeHint());    msgProgressBar->setStyleSheet("background: transparent");    msgProgressBar->setHidden(true);    msgProgressBar->setRange(0, 400);    msgProgressBar->setTextVisible(false);    msgPBCnt = 0;    //状态栏    ui->statusBar->setStyleSheet("QStatusBar::item{border:0px}");    ui->statusBar->addWidget(msgProgressBar);    ui->statusBar->addWidget(msgLabel);    ui->statusBar->addWidget(msg2Label);    //    QCompleter *completer = new QCompleter(this);    QFileSystemModel *fsModel = new QFileSystemModel(completer);    fsModel->setRootPath("");    completer->setModel(fsModel);    completer->setCaseSensitivity(Qt::CaseInsensitive);    ui->comboBox_Dir->setCompleter(completer);    //设置右下角小图标    this->setup_trayicon();    //设置tableView按钮    this->setup_tabmenu(ui->tableView_result);    /***************各个组件背景设置 *****************/    ui->centralWidget->setStyleSheet("background-image:url(':/img/frame-mid.png')");    ui->statusBar->setStyleSheet("background-image:url(':/img/frame-mid.png')");    ui->toolButtonSearchST->setStyleSheet("QToolButton:!hover{background: transparent;}"                                          "QToolButton:hover{background-image: url(':/img/ico-hover-bg.png');border:0px;}"                                          );    ui->toolButtonGetDir->setStyleSheet("QToolButton:!hover{background: transparent;}"                                        "QToolButton:hover{background-image: url(':/img/ico-hover-bg.png');border:0px;}"                                        );    ui->toolButtonHelp->setStyleSheet("QToolButton:!hover{background: transparent;}"                                          "QToolButton:hover{background-image: url(':/img/ico-hover-bg.png');border:0px;}"                                          );    /**************************************************/    connect(ui->toolButtonSearchST, SIGNAL(clicked()), this, SLOT(do_search()));    connect(ui->toolButtonHelp, SIGNAL(clicked()), this, SLOT(do_help()));    connect(ui->toolButtonGetDir, SIGNAL(clicked()), this, SLOT(do_brower_targetdir()));    find = new searchThread(this);    connect(find, SIGNAL(finished()), this,SLOT(do_resume_searchFileIcon()));    connect(find, SIGNAL(PushGotFiles(QString,QList<TFileInfo>)), this, SLOT(do_GetResultFileInfo(QString,QList<TFileInfo>) ));    /********************设置软件信息**********************/    QCoreApplication::setOrganizationName(QObject::tr(APP_NAME));    QCoreApplication::setApplicationName(QObject::tr(APP_NAME));    QCoreApplication::setApplicationVersion(tr("V1.2"));    //注册元类    qRegisterMetaType< QList<TFileInfo> >("QList<TFileInfo>");    //    this->defaultDir = ".";    //    QTimer *idleTimer = new QTimer(this);    connect(idleTimer, SIGNAL(timeout()), this, SLOT(do_ShowResultFileInfo()));    idleTimer->start(0);    //    show_watcher.addPath("shownow.cmd");    connect(&show_watcher, SIGNAL(fileChanged(QString)), this, SLOT(do_show()));}
开发者ID:lovekernel,项目名称:pingpingsearch,代码行数:84,


示例4: FCenterWindow

CenterWindow::CenterWindow(QWidget *parent) :    FCenterWindow(parent){    this->version = "3.1.0";    QDir dir;    QDir dir2(dir.homePath()+"/视频");    QDir dir3(dir.homePath()+"/Videos");    QString dbPath;    if(dir2.exists())    {        dbPath = dir.homePath()+"/视频/MvGather/Database";    }else if(dir3.exists())    {        dbPath = dir.homePath()+"/Videos/MvGather/Database";    }else    {        dbPath = dir.homePath()+"/MvGather";    }    dir.mkpath(dbPath);    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");//添加数据库驱动,这里用sqlite    db.setDatabaseName(dbPath+"/MvGather.db");    //    db.setDatabaseName("MvGather.db");    if(db.open())    {        //tvId:该视频唯一编号,tvName:视频中文名.tvno_hrefs:集数与相应地址...historyNo:上次观看到的集数;quality:清晰度;tvUrl:yunfan视频列表地址;source:视频来源标识        QSqlQuery query_creat_tb("CREATE TABLE IF NOT EXISTS playlistTB(tvId VARCHAR( 30 ) NOT NULL,tvName VARCHAR( 30 ),tvno_hrefs VARCHAR(100),historyNo VARCHAR( 30 ),quality VARCHAR( 30 ),tvUrl VARCHAR(100),source VARCHAR( 30 ))");        query_creat_tb.exec();        //taskId:创建下载任务的id;url任务原地址;fileSavePath:文件保存目录,percent完成的百分比        QSqlQuery query_creat_tb2("CREATE TABLE IF NOT EXISTS dtaskTB(taskId VARCHAR(30) NOT NULL,url VARCHAR(200) NOT NULL,fileSavePath VARCHAR(200) NOT NULL,percent VARCHAR(5))");        query_creat_tb2.exec();    }    playerWidget = new PlayerWidget(this);    addWidget(tr("播放器"), tr("Player"), playerWidget);    browseWidget = new  BrowseWidget(this);    addWidget(tr("视频库"), tr("MvList"), browseWidget);    recommendWidget = new RecommendWidget(this);    addWidget(tr("推荐"), tr("MvRecomend"), recommendWidget);    magnetWidget = new MagnetWidget(this);    addWidget(tr("磁力链"), tr("Magnet"), magnetWidget);    downloadManageWidget = new QScrollArea(this);    addWidget(tr("下载"), tr("Download"), downloadManageWidget);    downloadManageScrollAreaWidget = new QWidget(downloadManageWidget);    downloadManageWidget->setWidget(downloadManageScrollAreaWidget);    downloadManageScrollAreaWidgetMainLayout = new QVBoxLayout;    downloadManageScrollAreaWidgetMainLayout->setAlignment(Qt::AlignTop);    downloadManageScrollAreaWidget->setLayout(downloadManageScrollAreaWidgetMainLayout);    downloadManageScrollAreaWidget->setStyleSheet("background:transparent");    getNavgationBar()->setCurrentIndex(0);    setAlignment(TopCenter);    QSettings settings("MvGather", "xusongjie");    QString preferQualitysSetting = settings.value("app/preferQualitys", "").toString();    if(preferQualitysSetting =="")    {        preferQualitysSetting="高清#超清#M3U8#分段_高清_FLV#分段_高清_MP4#分段_高清_M3U8#分段_720P_FLV#分段_720P_MP4#分段_720P_M3U8#分段_1080P_FLV#分段_1080P_MP4#分段_1080P_M3U8#分段_超清_FLV#分段_超清_MP4#分段_超清_M3U8#分段_标清_FLV#分段_标清_MP4#分段_标清_M3U8#分段_高码1080P_FLV#分段_高码1080P_MP4#分段_高码1080P_M3U8#分段_原画_FLV#分段_原画_MP4#分段_原画_M3U8#分段_4K_FLV#分段_4K_MP4#分段_4K_M3U8#分段_高码4K_FLV#分段_高码4K_MP4#分段_高码4K_M3U8#分段_低清_FLV#分段_低清_MP4#分段_低清_M3U8#单段_高清_MP4#单段_高清_M3U8#单段_高清_FLV#单段_720P_FLV#单段_720P_MP4#单段_720P_M3U8#单段_1080P_FLV#单段_1080P_MP4#单段_1080P_M3U8#单段_超清_FLV#单段_超清_MP4#单段_超清_M3U8#单段_标清_FLV#单段_标清_MP4#单段_标清_M3U8#单段_高码1080P_FLV#单段_高码1080P_MP4#单段_高码1080P_M3U8#单段_原画_FLV#单段_原画_MP4#单段_原画_M3U8#单段_4K_FLV#单段_4K_MP4#单段_4K_M3U8#单段_高码4K_FLV#单段_高码4K_MP4#单段_高码4K_M3U8#单段_低清_FLV#单段_低清_MP4#单段_低清_M3U8";        settings.setValue("app/preferQualitys",preferQualitysSetting);    }    connect(browseWidget,SIGNAL(play(QString)),this,SLOT(addMvToPlaylist(QString)));    connect(playerWidget,SIGNAL(hideToFullScreen(bool)),this,SLOT(getIntofullScreenMode(bool)));    connect(playerWidget,SIGNAL(getIntoWideModel(bool)),this,SLOT(getIntoWideModel(bool)));    connect(magnetWidget,SIGNAL(addDownloadTask(QString)),this,SLOT(addDownloadTask(QString)));    connect(recommendWidget,SIGNAL(addDownloadTaskSignal(QString)),this,SLOT(addDownloadTask(QString)));    connect(getNavgationBar(),SIGNAL(indexChanged(int)),this,SLOT(firstLoadList(int)));    hideMouseTimer = new QTimer;    connect(hideMouseTimer,SIGNAL(timeout()),this,SLOT(hideMouse()));    hideMouseTimer->start(500);    loadDownloadSettings();}
开发者ID:jun-zhang,项目名称:MvGather,代码行数:84,


示例5: QMainWindow

ConsoleWindows::ConsoleWindows(QWidget *parent) :    QMainWindow(parent),    ui(new Ui::ConsoleWindows){    ui->setupUi(this);    m_compteur = 0;    //serveur LMS    m_LMS = new CLMS_DB("0.0.0.1");    //création de la base de donnée    m_BD = new CSQLite_Local_DB(m_LMS);    if(m_BD->Get_DataBaseIsReady())        qDebug()<< "[ConsoleWindows][SUCCESS] : Database connection is ready";    else    {        QFile log;        exit(-1);        qDebug()<< "[ConsoleWindows][FATAL ERROR] : No database connection !";    }    //CDoors    m_Doors = new CDoors(m_BD);    m_fileSaveTemlist = new CustomXml("SaveListsPackageTemp.xml","ListsPackageTemp");    m_fileConfig = new CustomXml("config.xml","SettingSystem");    //initialisation des Widgets    Initialization_Widgets();    //partage des positions Widgets et du stackedwidget pour les autres classes    Init_Show_Widgets();    //Creation timer    m_timer = new QTimer(this);    ui->comboBox_country->clear();    //test list pays    m_pays <<"France"<<"English";    ui->comboBox_country->addItems(m_pays);    m_flags<<QIcon(":/flags/France")<<QIcon(":/flags/English");    for(int i = 0 ; i<m_flags.count();i++){        ui->comboBox_country->setItemIcon(i,m_flags[i]);    }   //translator    m_country = new Country(FRENCH);   //connection bouton    connect(m_timer,SIGNAL(timeout()),this,SLOT(HideB_DeliveryMaintenance()));    connect(ui->comboBox_country,SIGNAL(currentIndexChanged(int)),this,SLOT(SelectPays(int)));    ui->B_DeliveryAndMaintenace->setVisible(false);    //gestion des evenements des widgets    ui->B_DeliveryAndMaintenace->installEventFilter(this);    ui->P_Home->installEventFilter(this);}
开发者ID:BTS2-Projet-1,项目名称:Locker_Control,代码行数:63,


示例6: GETSTELMODULE

// Initialize the dialog widgets and connect the signals/slotsvoid ExoplanetsDialog::createDialogContent(){	ep = GETSTELMODULE(Exoplanets);	ui->setupUi(dialog);	ui->tabs->setCurrentIndex(0);		connect(&StelApp::getInstance(), SIGNAL(languageChanged()),		this, SLOT(retranslate()));#ifdef Q_OS_WIN	//Kinetic scrolling for tablet pc and pc	QList<QWidget *> addscroll;	addscroll << ui->aboutTextBrowser << ui->infoTextBrowser << ui->websitesTextBrowser;	installKineticScrolling(addscroll);#endif	// Settings tab / updates group	ui->displayAtStartupCheckBox->setChecked(ep->getEnableAtStartup());	connect(ui->displayAtStartupCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setDisplayAtStartupEnabled(int)));	ui->displayModeCheckBox->setChecked(ep->getDisplayMode());	connect(ui->displayModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setDistributionEnabled(int)));	ui->displayShowExoplanetsButton->setChecked(ep->getFlagShowExoplanetsButton());	connect(ui->displayShowExoplanetsButton, SIGNAL(stateChanged(int)), this, SLOT(setDisplayShowExoplanetsButton(int)));	ui->timelineModeCheckBox->setChecked(ep->getTimelineMode());	connect(ui->timelineModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setTimelineEnabled(int)));	ui->habitableModeCheckBox->setChecked(ep->getHabitableMode());	connect(ui->habitableModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setHabitableEnabled(int)));	connect(ui->internetUpdatesCheckbox, SIGNAL(stateChanged(int)), this, SLOT(setUpdatesEnabled(int)));	connect(ui->updateButton, SIGNAL(clicked()), this, SLOT(updateJSON()));	connect(ep, SIGNAL(updateStateChanged(Exoplanets::UpdateState)), this, SLOT(updateStateReceiver(Exoplanets::UpdateState)));	connect(ep, SIGNAL(jsonUpdateComplete(void)), this, SLOT(updateCompleteReceiver(void)));	connect(ep, SIGNAL(jsonUpdateComplete(void)), ep, SLOT(reloadCatalog()));	connect(ui->updateFrequencySpinBox, SIGNAL(valueChanged(int)), this, SLOT(setUpdateValues(int)));	refreshUpdateValues(); // fetch values for last updated and so on	// if the state didn't change, setUpdatesEnabled will not be called, so we force it	setUpdatesEnabled(ui->internetUpdatesCheckbox->checkState());	updateTimer = new QTimer(this);	connect(updateTimer, SIGNAL(timeout()), this, SLOT(refreshUpdateValues()));	updateTimer->start(7000);	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));	connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));	connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults()));	connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings()));	connect(ui->plotDiagram, SIGNAL(clicked()), this, SLOT(drawDiagram()));	// About & Info tabs	setAboutHtml();	setInfoHtml();	setWebsitesHtml();	StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());	if(gui!=NULL)	{		ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));		ui->infoTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));		ui->websitesTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));	}	populateDiagramsList();	updateGuiFromSettings();}
开发者ID:PhiTheta,项目名称:stellarium,代码行数:63,


示例7: QCoreApplication

AssignmentClient::AssignmentClient(int &argc, char **argv) :    QCoreApplication(argc, argv),    _assignmentServerHostname(DEFAULT_ASSIGNMENT_SERVER_HOSTNAME){    setOrganizationName("High Fidelity");    setOrganizationDomain("highfidelity.io");    setApplicationName("assignment-client");    QSettings::setDefaultFormat(QSettings::IniFormat);    // set the logging target to the the CHILD_TARGET_NAME    Logging::setTargetName(ASSIGNMENT_CLIENT_TARGET_NAME);    const QVariantMap argumentVariantMap = HifiConfigVariantMap::mergeCLParametersWithJSONConfig(arguments());    const QString ASSIGNMENT_TYPE_OVERRIDE_OPTION = "t";    const QString ASSIGNMENT_POOL_OPTION = "pool";    const QString ASSIGNMENT_WALLET_DESTINATION_ID_OPTION = "wallet";    const QString CUSTOM_ASSIGNMENT_SERVER_HOSTNAME_OPTION = "a";    Assignment::Type requestAssignmentType = Assignment::AllTypes;    // check for an assignment type passed on the command line or in the config    if (argumentVariantMap.contains(ASSIGNMENT_TYPE_OVERRIDE_OPTION)) {        requestAssignmentType = (Assignment::Type) argumentVariantMap.value(ASSIGNMENT_TYPE_OVERRIDE_OPTION).toInt();    }    QString assignmentPool;    // check for an assignment pool passed on the command line or in the config    if (argumentVariantMap.contains(ASSIGNMENT_POOL_OPTION)) {        assignmentPool = argumentVariantMap.value(ASSIGNMENT_POOL_OPTION).toString();    }    // setup our _requestAssignment member variable from the passed arguments    _requestAssignment = Assignment(Assignment::RequestCommand, requestAssignmentType, assignmentPool);    // check for a wallet UUID on the command line or in the config    // this would represent where the user running AC wants funds sent to    if (argumentVariantMap.contains(ASSIGNMENT_WALLET_DESTINATION_ID_OPTION)) {        QUuid walletUUID = argumentVariantMap.value(ASSIGNMENT_WALLET_DESTINATION_ID_OPTION).toString();        qDebug() << "The destination wallet UUID for credits is" << uuidStringWithoutCurlyBraces(walletUUID);        _requestAssignment.setWalletUUID(walletUUID);    }    // create a NodeList as an unassigned client    NodeList* nodeList = NodeList::createInstance(NodeType::Unassigned);    // check for an overriden assignment server hostname    if (argumentVariantMap.contains(CUSTOM_ASSIGNMENT_SERVER_HOSTNAME_OPTION)) {        _assignmentServerHostname = argumentVariantMap.value(CUSTOM_ASSIGNMENT_SERVER_HOSTNAME_OPTION).toString();        // set the custom assignment socket on our NodeList        HifiSockAddr customAssignmentSocket = HifiSockAddr(_assignmentServerHostname, DEFAULT_DOMAIN_SERVER_PORT);        nodeList->setAssignmentServerSocket(customAssignmentSocket);    }    // call a timer function every ASSIGNMENT_REQUEST_INTERVAL_MSECS to ask for assignment, if required    qDebug() << "Waiting for assignment -" << _requestAssignment;    QTimer* timer = new QTimer(this);    connect(timer, SIGNAL(timeout()), SLOT(sendAssignmentRequest()));    timer->start(ASSIGNMENT_REQUEST_INTERVAL_MSECS);    // connect our readPendingDatagrams method to the readyRead() signal of the socket    connect(&nodeList->getNodeSocket(), &QUdpSocket::readyRead, this, &AssignmentClient::readPendingDatagrams);    // connections to AccountManager for authentication    connect(&AccountManager::getInstance(), &AccountManager::authRequired,            this, &AssignmentClient::handleAuthenticationRequest);        NetworkAccessManager::getInstance();}
开发者ID:Adrianl3d,项目名称:hifi,代码行数:73,


示例8: ConfigTaskWidget

ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTaskWidget(parent),    boardModel(0), m_stabSettingsBankCount(0), m_currentStabSettingsBank(0){    ui = new Ui_StabilizationWidget();    ui->setupUi(this);    setupExpoPlot();    setupStabBanksGUI();    ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();    Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();    if (!settings->useExpertMode()) {        ui->saveStabilizationToRAM_6->setVisible(false);    }    autoLoadWidgets();    realtimeUpdates = new QTimer(this);    connect(realtimeUpdates, SIGNAL(timeout()), this, SLOT(apply()));    connect(ui->realTimeUpdates_6, SIGNAL(toggled(bool)), this, SLOT(realtimeUpdatesSlot(bool)));    addWidget(ui->realTimeUpdates_6);    connect(ui->realTimeUpdates_8, SIGNAL(toggled(bool)), this, SLOT(realtimeUpdatesSlot(bool)));    addWidget(ui->realTimeUpdates_8);    connect(ui->realTimeUpdates_12, SIGNAL(toggled(bool)), this, SLOT(realtimeUpdatesSlot(bool)));    addWidget(ui->realTimeUpdates_12);    connect(ui->realTimeUpdates_7, SIGNAL(toggled(bool)), this, SLOT(realtimeUpdatesSlot(bool)));    addWidget(ui->realTimeUpdates_7);    connect(ui->checkBox_7, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));    addWidget(ui->checkBox_7);    connect(ui->checkBox_2, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));    addWidget(ui->checkBox_2);    connect(ui->checkBox_8, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));    addWidget(ui->checkBox_8);    connect(ui->checkBox_3, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));    addWidget(ui->checkBox_3);    addWidget(ui->pushButton_2);    addWidget(ui->pushButton_3);    addWidget(ui->pushButton_4);    addWidget(ui->pushButton_5);    addWidget(ui->pushButton_6);    addWidget(ui->pushButton_7);    addWidget(ui->pushButton_8);    addWidget(ui->pushButton_9);    addWidget(ui->pushButton_10);    addWidget(ui->pushButton_11);    addWidget(ui->pushButton_20);    addWidget(ui->pushButton_22);    addWidget(ui->pushButton_23);    addWidget(ui->basicResponsivenessGroupBox);    addWidget(ui->basicResponsivenessCheckBox);    connect(ui->basicResponsivenessCheckBox, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));    addWidget(ui->advancedResponsivenessGroupBox);    addWidget(ui->advancedResponsivenessCheckBox);    connect(ui->advancedResponsivenessCheckBox, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));    connect(ui->defaultThrottleCurveButton, SIGNAL(clicked()), this, SLOT(resetThrottleCurveToDefault()));    connect(ui->enableThrustPIDScalingCheckBox, SIGNAL(toggled(bool)), ui->ThrustPIDSource, SLOT(setEnabled(bool)));    connect(ui->enableThrustPIDScalingCheckBox, SIGNAL(toggled(bool)), ui->ThrustPIDTarget, SLOT(setEnabled(bool)));    connect(ui->enableThrustPIDScalingCheckBox, SIGNAL(toggled(bool)), ui->ThrustPIDAxis, SLOT(setEnabled(bool)));    connect(ui->enableThrustPIDScalingCheckBox, SIGNAL(toggled(bool)), ui->thrustPIDScalingCurve, SLOT(setEnabled(bool)));    ui->thrustPIDScalingCurve->setXAxisLabel(tr("Thrust"));    ui->thrustPIDScalingCurve->setYAxisLabel(tr("Scaling factor"));    ui->thrustPIDScalingCurve->setMin(-0.5);    ui->thrustPIDScalingCurve->setMax(0.5);    ui->thrustPIDScalingCurve->initLinearCurve(5, -0.25, 0.25);    connect(ui->thrustPIDScalingCurve, SIGNAL(curveUpdated()), this, SLOT(throttleCurveUpdated()));    addWidget(ui->defaultThrottleCurveButton);    addWidget(ui->enableThrustPIDScalingCheckBox);    addWidget(ui->thrustPIDScalingCurve);    addWidget(ui->thrustPIDScalingCurve);    connect(this, SIGNAL(widgetContentsChanged(QWidget *)), this, SLOT(processLinkedWidgets(QWidget *)));    connect(this, SIGNAL(autoPilotConnected()), this, SLOT(onBoardConnected()));    addWidget(ui->expoPlot);    connect(ui->expoSpinnerRoll, SIGNAL(valueChanged(int)), this, SLOT(replotExpoRoll(int)));    connect(ui->expoSpinnerPitch, SIGNAL(valueChanged(int)), this, SLOT(replotExpoPitch(int)));    connect(ui->expoSpinnerYaw, SIGNAL(valueChanged(int)), this, SLOT(replotExpoYaw(int)));    disableMouseWheelEvents();    updateEnableControls();}
开发者ID:CaptainFalco,项目名称:OpenPilot,代码行数:89,


示例9: QObject

// ===================== constructor =================CqSimulation::CqSimulation(QObject* parent): QObject(parent){	// init	init();	connect( &_simulationTimer, SIGNAL(timeout()), SLOT(simulationTimerTimeout() ) );}
开发者ID:Mr-Kumar-Abhishek,项目名称:construqtor,代码行数:7,


示例10: QObject

Timer_New::Timer_New(int device_port,QObject *parent) : QObject(parent){    connect(&timer,SIGNAL(timeout()),this,SLOT(timeout()));    this->device_port   = device_port;}
开发者ID:yangfengfeng8,项目名称:Test,代码行数:5,


示例11: QThread

//.........这里部分代码省略.........  //   _tsProc.burst_range_offset_m =  //     _config.burst_sample_delay() * lightSpeedMps / 2.0;  _tsProc.pulse_width_us = _config.tx_pulse_width() * 1.0e6;  const double SpeedOfLight = 2.99792458e8; // m/s  _tsProc.gate_spacing_m = _config.digitizer_sample_width() * SpeedOfLight / 2;  _tsProc.start_range_m = _config.range_to_gate0_m(); // center of gate 0 in meters  _tsProc.pol_mode = IWRF_POL_MODE_NOT_SET;  // initialize IWRF scan segment for simulation angles  iwrf_scan_segment_init(_simScan);  _simScan.scan_mode = IWRF_SCAN_MODE_AZ_SUR_360;  // initialize pulse header  iwrf_pulse_header_init(_pulseHdr);  /// PRT mode  _staggeredPrt = false;  if (_config.staggered_prt() != HcrDrxConfig::UNSET_BOOL) {    _staggeredPrt = _config.staggered_prt();  }  _prt1 = 1.0e-3;  if (_config.prt1() != HcrDrxConfig::UNSET_DOUBLE) {    _prt1 = _config.prt1();  }    /// beam angles    _azimuthDeg = 0.0;  _elevationDeg = 0.0;  /// angle corrections  _rollCorr = 0.0;  _pitchCorr = 0.0;  _headingCorr = 0.0;  _driftCorr = 0.0;  _tiltCorr = 0.0;  _rotationCorr = 0.0;  /// simulation of antenna angles  _simAntennaAngles = false;  _simNElev = 10;  _simStartElev = 0.5;  _simDeltaElev = 1.0;  _simAzRate = 10.0;  if (_config.simulate_antenna_angles() != HcrDrxConfig::UNSET_BOOL) {    _simAntennaAngles = _config.simulate_antenna_angles();  }  if (_config.sim_n_elev() != HcrDrxConfig::UNSET_INT) {    _simNElev = _config.sim_n_elev();  }  if (_config.sim_start_elev() != HcrDrxConfig::UNSET_DOUBLE) {    _simStartElev = _config.sim_start_elev();  }  if (_config.sim_delta_elev() != HcrDrxConfig::UNSET_DOUBLE) {    _simDeltaElev = _config.sim_delta_elev();  }  if (_config.sim_az_rate() != HcrDrxConfig::UNSET_DOUBLE) {    _simAzRate = _config.sim_az_rate();  }  _simElev = _simStartElev;  _simAz = 0.0;  _simVolNum = 0;  _simSweepNum = 0;  // IWRF EXPORT  // server  _serverIsOpen = false;  _sock = NULL;  _newClient = false;  // output fmq  _fmqPath = _config.iwrf_fmq_path();  _fmqOpen = false;  _firstFmqMessage = false;  if (_config.export_iwrf_via_fmq()) {    if (_openOutputFmq() == 0) {      _fmqOpen = true;      _firstFmqMessage = true;      DLOG << "==>> Opened FMQ for time series: " << _fmqPath;    } else {      ELOG << "ERROR: Cannot initialize FMQ: " << _fmqPath;      ELOG << "  Will open TCP server instead";    }  }    // Create a timer to print some status information on a regular basis, and  // start it when our thread is started.  _statusTimer = new QTimer();  _statusTimer->setInterval(10000);    // 10 s  connect(_statusTimer, SIGNAL(timeout()), this, SLOT(_logStatus()));  connect(this, SIGNAL(started()), _statusTimer, SLOT(start()));}
开发者ID:NCAR,项目名称:HCR_instrument,代码行数:101,


示例12: KPassivePopup

KRandrPassivePopup::KRandrPassivePopup( QWidget *parent, Qt::WFlags f )    : KPassivePopup( parent, f )    {    update_timer.setSingleShot( true );    connect( &update_timer, SIGNAL(timeout()), SLOT(slotPositionSelf()));    }
开发者ID:fluxer,项目名称:kde-workspace,代码行数:6,


示例13: QMainWindow

Window::Window(QWidget* parent):    QMainWindow(parent){    setObjectName("PlanetScannerWindow");    QToolBar* toolbar = new QToolBar(this);    toolbar->setIconSize(QSize(24, 24));    toolbar->setFloatable(false);    toolbar->setContextMenuPolicy(Qt::PreventContextMenu);    addToolBar(toolbar);    QAction* refreshAction = toolbar->addAction(QIcon(":/icons/refresh.png"), "Refresh");    connect(refreshAction, SIGNAL(triggered()), this, SLOT(refreshPlanets()));    QAction* settingsAction = toolbar->addAction(QIcon(":/icons/settings.png"), "Settings");    connect(settingsAction, SIGNAL(triggered()), this, SLOT(showSettingsDialog()));    planetTreeView = new QTreeView(this);    planetTreeView->setMinimumHeight(10);    planetTreeModel = new PlanetTreeModel(planetTreeView);    planetTreeProxyModel = new PlanetTreeSortFilterProxyModel(planetTreeModel);    planetTreeProxyModel->setSourceModel(planetTreeModel);    planetTreeView->setModel(planetTreeProxyModel);    planetTreeModel->setHorizontalHeaderLabels(QStringList() << "Hostname" << "Map" << "Gametype" << "Players" << "Address");    planetTreeView->setSortingEnabled(true);    planetTreeView->sortByColumn(0, Qt::AscendingOrder);    planetTreeView->setContextMenuPolicy(Qt::CustomContextMenu);    planetTreeView->setSelectionMode(QAbstractItemView::SingleSelection);    connect(planetTreeView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));    QAction* connectAction = new QAction("Connect", planetTreeView);    QAction* connectAsSpectatorAction = new QAction("Connect as spectator", planetTreeView);    QAction* copyAction = new QAction("Copy", planetTreeView);    QAction* openProfileAction = new QAction("Open profile in a browser", planetTreeView);    connect(connectAction, SIGNAL(triggered()), this, SLOT(connectSelected()));    connect(connectAsSpectatorAction, SIGNAL(triggered()), this, SLOT(connectAsSpectatorSelected()));    connect(copyAction, SIGNAL(triggered()), this, SLOT(copySelected()));    connect(openProfileAction, &QAction::triggered, this, &Window::openProfileSelected);    gameContextMenu = new QMenu(planetTreeView);    planetContextMenu = new QMenu(planetTreeView);    registeredPlayerContextMenu = new QMenu(planetTreeView);    unregisteredPlayerContextMenu = new QMenu(planetTreeView);    gameContextMenu->addActions(QList<QAction*>() << connectAction << connectAsSpectatorAction << copyAction);    planetContextMenu->addActions(QList<QAction*>() << copyAction);    registeredPlayerContextMenu->addActions(QList<QAction*>() << openProfileAction << copyAction);    unregisteredPlayerContextMenu->addActions(QList<QAction*>() << copyAction);    setCentralWidget(planetTreeView);    game = new QProcess(this);    statistics = new StatisticsWebSite(this);    connect(statistics, &StatisticsWebSite::playersInfoRecieved, this, &Window::processStatisticsPlayers);    autoRefreshTimer = new QTimer(this);    connect(autoRefreshTimer, SIGNAL(timeout()), this, SLOT(refreshPlanets()));    contextMenuShown = false;    Settings& settings = Settings::getInstance();    connect(&settings, &Settings::dataChanged, this, &Window::applyChangedSettings);    settings.load();    applyChangedSettings();    ::Settings::loadWindow(this);    refreshPlanets();}
开发者ID:nurupo,项目名称:nfk-lobby,代码行数:67,


示例14: switch

void DoorduinoAuth::iteration(void) {    switch(_state) {    case 1:      _gpio.set_led(LED_BLACK);      setTimeout(18);      _state=22;      break;    case 2:    case 3:    case 4:    case 22:      _gpio.set_led( (( _state==2 ) || ( _state==4 ))?LED_BLACK:LED_BLUE);      if(_env->s1) {			// button 1 - add key        _s1=true;        _state=5;      } else if(_env->s2) {		// button 2 - revoke key        _s2=true;        _state=6;      } else if(_env->s3) {		// button 3 - add admin key        _s3=true;        _state=7;      } else if(_scan_bus(_env->addr)) {	// scan onewire bus	_state=17;      } else if(timeout()) {		// idle led blink pattern (substates)        switch(_state) {          case 2: _state=3; setTimeout(2); break;          case 3: _state=4; setTimeout(2); break;          case 4: _state=22; setTimeout(18); break;          case 22: _state=2; setTimeout(2); break;        }      }      break;    case 5:      _s1=true; _state=8; setTimeout(SCAN_ADMIN_TIME); break;    case 6:      _s2=true; _state=8; setTimeout(SCAN_ADMIN_TIME); break;    case 7:      _s3=true; _state=8; setTimeout(SCAN_ADMIN_TIME); break;    case 8:      _gpio.blink_led(LED_BLACK,LED_BLUE,600,_timeout);      if(_scan_bus(_env->addr)) {        _state=9;      } else if(timeout()) {        _state=16;      }      break;    case 9:      if(_store.is_admin(_env->addr)) {	setTimeout(SCAN_SUBJECT_TIME);	_state=10;      } else {	setTimeout(FAIL_TIME);        _state=15;      }      break;    case 10:      _gpio.blink_led(LED_BLACK,LED_YELLOW,600,_timeout);      if(_scan_bus(_env->addr)) {	_state=_s2?11:12;      } else if(timeout()) {	_state=16;      }      break;    case 11:      if(_store.del_key(_env->addr)) CONFIRM else FAIL;      break;    case 12:      if(_store.add_key(_env->addr)) {        if(_s3) { // set admin          _state=13;        } else {	  CONFIRM        }      } else {        FAIL      }      break;    case 13:      if(_store.set_admin(_env->addr)) CONFIRM else FAIL;      break;    case 14:      _gpio.blink_led(LED_BLACK,LED_GREEN,600,_timeout);      if(timeout()) _state=16;      break;    case 15:      _gpio.blink_led(LED_RED,LED_BLUE,200,_timeout);      if(timeout()) _state=16;//.........这里部分代码省略.........
开发者ID:sonologic,项目名称:Doorduino,代码行数:101,


示例15: QMainWindow

BitcoinGUI::BitcoinGUI(QWidget *parent):    QMainWindow(parent),    clientModel(0),    walletModel(0),    encryptWalletAction(0),    changePassphraseAction(0),    unlockWalletAction(0),    aboutQtAction(0),    trayIcon(0),    notificator(0),    rpcConsole(0){    resize(850, 550);    setWindowTitle(tr("Philosopherstone") + " - " + tr("Wallet"));#ifndef Q_OS_MAC    qApp->setWindowIcon(QIcon(":icons/bitcoin"));    setWindowIcon(QIcon(":icons/bitcoin"));#else    setUnifiedTitleAndToolBarOnMac(true);    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);#endif    // Accept D&D of URIs    setAcceptDrops(true);    // Create actions for the toolbar, menu bar and tray/dock icon    createActions();    // Create application menu bar    createMenuBar();    // Create the toolbars    createToolBars();    // Create the tray icon (or setup the dock icon)    createTrayIcon();    // Create tabs    overviewPage = new OverviewPage();    transactionsPage = new QWidget(this);    QVBoxLayout *vbox = new QVBoxLayout();    transactionView = new TransactionView(this);    vbox->addWidget(transactionView);    transactionsPage->setLayout(vbox);    addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);    receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);    sendCoinsPage = new SendCoinsDialog(this);    signVerifyMessageDialog = new SignVerifyMessageDialog(this);    centralWidget = new QStackedWidget(this);    centralWidget->addWidget(overviewPage);    centralWidget->addWidget(transactionsPage);    centralWidget->addWidget(addressBookPage);    centralWidget->addWidget(receiveCoinsPage);    centralWidget->addWidget(sendCoinsPage);    setCentralWidget(centralWidget);    // Create status bar    statusBar();    // Status bar notification icons    QFrame *frameBlocks = new QFrame();    frameBlocks->setContentsMargins(0,0,0,0);    frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);    frameBlocksLayout->setContentsMargins(3,0,3,0);    frameBlocksLayout->setSpacing(3);    labelStakingIcon = new QLabel();    labelEncryptionIcon = new QLabel();    labelConnectionsIcon = new QLabel();    labelBlocksIcon = new QLabel();    frameBlocksLayout->addStretch();    frameBlocksLayout->addWidget(labelEncryptionIcon);    frameBlocksLayout->addStretch();    frameBlocksLayout->addWidget(labelStakingIcon);    frameBlocksLayout->addStretch();    frameBlocksLayout->addWidget(labelConnectionsIcon);    frameBlocksLayout->addStretch();    frameBlocksLayout->addWidget(labelBlocksIcon);    frameBlocksLayout->addStretch();    QTimer *timerStakingIcon = new QTimer(labelStakingIcon);    connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon()));    timerStakingIcon->start(30 * 1000);     updateStakingIcon();	 // Progress bar and label for blocks download    progressBarLabel = new QLabel();    progressBarLabel->setVisible(false);    progressBar = new QProgressBar();    progressBar->setAlignment(Qt::AlignCenter);    progressBar->setVisible(false);    // Override style sheet for progress bar for styles that have a segmented progress bar,    // as they make the text unreadable (workaround for issue #1071)    // See https://qt-project.org/doc/qt-4.8/gallery.html//.........这里部分代码省略.........
开发者ID:nicoschtein,项目名称:philosopherstone,代码行数:101,


示例16: QWidget

InformationPanelContent::InformationPanelContent(QWidget* parent) :    QWidget(parent),    m_item(),    m_pendingPreview(false),    m_outdatedPreviewTimer(0),    m_preview(0),    m_phononWidget(0),    m_nameLabel(0),    m_metaDataWidget(0),    m_metaDataArea(0),    m_placesItemModel(0){    parent->installEventFilter(this);    // Initialize timer for disabling an outdated preview with a small    // delay. This prevents flickering if the new preview can be generated    // within a very small timeframe.    m_outdatedPreviewTimer = new QTimer(this);    m_outdatedPreviewTimer->setInterval(300);    m_outdatedPreviewTimer->setSingleShot(true);    connect(m_outdatedPreviewTimer, SIGNAL(timeout()),            this, SLOT(markOutdatedPreview()));    QVBoxLayout* layout = new QVBoxLayout(this);    layout->setSpacing(KDialog::spacingHint());    // preview    const int minPreviewWidth = KIconLoader::SizeEnormous + KIconLoader::SizeMedium;    m_preview = new PixmapViewer(parent);    m_preview->setMinimumWidth(minPreviewWidth);    m_preview->setMinimumHeight(KIconLoader::SizeEnormous);    m_phononWidget = new PhononWidget(parent);    m_phononWidget->hide();    m_phononWidget->setMinimumWidth(minPreviewWidth);    connect(m_phononWidget, SIGNAL(hasVideoChanged(bool)),            this, SLOT(slotHasVideoChanged(bool)));    // name    m_nameLabel = new QLabel(parent);    QFont font = m_nameLabel->font();    font.setBold(true);    m_nameLabel->setFont(font);    m_nameLabel->setTextFormat(Qt::PlainText);    m_nameLabel->setAlignment(Qt::AlignHCenter);    m_nameLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);    const bool previewsShown = InformationPanelSettings::previewsShown();    m_preview->setVisible(previewsShown);#ifndef HAVE_NEPOMUK    m_metaDataWidget = new KFileMetaDataWidget(parent);#else    m_metaDataWidget = new Nepomuk2::FileMetaDataWidget(parent);#endif    m_metaDataWidget->setFont(KGlobalSettings::smallestReadableFont());    m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);    connect(m_metaDataWidget, SIGNAL(urlActivated(KUrl)), this, SIGNAL(urlActivated(KUrl)));    // Encapsulate the MetaDataWidget inside a container that has a dummy widget    // at the bottom. This prevents that the meta data widget gets vertically stretched    // in the case where the height of m_metaDataArea > m_metaDataWidget.    QWidget* metaDataWidgetContainer = new QWidget(parent);    QVBoxLayout* containerLayout = new QVBoxLayout(metaDataWidgetContainer);    containerLayout->setContentsMargins(0, 0, 0, 0);    containerLayout->setSpacing(0);    containerLayout->addWidget(m_metaDataWidget);    containerLayout->addStretch();    m_metaDataArea = new QScrollArea(parent);    m_metaDataArea->setWidget(metaDataWidgetContainer);    m_metaDataArea->setWidgetResizable(true);    m_metaDataArea->setFrameShape(QFrame::NoFrame);    QWidget* viewport = m_metaDataArea->viewport();    viewport->installEventFilter(this);    QPalette palette = viewport->palette();    palette.setColor(viewport->backgroundRole(), QColor(Qt::transparent));    viewport->setPalette(palette);    layout->addWidget(m_preview);    layout->addWidget(m_phononWidget);    layout->addWidget(m_nameLabel);    layout->addWidget(new KSeparator());    layout->addWidget(m_metaDataArea);    m_placesItemModel = new PlacesItemModel(this);}
开发者ID:blue-shell,项目名称:folderview,代码行数:90,


示例17: locker

void Simulator::onStart(){    QMutexLocker locker(&lock);    QThread* mainThread = QThread::currentThread();    qDebug() << "Simulator Thread: "<< mainThread;    // Get required UAVObjects    ExtensionSystem::PluginManager* pm = ExtensionSystem::PluginManager::instance();    UAVObjectManager* objManager = pm->getObject<UAVObjectManager>();    actDesired = ActuatorDesired::GetInstance(objManager);    actCommand = ActuatorCommand::GetInstance(objManager);    manCtrlCommand = ManualControlCommand::GetInstance(objManager);    gcsReceiver = GCSReceiver::GetInstance(objManager);    flightStatus = FlightStatus::GetInstance(objManager);    posHome = HomeLocation::GetInstance(objManager);    velActual = VelocityActual::GetInstance(objManager);    posActual = PositionActual::GetInstance(objManager);    baroAlt = BaroAltitude::GetInstance(objManager);    airspeedActual = AirspeedActual::GetInstance(objManager);    attActual = AttitudeActual::GetInstance(objManager);    attitudeSettings = AttitudeSettings::GetInstance(objManager);    accels = Accels::GetInstance(objManager);    gyros = Gyros::GetInstance(objManager);    gpsPos = GPSPosition::GetInstance(objManager);    gpsVel = GPSVelocity::GetInstance(objManager);    telStats = GCSTelemetryStats::GetInstance(objManager);    groundTruth = GroundTruth::GetInstance(objManager);    // Listen to autopilot connection events    TelemetryManager* telMngr = pm->getObject<TelemetryManager>();    connect(telMngr, SIGNAL(connected()), this, SLOT(onAutopilotConnect()));    connect(telMngr, SIGNAL(disconnected()), this, SLOT(onAutopilotDisconnect()));    //connect(telStats, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(telStatsUpdated(UAVObject*)));    // If already connect setup autopilot    GCSTelemetryStats::DataFields stats = telStats->getData();    if ( stats.Status == GCSTelemetryStats::STATUS_CONNECTED )        onAutopilotConnect();    inSocket = new QUdpSocket();    outSocket = new QUdpSocket();    setupUdpPorts(settings.hostAddress,settings.inPort,settings.outPort);    emit processOutput("/nLocal interface: " + settings.hostAddress + "/n" + /                       "Remote interface: " + settings.remoteAddress + "/n" + /                       "inputPort: " + QString::number(settings.inPort) + "/n" + /                       "outputPort: " + QString::number(settings.outPort) + "/n");    qxtLog->info("/nLocal interface: " + settings.hostAddress + "/n" + /                 "Remote interface: " + settings.remoteAddress + "/n" + /                 "inputPort: " + QString::number(settings.inPort) + "/n" + /                 "outputPort: " + QString::number(settings.outPort) + "/n");	connect(inSocket, SIGNAL(readyRead()), this, SLOT(receiveUpdate()),Qt::DirectConnection);	// Setup transmit timer	txTimer = new QTimer();	connect(txTimer, SIGNAL(timeout()), this, SLOT(transmitUpdate()),Qt::DirectConnection);	txTimer->setInterval(updatePeriod);	txTimer->start();	// Setup simulator connection timer	simTimer = new QTimer();	connect(simTimer, SIGNAL(timeout()), this, SLOT(onSimulatorConnectionTimeout()),Qt::DirectConnection);	simTimer->setInterval(simTimeout);	simTimer->start();	// setup time	time = new QTime();	time->start();	current.T=0;	current.i=0;}
开发者ID:Crash1,项目名称:TauLabs,代码行数:75,


示例18: QDialog

//.........这里部分代码省略.........			layerTable->setItem(info->layerInfo.count()-counter-1, 2, tW);			layerTable->setRowHeight(info->layerInfo.count()-counter-1, 40);			counter++;		}		tabLayout->addWidget( layerTable );		layerTable->setColumnWidth(1, 24 + col2Width);		layerTable->setColumnWidth(0, 24 + col1Width);		blendMode->setCurrentIndex(0);// 		headerH->setResizeMode(QHeaderView::Fixed);		propsTab->addTab( tab,  tr( "Layers" ) );	}	tab_2 = new QWidget( propsTab );	tabLayout_2 = new QVBoxLayout( tab_2 );	tabLayout_2->setMargin(6);	tabLayout_2->setSpacing(6);	pathList = new QListWidget( tab_2 );	pathList->clear();	pathList->setIconSize(QSize(40, 40));	QMap<QString, FPointArray>::Iterator it;	if (info->PDSpathData.count() != 0)	{		for (it = info->PDSpathData.begin(); it != info->PDSpathData.end(); ++it)		{			QImage pixm(40, 40, QImage::Format_ARGB32_Premultiplied);			ScPainter *p = new ScPainter(&pixm, 40, 40);			p->clear();			p->translate(3.0, 3.0);			if (it.key() == info->clipPath)			{				pixm.fill(Qt::green);				p->clear(Qt::green);			}			else				pixm.fill(Qt::white);			FPointArray Path;			Path.resize(0);			Path = info->PDSpathData[it.key()].copy();			FPoint min = getMinClipF(&Path);			Path.translate(-min.x(), -min.y());			FPoint max = Path.WidthHeight();			QTransform mm;			mm.scale(34.0 / qMax(max.x(), max.y()), 34.0 / qMax(max.x(), max.y()));			Path.map(mm);			p->setupPolygon(&Path);			p->setPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);			p->setBrush(Qt::white);			p->setFillMode(ScPainter::None);			p->setStrokeMode(ScPainter::Solid);			p->strokePath();			p->end();			delete p;			QPixmap pm;			pm=QPixmap::fromImage(pixm);			new QListWidgetItem(QIcon(pm), it.key(), pathList);			if (it.key() == info->usedPath)			{				pathList->setCurrentRow(pathList->count()-1);				pathList->currentItem()->setSelected(true);			}		}	}	tabLayout_2->addWidget( pathList );	resetPath = new QPushButton( tr("Don't use any Path"), tab_2);	tabLayout_2->addWidget( resetPath );	propsTab->addTab( tab_2, tr( "Paths" ) );	ExtImagePropsLayout->addWidget( propsTab );	layoutBottom = new QHBoxLayout;	layoutBottom->setMargin(0);	layoutBottom->setSpacing(6);	livePreview = new QCheckBox( this );	livePreview->setText( tr( "Live Preview" ) );	livePreview->setChecked(true);	doPreview = true;	layoutBottom->addWidget( livePreview );	QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );	layoutBottom->addItem( spacer );	okButton = new QPushButton( CommonStrings::tr_OK, this );	layoutBottom->addWidget( okButton );	cancelButton = new QPushButton( CommonStrings::tr_Cancel, this );	cancelButton->setDefault( true );	layoutBottom->addWidget( cancelButton );	ExtImagePropsLayout->addLayout( layoutBottom );	resize(330, 320);	connect(pathList, SIGNAL( itemClicked(QListWidgetItem*) ), this, SLOT( selPath(QListWidgetItem*) ) );	connect(resetPath, SIGNAL(clicked()), this, SLOT(noPath()));	connect(livePreview, SIGNAL(clicked()), this, SLOT(changePreview()));	connect(okButton, SIGNAL(clicked()), this, SLOT(leaveOK()));	connect(cancelButton, SIGNAL(clicked()), this, SLOT(leaveCancel()));	if (info->layerInfo.count() != 0)	{		layerTable->selectionModel()->clearSelection();		opacitySpinBox->setEnabled(false);		blendMode->setEnabled(false);		connect(m_timer, SIGNAL(timeout()), this,  SLOT(changedLayer()));		connect(layerTable, SIGNAL(itemSelectionChanged()), this, SLOT(selLayer()));		connect(opacitySpinBox, SIGNAL(valueChanged(double)), this, SLOT(delayedLayerChange()));		connect(blendMode, SIGNAL(activated(int)), this, SLOT(changedLayer()));	}
开发者ID:Fahad-Alsaidi,项目名称:scribus-svn,代码行数:101,


示例19: QGroupBox

//.........这里部分代码省略.........    layout()->setMargin(2);    QHBoxLayout* topHBox = new QHBoxLayout();    QVBoxLayout* pmVBox1 = new QVBoxLayout();    QVBoxLayout* taVBox3 = new QVBoxLayout();    layout()->addItem(topHBox);    m_plus = new QToolButton(this);    m_plus->setIconSize(QSize(32, 32));    m_plus->setIcon(QIcon(":/edit_add.png"));    pmVBox1->addWidget(m_plus, Qt::AlignVCenter | Qt::AlignLeft);    connect(m_plus, SIGNAL(pressed()), this, SLOT(slotPlusMinus()));    connect(m_plus, SIGNAL(released()), this, SLOT(slotPlusMinus()));    m_minus = new QToolButton(this);    m_minus->setIconSize(QSize(32, 32));    m_minus->setIcon(QIcon(":/edit_remove.png"));    pmVBox1->addWidget(m_minus, Qt::AlignVCenter | Qt::AlignLeft);    connect(m_minus, SIGNAL(pressed()), this, SLOT(slotPlusMinus()));    connect(m_minus, SIGNAL(released()), this, SLOT(slotPlusMinus()));    topHBox->addItem(pmVBox1);    m_dial = new QDial(this);    m_dial->setWrapping(true);    m_dial->setNotchesVisible(true);    m_dial->setNotchTarget(15);    m_dial->setTracking(true);    topHBox->addWidget(m_dial);    connect(m_dial, SIGNAL(valueChanged(int)), this, SLOT(slotDialChanged(int)));    m_tap = new QPushButton(tr("Tap"), this);    m_tap->setStyleSheet(tapDefaultSS);    m_tap->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);    taVBox3->addWidget(m_tap);    connect(m_tap, SIGNAL(clicked()), this, SLOT(slotTapClicked()));    topHBox->addItem (taVBox3);    QHBoxLayout* timeHBox = new QHBoxLayout();    layout()->addItem(timeHBox);    m_hrs = new FocusSpinBox(this);    m_hrs->setRange(0, HRS_MAX);    m_hrs->setSuffix("h");    m_hrs->setButtonSymbols(QSpinBox::NoButtons);    m_hrs->setToolTip(tr("Hours"));    timeHBox->addWidget(m_hrs);    connect(m_hrs, SIGNAL(valueChanged(int)), this, SLOT(slotHoursChanged()));    connect(m_hrs, SIGNAL(focusGained()), this, SLOT(slotSpinFocusGained()));    m_min = new FocusSpinBox(this);    m_min->setRange(0, MIN_MAX);    m_min->setSuffix("m");    m_min->setButtonSymbols(QSpinBox::NoButtons);    m_min->setToolTip(tr("Minutes"));    timeHBox->addWidget(m_min);    connect(m_min, SIGNAL(valueChanged(int)), this, SLOT(slotMinutesChanged()));    connect(m_min, SIGNAL(focusGained()), this, SLOT(slotSpinFocusGained()));    m_sec = new FocusSpinBox(this);    m_sec->setRange(0, SEC_MAX);    m_sec->setSuffix("s");    m_sec->setButtonSymbols(QSpinBox::NoButtons);    m_sec->setToolTip(tr("Seconds"));    timeHBox->addWidget(m_sec);    connect(m_sec, SIGNAL(valueChanged(int)), this, SLOT(slotSecondsChanged()));    connect(m_sec, SIGNAL(focusGained()), this, SLOT(slotSpinFocusGained()));    m_ms = new FocusSpinBox(this);    m_ms->setRange(0, MS_MAX);    m_ms->setSuffix("ms");    m_ms->setButtonSymbols(QSpinBox::NoButtons);    m_ms->setToolTip(tr("Milliseconds"));    timeHBox->addWidget(m_ms);    connect(m_ms, SIGNAL(valueChanged(int)), this, SLOT(slotMSChanged()));    connect(m_ms, SIGNAL(focusGained()), this, SLOT(slotSpinFocusGained()));    m_infiniteCheck = new QCheckBox(this);    m_infiniteCheck->setText(tr("Infinite"));    layout()->addWidget(m_infiniteCheck);    connect(m_infiniteCheck, SIGNAL(toggled(bool)), this, SLOT(slotInfiniteChecked(bool)));    m_focus = m_ms;    m_dial->setRange(m_focus->minimum(), m_focus->maximum());    m_dial->setSingleStep(m_focus->singleStep());    m_timer->setInterval(TIMER_HOLD);    connect(m_timer, SIGNAL(timeout()), this, SLOT(slotPlusMinusTimeout()));    m_tapTickElapseTimer = new QTimer();#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)    m_tapTickElapseTimer->setTimerType(Qt::PreciseTimer);#endif    m_tapTickElapseTimer->setSingleShot(true);    connect(m_tapTickElapseTimer, SIGNAL(timeout()),                this, SLOT(slotTapTimeout()));    //Hide elements according to current visibility mask    setVisibilityMask(m_visibilityMask);}
开发者ID:exmatrikulator,项目名称:qlcplus,代码行数:101,


示例20: GETSTELMODULE

// Initialize the dialog widgets and connect the signals/slotsvoid ExoplanetsDialog::createDialogContent(){	ep = GETSTELMODULE(Exoplanets);	ui->setupUi(dialog);	ui->tabs->setCurrentIndex(0);		connect(&StelApp::getInstance(), SIGNAL(languageChanged()),		this, SLOT(retranslate()));	// Kinetic scrolling	kineticScrollingList << ui->aboutTextBrowser << ui->infoTextBrowser << ui->websitesTextBrowser;	StelGui* gui= dynamic_cast<StelGui*>(StelApp::getInstance().getGui());	if (gui)	{		enableKineticScrolling(gui->getFlagUseKineticScrolling());		connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool)));	}	// Settings tab / updates group	ui->displayAtStartupCheckBox->setChecked(ep->getEnableAtStartup());	connect(ui->displayAtStartupCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setDisplayAtStartupEnabled(int)));	ui->displayModeCheckBox->setChecked(ep->getDisplayMode());	connect(ui->displayModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setDistributionEnabled(int)));	ui->displayShowExoplanetsButton->setChecked(ep->getFlagShowExoplanetsButton());	connect(ui->displayShowExoplanetsButton, SIGNAL(stateChanged(int)), this, SLOT(setDisplayShowExoplanetsButton(int)));	ui->timelineModeCheckBox->setChecked(ep->getTimelineMode());	connect(ui->timelineModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setTimelineEnabled(int)));	ui->habitableModeCheckBox->setChecked(ep->getHabitableMode());	connect(ui->habitableModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setHabitableEnabled(int)));	ui->displayShowDesignationsCheckBox->setChecked(ep->getFlagShowExoplanetsDesignations());	connect(ui->displayShowDesignationsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setDisplayShowExoplanetsDesignations(int)));	connect(ui->internetUpdatesCheckbox, SIGNAL(stateChanged(int)), this, SLOT(setUpdatesEnabled(int)));	connect(ui->updateButton, SIGNAL(clicked()), this, SLOT(updateJSON()));	connect(ep, SIGNAL(updateStateChanged(Exoplanets::UpdateState)), this, SLOT(updateStateReceiver(Exoplanets::UpdateState)));	connect(ep, SIGNAL(jsonUpdateComplete(void)), this, SLOT(updateCompleteReceiver(void)));		connect(ui->updateFrequencySpinBox, SIGNAL(valueChanged(int)), this, SLOT(setUpdateValues(int)));	refreshUpdateValues(); // fetch values for last updated and so on	// if the state didn't change, setUpdatesEnabled will not be called, so we force it	setUpdatesEnabled(ui->internetUpdatesCheckbox->checkState());	connectColorButton(ui->exoplanetMarkerColor,		"Exoplanets.markerColor",    "Exoplanets/exoplanet_marker_color");	connectColorButton(ui->habitableExoplanetMarkerColor,	"Exoplanets.habitableColor", "Exoplanets/habitable_exoplanet_marker_color");	updateTimer = new QTimer(this);	connect(updateTimer, SIGNAL(timeout()), this, SLOT(refreshUpdateValues()));	updateTimer->start(7000);	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));	connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));	connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults()));	connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings()));	connect(ui->plotDiagram, SIGNAL(clicked()), this, SLOT(drawDiagram()));	populateTemperatureScales();	int idx = ui->temperatureScaleComboBox->findData(ep->getCurrentTemperatureScaleKey(), Qt::UserRole, Qt::MatchCaseSensitive);	if (idx==-1)	{		// Use Celsius as default		idx = ui->temperatureScaleComboBox->findData(QVariant("Celsius"), Qt::UserRole, Qt::MatchCaseSensitive);	}	ui->temperatureScaleComboBox->setCurrentIndex(idx);	connect(ui->temperatureScaleComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setTemperatureScale(int)));	// About & Info tabs	setAboutHtml();	setInfoHtml();	setWebsitesHtml();	if(gui!=Q_NULLPTR)	{		ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));		ui->infoTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));		ui->websitesTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));	}	populateDiagramsList();		updateGuiFromSettings();}
开发者ID:Stellarium,项目名称:stellarium,代码行数:78,


示例21: Q_UNUSED

void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ){  Q_UNUSED( itemStyle );  Q_UNUSED( pWidget );  if ( !painter )  {    return;  }  if ( !shouldDrawItem() )  {    return;  }  drawBackground( painter );  painter->save();  //antialiasing on  painter->setRenderHint( QPainter::Antialiasing, true );  double penWidth = hasFrame() ? ( pen().widthF() / 2.0 ) : 0;  double xPenAdjust = mMarginX < 0 ? -penWidth : penWidth;  double yPenAdjust = mMarginY < 0 ? -penWidth : penWidth;  QRectF painterRect( xPenAdjust + mMarginX, yPenAdjust + mMarginY, rect().width() - 2 * xPenAdjust - 2 * mMarginX, rect().height() - 2 * yPenAdjust - 2 * mMarginY );  QString textToDraw = displayText();  if ( mHtmlState )  {    painter->scale( 1.0 / mHtmlUnitsToMM / 10.0, 1.0 / mHtmlUnitsToMM / 10.0 );    QWebPage *webPage = new QWebPage();    webPage->setNetworkAccessManager( QgsNetworkAccessManager::instance() );    //Setup event loop and timeout for rendering html    QEventLoop loop;    QTimer timeoutTimer;    timeoutTimer.setSingleShot( true );    //This makes the background transparent. Found on http://blog.qt.digia.com/blog/2009/06/30/transparent-qwebview-or-qwebpage/    QPalette palette = webPage->palette();    palette.setBrush( QPalette::Base, Qt::transparent );    webPage->setPalette( palette );    //webPage->setAttribute(Qt::WA_OpaquePaintEvent, false); //this does not compile, why ?    webPage->setViewportSize( QSize( painterRect.width() * mHtmlUnitsToMM * 10.0, painterRect.height() * mHtmlUnitsToMM * 10.0 ) );    webPage->mainFrame()->setZoomFactor( 10.0 );    webPage->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );    webPage->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );    // QGIS segfaults when rendering web page while in composer if html    // contains images. So if we are not printing the composition, then    // disable image loading    if ( mComposition->plotStyle() != QgsComposition::Print &&         mComposition->plotStyle() != QgsComposition::Postscript )    {      webPage->settings()->setAttribute( QWebSettings::AutoLoadImages, false );    }    //Connect timeout and webpage loadFinished signals to loop    connect( &timeoutTimer, SIGNAL( timeout() ), &loop, SLOT( quit() ) );    connect( webPage, SIGNAL( loadFinished( bool ) ), &loop, SLOT( quit() ) );    //mHtmlLoaded tracks whether the QWebPage has completed loading    //its html contents, set it initially to false. The loadingHtmlFinished slot will    //set this to true after html is loaded.    mHtmlLoaded = false;    connect( webPage, SIGNAL( loadFinished( bool ) ), SLOT( loadingHtmlFinished( bool ) ) );    webPage->mainFrame()->setHtml( textToDraw );    //For very basic html labels with no external assets, the html load will already be    //complete before we even get a chance to start the QEventLoop. Make sure we check    //this before starting the loop    if ( !mHtmlLoaded )    {      // Start a 20 second timeout in case html loading will never complete      timeoutTimer.start( 20000 );      // Pause until html is loaded      loop.exec();    }    webPage->mainFrame()->render( painter );//DELETE WEBPAGE ?  }  else  {
开发者ID:dakcarto,项目名称:QGIS,代码行数:83,


示例22: QGLWidget

GLWidget::GLWidget(QWidget *parent) :    QGLWidget(parent){    connect(&timer, SIGNAL(timeout()), this, SLOT(updateGL()));    timer.start(16);}
开发者ID:ericvader,项目名称:A-STAR-IHPC-Project,代码行数:6,


示例23: glClear

void GLPlayerWindow::paintGL() {     if (sasdlCtx == NULL) {         glClear(GL_COLOR_BUFFER_BIT);         return;     }     GLenum texture_format;     GLint  nOfColors;     if(SASDL_eof(sasdlCtx)) {          SASDL_stop(sasdlCtx);          connect(timer, SIGNAL(timeout()), this, SLOT(close()));     }     if(SASDL_video_is_stopped(sasdlCtx)) {          glClear(GL_COLOR_BUFFER_BIT);          return;     }     SASDL_draw(sasdlCtx, frame);     nOfColors = frame->format->BytesPerPixel;     if (nOfColors == 4) {          if (frame->format->Rmask == 0x000000ff)               texture_format = GL_RGBA;          else               texture_format = GL_BGRA;     } else if (nOfColors == 3) {          if (frame->format->Rmask == 0x000000ff)               texture_format = GL_RGB;          else               texture_format = GL_BGR;     } else {          std::cerr << "warning: the image is not truecolor... "                    << "this will probably break." << std::endl;          // FIXME: this error should not go unhandled     }     if(textureContainsData) {          glDeleteTextures(1, &texture);     }      glGenTextures(1, &texture);     glBindTexture(GL_TEXTURE_2D, texture);     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);      glTexImage2D(GL_TEXTURE_2D, 0, nOfColors, frame->w, frame->h, 0,                  texture_format, GL_UNSIGNED_BYTE, frame->pixels);     textureContainsData = true;          glBegin(GL_QUADS);     glTexCoord2f(0.0f, 0.0f); glVertex2f(0, this->height());     glTexCoord2f(1.0f, 0.0f); glVertex2f(this->width(), this->height());     glTexCoord2f(1.0f, 1.0f); glVertex2f(this->width(), 0);     glTexCoord2f(0.0f, 1.0f); glVertex2f(0.0f, 0.0f);     glEnd();#ifndef __GLPLAYER__NO__DEBUG__#ifdef __GLPLAYER__DEBUG__CAL__FPS__     // static int64_t prevFrameShowTime = 0;     // std::cout << (double)1000000 / (double)(av_gettime() - prevFrameShowTime) << std::endl;     // prevFrameShowTime = av_gettime();     static int64_t prevFrameShowTime = 0;     static int FPSCalCycleCount = -1;     if(FPSCalCycleCount == -1) {          FPSCalCycleCount = 0;          prevFrameShowTime = av_gettime();     } else if(FPSCalCycleCount == 5) {          // This will also work.          // std::cout << "Yoooooo FPS: " << (float)5000000 / (float)(av_gettime() - prevFrameShowTime)          //           << std::endl;          std::cout << "Current FPS: " << (double)5000000 / (double)(av_gettime() - prevFrameShowTime)                    << std::endl;          FPSCalCycleCount = 0;          prevFrameShowTime = av_gettime();     }     FPSCalCycleCount++;#endif#endif     // FIXME: will paintGL() be called while waiting for the next frame?     SASDL_wait_for_next_frame(sasdlCtx);}
开发者ID:jgfntu,项目名称:glplayer,代码行数:89,


示例24: SLOT

            this, SLOT(onKIdleTimeoutReached(int,int)));    connect(KIdleTime::instance(), SIGNAL(resumingFromIdle()),            this, SLOT(onResumingFromIdle()));    connect(m_activityConsumer, SIGNAL(currentActivityChanged(QString)),            this, SLOT(loadProfile()));    // Set up the policy agent    PowerDevil::PolicyAgent::instance()->init();    // Initialize the action pool, which will also load the needed startup actions.    PowerDevil::ActionPool::instance()->init(this);    // Set up the critical battery timer    m_criticalBatteryTimer->setSingleShot(true);    m_criticalBatteryTimer->setInterval(30000);    connect(m_criticalBatteryTimer, SIGNAL(timeout()), this, SLOT(onCriticalBatteryTimerExpired()));    // In 30 seconds (so we are sure the user sees eventual notifications), check the battery state    QTimer::singleShot(30000, this, SLOT(checkBatteryStatus()));    // All systems up Houston, let's go!    emit coreReady();    refreshStatus();    KActionCollection* actionCollection = new KActionCollection( this );    KAction* globalAction = actionCollection->addAction("Increase Screen Brightness");    globalAction->setText(i18nc("Global shortcut", "Increase Screen Brightness"));    globalAction->setGlobalShortcut(KShortcut(Qt::Key_MonBrightnessUp));    connect(globalAction, SIGNAL(triggered(bool)), SLOT(increaseBrightness()));
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:30,


示例25: QFrame

TurtleFrame::TurtleFrame(QWidget* parent, Qt::WindowFlags f): QFrame(parent, f), path_image_(500, 500, QImage::Format_ARGB32), path_painter_(&path_image_), frame_count_(0), id_counter_(0){  setFixedSize(500, 500);  setWindowTitle("TurtleSim");  srand(time(NULL));  update_timer_ = new QTimer(this);  update_timer_->setInterval(16);  update_timer_->start();  connect(update_timer_, SIGNAL(timeout()), this, SLOT(onUpdate()));  nh_.setParam("background_r", DEFAULT_BG_R);  nh_.setParam("background_g", DEFAULT_BG_G);  nh_.setParam("background_b", DEFAULT_BG_B);  QVector<QString> turtles;  turtles.append("box-turtle.png");  turtles.append("robot-turtle.png");  turtles.append("sea-turtle.png");  turtles.append("diamondback.png");  turtles.append("electric.png");  turtles.append("fuerte.png");  turtles.append("groovy.png");  turtles.append("hydro.svg");  turtles.append("indigo.svg");  turtles.append("jade.png");  QString images_path = (ros::package::getPath("turtlesim") + "/images/").c_str();  for (size_t i = 0; i < turtles.size(); ++i)  {    QImage img;    img.load(images_path + turtles[i]);    turtle_images_.append(img);  }  meter_ = turtle_images_[0].height();  clear();  clear_srv_ = nh_.advertiseService("clear", &TurtleFrame::clearCallback, this);  reset_srv_ = nh_.advertiseService("reset", &TurtleFrame::resetCallback, this);  spawn_srv_ = nh_.advertiseService("spawn", &TurtleFrame::spawnCallback, this);  kill_srv_ = nh_.advertiseService("kill", &TurtleFrame::killCallback, this);  ROS_INFO("Starting turtlesim with node name %s", ros::this_node::getName().c_str()) ;  width_in_meters_ = (width() - 1) / meter_;  height_in_meters_ = (height() - 1) / meter_;  spawnTurtle("", width_in_meters_ / 2.0, height_in_meters_ / 2.0, 0);  // spawn all available turtle types  if(FALSE)  {    for(size_t index = 0; index < turtles.size(); index++)    {      QString name = turtles[index];      name = name.split(".").first();      name.replace(QString("-"), QString(""));      spawnTurtle(name.toStdString(), 1.0 + 1.5 * (index % 7), 1.0 + 1.5 * (index / 7), PI / 2.0, index);    }  }}
开发者ID:ChingHengWang,项目名称:ros_tutorials,代码行数:69,


示例26: mSettings

MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :    mSettings(settings),    mApplications(new ApplicationList(this)),    mTranslation(th),    mLogView(NULL),    mScratchPad(NULL),    mProject(NULL),    mPlatformActions(new QActionGroup(this)),    mCStandardActions(new QActionGroup(this)),    mCppStandardActions(new QActionGroup(this)),    mExiting(false){    mUI.setupUi(this);    mUI.mResults->Initialize(mSettings, mApplications);    mThread = new ThreadHandler(this);    // Filter timer to delay filtering results slightly while typing    mFilterTimer = new QTimer(this);    mFilterTimer->setInterval(500);    mFilterTimer->setSingleShot(true);    connect(mFilterTimer, SIGNAL(timeout()), this, SLOT(FilterResults()));    // "Filter" toolbar    mLineEditFilter = new QLineEdit(mUI.mToolBarFilter);    mLineEditFilter->setPlaceholderText(tr("Quick Filter:"));    mUI.mToolBarFilter->addWidget(mLineEditFilter);    connect(mLineEditFilter, SIGNAL(textChanged(const QString&)), mFilterTimer, SLOT(start()));    connect(mLineEditFilter, SIGNAL(returnPressed()), this, SLOT(FilterResults()));    connect(mUI.mActionPrint, SIGNAL(triggered()), mUI.mResults, SLOT(Print()));    connect(mUI.mActionPrintPreview, SIGNAL(triggered()), mUI.mResults, SLOT(PrintPreview()));    connect(mUI.mActionQuit, SIGNAL(triggered()), this, SLOT(close()));    connect(mUI.mActionCheckFiles, SIGNAL(triggered()), this, SLOT(CheckFiles()));    connect(mUI.mActionCheckDirectory, SIGNAL(triggered()), this, SLOT(CheckDirectory()));    connect(mUI.mActionSettings, SIGNAL(triggered()), this, SLOT(ProgramSettings()));    connect(mUI.mActionClearResults, SIGNAL(triggered()), this, SLOT(ClearResults()));    connect(mUI.mActionOpenXML, SIGNAL(triggered()), this, SLOT(OpenResults()));    connect(mUI.mActionShowStyle, SIGNAL(toggled(bool)), this, SLOT(ShowStyle(bool)));    connect(mUI.mActionShowErrors, SIGNAL(toggled(bool)), this, SLOT(ShowErrors(bool)));    connect(mUI.mActionShowWarnings, SIGNAL(toggled(bool)), this, SLOT(ShowWarnings(bool)));    connect(mUI.mActionShowPortability, SIGNAL(toggled(bool)), this, SLOT(ShowPortability(bool)));    connect(mUI.mActionShowPerformance, SIGNAL(toggled(bool)), this, SLOT(ShowPerformance(bool)));    connect(mUI.mActionShowInformation, SIGNAL(toggled(bool)), this, SLOT(ShowInformation(bool)));    connect(mUI.mActionCheckAll, SIGNAL(triggered()), this, SLOT(CheckAll()));    connect(mUI.mActionUncheckAll, SIGNAL(triggered()), this, SLOT(UncheckAll()));    connect(mUI.mActionCollapseAll, SIGNAL(triggered()), mUI.mResults, SLOT(CollapseAllResults()));    connect(mUI.mActionExpandAll, SIGNAL(triggered()), mUI.mResults, SLOT(ExpandAllResults()));    connect(mUI.mActionShowHidden, SIGNAL(triggered()), mUI.mResults, SLOT(ShowHiddenResults()));    connect(mUI.mActionViewLog, SIGNAL(triggered()), this, SLOT(ShowLogView()));    connect(mUI.mActionViewStats, SIGNAL(triggered()), this, SLOT(ShowStatistics()));    connect(mUI.mActionRecheck, SIGNAL(triggered()), this, SLOT(ReCheck()));    connect(mUI.mActionStop, SIGNAL(triggered()), this, SLOT(StopChecking()));    connect(mUI.mActionSave, SIGNAL(triggered()), this, SLOT(Save()));    // About menu    connect(mUI.mActionAbout, SIGNAL(triggered()), this, SLOT(About()));    connect(mUI.mActionLicense, SIGNAL(triggered()), this, SLOT(ShowLicense()));    // View > Toolbar menu    connect(mUI.mActionToolBarMain, SIGNAL(toggled(bool)), this, SLOT(ToggleMainToolBar()));    connect(mUI.mActionToolBarView, SIGNAL(toggled(bool)), this, SLOT(ToggleViewToolBar()));    connect(mUI.mActionToolBarFilter, SIGNAL(toggled(bool)), this, SLOT(ToggleFilterToolBar()));    connect(mUI.mActionAuthors, SIGNAL(triggered()), this, SLOT(ShowAuthors()));    connect(mThread, SIGNAL(Done()), this, SLOT(CheckDone()));    connect(mUI.mResults, SIGNAL(GotResults()), this, SLOT(ResultsAdded()));    connect(mUI.mResults, SIGNAL(ResultsHidden(bool)), mUI.mActionShowHidden, SLOT(setEnabled(bool)));    connect(mUI.mMenuView, SIGNAL(aboutToShow()), this, SLOT(AboutToShowViewMenu()));    // File menu    connect(mUI.mActionNewProjectFile, SIGNAL(triggered()), this, SLOT(NewProjectFile()));    connect(mUI.mActionOpenProjectFile, SIGNAL(triggered()), this, SLOT(OpenProjectFile()));    connect(mUI.mActionShowScratchpad, SIGNAL(triggered()), this, SLOT(ShowScratchpad()));    connect(mUI.mActionCloseProjectFile, SIGNAL(triggered()), this, SLOT(CloseProjectFile()));    connect(mUI.mActionEditProjectFile, SIGNAL(triggered()), this, SLOT(EditProjectFile()));    connect(mUI.mActionHelpContents, SIGNAL(triggered()), this, SLOT(OpenHelpContents()));    LoadSettings();    mThread->Initialize(mUI.mResults);    FormatAndSetTitle();    EnableCheckButtons(true);    mUI.mActionPrint->setShortcut(QKeySequence::Print);    mUI.mActionPrint->setEnabled(false);    mUI.mActionPrintPreview->setEnabled(false);    mUI.mActionClearResults->setEnabled(false);    mUI.mActionSave->setEnabled(false);    mUI.mActionRecheck->setEnabled(false);    EnableProjectOpenActions(true);    EnableProjectActions(false);    // Must setup MRU menu before CLI param handling as it can load a    // project file and update MRU menu.//.........这里部分代码省略.........
开发者ID:vanliao,项目名称:cppcheck,代码行数:101,


示例27: QTimer

GlobalSettings::GlobalSettings(){  mConfigSyncTimer = new QTimer( this );  mConfigSyncTimer->setSingleShot( true );  connect( mConfigSyncTimer, SIGNAL( timeout() ), this, SLOT( slotSyncNow() ) );}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:6,


示例28: main

int main(int argc, char **argv) {	int y, x;	int oldy, oldx;	int graphy;	int xhalf, graphyx2;	int key;	bool redraw = true;	bool erase = true;	bool changedelay = false;	long timer = 0;	struct timeval tv;	struct iface ifa;	WINDOW *rxgraph, *txgraph, *rxstats, *txstats;	memset(&ifa, 0, sizeof(ifa));	ARGBEGIN {	case 'v':		eprintf("nbwmon-%s/n", VERSION);	case 'C':		colors = false;		break;	case 's':		siunits = true;		break;	case 'm':		minimum = true;		break;	case 'g':		globalmax = true;		break;	case 'd':		delay = estrtod(EARGF(usage()));		break;	case 'i':		strlcpy(ifa.ifname, EARGF(usage()), IFNAMSIZ);		break;	default:		usage();	} ARGEND;	if (!detectiface(ifa.ifname))		eprintf("Can't find network interface/n");	if (!getcounters(ifa.ifname, &ifa.rx, &ifa.tx))		eprintf("Can't read rx and tx bytes for %s/n", ifa.ifname);	initscr();	curs_set(FALSE);	noecho();	timeout(10);	if (colors && has_colors()) {		start_color();		use_default_colors();		init_pair(1, COLOR_GREEN, -1);		init_pair(2, COLOR_RED, -1);	}	getmaxyx(stdscr, y, x);	getmaxyx(stdscr, oldy, oldx);	ifa.rxs = ecalloc(x - 3, sizeof(*ifa.rxs));	ifa.txs = ecalloc(x - 3, sizeof(*ifa.txs));	graphy = (y - 7) / 2;	rxgraph = newwin(graphy, x, 0, 0);	txgraph = newwin(graphy, x, graphy, 0);	rxstats = newwin(y - graphy * 2, x / 2, graphy * 2, 0);	txstats = newwin(y - graphy * 2, x - x / 2, graphy * 2, x / 2);	for (key = ERR; key != 'q'; key = getch()) {		if (key != ERR)			redraw = true;		switch (key) {		case 's':			siunits = !siunits;			break;		case 'm':			minimum = !minimum;			break;		case 'g':			globalmax = !globalmax;			break;		case '+':			if (delay < 8) {				delay *= 2;				changedelay = true;			}			break;		case '-':			if (delay > 0.25) {				delay /= 2;				changedelay = true;			}			break;		}		if (y < 11 || x < 44) {			werase(stdscr);			addstr("terminal too small");			wrefresh(stdscr);			if (key == KEY_RESIZE)//.........这里部分代码省略.........
开发者ID:causes-,项目名称:nbwmon,代码行数:101,



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


C++ timeout_add函数代码示例
C++ timediff函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。