关键字:QTreeWidget、setData、数据结构
1、在QTreeWidget控件的编程过程中,常用的用户需求是增加右键点击菜单,比如代码如下;
void MainWindow::initPage()
{
mAddEquip = new QAction(this);
mAddEquip->setText("新增设备");
connect(mAddEquip,SIGNAL(triggered()),this,SLOT(AddEquip()));
mUpdateEquip = new QAction(this);
mUpdateEquip->setText("修改设备");
connect(mUpdateEquip,SIGNAL(triggered()),this,SLOT(UpdateEquip()));
mDelEquip = new QAction(this);
mDelEquip->setText("删除设备");
connect(mDelEquip,SIGNAL(triggered()),this,SLOT(DelEquip()));
mAddChannel = new QAction(this);
mAddChannel->setText("新增通道");
connect(mAddChannel,SIGNAL(triggered()),this,SLOT(AddChannel()));
mUpdateChannel = new QAction(this);
mUpdateChannel->setText("修改通道");
connect(mUpdateChannel,SIGNAL(triggere
七、QTreeWidget的右键点击菜单及节点包含数据结构
最新推荐文章于 2024-04-25 15:33:38 发布