void WizardPageChangeWatcher::pageChanged() { /* Use a bit more conservative approach than that for the QTabWidget, * change the selection only if a selected child becomes invisible by * changing the page. */ QWizard *wizard = static_cast<QWizard *>(parent()); QDesignerFormWindowInterface *fw = QDesignerFormWindowInterface::findFormWindow(wizard); if (!fw) return; QDesignerFormWindowCursorInterface *cursor = fw->cursor(); const int selCount = cursor->selectedWidgetCount(); for (int i = 0; i < selCount; i++) { if (!cursor->selectedWidget(i)->isVisible()) { fw->clearSelection(false); fw->selectWidget(wizard, true); break; } } }
void ButtonGroupCommand::breakButtonGroup() { if (debugButtonMenu) qDebug() << "Removing " << m_buttonGroup << " consisting of " << m_buttonList; QDesignerFormWindowInterface *fw = formWindow(); QDesignerFormEditorInterface *core = fw->core(); // Button group was selected, that is, break was invoked via its context menu. Remove it from property editor, select the buttons if (core->propertyEditor()->object() == m_buttonGroup) { fw->clearSelection(false); const ButtonList::const_iterator cend = m_buttonList.constEnd(); for (ButtonList::const_iterator it = m_buttonList.constBegin(); it != cend; ++it) fw->selectWidget(*it, true); } // Now remove and refresh object inspector removeButtonsFromGroup(); // Notify components (for example, signal slot editor) if (qdesigner_internal::FormWindowBase *fwb = qobject_cast<qdesigner_internal::FormWindowBase *>(fw)) fwb->emitObjectRemoved(m_buttonGroup); core->metaDataBase()->remove(m_buttonGroup); core->objectInspector()->setFormWindow(fw); }