本文整理汇总了C++中QDesignerFormWindowInterface类的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerFormWindowInterface类的具体用法?C++ QDesignerFormWindowInterface怎么用?C++ QDesignerFormWindowInterface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QDesignerFormWindowInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: formWindow
void PromotionTaskMenu::slotEditSignalsSlots()
{
QDesignerFormWindowInterface *fw = formWindow();
if (!fw)
return;
SignalSlotDialog::editPromotedClass(fw->core(), m_widget, fw);
}
示例2: formFileBufferChanged
void QtDesignerChild::formFileBufferChanged()
{
QDesignerFormWindowInterface* form = mHostWidget->formWindow();
QRect rect = form->geometry();
rect.moveTopLeft( QPoint() );
form->cursor()->setWidgetProperty( form->mainContainer(), "geometry", rect );
}
示例3: fileNameChanged
void MainWindowDsgnPlugin::fileNameChanged(const QString& fileName)
{
if (fileName.isEmpty() && m_mainWindow)
{
QDesignerContainerExtension* c = qt_extension<QDesignerContainerExtension*>(m_core->extensionManager(), m_mainWindow);
QDesignerFormWindowInterface* formWindow = QDesignerFormWindowInterface::findFormWindow(m_mainWindow->parentWidget());
disconnect(formWindow, SIGNAL(fileNameChanged(const QString&)), this, SLOT(fileNameChanged(const QString&)));
if (QWidget* ribbonBar = qobject_cast<QWidget*>(m_core->widgetFactory()->createWidget(QLatin1String("Qtitan::RibbonBar"), m_mainWindow)))
{
m_core->widgetFactory()->initialize(ribbonBar);
c->addWidget(ribbonBar);
m_core->metaDataBase()->add(ribbonBar);
ribbonBar->setObjectName(QLatin1String("ribbonBar"));
formWindow->ensureUniqueObjectName(ribbonBar);
}
if (QWidget* statusBar = m_mainWindow->statusBar())
{
c->addWidget(statusBar);
m_core->metaDataBase()->add(statusBar);
statusBar->setObjectName(QLatin1String("statusBar"));
formWindow->ensureUniqueObjectName(statusBar);
}
if (QWidget* style = m_core->widgetFactory()->createWidget(QLatin1String("Qtitan::RibbonStyle"), m_mainWindow))
{
m_core->widgetFactory()->initialize(style);
c->addWidget(style);
m_core->metaDataBase()->add(style);
style->setObjectName(QLatin1String("ribbonStyle"));
formWindow->ensureUniqueObjectName(style);
}
}
示例4: 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);
}
}
}
示例5: applyProperties
void TaskMenuExtension::applyProperties(const QString &properties)
{
QDesignerFormWindowInterface *formWindow
= QDesignerFormWindowInterface::findFormWindow(d_widget);
if ( formWindow && formWindow->cursor() )
formWindow->cursor()->setProperty("propertiesDocument", properties);
}
示例6: changeOrder
void QStackedWidgetEventFilter::changeOrder()
{
QDesignerFormWindowInterface *fw = QDesignerFormWindowInterface::findFormWindow(stackedWidget());
if (!fw)
return;
const QWidgetList oldPages = qdesigner_internal::OrderDialog::pagesOfContainer(fw->core(), stackedWidget());
const int pageCount = oldPages.size();
if (pageCount < 2)
return;
qdesigner_internal::OrderDialog dlg(fw);
dlg.setPageList(oldPages);
if (dlg.exec() == QDialog::Rejected)
return;
const QWidgetList newPages = dlg.pageList();
if (newPages == oldPages)
return;
fw->beginCommand(tr("Change Page Order"));
for(int i=0; i < pageCount; ++i) {
if (newPages.at(i) == stackedWidget()->widget(i))
continue;
qdesigner_internal::MoveStackedWidgetCommand *cmd = new qdesigner_internal::MoveStackedWidgetCommand(fw);
cmd->init(stackedWidget(), newPages.at(i), i);
fw->commandHistory()->push(cmd);
}
fw->endCommand();
}
示例7: findAction
void QDesignerMenuBar::dropEvent(QDropEvent *event)
{
m_dragging = false;
if (const ActionRepositoryMimeData *d = qobject_cast<const ActionRepositoryMimeData*>(event->mimeData())) {
QAction *action = d->actionList().first();
if (checkAction(action) == AcceptActionDrag) {
event->acceptProposedAction();
int index = findAction(event->pos());
index = qMin(index, actions().count() - 1);
QDesignerFormWindowInterface *fw = formWindow();
InsertActionIntoCommand *cmd = new InsertActionIntoCommand(fw);
cmd->init(this, action, safeActionAt(index));
fw->commandHistory()->push(cmd);
m_currentIndex = index;
update();
adjustIndicator(QPoint(-1, -1));
return;
}
}
event->ignore();
}
示例8: 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();
}
示例9: qDebug
bool FormWindowEditor::open(QString *errorString, const QString &fileName, const QString &realFileName)
{
if (Designer::Constants::Internal::debug)
qDebug() << "FormWindowEditor::open" << fileName;
auto document = qobject_cast<FormWindowFile *>(textDocument());
QDesignerFormWindowInterface *form = document->formWindow();
QTC_ASSERT(form, return false);
if (fileName.isEmpty())
return true;
const QFileInfo fi(fileName);
const QString absfileName = fi.absoluteFilePath();
QString contents;
if (document->read(absfileName, &contents, errorString) != Utils::TextFileFormat::ReadSuccess)
return false;
form->setFileName(absfileName);
const QByteArray contentsBA = contents.toUtf8();
QBuffer str;
str.setData(contentsBA);
str.open(QIODevice::ReadOnly);
if (!form->setContents(&str, errorString))
return false;
form->setDirty(fileName != realFileName);
document->syncXmlFromFormWindow();
document->setFilePath(absfileName);
document->setShouldAutoSave(false);
document->resourceHandler()->updateResources(true);
return true;
}
示例10: formWindow
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);
}
}
示例11: Q_ASSERT
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);
}
}
示例12: QDialog
// -------------------- NewActionDialog
NewActionDialog::NewActionDialog(ActionEditor *parent) :
QDialog(parent, Qt::Sheet),
m_ui(new Ui::NewActionDialog),
m_actionEditor(parent)
{
m_ui->setupUi(this);
m_ui->tooltipEditor->setTextPropertyValidationMode(ValidationRichText);
connect(m_ui->toolTipToolButton, SIGNAL(clicked()), this, SLOT(slotEditToolTip()));
m_ui->keysequenceResetToolButton->setIcon(createIconSet(QStringLiteral("resetproperty.png")));
connect(m_ui->keysequenceResetToolButton, SIGNAL(clicked()), this, SLOT(slotResetKeySequence()));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_ui->editActionText->setFocus();
m_auto_update_object_name = true;
updateButtons();
QDesignerFormWindowInterface *form = parent->formWindow();
m_ui->iconSelector->setFormEditor(form->core());
FormWindowBase *formBase = qobject_cast<FormWindowBase *>(form);
if (formBase) {
m_ui->iconSelector->setPixmapCache(formBase->pixmapCache());
m_ui->iconSelector->setIconCache(formBase->iconCache());
}
}
示例13: formWindow
void ToolBarEventFilter::slotRemoveToolBar()
{
QDesignerFormWindowInterface *fw = formWindow();
Q_ASSERT(fw);
DeleteToolBarCommand *cmd = new DeleteToolBarCommand(fw);
cmd->init(m_toolBar);
fw->commandHistory()->push(cmd);
}
示例14: dlg
void ActionEditor::editAction(QAction *action)
{
if (!action)
return;
NewActionDialog dlg(this);
dlg.setWindowTitle(tr("Edit action"));
ActionData oldActionData;
QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), action);
oldActionData.name = action->objectName();
oldActionData.text = action->text();
oldActionData.toolTip = textPropertyValue(sheet, QLatin1String(toolTipPropertyC));
oldActionData.icon = qvariant_cast<PropertySheetIconValue>(sheet->property(sheet->indexOf(QLatin1String(iconPropertyC))));
oldActionData.keysequence = ActionModel::actionShortCut(sheet);
oldActionData.checkable = action->isCheckable();
dlg.setActionData(oldActionData);
if (!dlg.exec())
return;
// figure out changes and whether to start a macro
const ActionData newActionData = dlg.actionData();
const unsigned changeMask = newActionData.compare(oldActionData);
if (changeMask == 0u)
return;
const bool severalChanges = (changeMask != ActionData::TextChanged) && (changeMask != ActionData::NameChanged)
&& (changeMask != ActionData::ToolTipChanged) && (changeMask != ActionData::IconChanged)
&& (changeMask != ActionData::CheckableChanged) && (changeMask != ActionData::KeysequenceChanged);
QDesignerFormWindowInterface *fw = formWindow();
QUndoStack *undoStack = fw->commandHistory();
if (severalChanges)
fw->beginCommand(QStringLiteral("Edit action"));
if (changeMask & ActionData::NameChanged)
undoStack->push(createTextPropertyCommand(QLatin1String(objectNamePropertyC), newActionData.name, action, fw));
if (changeMask & ActionData::TextChanged)
undoStack->push(createTextPropertyCommand(QLatin1String(textPropertyC), newActionData.text, action, fw));
if (changeMask & ActionData::ToolTipChanged)
undoStack->push(createTextPropertyCommand(QLatin1String(toolTipPropertyC), newActionData.toolTip, action, fw));
if (changeMask & ActionData::IconChanged)
undoStack->push(setIconPropertyCommand(newActionData.icon, action, fw));
if (changeMask & ActionData::CheckableChanged)
undoStack->push(setPropertyCommand(QLatin1String(checkablePropertyC), newActionData.checkable, false, action, fw));
if (changeMask & ActionData::KeysequenceChanged)
undoStack->push(setKeySequencePropertyCommand(newActionData.keysequence, action, fw));
if (severalChanges)
fw->endCommand();
}
示例15: formWindow
void ContainerWidgetTaskMenu::addPageAfter()
{
if (containerExtension()) {
QDesignerFormWindowInterface *fw = formWindow();
AddContainerWidgetPageCommand *cmd = new AddContainerWidgetPageCommand(fw);
cmd->init(m_containerWidget, m_type, AddContainerWidgetPageCommand::InsertAfter);
fw->commandHistory()->push(cmd);
}
}