//----------------------------------------------------------------------------- //! //----------------------------------------------------------------------------- void tApErrorStateWidget::ShowNoAutopilotComputer() { int margin = 15; int spacing = 15; m_pErrorIcon = new QLabel(); m_pErrorIcon->setPixmap(ErrorPixmap()); m_pErrorLabel1 = new QLabel( tr( "No autopilot computer" ) ); m_pErrorLabel1->setWordWrap(true); CreateCloseButton(); QVBoxLayout* vLayout = new QVBoxLayout; vLayout->setContentsMargins( margin, margin, margin, margin ); vLayout->setSpacing( spacing ); QHBoxLayout* hLayout = new QHBoxLayout; hLayout->setContentsMargins( 0, 0, 0, 0 ); hLayout->setSpacing( spacing ); vLayout->addStretch(); hLayout->addWidget( m_pErrorIcon, Qt::AlignLeft ); hLayout->addWidget( m_pErrorLabel1, Qt::AlignTop | Qt::AlignLeft ); vLayout->addLayout( hLayout ); vLayout->addStretch(); vLayout->addWidget( m_pCloseBtn ); setLayout( vLayout ); m_pCloseBtn->setFocus(); m_pUpdateTimer = new QTimer(this); Connect( m_pUpdateTimer, SIGNAL( timeout() ), this, SLOT( CheckHeartbeat() ) ); m_pUpdateTimer->start( 2000 ); }
Action::Action(Database* db) { m_db = db; while(1) { CheckHeartbeat(); sleep(10); } }