Qt-interest Archive, January 2007
Sizing a ListView
Message 1 in thread
I have never had 100% success with layouts, so I am a bit stuck with
this one. I have a simple dialog with 3 buttons and a listview, the
listview dominates the dialog. The number of items in the listview is
variable, so sometimes it has only a few items, other times it is big
with scroll bars. When big, the dialog remains a certain size and the
listView expands itself and pushes the buttons off the bottom of the
dialog. right now I have everything enclosed in a matrix layout, two
HSpacers inserted to make the width of the listView line up OK with the
buttons on the bottom.
How do I make the dialog resize with the ListView?
Thanks, I am sure this is simple.
--
[ signature omitted ]
Message 2 in thread
> I have never had 100% success with layouts, so I am a bit
> stuck with this one. I have a simple dialog with 3 buttons
> and a listview, the listview dominates the dialog. The number
> of items in the listview is variable, so sometimes it has
> only a few items, other times it is big with scroll bars.
> When big, the dialog remains a certain size and the listView
> expands itself and pushes the buttons off the bottom of the
> dialog. right now I have everything enclosed in a matrix
> layout, two HSpacers inserted to make the width of the
> listView line up OK with the buttons on the bottom.
>
> How do I make the dialog resize with the ListView?
Do you have any specific reason to resize the dialog? Ideally it should
be that if 1000s of items are added it should have a scroll bar.
If you set the minimumSize and maximumSize property of List View it wont
grow any further than that.
>
> Thanks, I am sure this is simple.
>
> --
> To unsubscribe - send a mail to
> qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the
> subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
--
[ signature omitted ]
Message 3 in thread
Jaya Meghani wrote:
>> I have never had 100% success with layouts, so I am a bit
>> stuck with this one. I have a simple dialog with 3 buttons
>> and a listview, the listview dominates the dialog. The number
>> of items in the listview is variable, so sometimes it has
>> only a few items, other times it is big with scroll bars.
>> When big, the dialog remains a certain size and the listView
>> expands itself and pushes the buttons off the bottom of the
>> dialog. right now I have everything enclosed in a matrix
>> layout, two HSpacers inserted to make the width of the
>> listView line up OK with the buttons on the bottom.
>>
>> How do I make the dialog resize with the ListView?
> Do you have any specific reason to resize the dialog? Ideally it should
> be that if 1000s of items are added it should have a scroll bar.
> If you set the minimumSize and maximumSize property of List View it wont
> grow any further than that.
>> Thanks, I am sure this is simple.
>>
>> --
>> To unsubscribe - send a mail to
>> qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the
>> subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
Thanks for advice, it seemed like the max size was OK in the designer,
but wasnt behaving right when the app ran. I just discovered that a
dialog has its own layout, using that instead of a new layout seemed to
work better. The problem was that the list box grew so big that it
forced the other buttons off the dialog. Using the dialog's layout fixed
that, everybody stays on.
--
[ signature omitted ]