[Qt-interest] tweaking QStackedWidget

Sean Harmer sean.harmer at maps-technology.com
Mon Nov 23 11:27:39 CET 2009


Hi,

On Monday 23 November 2009 10:18:55 Akshey Jawa wrote:
> I am using QStackedWidget. As shown in the attachment, it is showing small
> arrows to change the pages; but I do not want that. I want the pages to
> change only when the user selects some entry from the combo box. In short,
>  I want to remove the left and right buttons from QStackedWidget. Is it
>  possible?
> I could have tried this using QStackedLayout but that is not available in
> Designer and I would prefer not to spend time in coding the things which
>  can be done in designer.

Those small arrows only appear in Designer as a convenience to you at design 
time for switching between pages. They do not appear in your running 
application.

To change pages in your app just make a connection from QComboBox's 
currentIndexChanged( int ) signal to QStackedWidget's setCurrentIndex( int ) 
slot. Only one line of code - or you could even do it in designer with the 
signal-slot editor.

Have fun,

Sean



More information about the Qt-interest-old mailing list