本文整理汇总了C++中QDesignerFormWindowInterface::clearSelection方法的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerFormWindowInterface::clearSelection方法的具体用法?C++ QDesignerFormWindowInterface::clearSelection怎么用?C++ QDesignerFormWindowInterface::clearSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDesignerFormWindowInterface
的用法示例。
在下文中一共展示了QDesignerFormWindowInterface::clearSelection方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotCurrentItemChanged
void ActionEditor::slotCurrentItemChanged(QAction *action)
{
QDesignerFormWindowInterface *fw = formWindow();
if (!fw)
return;
const bool hasCurrentAction = action != 0;
m_actionEdit->setEnabled(hasCurrentAction);
if (!action) {
fw->clearSelection();
return;
}
QDesignerObjectInspector *oi = qobject_cast<QDesignerObjectInspector *>(core()->objectInspector());
if (action->associatedWidgets().empty()) {
// Special case: action not in object tree. Deselect all and set in property editor
fw->clearSelection(false);
if (oi)
oi->clearSelection();
core()->propertyEditor()->setObject(action);
} else {
if (oi)
oi->selectObject(action);
}
}
示例2: pageChanged
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;
}
}
}
示例3: breakButtonGroup
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);
}
示例4: filterEvent
bool DesignerStyleInput::filterEvent(const QEvent* event)
{
if (event->type()== QEvent::MouseButtonPress)
{
QMouseEvent* me = (QMouseEvent *)event;
if (me->button() == Qt::LeftButton)
{
QDesignerFormWindowInterface* formWindow = QDesignerFormWindowInterface::findFormWindow(m_widget);
formWindow->clearSelection(false);
formWindow->core()->propertyEditor()->setObject(m_widget);
formWindow->core()->propertyEditor()->setEnabled(true);
return true;
}
else if (me->button() == Qt::RightButton)
{
QList<QAction *> actions;
actions.append(m_actRemoveStyle);
QMenu::exec(actions, QCursor::pos());
return true;
}
}
return true; // Handle all input context events here.
}