[Kstars-devel] KDE/kdeedu/kstars/kstars

Jasem Mutlaq mutlaqja at ikarustech.com
Thu Mar 2 09:39:22 CET 2006


>I don't understand this.  The Ui::gui_class is not a
>QObject, so how 
>can you 
>have signal/slot etc. if you inherit only from the
>Ui class?

You can have signals/slots in the class employing the
Ui::gui_class

For example:

class parent_class : public QDialog
{
  parent_class(QWidget *p);
  ....
  Ui::gui_class *ui;

};

parent_class::parent_class(QWidget *p) : QDialog(p)
{
  ui = new Ui::gui_class();
  ui->setupUi(this);

  connect(ui->button, SIGNAL(clicked()), this,
SLOT(foo()));
}

I was wrong when I said don't make it inherit from
QObject, I wanted to say don't inherit it from any
QWidget class because this will lead to layout
problems.

regards,
Jason


More information about the Kstars-devel mailing list