PDA

View Full Version : How to use widgets of other ui within a class???



sinha.ashish
10th April 2008, 08:35
I have a class and its associated GUI now i want to use another GUI and want to access all the widgets of that GUI within that class. please help me to do so.....!!!!!!

Details are:

Forms
-------
vista.ui
vod.ui name of dialog object is vod

Headers
---------
vista.h
ui_vista.h
ui_vod.h

Sources
----------
vista.cpp
main.cpp


/*CODE of vista .cpp*/

#include "vista.h"
#include "ui_vod.h"
VistaMedia::VistaMedia(QString uname, QWidget *parent):QDialog(parent)
{
setupUi(this);
Ui_vod *adform=new Ui_vod;
adform->show();
}

i got error that adform has no member named "show"
any tricks???????

Lykurg
10th April 2008, 15:30
Hi,

did you recognize the code-blocks in the editor and the designer manual "Using a Component in Your Application" (http://doc.trolltech.com/4.4rc1/designer-using-a-component.html)?

QWidget *widget = new QWidget;
Ui::CalculatorForm ui;
ui.setupUi(widget);
widget->show();

Just customize to your needs.

Lykurg