Вообщем понял в чём была моя ошибка, похоже невнимательность к правилам языка (хмм, как бы точнее выразиться, спользование
неинициализированных данных), но то собсно что я понял говорит о том что затея напрасна, а жаль, я на неё возлагал большие надежды :(
Вот теперь тот код который полностью демонстрирует глупость затеи
main.cpp
/*********************************************************************/
#include "test.h"
int main(int argc, char **argv)
{
QApplication app ( argc, argv );
test *t = new test;
app.setMainWidget(t->mw());
t->init();
return app.exec();
}
/*********************************************************************/
test.h
/*********************************************************************/
#ifndef _TEST_H_
#define _TEST_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "inc.h"
#include "testwindow.h"
#include "testtabs.h"
/**
* @short Application Main Window
* @author test <alexandr@cyclon>
* @version 0.1
*/
class test
{
public:
test();
virtual ~test();
QWidget* mw();
void init();
testWindow *w;
testSTabs *tab;
};
#endif // _TEST_H_
/*********************************************************************/
test.cpp
/*********************************************************************/
#include "test.h"
test::test()
{
w = new testWindow();
w->show();
tab = new testSTabs();
}
test::~test()
{
}
QWidget* test::mw()
{
return w;
}
void test::init()
{
w->add(tab);
}
#include "test.moc"
/*********************************************************************/
testtabs.h
/*********************************************************************/
#ifndef TESTTABS_H
#define TESTTABS_H
#include "inc.h"
/**
@author test
*/
class testTabs : public QWidget
{
Q_OBJECT
public:
testTabs(QWidget *parent = 0, const char *name = 0);
~testTabs();
QPushButton *b;
};
#endif
/*********************************************************************/
testtabs.cpp
/*********************************************************************/
#include "testtabs.h"
testTabs::testTabs(QWidget *parent, const char *name)
: QWidget(parent, name)
{
}
testTabs::~testTabs()
{
}
#include "testtabs.moc"
/*********************************************************************/
teststabs.h
/*********************************************************************/
#ifndef TESTSTABS_H
#define TESTSTABS_H
#include <testtabs.h>
/**
@author test
*/
class testSTabs : public testTabs
{
public:
testSTabs();
~testSTabs();
};
#endif
/*********************************************************************/
teststabs.cpp
/*********************************************************************/
#include "teststabs.h"
testSTabs::testSTabs()
: testTabs()
{
b = new QPushButton(this);
b->show();
}
testSTabs::~testSTabs()
{
}
/*********************************************************************/
testwindow.h
/*********************************************************************/
#ifndef TESTWINDOW_H
#define TESTWINDOW_H
#include "inc.h"
#include "teststabs.h"
/**
@author test
*/
class testWindow : public QWidget
{
Q_OBJECT
public:
testWindow(QWidget *parent = 0, const char *name = 0);
~testWindow();
void add(testTabs *tab);
QPtrList <testTabs> p;
};
#endif
/*********************************************************************/
testwindow.cpp
/*********************************************************************/
#include "testwindow.h"
testWindow::testWindow(QWidget *parent, const char *name)
: QWidget(parent, name)
{
}
testWindow::~testWindow()
{
}
void testWindow::add(testTabs* tab)
{
p.append(new testTabs(tab));
p.at(0)->reparent(this, QPoint(0,0));
p.at(0)->show();
}
#include "testwindow.moc"
/*********************************************************************/
Кнопки, созданной в testSTabs::testSTabs(), не видно.
ПыСы если кому интересно о чём речь, см посты ниже.
Ответ на:
комментарий
от anonymous

Ответ на:
комментарий
от cyclon
Ответ на:
комментарий
от bd
Ответ на:
комментарий
от anonymous
Ответ на:
комментарий
от anonymous
Ответ на:
комментарий
от bd

Ответ на:
комментарий
от cyclon
Ответ на:
комментарий
от cyclon
Ответ на:
комментарий
от bd

Ответ на:
комментарий
от cyclon
Ответ на:
комментарий
от bd

Ответ на:
комментарий
от cyclon

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.
Похожие темы
- Форум Qt Creator. Кто как предпочитает подключать *.ui ? (2010)
- Форум [QT] subclassing (2009)
- Форум [Qt] проблеммы при наследовании классов Qt и своих классов. (2010)
- Форум Передача виджета. (2005)
- Форум нужна помощь в переводе кода из c++ в python3 (2018)
- Форум не пашут слоты (2003)
- Форум [Qt][noob]Создание виджета, содержащего сцену (2011)
- Форум Проблемма с инклудами!!! (2005)
- Форум Object::connect: No such slot QLCDNumber::display(3) (2009)
- Форум Проблема с ALSA (2010)