- qtgui
- qtdbus
- qtwidgets
- qtcore
- dtkcore
- qsettingbackend_zh
- dobject_zh
- abstractappender_zh
- abstractstringappender_zh
- dfilewatcher_zh
- outputdebugappender_zh
- dsettingsbackend_zh
- drecentmanager_zh
- ddesktopentry_zh
- consoleappender_zh
- gsettingsbackend_zh
- dsettingsgroup_zh
- dlogmanager_zh
- fileappender_zh
- dsettings_zh
- dfilesystemwatcher_zh
- dfilewatchermanager_zh
- dbasefilewatcher_zh
- dtkgui
- dtkwidget
- dviewitemaction_zh
- dstandarditem_zh
- dfiledialog_zh
- dclipeffectwidget_zh
- danchors_zh
- dgraphicsclipeffect_zh
- dstyle_zh
- dcoloredprogressbar_zh
- dbuttonboxbutton_zh
- dlabel_zh
- dtiplabel_zh
- darrowlinedrawer_zh
- daboutdialog_zh
- dsettingswidgetfactory_zh
- dsearchcombobox_zh
- dcrumbedit_zh
- dcommandlinkbutton_zh
- dsettingsdialog_zh
- dwindowoptionbutton_zh
- dspinner_zh
- dsimplelistview_zh
- dwaterprogress_zh
- dmainwindow_zh
- dhidpihelper_zh
- dslider_zh
- dpasswordedit_zh
- danchorinfo_zh
- dmpriscontrol_zh
- darrowbutton_zh
- dbackgroundgroup_zh
- dcircleprogress_zh
- dwarningbutton_zh
- dwindowclosebutton_zh
- dvideowidget_zh
- dfilechooseredit_zh
- dblureffectwidget_zh
- darrowrectangle_zh
- dsearchedit_zh
- dfloatingmessage_zh
- dswitchlineexpand_zh
- dtabbar_zh
- dlineedit_zh
- danchorsbase_zh
- dstylediconengine_zh
- dwindowmaxbutton_zh
- dpageindicator_zh
- dsuggestbutton_zh
- dapplicationsettings_zh
- dtooltip_zh
- dwindowminbutton_zh
- ddrawer_zh
- dtitlebar_zh
- dsimplelistitem_zh
- dpicturesequenceview_zh
dstandarditem_zh
Class::DStandardItem
暂无该属性
Detailed Description
提供标准项 item, 通常用于模型/视图,或模型-代理-视图里面,用以提供标准的 item 控件 UnknownCommand QStandardItem, 和 DViewItemAction (有代码片示例,可重点参考)
DStandardItem::~DStandardItem
~DStandardItem()
析构函数
DStandardItem::setActionList
void setActionList(int edge, const DViewItemActionList &list)
设置 actionList edge 选用数值方向的枚举值, 表示设置 list 是在本对象 DStandardItem 的哪一个区域; edge是相对于 item 的内容区域的,内容区域指的是 item 自身的图标和文字所在区域,也就是通过 setIcon和setText设置的内容的显示区域。 list 许多 actiontem 的集合的 list 列表 See also actionList()
DStandardItem::actionList
DViewItemActionList actionList(int edge) const
获取项 item 的集合列表 list edge edge是相对于 item 的内容区域的,内容区域指的是 item 自身的图标和文字所在区域,也就是通过 setIcon和setText设置的内容的显示区域。 Returns 返回项 item 的集合列表 list See also setActionList()
DStandardItem::setTextActionList
void setTextActionList(const DViewItemActionList &list)
设置项 item 的集合列表 list, 只显示有 text 的 DViewItemActionList 集合 项 item 的集合列表 list, 只显示文字的 item 的集合 一个参考代码片段,使用 :
QMainWindow *wid = new QMainWindow();
wid->resize(800, 600);
//视图和模型
DListView *view = new DListView(wid);
QStandardItemModel *model = new QStandardItemModel(view);
view->setModel(model);
//标准DStandardItem item
DStandardItem *item = new DStandardItem();
item->setText("@1:这是同一个item 的text\n@2:这是同一个item 的text\n@3:这是同一个item 的text\n@4:这是同一个item 的text\n@5:这是同一个item 的text\n@6:这是同一个item 的text");
//DViewItemAction() 的形参: 其参数 alignment = AlignLeft 或 AlignHCenter 或 AlignRight; 设置为 AlignTop, AlignVCenter, AlignBottom 也是无效的
DViewItemAction *act1 = new DViewItemAction(Qt::AlignBottom, QSize(15, 15), QSize(50, 50));
act1->setText("act1");
act1->setIcon(QIcon("/home/yuanyi/Desktop/dog.jpg"));
DViewItemAction *act2 = new DViewItemAction(Qt::AlignVCenter, QSize(15, 15), QSize());
act2->setText("act2");
act2->setIcon(QIcon("/home/yuanyi/Desktop/dog.jpg"));
DViewItemAction *act3 = new DViewItemAction(Qt::AlignTop, QSize(15, 15), QSize(100, 50));
act3->setText("act3");
act3->setIcon(QIcon("/home/yuanyi/Desktop/dog.jpg"));
DViewItemAction *act4 = new DViewItemAction(Qt::AlignBottom, QSize(15, 15), QSize(100, 50));
act4->setText("act4");
act4->setIcon(QIcon("/home/yuanyi/Desktop/dog.jpg"));
DViewItemActionList *list = new DViewItemActionList();
list->append(act1);
list->append(act2);
list->append(act3);
list->append(act4);
item->setTextActionList(*list);
model->appendRow(item);
wid->setCentralWidget(view);
wid->show();
代码片运行效果图:
See also textActionList()
DStandardItem::textActionList
DViewItemActionList textActionList() const
返回 "扩充的文本内容列表" 数据 See also setTextActionList()
DStandardItem::setTextColorRole
void setTextColorRole(int role) See also textColorRole()
DStandardItem::textColorType
int textColorType() const
DStandardItem::textColorRole
int textColorRole() const See also setTextColorRole()
DStandardItem::setBackgroundRole
void setBackgroundRole(int role) See also backgroundRole()
DStandardItem::backgroundType
int backgroundType() const
DStandardItem::backgroundRole
int backgroundRole() const See also setBackgroundRole()
DStandardItem::setFontSize
void setFontSize(int size)
DStandardItem::font
int font() const