コード例 #1
0
ファイル: app.cpp プロジェクト: Babbsdrebbler/qlcplus
void App::closeEvent(QCloseEvent* e)
{
    /* Accept the close event by default */
    e->accept();

    QListIterator <QMdiSubWindow*> it(
        qobject_cast<QMdiArea*> (centralWidget())->subWindowList());
    while (it.hasNext() == true)
    {
        QLCFixtureEditor* editor;
        QMdiSubWindow* sub;

        sub = it.next();
        Q_ASSERT(sub != NULL);

        editor = static_cast<QLCFixtureEditor*> (sub->widget());
        Q_ASSERT(editor != NULL);

        editor->show();
        editor->setFocus();

        if (editor->close() == false)
        {
            /* Ignore the close event if just one editor refuses */
            e->ignore();
            break;
        }
    }
}
コード例 #2
0
ファイル: app.cpp プロジェクト: speakman/qlc
//
// File -> Exit or Window destroyed
//
void App::closeEvent(QCloseEvent* e)
{
	QLCFixtureEditor* editor = NULL;

	e->accept();

	QWidgetList wl = workspace()->windowList();
	for (unsigned int i = 0; i < wl.count(); i++)
	{
		editor = static_cast<QLCFixtureEditor*> (wl.at(i));
		assert(editor);

		editor->show();
		editor->setFocus();
		if ( !editor->close() )
		{
			e->ignore();
		}
	}
}