i'm very newbie and lost! I have a .cpp file in my qt project and my own widget.cpp wich has drawings! Now i want to get the data from the other .cpp file, from a class called, outputtext..which has a method add(name,value) both std string!
Know i want in my widget.cpp to import this stings! I have a form and i put a button on it 'get string'-button! Know i have
void Widget::on_pushButton_clicked(){
// how can i use Qpainter to deaw the text in my widget?
}
so, this is my widget class:
#include "widget.h"
#include "ui_widget.h"
#include "outputtext.h"
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
}
Widget::~Widget()
{
delete ui;
}
void Widget::on_pushButton_clicked()
{
//int outputtext.add(name,value);
// i want to say get the name and value from outputtext class and draw it in the widget!
}
and the other cpp file (outputtext) as a method add(name, vale) as string:
unsigned int OutPutText::add( std::string name , std::string value )
{
.....
}
please help!! i think it is easy but I just can't get the painter works from the push-button!