Hello. I'm trying to make a widget and a child widget. I'd like Widget2 to be a child of Widget. Would anybody be able to check if I'm doing it right. Thanx
main.cpp:
.......
Widget2::Widget2(Widget* parent): Widget(parent)
{
}
{
}
......
.......
Widget2::Widget2(Widget* parent): Widget(parent)
{
}
Widget::Widget(QWidget* parent): QWidget(parent)
{
}
......
To copy to clipboard, switch view to plain text mode
hfile.h
#ifndef HFILE_H
#define HFILE_H
#include <QtGui>
{
Q_OBJECT
public:
protected:
private:
};
class Widget2 : public Widget
{
Q_OBJECT
public:
protected:
private:
};
#endif
#ifndef HFILE_H
#define HFILE_H
#include <QtGui>
class Widget : public QWidget
{
Q_OBJECT
public:
Widget (QWidget* parent = 0);
protected:
private:
};
class Widget2 : public Widget
{
Q_OBJECT
public:
Widget2 (Widget* QWidget);
protected:
private:
};
#endif
To copy to clipboard, switch view to plain text mode
Bookmarks