本文整理汇总了C++中QDesignerFormWindowInterface::core方法的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerFormWindowInterface::core方法的具体用法?C++ QDesignerFormWindowInterface::core怎么用?C++ QDesignerFormWindowInterface::core使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDesignerFormWindowInterface
的用法示例。
在下文中一共展示了QDesignerFormWindowInterface::core方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: slotEditSignalsSlots
void PromotionTaskMenu::slotEditSignalsSlots()
{
QDesignerFormWindowInterface *fw = formWindow();
if (!fw)
return;
SignalSlotDialog::editPromotedClass(fw->core(), m_widget, fw);
}
示例3: 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());
}
}
示例4: widgetManaged
void DsgnRibbonStatusBarPlugin::widgetManaged(QWidget* widget)
{
if (widget->metaObject()->className() == QString("Qtitan::RibbonStatusBar"))
{
QDesignerFormWindowInterface* formWindow = static_cast<QDesignerFormWindowInterface *>(sender());
QDesignerFormEditorInterface* core = formWindow->core();
QDesignerContainerExtension* container = qt_extension<QDesignerContainerExtension*>(core->extensionManager(), formWindow->mainContainer());
formWindow->unmanageWidget(widget);
QUndoStack* stack = formWindow->commandHistory();
if (!stack->isClean())
{
//This code check the InsertWidget command on the stack.
const QUndoCommand* command = stack->command(stack->index());
if (command->childCount() == 0)
return;
}
if (qobject_cast<QMainWindow *>(formWindow->mainContainer()) == 0)
{
QMessageBox::critical(
formWindow->mainContainer(),
tr("Can't add Ribbon StatusBar"),
tr("You can add Ribbon StatusBar onto Qtitan::RibbonMainWindow or QMainWindow only."));
widget->deleteLater();
return;
}
for (int i = 0; i < container->count(); ++i)
{
QWidget* w = container->widget(i);
if (w->metaObject()->className() == QString("Qtitan::RibbonStatusBar") ||
w->metaObject()->className() == QString("QStatusBar"))
{
QMessageBox::critical(
formWindow->mainContainer(),
tr("Can't add Ribbon StatusBar"),
tr("Only one instance of the Ribbon StatusBar can be adding to the main form."));
widget->deleteLater();
return;
}
}
container->addWidget(widget);
formWindow->core()->metaDataBase()->add(widget);
}
}
示例5: slotEditPromotedWidgets
void PromotionTaskMenu::slotEditPromotedWidgets()
{
// Global context, show over non-promotable widget
QDesignerFormWindowInterface *fw = formWindow();
if (!fw)
return;
editPromotedWidgets(fw->core(), fw);
}
示例6: slotDemoteFromCustomWidget
void PromotionTaskMenu::slotDemoteFromCustomWidget()
{
QDesignerFormWindowInterface *fw = formWindow();
const PromotionSelectionList promotedWidgets = promotionSelectionList(fw);
Q_ASSERT(!promotedWidgets.empty() && isPromoted(fw->core(), promotedWidgets.front()));
// ### use the undo stack
DemoteFromCustomWidgetCommand *cmd = new DemoteFromCustomWidgetCommand(fw);
cmd->init(promotedWidgets);
fw->commandHistory()->push(cmd);
}
示例7: createButtonGroup
void ButtonGroupCommand::createButtonGroup()
{
if (debugButtonMenu)
qDebug() << "Creating " << m_buttonGroup << " from " << m_buttonList;
QDesignerFormWindowInterface *fw = formWindow();
QDesignerFormEditorInterface *core = fw->core();
core->metaDataBase()->add(m_buttonGroup);
addButtonsToGroup();
// Make button group visible
core->objectInspector()->setFormWindow(fw);
}
示例8: 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.
}
示例9: updatePropertySheet
void QAxWidgetPropertySheet::updatePropertySheet()
{
// refresh the property sheet (we are deleting m_currentProperties)
struct SavedProperties tmp = m_currentProperties;
QDesignerAxWidget *axw = axWidget();
QDesignerFormWindowInterface *formWin = QDesignerFormWindowInterface::findFormWindow(axw);
Q_ASSERT(formWin != 0);
tmp.widget = axw;
tmp.clsid = axw->control();
// Delete the sheets as they cache the meta object and other information
delete this;
delete qt_extension<QDesignerMemberSheetExtension *>(formWin->core()->extensionManager(), axw);
reloadPropertySheet(tmp, formWin);
}
示例10: leaveEditMode
void QDesignerMenuBar::leaveEditMode(LeaveEditMode mode)
{
m_editor->releaseKeyboard();
if (mode == Default)
return;
if (m_editor->text().isEmpty())
return;
QAction *action = 0;
QDesignerFormWindowInterface *fw = formWindow();
Q_ASSERT(fw);
if (m_currentIndex >= 0 && m_currentIndex < realActionCount()) {
action = safeActionAt(m_currentIndex);
fw->beginCommand(QApplication::translate("Command", "Change Title"));
} else {
fw->beginCommand(QApplication::translate("Command", "Insert Menu"));
const QString niceObjectName = ActionEditor::actionTextToName(m_editor->text(), QStringLiteral("menu"));
QMenu *menu = qobject_cast<QMenu*>(fw->core()->widgetFactory()->createWidget(QStringLiteral("QMenu"), this));
fw->core()->widgetFactory()->initialize(menu);
menu->setObjectName(niceObjectName);
menu->setTitle(tr("Menu"));
fw->ensureUniqueObjectName(menu);
action = menu->menuAction();
AddMenuActionCommand *cmd = new AddMenuActionCommand(fw);
cmd->init(action, m_addMenu, this, this);
fw->commandHistory()->push(cmd);
}
SetPropertyCommand *cmd = new SetPropertyCommand(fw);
cmd->init(action, QStringLiteral("text"), m_editor->text());
fw->commandHistory()->push(cmd);
fw->endCommand();
}
示例11: setData
bool ConnectionModel::setData(const QModelIndex &index, const QVariant &data, int)
{
if (!index.isValid() || !m_editor)
return false;
if (data.type() != QVariant::String)
return false;
SignalSlotConnection *con = static_cast<SignalSlotConnection*>(m_editor->connection(index.row()));
QDesignerFormWindowInterface *form = m_editor->formWindow();
QString s = data.toString();
switch (index.column()) {
case 0:
if (!s.isEmpty() && !objectNameList(form).contains(s))
s.clear();
m_editor->setSource(con, s);
break;
case 1:
if (!memberFunctionListContains(form->core(), con->object(CETypes::EndPoint::Source), SignalMember, s))
s.clear();
m_editor->setSignal(con, s);
break;
case 2:
if (!s.isEmpty() && !objectNameList(form).contains(s))
s.clear();
m_editor->setTarget(con, s);
break;
case 3:
if (!memberFunctionListContains(form->core(), con->object(CETypes::EndPoint::Target), SlotMember, s))
s.clear();
m_editor->setSlot(con, s);
break;
}
return true;
}
示例12: apply
bool SetControlCommand::apply(const QString &clsid)
{
if (m_oldClsid == m_newClsid)
return true;
QObject *ext = m_formWindow->core()->extensionManager()->extension(m_axWidget, Q_TYPEID(QDesignerPropertySheetExtension));
QAxWidgetPropertySheet *sheet = qobject_cast<QAxWidgetPropertySheet*>(ext);
if (!sheet)
return false;
const bool hasClsid = !clsid.isEmpty();
const int index = sheet->indexOf(QLatin1String(QAxWidgetPropertySheet::controlPropertyName));
if (hasClsid)
sheet->setProperty(index, clsid);
else
sheet->reset(index);
return true;
}
示例13: slotEditPromoteTo
void PromotionTaskMenu::slotEditPromoteTo()
{
Q_ASSERT(m_widget);
// Check whether invoked over a promotable widget
QDesignerFormWindowInterface *fw = formWindow();
QDesignerFormEditorInterface *core = fw->core();
const QString base_class_name = WidgetFactory::classNameOf(core, m_widget);
Q_ASSERT(QDesignerPromotionDialog::baseClassNames(core->promotion()).contains(base_class_name));
// Show over promotable widget
QString promoteToClassName;
QDialog *promotionEditor = 0;
if (QDesignerLanguageExtension *lang = languageExtension(core))
promotionEditor = lang->createPromotionDialog(core, base_class_name, &promoteToClassName, fw);
if (!promotionEditor)
promotionEditor = new QDesignerPromotionDialog(core, fw, base_class_name, &promoteToClassName);
if (promotionEditor->exec() == QDialog::Accepted && !promoteToClassName.isEmpty()) {
promoteTo(fw, promoteToClassName);
}
delete promotionEditor;
}
示例14: 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);
}
示例15: event
bool DsgnOfficeStyleWidget::event(QEvent* event)
{
bool res = QWidget::event(event);
if (event->type() == QEvent::ParentChange)
{
if (DsgnOfficeStyle* desStyle = dynamic_cast<DsgnOfficeStyle *>(m_targetStyle))
desStyle->setParentStyle(parentWidget());
}
else if (event->type() == QEvent::Hide && isHidden())
{
QDesignerFormWindowInterface* formWindow = QDesignerFormWindowInterface::findFormWindow(parentWidget());
QDesignerFormEditorInterface* core = formWindow->core();
QDesignerContainerExtension* container = qt_extension<QDesignerContainerExtension*>(core->extensionManager(), formWindow->mainContainer());
if (container->widget(container->count() - 1) == this)
{
container->remove(container->count() - 1);
core->metaDataBase()->remove(this);
formWindow->emitSelectionChanged();
}
}
return res;
}