当前位置: 首页>>代码示例>>C++>>正文


C++ QDesignerFormWindowInterface::cursor方法代码示例

本文整理汇总了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();
}
开发者ID:phen89,项目名称:rtqt,代码行数:25,代码来源:button_taskmenu.cpp

示例2: applyProperties

void TaskMenuExtension::applyProperties(const QString &properties)
{
    QDesignerFormWindowInterface *formWindow
        = QDesignerFormWindowInterface::findFormWindow(d_widget);
    if ( formWindow && formWindow->cursor() )
        formWindow->cursor()->setProperty("propertiesDocument", properties);
}
开发者ID:copasi,项目名称:copasi-dependencies,代码行数:7,代码来源:qwt_designer_plugin.cpp

示例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);
    }
}
开发者ID:phen89,项目名称:rtqt,代码行数:27,代码来源:button_taskmenu.cpp

示例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();
}
开发者ID:phen89,项目名称:rtqt,代码行数:26,代码来源:button_taskmenu.cpp

示例5: formFileBufferChanged

void QtDesignerChild::formFileBufferChanged()
{
    QDesignerFormWindowInterface* form = mHostWidget->formWindow();
    QRect rect = form->geometry();
    rect.moveTopLeft( QPoint() );
    form->cursor()->setWidgetProperty( form->mainContainer(), "geometry", rect );
}
开发者ID:pasnox,项目名称:monkeystudio2,代码行数:7,代码来源:QtDesignerChild.cpp

示例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);
        }
    }
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:33,代码来源:abstractintegration.cpp

示例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();
}
开发者ID:Ulle84,项目名称:UllesSourceCode,代码行数:12,代码来源:DoubleButtonDialog.cpp

示例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;
        }
    }
}
开发者ID:maxxant,项目名称:qt,代码行数:19,代码来源:widgetfactory.cpp

示例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);

}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:20,代码来源:abstractintegration.cpp

示例10: removeFromGroup

void ButtonTaskMenu::removeFromGroup()
{
    QDesignerFormWindowInterface *fw = formWindow();
    if (QUndoCommand *cmd = createRemoveButtonsCommand(fw, buttonList(fw->cursor())))
        fw->commandHistory()->push(cmd);
}
开发者ID:phen89,项目名称:rtqt,代码行数:6,代码来源:button_taskmenu.cpp


注:本文中的QDesignerFormWindowInterface::cursor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。