Qt-interest Archive, March 2002
unable set height for popup menu
Message 1 in thread
- Subject: unable set height for popup menu
- From: Ben Hui <bhui@xxxxxxx>
- Date: Thu, 28 Mar 2002 10:20:37 -0500
- Return-receipt-to: Ben Hui <bhui@724.com>
- To: "Qt-Interest (E-mail)" <qt-interest@xxxxxxxxxxxxx>
Hi all,
I have a popup menu, and a QListView inside this popup menu. the problem is
the height of popup menu always longer than that of QListView, making a
space below the QListView. see my code below, I tried setMaximumHeight and
setFixedHeight, neither seem to work, the popup menu just determine the
height by its own mean. how do I make the popup menu just the same height as
the QListView inside??
MemoryList = new QListView( NULL, "popup", 0 );
MemoryList->setMaximumWidth( 180 ); // this works ok
MemoryList->setMaximumHeight( 80 );
QPopupMenu *pMenu = new QPopupMenu( this );
pMenu->setMaximumWidth( 180 );
pMenu->setMaximumHeight( 80 ); // also tried setFixedHeight(..), doesn't
work
pMenu->insertItem( MemoryList );
PopupButton->setPopup( pMenu );
PopupButton->setPopupDelay( 0 );
thanks
ben