本文整理汇总了C++中PropertySheetStringValue::value方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertySheetStringValue::value方法的具体用法?C++ PropertySheetStringValue::value怎么用?C++ PropertySheetStringValue::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertySheetStringValue
的用法示例。
在下文中一共展示了PropertySheetStringValue::value方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: textPropertyValue
// Return the text value of a string property via PropertySheetStringValue
static inline QString textPropertyValue(const QDesignerPropertySheetExtension *sheet, const QString &name)
{
const int index = sheet->indexOf(name);
Q_ASSERT(index != -1);
const PropertySheetStringValue ps = qvariant_cast<PropertySheetStringValue>(sheet->property(index));
return ps.value();
}
示例2: reloadProperties
void FormWindowBase::reloadProperties()
{
pixmapCache()->clear();
iconCache()->clear();
QMapIterator<QDesignerPropertySheet *, QMap<int, bool> > itSheet(m_d->m_reloadableResources);
while (itSheet.hasNext()) {
QDesignerPropertySheet *sheet = itSheet.next().key();
QMapIterator<int, bool> itIndex(itSheet.value());
while (itIndex.hasNext()) {
const int index = itIndex.next().key();
const QVariant newValue = sheet->property(index);
if (qobject_cast<QLabel *>(sheet->object()) && sheet->propertyName(index) == QLatin1String("text")) {
const PropertySheetStringValue newString = qvariant_cast<PropertySheetStringValue>(newValue);
// optimize a bit, reset only if the text value might contain a reference to qt resources
// (however reloading of icons other than taken from resources might not work here)
if (newString.value().contains(QLatin1String(":/"))) {
const QVariant resetValue = QVariant::fromValue(PropertySheetStringValue());
sheet->setProperty(index, resetValue);
}
}
sheet->setProperty(index, newValue);
}
if (QTabWidget *tabWidget = qobject_cast<QTabWidget *>(sheet->object())) {
const int count = tabWidget->count();
const int current = tabWidget->currentIndex();
const QString currentTabIcon = QLatin1String("currentTabIcon");
for (int i = 0; i < count; i++) {
tabWidget->setCurrentIndex(i);
const int index = sheet->indexOf(currentTabIcon);
sheet->setProperty(index, sheet->property(index));
}
tabWidget->setCurrentIndex(current);
} else if (QToolBox *toolBox = qobject_cast<QToolBox *>(sheet->object())) {
const int count = toolBox->count();
const int current = toolBox->currentIndex();
const QString currentItemIcon = QLatin1String("currentItemIcon");
for (int i = 0; i < count; i++) {
toolBox->setCurrentIndex(i);
const int index = sheet->indexOf(currentItemIcon);
sheet->setProperty(index, sheet->property(index));
}
toolBox->setCurrentIndex(current);
}
}
QMapIterator<QDesignerPropertySheet *, QObject *> itSh(m_d->m_reloadablePropertySheets);
while (itSh.hasNext()) {
QObject *object = itSh.next().value();
reloadIconResources(iconCache(), object);
}
}
示例3: 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);
const int index = sheet->indexOf(QLatin1String(styleSheetProperty));
const PropertySheetStringValue value = qVariantValue<PropertySheetStringValue>(sheet->property(index));
setText(value.value());
}