LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Qt Creator Problem (https://www.linuxquestions.org/questions/programming-9/qt-creator-problem-814965/)

MTK358 06-18-2010 11:38 AM

Qt Creator Problem
 
1 Attachment(s)
I was fillowing a tutorial on YouTube on Qt timers by making a simple stopwatch app. I made it but it fails to compile, saying that the GUI widgets I created in the UI designer are not declared in the scope of the code.

See the attachment.

Sergei Steshenko 06-18-2010 12:50 PM

Quote:

Originally Posted by MTK358 (Post 4007732)
I was fillowing a tutorial on YouTube ...

You have failed just by doing this - one can't copy-paste text from a YouTube movie and one can't copy-paste text from your attachment.

I.e. in order to even ask a question about an entity involved one would have to painfully type in the entity name.

MTK358 06-18-2010 01:08 PM

I didn't copy and paste from the video.

The video used a slightly different program, and I wrote and understood the code myself, approximately following along with the video.

Sergei Steshenko 06-18-2010 01:24 PM

Quote:

Originally Posted by MTK358 (Post 4007831)
...I wrote and understood the code myself ...

Do you seriously expect us to possess telepathic abilities ?

MTK358 06-18-2010 03:11 PM

I just thought that one of you might know where the widgets added in the Qt Designer are defined.

Sergei Steshenko 06-18-2010 03:12 PM

Quote:

Originally Posted by MTK358 (Post 4007935)
I just thought that one of you might know where the widgets added in the Qt Designer are defined.

And why not to read the documentation ?

graemef 06-19-2010 05:49 AM

Assuming that everything is installed correctly then places to look would be:

The project file: Is the CONFIG variable set to add qt - CONFIG += qt (This will link the core and GUI modules)
Makefile: did you run qmake to generate the Makefile, this will need to be done after you have added a GUI window so that the moc file is built

There could be other pointers for you to follow but the info was a little spartan ;)

4play 06-23-2010 11:27 AM

try using Ui->startBtn instead of just startBtn.

Im trying to learn Qt as well at the minute so can you link the youtube video your trying to get working.

MTK358 06-23-2010 12:18 PM

I figured it out already, you're supposed to say "ui->myWidget" instead of just "myWidget".

The Qt Designer actually makes a class containing all the widgets and puts it in your main window class under the name "ui".

Here's the video: http://www.youtube.com/watch?v=mVvB9Yqsigw


All times are GMT -5. The time now is 10:34 PM.