Jump to content

KDevelop QT simple program problem


Recommended Posts

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 by MrMad
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...