开发者

How to hide dotted lines in QTreeWidget

开发者 https://www.devze.com 2023-02-04 04:12 出处:网络
Qt. QTreeWidget. How to hide dotted li开发者_StackOverflownes?If this indeed is about the branches (the question is not very clear), then QTreeView (and thus QTreeWidget) has a special function to do

Qt. QTreeWidget. How to hide dotted li开发者_StackOverflownes?


If this indeed is about the branches (the question is not very clear), then QTreeView (and thus QTreeWidget) has a special function to do just that (since Qt 4.2):

treeWidget->setRootIsDecorated(false);


If you're talking about the branch lines on the left of the tree, try setting a stylesheet as such :

treeWidget->setStyleSheet(QString("QTreeView::branch { border-image: none; }"));


What about

treeWidget->setRowHidden(rowNumber,QModelIndex(),true);


Try strecthing the header with;

treeWidget->header()->setStretchLastSection(true);
0

精彩评论

暂无评论...
验证码 换一张
取 消