PDA

View Full Version : Qtcreatore : UI



shenakan
18th August 2009, 10:26
I create a new widget to display roadmaps. there is a way to add this widget to the UI designer. For the moment, I have just added direclty in my code.


#ifndef QMAPS_H
#define QMAPS_H

#include <QWidget>
#include <QtGui>

class QMaps : public QWidget{
Q_OBJECT

public:
QMaps(QWidget *parent = 0);
QSize sizeHint() const;
QSize minimumSizeHint() const;

protected:
void paintEvent(QPaintEvent *event);

private:

};

#endif // QMAPS_H




MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindowClass)
{
ui->setupUi(this);
qout=new QDebugStream(std::cout, ui->textBox);
qmaps=new QMaps(this);
qmaps->show();
}

yogeshgokul
18th August 2009, 11:05
Yes you can do it.
See this (http://doc.trolltech.com/4.5/designer-creating-custom-widgets.html).