2 questions about QTreeView
-
Hello!
I have 2 questions about QTreeView:
1)How can I change the height of a line (oddly, nothing about it says in the help)
2)How do I remove this artifact by using QSS and the delegate (in 1 column, all items have a delegate)
!http://hostingkartinok.com/uploads/images/2012/03/cb4745a8c0f94e741e857aaf2c09c90e.jpg(1)!
I use this qss code:
@QTreeView::item {
border: 1px solid rgba(108,108,108,75);
border-top-color: transparent;
border-bottom-color: transparent;
border-right-color: transparent;
}QTreeView::item:hover {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgba(231,239,253,200), stop: 1 rgba(203,218,241,200));
}QTreeView::item:selected:active, QTreeView::item:selected:!active{
border-right-color: transparent;
border: 1px solid rgba(108,108,108,128);
color: black;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);
}@
I tried to set the style sheet to delegate and use them widget - it is dont help
Thank you in advance! -
[quote author="Ruzik" date="1331557006"]
1)How can I change the height of a line (oddly, nothing about it says in the help)
[/quote]I think you should override the delegate's virtual method "sizeHint":http://qt-project.org/doc/qt-4.8/qitemdelegate.html#sizeHint.