I want to add a widget in a QTableView by shifting the viewport a bit down. I tried using QAbstractScrollArea::setViewportMargins() in the constructor of QTableView but it doesn't seem to do anything. Any ideas?
Printable View
I want to add a widget in a QTableView by shifting the viewport a bit down. I tried using QAbstractScrollArea::setViewportMargins() in the constructor of QTableView but it doesn't seem to do anything. Any ideas?
just found this:
http://www.qtsoftware.com/developer/...entry&id=94559
so it means i can't change the margins in QTableView?Quote:
Bug Description: setViewportMargins() has no effect on QTableView, when calling this function it does not visual change to the margins for the QTableView widget.
Answer:
QTableView manages the viewport margins itself, this is not something that the user should be able to set.
Have you tried style sheets?
Ya, i am using style sheets but i don't know if by using style sheets i can achieve what i want here.
Does setContentsMargins() and getContentsMargins() and contentsRect() work?
Have you seen if the bug was fixed in newer releases? If not, maybe you can use QTreeView instead?
doesn't seem to be fixed in the newer version too. I am using a workaround for now. Will see if i can use TreeView.