1 Attachment(s)
How to obtain the layout of the windows of a tab widget?
Hi all, in my app I have a QTabWidget that conatins 6 windows. Each of these windows is a QListViews of icons (as I show on the image attached). I want to set the margins of each window because as you can see the listwidgets are nearly 'touching' the window and looks bad. I've tried obtaininig the layout of the list widgets with QWidget::layout() but it crashes. Another solution could be inserting the list widgets in a QFrame and setting the margins of the layout of this frame. The problem is that could be useful for me if everytime that I call to QTabWidget::widget(i) it returns directly a QListWidget * not a QFrame *. Anybody knows how could I do it?
Thanks.
Re: How to obtain the layout of the windows of a tab widget?
Have you tried to set viewport margins for the list widget?
QAbstractScrollArea::setViewportMargins()
Re: How to obtain the layout of the windows of a tab widget?
Thanks jpn, but I missed to say that I tried it too but nothing happened. Moreover it's a protected method and I prefer not to subclass QListWidget if it's possible
Re: How to obtain the layout of the windows of a tab widget?
How about QListView::setSpacing() then? It adds space between items too, though..
Re: How to obtain the layout of the windows of a tab widget?
Quote:
Originally Posted by jpn
How about QListView::setSpacing() then? It adds space between items too, though..
Now got it working!!! thanks jpn. I didn't set the spacing because in old versions of Qt when I activate an option of the list (I don't remeber which of one) it disabled the spacing. But now seems like it's fixed :D