Пример #1
0
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
//
// 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();
		}
	}
}