//baseclass.h
#ifndef BASECLASS_H
#define BASECLASS_H
#include <QMainWindow>
namespace Ui {
class baseclass;
}
{
Q_OBJECT
public:
explicit baseclass
(QWidget *parent
= 0);
~baseclass();
// baseclass(int i = 10) : member(i){}
// int getMember() {return member;}
int i;
Ui::baseclass *ui;
public slots:
void on_pushButton_clicked();
void test();
private:
private slots:
private slots:
void on_lineEdit_cursorPositionChanged(int , int );
};
#endif // BASECLASS_H
//derived class
#ifndef BASECLASS_H
#define BASECLASS_H
#include <QMainWindow>
namespace Ui {
class baseclass;
}
{
Q_OBJECT
public:
explicit baseclass
(QWidget *parent
= 0);
~baseclass();
// baseclass(int i = 10) : member(i){}
// int getMember() {return member;}
int i;
Ui::baseclass *ui;
public slots:
void on_pushButton_clicked();
void test();
private:
private slots:
private slots:
void on_lineEdit_cursorPositionChanged(int , int );
};
#endif // BASECLASS_H
//baseclass.cpp
#ifndef BASECLASS_H
#define BASECLASS_H
#include <QMainWindow>
namespace Ui {
class baseclass;
}
{
Q_OBJECT
public:
explicit baseclass
(QWidget *parent
= 0);
~baseclass();
// baseclass(int i = 10) : member(i){}
// int getMember() {return member;}
int i;
Ui::baseclass *ui;
public slots:
void on_pushButton_clicked();
void test();
private:
private slots:
private slots:
void on_lineEdit_cursorPositionChanged(int , int );
};
#endif // BASECLASS_H
//mai.cpp
#ifndef BASECLASS_H
#define BASECLASS_H
#include <QMainWindow>
namespace Ui {
class baseclass;
}
{
Q_OBJECT
public:
explicit baseclass
(QWidget *parent
= 0);
~baseclass();
// baseclass(int i = 10) : member(i){}
// int getMember() {return member;}
int i;
Ui::baseclass *ui;
public slots:
void on_pushButton_clicked();
void test();
private:
private slots:
private slots:
void on_lineEdit_cursorPositionChanged(int , int );
};
#endif // BASECLASS_H
//derivedclass.cpp
#include "derivedclass.h"
#include "ui_derivedclass.h"
#include "baseclass.h"
derivedclass
::derivedclass(QWidget *parent
) : baseclass(parent),
ui(new Ui::derivedclass)
{
ui->setupUi(this);
test();
ui->lineEdit->setText(v);
}
derivedclass::~derivedclass()
{
delete ui;
}
//baseclass.h
#ifndef BASECLASS_H
#define BASECLASS_H
#include <QMainWindow>
namespace Ui {
class baseclass;
}
class baseclass : public QMainWindow
{
Q_OBJECT
public:
explicit baseclass(QWidget *parent = 0);
~baseclass();
// baseclass(int i = 10) : member(i){}
// int getMember() {return member;}
int i;
Ui::baseclass *ui;
public slots:
void on_pushButton_clicked();
void test();
private:
private slots:
private slots:
void on_lineEdit_cursorPositionChanged(int , int );
};
#endif // BASECLASS_H
//derived class
#ifndef BASECLASS_H
#define BASECLASS_H
#include <QMainWindow>
namespace Ui {
class baseclass;
}
class baseclass : public QMainWindow
{
Q_OBJECT
public:
explicit baseclass(QWidget *parent = 0);
~baseclass();
// baseclass(int i = 10) : member(i){}
// int getMember() {return member;}
int i;
Ui::baseclass *ui;
public slots:
void on_pushButton_clicked();
void test();
private:
private slots:
private slots:
void on_lineEdit_cursorPositionChanged(int , int );
};
#endif // BASECLASS_H
//baseclass.cpp
#ifndef BASECLASS_H
#define BASECLASS_H
#include <QMainWindow>
namespace Ui {
class baseclass;
}
class baseclass : public QMainWindow
{
Q_OBJECT
public:
explicit baseclass(QWidget *parent = 0);
~baseclass();
// baseclass(int i = 10) : member(i){}
// int getMember() {return member;}
int i;
Ui::baseclass *ui;
public slots:
void on_pushButton_clicked();
void test();
private:
private slots:
private slots:
void on_lineEdit_cursorPositionChanged(int , int );
};
#endif // BASECLASS_H
//mai.cpp
#ifndef BASECLASS_H
#define BASECLASS_H
#include <QMainWindow>
namespace Ui {
class baseclass;
}
class baseclass : public QMainWindow
{
Q_OBJECT
public:
explicit baseclass(QWidget *parent = 0);
~baseclass();
// baseclass(int i = 10) : member(i){}
// int getMember() {return member;}
int i;
Ui::baseclass *ui;
public slots:
void on_pushButton_clicked();
void test();
private:
private slots:
private slots:
void on_lineEdit_cursorPositionChanged(int , int );
};
#endif // BASECLASS_H
//derivedclass.cpp
#include "derivedclass.h"
#include "ui_derivedclass.h"
#include "baseclass.h"
derivedclass::derivedclass(QWidget *parent) :
baseclass(parent),
ui(new Ui::derivedclass)
{
ui->setupUi(this);
test();
QString v=QString::number(i);
ui->lineEdit->setText(v);
}
derivedclass::~derivedclass()
{
delete ui;
}
To copy to clipboard, switch view to plain text mode
Bookmarks