Qt-interest Archive, January 2007
Why QListWidget does not response to ResizeMode::Adjust until an initial click?
Message 1 in thread
Hi, all,
I found a new created QListWidget does not response to
ResizeMode::Adjust during resizing the width of the widget.
But if you give an initial click on any list item before resizing the
window, then, the Adjust mode works well.
Does anyone know why the initial click is necessary to make the Adjust
mode work?
You can test this in Qt’s example program at:
C:\Qt\4.1.1\examples\draganddrop\puzzle
By adding one line of code in
PiecesList::PiecesList(QWidget *parent)
: QListWidget(parent)
{
. . .
setResizeMode(QListView::ResizeMode::Adjust); // add this line
}
BTY, this is not caused by loosing focus. You can set focus by:
piecesList->setCurrentRow(0);
but it won’t help.
Thanks,
Lingfa
--
[ signature omitted ]
Message 2 in thread
On 23.01.07 14:10:14, lingfa wrote:
> I found a new created QListWidget does not response to ResizeMode::Adjust
> during resizing the width of the widget.
> But if you give an initial click on any list item before resizing the window,
> then, the Adjust mode works well.
>
> Does anyone know why the initial click is necessary to make the Adjust mode
> work?
>
> You can test this in Qtâs example program at:
> C:\Qt\4.1.1\examples\draganddrop\puzzle
Sounds like a bug in Qt4, upgrade to a newer version, I don't see any
unexpected behaviour with Qt4.2.2 here.
Andreas
--
[ signature omitted ]