MrMad Posted November 18, 2005 Report Share Posted November 18, 2005 (edited) Hello, i just tried to create the simple C++ app using QT. So I created a simple form and button and then I added a slot thus a piece of code is called when user click the button. Everything is ok until I entered the code into a virtual function. The simple code in this place like printf etc. wrok well. But when I want ad something like this and change the push button text : void MyForm::ZmianaTekstu() { pushButton4.setText("Wingroza"); } then the compiler complains: myform.cpp:29: error: request for member 'setText' in '((MyForm*)this)->MyForm::<anonymous>.Form1::pushButton4', which is of non-class type 'QPushButton*' Don't know why - if in the same place I will add the code to change the form caption it's ok ... You can find the sources in attachment. What I'm doing wrong ? Regards MrMad packed.zip Edited November 18, 2005 by MrMad Quote Link to comment Share on other sites More sharing options...
MrMad Posted November 21, 2005 Author Report Share Posted November 21, 2005 Mea Culpa 1st: it should be: pushButton4->setText("Wingroza"); 2nd: the missing: #include "qpushbutton.h" Shame on me :-) Anyway solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.