本文整理汇总了C++中QDesignerFormWindowInterface::cursor方法的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerFormWindowInterface::cursor方法的具体用法?C++ QDesignerFormWindowInterface::cursor怎么用?C++ QDesignerFormWindowInterface::cursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDesignerFormWindowInterface
的用法示例。
在下文中一共展示了QDesignerFormWindowInterface::cursor方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: formWindow
QList<QAction*> ButtonTaskMenu::taskActions() const
{
ButtonTaskMenu *ncThis = const_cast<ButtonTaskMenu*>(this);
QButtonGroup *buttonGroup = 0;
QDesignerFormWindowInterface *fw = formWindow();
const SelectionType st = selectionType(fw->cursor(), &buttonGroup);
m_groupMenu.initialize(fw, buttonGroup, button());
const bool hasAssignOptions = ncThis->refreshAssignMenu(fw, fw->cursor()->selectedWidgetCount(), st, buttonGroup);
m_assignToGroupSubMenuAction->setVisible(hasAssignOptions);
// add/remove
switch (st) {
case UngroupedButtonSelection:
case OtherSelection:
m_currentGroupSubMenuAction->setVisible(false);
break;
case GroupedButtonSelection:
m_currentGroupSubMenuAction->setText(tr("Button group '%1'").arg(buttonGroup->objectName()));
m_currentGroupSubMenuAction->setVisible(true);
break;
}
return m_taskActions + QDesignerTaskMenu::taskActions();
}
示例2: applyProperties
void TaskMenuExtension::applyProperties(const QString &properties)
{
QDesignerFormWindowInterface *formWindow
= QDesignerFormWindowInterface::findFormWindow(d_widget);
if ( formWindow && formWindow->cursor() )
formWindow->cursor()->setProperty("propertiesDocument", properties);
}
示例3: addToGroup
void ButtonTaskMenu::addToGroup(QAction *a)
{
QButtonGroup *bg = qvariant_cast<QButtonGroup *>(a->data());
Q_ASSERT(bg);
QDesignerFormWindowInterface *fw = formWindow();
const ButtonList bl = buttonList(fw->cursor());
// Do we need to remove the buttons from an existing group?
QUndoCommand *removeCmd = 0;
if (bl.front()->group()) {
removeCmd = createRemoveButtonsCommand(fw, bl);
if (!removeCmd)
return;
}
AddButtonsToGroupCommand *addCmd = new AddButtonsToGroupCommand(fw);
addCmd->init(bl, bg);
QUndoStack *history = fw->commandHistory();
if (removeCmd) {
history->beginMacro(addCmd->text());
history->push(removeCmd);
history->push(addCmd);
history->endMacro();
} else {
history->push(addCmd);
}
}
示例4: createGroup
void ButtonTaskMenu::createGroup()
{
QDesignerFormWindowInterface *fw = formWindow();
const ButtonList bl = buttonList(fw->cursor());
// Do we need to remove the buttons from an existing group?
QUndoCommand *removeCmd = 0;
if (bl.front()->group()) {
removeCmd = createRemoveButtonsCommand(fw, bl);
if (!removeCmd)
return;
}
// Add cmd
CreateButtonGroupCommand *addCmd = new CreateButtonGroupCommand(fw);
if (!addCmd->init(bl)) {
qWarning("** WARNING Failed to initialize CreateButtonGroupCommand!");
delete addCmd;
return;
}
// Need a macro [even if we only have the add command] since the command might trigger additional commands
QUndoStack *history = fw->commandHistory();
history->beginMacro(addCmd->text());
if (removeCmd)
history->push(removeCmd);
history->push(addCmd);
history->endMacro();
}
示例5: formFileBufferChanged
void QtDesignerChild::formFileBufferChanged()
{
QDesignerFormWindowInterface* form = mHostWidget->formWindow();
QRect rect = form->geometry();
rect.moveTopLeft( QPoint() );
form->cursor()->setWidgetProperty( form->mainContainer(), "geometry", rect );
}
示例6: getSelection
void QDesignerIntegrationPrivate::getSelection(Selection &s)
{
QDesignerFormEditorInterface *core = q->core();
// Get multiselection from object inspector
if (QDesignerObjectInspector *designerObjectInspector = qobject_cast<QDesignerObjectInspector *>(core->objectInspector())) {
designerObjectInspector->getSelection(s);
// Action editor puts actions that are not on the form yet
// into the property editor only.
if (s.empty())
if (QObject *object = core->propertyEditor()->object())
s.objects.push_back(object);
} else {
// Just in case someone plugs in an old-style object inspector: Emulate selection
s.clear();
QDesignerFormWindowInterface *formWindow = core->formWindowManager()->activeFormWindow();
if (!formWindow)
return;
QObject *object = core->propertyEditor()->object();
if (object->isWidgetType()) {
QWidget *widget = static_cast<QWidget*>(object);
QDesignerFormWindowCursorInterface *cursor = formWindow->cursor();
if (cursor->isWidgetSelected(widget)) {
s.managed.push_back(widget);
} else {
s.unmanaged.push_back(widget);
}
} else {
s.objects.push_back(object);
}
}
}
示例7: on_buttonBox_accepted
void DoubleButtonDialog::on_buttonBox_accepted()
{
QDesignerFormWindowInterface* formWindow = QDesignerFormWindowInterface::findFormWindow(m_doubleButton);
if (formWindow)
{
formWindow->cursor()->setProperty("ButtonText1", m_doubleButton->buttonText1());
formWindow->cursor()->setProperty("ButtonText2", m_doubleButton->buttonText2());
}
accept();
}
示例8: 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;
}
}
}
示例9: updateSelection
void QDesignerIntegrationPrivate::updateSelection()
{
QDesignerFormEditorInterface *core = q->core();
QDesignerFormWindowInterface *formWindow = core->formWindowManager()->activeFormWindow();
QWidget *selection = 0;
if (formWindow) {
selection = formWindow->cursor()->current();
}
if (QDesignerActionEditorInterface *actionEditor = core->actionEditor())
actionEditor->setFormWindow(formWindow);
if (QDesignerPropertyEditorInterface *propertyEditor = core->propertyEditor())
propertyEditor->setObject(selection);
if (QDesignerObjectInspectorInterface *objectInspector = core->objectInspector())
objectInspector->setFormWindow(formWindow);
}
示例10: removeFromGroup
void ButtonTaskMenu::removeFromGroup()
{
QDesignerFormWindowInterface *fw = formWindow();
if (QUndoCommand *cmd = createRemoveButtonsCommand(fw, buttonList(fw->cursor())))
fw->commandHistory()->push(cmd);
}