PDA

View Full Version : Two bugs in Qt



Chiz
29th December 2010, 09:18
QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
frame->setSizePolicy(sizePolicy);

then frame will resize on MAXIMUM area.

If
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);

then frame will resize on MINIMUM area.

How can programmers miss such thing, I don't understand :mad:

Another one.

if write such code:

contentListView->setFlow(QListView::TopToBottom);
then icons or another items will flow from LEFT to RIGHT
and if

menuListView->setFlow(QListView::LeftToRight);
then from TOP to BOTTOM.


Please, tell me, why I have such a problem?
I'm using Windows XP SP3, Eclipse and last sdk. What else info need? I can provide anything.

fullmetalcoder
31st December 2010, 12:42
From QSizePolicy docs :

QSizePolicy::Minimum GrowFlag The sizeHint() is minimal, and sufficient. The widget can be expanded, but there is no advantage to it being larger (e.g. the horizontal direction of a push button). It cannot be smaller than the size provided by sizeHint().

QSizePolicy::Maximum ShrinkFlag The sizeHint() is a maximum. The widget can be shrunk any amount without detriment if other widgets need the space (e.g. a separator line). It cannot be larger than the size provided by sizeHint().In other words a Maximum size policy will incite layouts to shrink the widget to accomodate neighbours that want more space and a Minimum size policy has the reverse effect (trying to reclaim space from neighbours). You may be confused by the names but there is no bug in Qt.

I did not check the list view flow issue but I'm reasonably sure if it was an actual bug and not just a misunderstanding on your part (or a blatant failure to read the docs) it would have been reported by now. By the way, the best way to get bugs fixed, if you do find some, is to file a bug report (http://bugreports.qt.nokia.com) instead of bitching on the forums.

wysota
31st December 2010, 15:28
How can programmers miss such thing, I don't understand :mad:

Please, tell me, why I have such a problem?
I'm using Windows XP SP3, Eclipse and last sdk. What else info need? I can provide anything.
It is not enough to say you found a bug in some property just by arbitrary changing that property value because the final behaviour depends on the whole environment. As you were already shown, result of using Maximum and Minimum size policies depends on other widgets present (and visible) in the window. The same goes with your other "bug". The flow depends on things such as the wrapping property and a couple of other things.

Chiz
10th January 2011, 07:47
I understand. Thanks!