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. |
Quote:
I.e. in order to even ask a question about an entity involved one would have to painfully type in the entity name. |
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. |
Quote:
|
I just thought that one of you might know where the widgets added in the Qt Designer are defined.
|
Quote:
|
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 ;) |
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. |
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. |