Thanks.
I really dont understand what to do. Will you please help me further.
my main() is:
#include <QtGui/QApplication>
#include "overfore.h"
#include "vindu.h"
#include <QObject>
int main(int argc, char *argv[])
{
Overfore ov;
return a.exec();
}
#include <QtGui/QApplication>
#include "overfore.h"
#include "vindu.h"
#include <QObject>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Overfore ov;
return a.exec();
}
To copy to clipboard, switch view to plain text mode
my overfore.cpp is:
#include "overfore.h"
#include "ui_overfore.h"
Overfore
::Overfore(QWidget *parent
) : ui(new Ui::Overfore)
{
ui->setupUi(this);
textOverfore->append("Hello");
Vindu *vindu = new Vindu;
vindu->layout();
}
#include "overfore.h"
#include "ui_overfore.h"
Overfore::Overfore(QWidget *parent) :
QWidget(parent),
ui(new Ui::Overfore)
{
ui->setupUi(this);
textOverfore = new QTextEdit;
textOverfore->append("Hello");
Vindu *vindu = new Vindu;
vindu->layout();
}
To copy to clipboard, switch view to plain text mode
and my vindu.cpp is:
#include "vindu.h"
{
buttonLayout->addWidget(button);
buttonLayout->addWidget(textfield);
setLayout(buttonLayout);
setVisible(buttonLayout);
}
#include "vindu.h"
Vindu::Vindu(QWidget *parent) :
QWidget(parent)
{
QPushButton *button = new QPushButton("button");
textfield = new QTextEdit;
QHBoxLayout *buttonLayout = new QHBoxLayout;
buttonLayout->addWidget(button);
buttonLayout->addWidget(textfield);
setLayout(buttonLayout);
setVisible(buttonLayout);
}
To copy to clipboard, switch view to plain text mode
What I really want is when I push "button" in class Vindu, I want the "textfield" from class Overfore to be shown in the field textOverfore in object vindu class Vindu. The variables are defined in the header files.
Bookmarks