#ifndef TEST_H#define TEST_H#include <QMainWindow>#include <ui_mainwindow.h>class MainWindow;class Test : public QMainWindow{ Q_OBJECTpublic: explicit Test(QWidget *parent = 0); Ui_MainWindow Form;signals: public slots:};#endif // TEST_H
#include "test.h"#include "Mainwindow.h"#include "ui_mainwindow.h"Test::Test(QWidget *parent) : QMainWindow(parent){ Form.FindButton->setVisible(false);}
#ifndef TMO_H#define TMO_H#include <QtGui/QMainWindow>#include "ui_tmo.h"class tmo : public QMainWindow{ Q_OBJECTpublic: tmo(QWidget *parent = 0, Qt::WFlags flags = 0); ~tmo();private: Ui::tmoClass ui;};#endif // TMO_H
#include "tmo.h"tmo::tmo(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags){ ui.setupUi(this); ui.label->setText("Olala");}tmo::~tmo(){}
#include "mainwindow.h"#include "ui_mainwindow.h"#include "test.h"MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){ ui->setupUi(this); Test *treetest = new Test(); QObject::connect(ui->TreeFiles, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(treetest->TreeClick(QTreeWidgetItem*,int)));}MainWindow::~MainWindow(){ delete ui;}
#ifndef TEST_H#define TEST_H#include <QMainWindow>#include <ui_mainwindow.h>class MainWindow;class Test : public QMainWindow{ Q_OBJECTpublic: explicit Test(QWidget *parent = 0);signals: public slots: void TreeClick(QTreeWidgetItem *item, int column);private: Ui::MainWindow ui;};#endif // TEST_H
#include "test.h"#include "ui_mainwindow.h"#include "QDebug"Test::Test(QWidget *parent) : QMainWindow(parent){ ui.setupUi(this);}void Test::TreeClick(QTreeWidgetItem *item, int column){ QTreeWidgetItem *atem = new QTreeWidgetItem(); atem->setText(0, "Test"); ui.TreeFiles->addTopLevelItem(atem);}