dima
2nd December 2010, 07:24
I have default application CTest based on QMainWindow.
If I add Qt class dirive from QWidget , do I have to add also UI file for that class ????????????
//Code Not working CTest inherite QWidget
#include "test3.h"
#include <QWidget>
#include "CTest.h"
test3::test3(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
m_pT = new CTest(ui.centralWidget);
m_pT->setStyleSheet("QWidget { background-color: blue; }");
}
//Code working
#include "test3.h"
#include <QWidget>
test3::test3(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
QWidget* pT = new QWidget(ui.centralWidget);
pT->setStyleSheet("QWidget { background-color: blue; }");
}
If I add Qt class dirive from QWidget , do I have to add also UI file for that class ????????????
//Code Not working CTest inherite QWidget
#include "test3.h"
#include <QWidget>
#include "CTest.h"
test3::test3(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
m_pT = new CTest(ui.centralWidget);
m_pT->setStyleSheet("QWidget { background-color: blue; }");
}
//Code working
#include "test3.h"
#include <QWidget>
test3::test3(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
QWidget* pT = new QWidget(ui.centralWidget);
pT->setStyleSheet("QWidget { background-color: blue; }");
}