qtreewidget读取MySQL_QTreeWidget的使用方法及设置列表项不可选和编辑
发布日期:2021-06-24 17:43:48 浏览次数:2 分类:技术文章

本文共 1190 字,大约阅读时间需要 3 分钟。

使用到QTreeWidget做总结,以便下次使用。

QTreeWidget CalibrationWidget = new QTreeWidget;

CalibrationWidget->setColumnCount(2); //将treewidget设置为两列

CalibrationWidget->setColumnWidth(0, 155); //设置指定列宽

CalibrationWidget->setItemsExpandable(true); //设置默认为展开

QStringList m_header;

m_header

QStringList dynamic;

dynamic<

1、删除所有子列表项

QListQTreeWidgetItem::takeChildren() //删除所有子列表项

Removes the list of children and returns it, otherwise returns an empty list.

2、删除指定子列表项

void QTreeWidgetItem::removeChild(QTreeWidgetItem * child) //删除指定子列表项

Removes the given item indicated by child. The removed item will not be deleted.

3、删除指定索引的子列表项

QTreeWidgetItem * QTreeWidgetItem::takeChild(int index) //删除指定索引的子列表项

Removes the item at index and returns it, otherwise return 0.

4、添加子列表项

void QTreeWidgetItem::addChild(QTreeWidgetItem * child) //添加子列表项

Appends the child item to the list of children.

5、添加多条子列表项

void QTreeWidgetItem::addChildren(const QList& children) //添加多条子列表项

Appends the given list of children to the item.

6、设置treewidget字体样式及treewidget头字体样式

QTreeWidget->setFont(QFont("微软雅黑", 12, QFont::Normal, false));

QTreeWidget->headerItem()->setFont(0, QFont("微软雅黑", 12, QFont::Normal, false));//设置treewidget头字体格式

转载地址:https://blog.csdn.net/weixin_34207880/article/details/113996000 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:ubuntu mysql emma_linux ubuntu mysql 管理界面软件 emma 配置 - Lcz
下一篇:sqlanyshere转mysql_( 转 ) mysql复合索引、普通索引总结

发表评论

最新留言

哈哈,博客排版真的漂亮呢~
[***.90.31.176]2024年04月10日 08时58分22秒