QTreeWidget与QTreeView选中后会出现虚线框,也就是焦点。
解决方法一:
QTreeView->setStyleSheet("{outline:0px;}");
QTreeWidget->setStyleSheet("{outline:0px;}");
解决方法二:
QTreeView->setStyleSheet("{outline:none;}");
QTreeWidget->setStyleSheet("{outline:none;}");
解决方法三:
QTreeView->setFocusPolicy(Qt::NoFocus);
QTreeWidget->setFocusPolicy(Qt::NoFocus);
效果: