Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, December 2007
Qt button bug ?


Message 1 in thread

This code:

    playButton = new QToolButton( this );
    playButton->setText( qtr( "&Play" ) );
    playButton->setSizePolicy( buttonSizePolicy );
    playButton->setMinimumSize( QSize(90, 0) );
    playButton->setPopupMode( QToolButton::MenuButtonPopup );
    playButton->setToolButtonStyle( Qt::ToolButtonTextOnly );

seems to work perfectly on linux:
http://people.videolan.org/~jb/VLC-Screenshots/VLC-Qt-bug.jpeg
but not on windows:
http://people.videolan.org/~jb/VLC-Screenshots/VLC-0.9.0-Vista2.jpeg
where the play button is flatten....

Is it a bug ? A misinterpretation of the doc? A bug in my code?

Code here
http://trac.videolan.org/vlc/browser/trunk/modules/gui/qt4/dialogs/open.cpp

Best Regards,

-- 
 [ signature omitted ] 

Message 2 in thread

Jean-Baptiste Kempf wrote:
> This code:
> 
>     playButton = new QToolButton( this );
>     playButton->setText( qtr( "&Play" ) );
>     playButton->setSizePolicy( buttonSizePolicy );
>     playButton->setMinimumSize( QSize(90, 0) );
>     playButton->setPopupMode( QToolButton::MenuButtonPopup );
>     playButton->setToolButtonStyle( Qt::ToolButtonTextOnly );
> 
> seems to work perfectly on linux:
> http://people.videolan.org/~jb/VLC-Screenshots/VLC-Qt-bug.jpeg
> but not on windows:
> http://people.videolan.org/~jb/VLC-Screenshots/VLC-0.9.0-Vista2.jpeg
> where the play button is flatten....
> 
> Is it a bug ? A misinterpretation of the doc? A bug in my code?

Make it a QPushButton instead. On Windows, QToolButtons are "flat" (ie. 
no 3D border) by default.

-- 
 [ signature omitted ] 

Message 3 in thread

On Wed, Dec 19, 2007, Paul Miller wrote :
> Jean-Baptiste Kempf wrote:
> >This code:
> >
> >    playButton = new QToolButton( this );
> >    playButton->setText( qtr( "&Play" ) );
> >    playButton->setSizePolicy( buttonSizePolicy );
> >    playButton->setMinimumSize( QSize(90, 0) );
> >    playButton->setPopupMode( QToolButton::MenuButtonPopup );
> >    playButton->setToolButtonStyle( Qt::ToolButtonTextOnly );
> >
> >seems to work perfectly on linux:
> >http://people.videolan.org/~jb/VLC-Screenshots/VLC-Qt-bug.jpeg
> >but not on windows:
> >http://people.videolan.org/~jb/VLC-Screenshots/VLC-0.9.0-Vista2.jpeg
> >where the play button is flatten....
> >
> >Is it a bug ? A misinterpretation of the doc? A bug in my code?
> 
> Make it a QPushButton instead. On Windows, QToolButtons are "flat" (ie. 
> no 3D border) by default.

Yes, but I would miss the menu part of the button:

- in a QToolbutton, the menu is on the side, which make your click on
  the
button activate the default action.
- in a QPushButton, when you click, it shows the menu.

This is different and a lot different from a user point of view.

Best Regards,

-- 
 [ signature omitted ]