本文整理汇总了C++中QDesignerPropertySheetExtension类的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerPropertySheetExtension类的具体用法?C++ QDesignerPropertySheetExtension怎么用?C++ QDesignerPropertySheetExtension使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QDesignerPropertySheetExtension类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dlg
void ActionEditor::slotNewAction()
{
NewActionDialog dlg(this);
dlg.setWindowTitle(tr("New action"));
if (dlg.exec() == QDialog::Accepted) {
const ActionData actionData = dlg.actionData();
m_actionView->clearSelection();
QAction *action = new QAction(formWindow());
action->setObjectName(actionData.name);
formWindow()->ensureUniqueObjectName(action);
action->setText(actionData.text);
QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), action);
if (!actionData.toolTip.isEmpty())
setInitialProperty(sheet, QLatin1String(toolTipPropertyC), actionData.toolTip);
if (actionData.checkable)
setInitialProperty(sheet, QLatin1String(checkablePropertyC), QVariant(true));
if (!actionData.keysequence.value().isEmpty())
setInitialProperty(sheet, QLatin1String(shortcutPropertyC), QVariant::fromValue(actionData.keysequence));
sheet->setProperty(sheet->indexOf(QLatin1String(iconPropertyC)), QVariant::fromValue(actionData.icon));
AddActionCommand *cmd = new AddActionCommand(formWindow());
cmd->init(action);
formWindow()->commandHistory()->push(cmd);
}
}
示例2: sipAbstractMethod
static PyObject *meth_QDesignerPropertySheetExtension_count(PyObject *sipSelf, PyObject *sipArgs)
{
PyObject *sipParseErr = NULL;
PyObject *sipOrigSelf = sipSelf;
{
QDesignerPropertySheetExtension *sipCpp;
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QDesignerPropertySheetExtension, &sipCpp))
{
int sipRes;
if (!sipOrigSelf)
{
sipAbstractMethod(sipName_QDesignerPropertySheetExtension, sipName_count);
return NULL;
}
Py_BEGIN_ALLOW_THREADS
sipRes = sipCpp->count();
Py_END_ALLOW_THREADS
return SIPLong_FromLong(sipRes);
}
}
开发者ID:ClydeMojura,项目名称:android-python27,代码行数:25,代码来源:sipQtDesignerQDesignerPropertySheetExtension.cpp
示例3: sipAbstractMethod
static PyObject *meth_QDesignerPropertySheetExtension_setChanged(PyObject *sipSelf, PyObject *sipArgs)
{
PyObject *sipParseErr = NULL;
PyObject *sipOrigSelf = sipSelf;
{
int a0;
bool a1;
QDesignerPropertySheetExtension *sipCpp;
if (sipParseArgs(&sipParseErr, sipArgs, "Bib", &sipSelf, sipType_QDesignerPropertySheetExtension, &sipCpp, &a0, &a1))
{
if (!sipOrigSelf)
{
sipAbstractMethod(sipName_QDesignerPropertySheetExtension, sipName_setChanged);
return NULL;
}
sipCpp->setChanged(a0,a1);
Py_INCREF(Py_None);
return Py_None;
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipParseErr, sipName_QDesignerPropertySheetExtension, sipName_setChanged, doc_QDesignerPropertySheetExtension_setChanged);
return NULL;
}
示例4: buddy
static QString buddy(QLabel *label, QDesignerFormEditorInterface *core)
{
QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core->extensionManager(), label);
if (sheet == 0)
return QString();
const int prop_idx = sheet->indexOf(QLatin1String(buddyPropertyC));
if (prop_idx == -1)
return QString();
return sheet->property(prop_idx).toString();
}
示例5: actionShortCut
// shortcut is a fake property, need to retrieve it via property sheet.
static QString actionShortCut(QDesignerFormEditorInterface *core, QAction *action)
{
QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core->extensionManager(), action);
if (!sheet)
return QString();
const int index = sheet->indexOf(QLatin1String("shortcut"));
if (index == -1)
return QString();
const QKeySequence keysequence = qvariant_cast<QKeySequence>(sheet->property(index));
return keysequence.toString();
}
示例6: core
void ActionEditor::manageAction(QAction *action)
{
action->setParent(formWindow()->mainContainer());
core()->metaDataBase()->add(action);
if (action->isSeparator() || action->menu() != 0)
return;
QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), action);
sheet->setChanged(sheet->indexOf(QLatin1String(objectNamePropertyC)), true);
sheet->setChanged(sheet->indexOf(QLatin1String(textPropertyC)), true);
refreshIconPropertyChanged(action, sheet);
m_actionView->setCurrentIndex(m_actionView->model()->addAction(action));
connect(action, SIGNAL(changed()), this, SLOT(slotActionChanged()));
}
示例7: initHeaderProperties
void ItemViewPropertySheet::initHeaderProperties(QHeaderView *hv, const QString &prefix)
{
QDesignerPropertySheetExtension *headerSheet = d->m_propertySheet.value(hv);
Q_ASSERT(headerSheet);
const QString headerGroupS = QLatin1String(headerGroup);
foreach (const QString &realPropertyName, d->realPropertyNames()) {
const int headerIndex = headerSheet->indexOf(realPropertyName);
Q_ASSERT(headerIndex != -1);
const QVariant defaultValue = realPropertyName == QLatin1String(visibleProperty) ?
QVariant(true) : headerSheet->property(headerIndex);
const QString fakePropertyName = d->fakePropertyName(prefix, realPropertyName);
const int fakeIndex = createFakeProperty(fakePropertyName, defaultValue);
d->m_propertyIdMap.insert(fakeIndex, Property(headerSheet, headerIndex));
setAttribute(fakeIndex, true);
setPropertyGroup(fakeIndex, headerGroupS);
}
}
示例8: StyleSheetEditorDialog
// --- StyleSheetPropertyEditorDialog
StyleSheetPropertyEditorDialog::StyleSheetPropertyEditorDialog(QWidget *parent,
QDesignerFormWindowInterface *fw,
QWidget *widget):
StyleSheetEditorDialog(fw->core(), parent),
m_fw(fw),
m_widget(widget)
{
Q_ASSERT(m_fw != 0);
QPushButton *apply = buttonBox()->addButton(QDialogButtonBox::Apply);
QObject::connect(apply, SIGNAL(clicked()), this, SLOT(applyStyleSheet()));
QObject::connect(buttonBox(), SIGNAL(accepted()), this, SLOT(applyStyleSheet()));
QDesignerPropertySheetExtension *sheet =
qt_extension<QDesignerPropertySheetExtension*>(m_fw->core()->extensionManager(), m_widget);
Q_ASSERT(sheet != 0);
setText(sheet->property(sheet->indexOf(QLatin1String(styleSheetProperty))).toString());
}
示例9: reset
bool ItemViewPropertySheet::reset(int index)
{
const FakePropertyMap::iterator it = d->m_propertyIdMap.find(index);
if (it != d->m_propertyIdMap.end()) {
QDesignerPropertySheetExtension *headerSheet = it.value().m_sheet;
const int headerIndex = it.value().m_id;
const bool resetRC = headerSheet->reset(headerIndex);
// Resetting for "visible" might fail and the stored default
// of the Widget database is "false" due to the widget not being
// visible at the time it was determined. Reset to "true" manually.
if (!resetRC && headerSheet->propertyName(headerIndex) == QLatin1String(visibleProperty)) {
headerSheet->setProperty(headerIndex, QVariant(true));
headerSheet->setChanged(headerIndex, false);
return true;
}
return resetRC;
} else {
return QDesignerPropertySheet::reset(index);
}
}
示例10: property
void QtDesignerChild::formGeometryChanged()
{
// set modified state
bool loading = property( "loadingFile" ).toBool();
bool modified = !loading;
// update property
QDesignerPropertySheetExtension* sheet = qt_extension<QDesignerPropertySheetExtension*>( mDesignerManager->core()->extensionManager(), mHostWidget->formWindow() );
QRect geo = sheet->property( sheet->indexOf( "geometry" ) ).toRect();
geo.moveTopLeft( QPoint( 0, 0 ) );
delete sheet;
mDesignerManager->core()->propertyEditor()->setPropertyValue( "geometry", geo, modified );
// update state
mHostWidget->formWindow()->setDirty( modified );
setWindowModified( modified );
setProperty( "loadingFile", false );
// emit modified state
emit modifiedChanged( modified );
emit contentChanged();
}
示例11: slot_QDesignerPropertySheetExtension___len__
static SIP_SSIZE_T slot_QDesignerPropertySheetExtension___len__(PyObject *sipSelf)
{
QDesignerPropertySheetExtension *sipCpp = reinterpret_cast<QDesignerPropertySheetExtension *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QDesignerPropertySheetExtension));
if (!sipCpp)
return 0;
{
{
SIP_SSIZE_T sipRes = 0;
#line 1 "Auto-generated"
sipRes = (SIP_SSIZE_T)sipCpp->count();
#line 908 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\QtDesigner/sipQtDesignerQDesignerPropertySheetExtension.cpp"
return sipRes;
}
}
return 0;
}
示例12: reloadPropertySheet
void QAxWidgetPropertySheet::reloadPropertySheet(const struct SavedProperties &properties, QDesignerFormWindowInterface *formWin)
{
QDesignerFormEditorInterface *core = formWin->core();
//Recreation of the property sheet
QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension *>(core->extensionManager(), properties.widget);
bool foundGeometry = false;
const QString geometryProperty = QLatin1String(geometryPropertyC);
const SavedProperties::NamePropertyMap::const_iterator cend = properties.changedProperties.constEnd();
for (SavedProperties::NamePropertyMap::const_iterator i = properties.changedProperties.constBegin(); i != cend; ++i) {
const QString name = i.key();
const int index = sheet->indexOf(name);
if (index == -1)
continue;
// filter out geometry as this will resize the control
// to is default size even if it is attached to an layout
// but set the changed flag to work around preview bug...
if (name == geometryProperty) {
sheet->setChanged(index, true);
foundGeometry = true;
continue;
}
if (name == QLatin1String(controlPropertyName)) {
sheet->setChanged(index, !i.value().toString().isEmpty());
continue;
}
sheet->setChanged(index, true);
sheet->setProperty(index, i.value());
}
if (!foundGeometry) // Make sure geometry is always changed in Designer
sheet->setChanged(sheet->indexOf(geometryProperty), true);
if (core->propertyEditor()->object() == properties.widget) {
formWin->clearSelection(true);
formWin->selectWidget(properties.widget);
}
}
示例13: markChangedStretchProperties
void LayoutPropertySheet::markChangedStretchProperties(QDesignerFormEditorInterface *core, QLayout *lt, const DomLayout *domLayout)
{
// While the actual values are applied by the form builder, we still need
// to mark them as 'changed'.
QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core->extensionManager(), lt);
Q_ASSERT(sheet);
if (!domLayout->attributeStretch().isEmpty())
sheet->setChanged(sheet->indexOf(QLatin1String(boxStretchPropertyC)), true);
if (!domLayout->attributeRowStretch().isEmpty())
sheet->setChanged(sheet->indexOf(QLatin1String(gridRowStretchPropertyC)), true);
if (!domLayout->attributeColumnStretch().isEmpty())
sheet->setChanged(sheet->indexOf(QLatin1String(gridColumnStretchPropertyC)), true);
if (!domLayout->attributeColumnMinimumWidth().isEmpty())
sheet->setChanged(sheet->indexOf(QLatin1String(gridColumnMinimumWidthPropertyC)), true);
if (!domLayout->attributeRowMinimumHeight().isEmpty())
sheet->setChanged(sheet->indexOf(QLatin1String(gridRowMinimumHeightPropertyC)), true);
}