DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
Dtk::Quick::DQuickDciIcon类 参考

A dci icon type for qml. 更多...

Public 成员函数

 DQuickDciIcon (const DQuickDciIcon &other)
 
DQuickDciIconoperator= (const DQuickDciIcon &other)
 
bool operator== (const DQuickDciIcon &other) const
 
bool operator!= (const DQuickDciIcon &other) const
 
bool isEmpty () const
 Determine whether the icon data is empty.
 
QString name () const
 
void setName (const QString &name)
 
void resetName ()
 
int width () const
 
void setWidth (int width)
 
void resetWidth ()
 
int height () const
 
void setHeight (int height)
 
void resetHeight ()
 
DQMLGlobalObject::ControlState mode () const
 
void setMode (DQMLGlobalObject::ControlState mode)
 
void resetMode ()
 
DGuiApplicationHelper::ColorType theme () const
 
void setTheme (DTK_GUI_NAMESPACE::DGuiApplicationHelper::ColorType theme)
 
void resetTheme ()
 
DDciIconPalette palette () const
 
void setPalette (const DDciIconPalette &palette)
 
void resetPalette ()
 
const QUrl & source () const
 
void setSource (const QUrl &newSource)
 
void resetSource ()
 
bool fallbackToQIcon () const
 
void setFallbackToQIcon (bool newFallbackToQIcon)
 
void resetFallbackToQIcon ()
 

属性

QString name
 Represents the path of the icon.
 
int width
 Represents the width of the icon.
 
int height
 Represents the height of the icon.
 
DTK_QUICK_NAMESPACE::DQMLGlobalObject::ControlState mode
 Represents the mode of the icon.
 
DTK_GUI_NAMESPACE::DGuiApplicationHelper::ColorType theme
 Represents the theme of the icon.
 
DTK_GUI_NAMESPACE::DDciIconPalette palette
 Represents the palette of the icon.
 
QUrl source
 
bool fallbackToQIcon
 

详细描述

A dci icon type for qml.

\inmodule dtkdeclarative

This is a DCI icon type that can be added to QML. Since controls in QML Quick cannot be inherited individually, we can only inherit some internal controls and internalize them.

It may not show up directly in your help documentation, but you can still use it normally. For example, you can use it in a Button control, such as the code below:

import org.deepin.dtk.controls 1.0 as D
Button {
id: btn
text: "A Button"
icon.name: "button_add"
icon.width: 32
D.DciIcon.type: D.DciIcon.TextType
}

You may need to know about DCI icons. The DCI icon can automatically return the icon you need to display according to the DCI file you provide and the current icon status and icon mode. For example, You might need to highlight a selected icon, All you need to do is provide a DCI file that holds various schema icons and choose to use the Text or Action type, so we can help you with the task of highlighting icons.

注解
If your DCI file does not contain icons under the corresponding Mode, we will render the icons in the Normal Mode you provided to complete the state you want.
警告
Icon type icons will not be rendered in different modes.

成员函数说明

◆ isEmpty()

bool Dtk::Quick::DQuickDciIcon::isEmpty ( ) const

Determine whether the icon data is empty.

返回
Return true if is empty, otherwise return false.

属性说明

◆ name

Dtk::Quick::DQuickDciIcon::name
readwrite

Represents the path of the icon.

Typically,

返回
the path to the DCI file.

该类的文档由以下文件生成: