qt - Init QListWidget to show its all content (with no scroll bars) -


i playing config dialog example, fine. changed in right part of dialog. found contentswidget (qlistwidget) in left part of dialog became smaller , showed scroll bars (both horizontal , vertical).

i want qlistwidget show content no scroll bars needed. items added @ beginning , fixed. no dynamic. guess there method let qlistwidget expand show content @ beginning.

could me , tell me magic word?

here code:

contentswidget = new qlistwidget; contentswidget->setviewmode(qlistview::iconmode); contentswidget->seticonsize(qsize(96, 84)); contentswidget->setmovement(qlistview::static); contentswidget->setmaximumwidth(128); contentswidget->setspacing(12); //contentswidget->setminimumwidth(contentswidget->sizehintforcolumn(0)); //contentswidget->setmaximumwidth(contentswidget->sizehintforcolumn(0)); //contentswidget->adjustsize(); //qdebug()<<contentswidget->sizehintforcolumn(0); createicons(); contentswidget->setcurrentrow(0);  qhboxlayout *horizontallayout = new qhboxlayout; horizontallayout->addwidget(contentswidget); horizontallayout->addwidget(pageswidget, 1); 

i tried contentswidget->sizehintforcolumn(0), didn't work. 0. tried other methods nothing worked.

i think should try:

contentswidget->setminimumwidth(128); 

this ensure no matters what, size of contentswidget @ least 128, hence large enough contains icons.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -