Exemple #1
0
void ACEApp::quit_main()
{
    is_quit_ = true;
    if (is_child_)
    {
        quit_child();
    }
    else
    {
        ACE_Reactor::instance()->end_reactor_event_loop();
    }
}
Exemple #2
0
Qt_launchpad::Qt_launchpad(unsigned long initial_quota, QWidget *parent)
    : QMainWindow(parent), Launchpad(initial_quota)
{
	setupUi(this);

	// disable minimize and maximize buttons
	Qt::WindowFlags flags = windowFlags();
	flags &= ((~Qt::WindowMinMaxButtonsHint)|(Qt::WindowStaysOnTopHint));
	setWindowFlags(flags);

	// To trigger lastWindowClosed()
	setAttribute(Qt::WA_QuitOnClose, true);

	launcherDockWidgetContents = new QToolBox();
	// put a QScrollArea into launcherDockWidget for scrolling of launcher entries
  	/*QScrollArea *launcherScrollArea = new QScrollArea;
	launcherScrollArea->setFrameStyle(QFrame::NoFrame);
	launcherScrollArea->setWidget(launcherDockWidgetContents);*/
	launcherDockWidget->setWidget(launcherDockWidgetContents);
	launcherDockWidget->setFont(QFont("OS5",12,QFont::Bold));

	// put a QScrollArea into childrenDockWidget for scrolling of child entries
  	QScrollArea *childrenScrollArea = new QScrollArea;
	childrenScrollArea->setFrameStyle(QFrame::NoFrame);
	childrenScrollArea->setWidget(childrenDockWidgetContents);
	
	childrenDockWidget->setWidget(childrenScrollArea);
	childrenDockWidget->setFont(QFont("OS5",12,QFont::Bold));
	
	QVBoxLayout *childrenDockWidgetLayout = new QVBoxLayout;
	childrenDockWidgetLayout->setContentsMargins(0, 0, 0, 0);
	childrenDockWidgetLayout->setSpacing(0);
	childrenDockWidgetLayout->setAlignment(Qt::AlignTop);
	childrenDockWidgetContents->setLayout(childrenDockWidgetLayout);
	childrenDockWidget->hide();
	statusDockWidget->hide();

	QObject::connect(childrenDockWidget,SIGNAL(topLevelChanged(bool)),this,SLOT(enlarge_childrenDockWg(bool)));
	QObject::connect(statusDockWidget,SIGNAL(topLevelChanged(bool)),this,SLOT(enlarge_statusDockWg(bool)));

	// update the available quota bar every 200ms
	QTimer *avail_quota_timer = new QTimer(this);
	connect(avail_quota_timer, SIGNAL(timeout()), this, SLOT(avail_quota_update()));
	avail_quota_timer->start(200);
	Middle* middle=new Middle();
	QObject::connect(middle,SIGNAL(quit_child()),this,SLOT(close_child()));
	QObject::connect(this,SIGNAL(unlock_child()),middle,SLOT(unlock()));	
	middle->start();
}