PDA

View Full Version : Inherit from QTabWidget



Suncell
27th June 2010, 21:15
Hi, I want to add some code to addTab. Therefore I tried to build an inherit class of QTabWidget. What am I doing wrong?
Thx -,
Chris

test.h



#ifndef TEST_H
#define TEST_H

#include <QtGui/QTabWidget>


class CTest : public QTabWidget
{
Q_OBJECT

public:
CTest(QWidget* parent = 0);
~CTest();

int addTab(QWidget* , const QString& );

};

#endif // TEST_H


test.cpp


#include "test.h"

#include <QtGui>

CTest::CTest(QWidget* parent)
: QTabWidget(parent)
{

}

CTest::~CTest()
{

}

int CTest::addTab(QWidget* page, const QString& label)
{
//some aditional code

return QTabWidget::addTab(page, label);
}

Zlatomir
27th June 2010, 22:01
Post more details about the problem, it's a compile error? a run-time one? some functionality doesn't work?

Suncell
27th June 2010, 22:06
problem solved - everything was fine - just included files into a wrong .pro file -sorry