PDA

View Full Version : How to widget....



hgedek
30th July 2007, 13:16
I have a stackedWidget.Each page is designed by designer and I need to write functions for this pages?.I tried to write new classes which each of them is for one of this pages.But I couldnt combine?

How can I do?

marcel
30th July 2007, 13:24
So you want to add widgets to these pages?
Also you will need something to switch between the pages.

Widgets can be added with QStackedWidget::addWidget or QStackedWidget::insterWidget.

Also, you can switch between the pages with QStackedWidget::setCurrentIndex.



I tried to write new classes which each of them is for one of this pages

You should write custom widgets only if you need them. Otherwise use the existing widgets and layouts.

Why don't you tell us exactly what you want to do? Maybe we can help you.

Regards

hgedek
30th July 2007, 13:32
Thanks.
I will explain by example.
I created a widget(has buttons etc) and put this to page1 using designer.Now I need some functions for using this widgets items.So question is this:How can I add these functions to this widget?
(Lets think this so:We created this widget not designer and while creating we added functions as public or private.I want to do this?)

marcel
30th July 2007, 13:52
Can you post the code?

You usually access the widgets through the UI object in your class or directly, depending how you used the UI class generated by designer for the window/dialog: subclassed it or added it as a member.

Regards