I am building a qt application in which i am have to access ui elements. but i am getting error as
invalid use of member 'foo::ui' in static member function
The code is big so cant add here.
Declaration of ui
private:
Ui::foo *ui;
Initialization in Constructor
foo::foo(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::foo)
{
ui->setupUi(this);
}
Accessing in static function where it is giving error.
ui->fp->setText("Some Text");
Static function declaration.
static I eventCallback(PVOID i_pv_context,
T_xyz i_i_command,
PVOID i_pv_param);
main code
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
BarrierInterfaceModule w;
w.show();
return a.exec();
}
I have looked on Internet but did not get solution. please let me know if there is a way around.let me know if you need any more info Thanks in advance