mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Issue #77 Methods to convert icons to QVariant
Needed so propertyindex methods don't need to depend on CVariant.
This commit is contained in:
@@ -96,4 +96,14 @@ namespace BlackMisc
|
||||
Q_ASSERT_X(index >= 0 && index < CIconList::allIcons().size(), "iconForIndex", "wrong index");
|
||||
return CIconList::allIcons()[index];
|
||||
}
|
||||
|
||||
// CIcons methods defined here to circumvent cyclic dependency
|
||||
QVariant CIcons::toVariant(IconIndex icon)
|
||||
{
|
||||
return QVariant::fromValue(CIcon(icon));
|
||||
}
|
||||
QVariant CIcons::toVariantPixmap(IconIndex icon)
|
||||
{
|
||||
return QVariant::fromValue(CIcon(icon).toPixmap());
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user