[SOLVED] How to Get string and drawtext?
-
I need your help!
I'm over 20 hours stucked in my case couse iam a bad programmer :(
This is my non answerd thread by stackof! Please some one help me!http://stackoverflow.com/questions/20243837/qt-get-string-from-c-method-and-drawtext-in-widget
-
@sumit
thank you! I understand the strategy but don't know how to write the code!
this is my Button:
void Widget::on_pushButton_clicked()
{
QPaintEvent e;
QString name;
QString value;
unsigned int name_val= QString::fromStdString(OutPutText::add(name, value));painter = paintEvent(e);
}
i dont know how to catch the strings from the add(name,value) ant paint them in the widget with my paintevent! it shouldn't be deficult but i dont have ist!! -
ok you need code-I am just writing rough code so you can easily understand.
In Output.h classclass Output
{
public :
void add(name,value);
};
in Widget.h class#include "Output.h"
class Output;
class Widget
{
private:
Output *pOutputObj;
};in Constructor of Output class--
{
pOutputObj=new Output(this);
}
void Widget::on_pushButton_clicked()
{
pOutputObj->add(name,value); //here u can call add function
}
Remark ::-->Not Tested