本文整理汇总了C++中QtProperty::propertyManager方法的典型用法代码示例。如果您正苦于以下问题:C++ QtProperty::propertyManager方法的具体用法?C++ QtProperty::propertyManager怎么用?C++ QtProperty::propertyManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QtProperty
的用法示例。
在下文中一共展示了QtProperty::propertyManager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fitContextMenu
void IqtFit::fitContextMenu(const QPoint &) {
QtBrowserItem *item(NULL);
item = m_ffTree->currentItem();
if (!item)
return;
// is it a fit property ?
QtProperty *prop = item->property();
// is it already fixed?
bool fixed = prop->propertyManager() != m_dblManager;
if (fixed && prop->propertyManager() != m_stringManager)
return;
// Create the menu
QMenu *menu = new QMenu("IqtFit", m_ffTree);
QAction *action;
if (!fixed) {
action = new QAction("Fix", m_parentWidget);
connect(action, SIGNAL(triggered()), this, SLOT(fixItem()));
} else {
action = new QAction("Remove Fix", m_parentWidget);
connect(action, SIGNAL(triggered()), this, SLOT(unFixItem()));
}
menu->addAction(action);
// Show the menu
menu->popup(QCursor::pos());
}
示例2: EditorDestroyed
void LineEditPropertyFactory::EditorDestroyed(QObject *object)
{
QMap<QLineEdit*, QtProperty*>::ConstIterator iter = editorToProperty_.constBegin();
while (iter != editorToProperty_.constEnd())
{
if (iter.key() == object)
{
QLineEdit *editor = iter.key();
QtProperty *property = iter.value();
QtStringPropertyManager *stringManager = qobject_cast<QtStringPropertyManager*>(property->propertyManager());
if(stringManager)
stringManager->setValue(property, iter.key()->text());
editorToProperty_.remove(editor);
propertyToEditor_.remove(property);
int size = editorToProperty_.size();
size = propertyToEditor_.size();
break;
}
iter++;
}
}