LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-18-2010, 11:38 AM   #1
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Qt Creator Problem


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.
Attached Thumbnails
Click image for larger version

Name:	qtcreator.jpeg
Views:	23
Size:	170.9 KB
ID:	3899  
 
Old 06-18-2010, 12:50 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by MTK358 View Post
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.
 
Old 06-18-2010, 01:08 PM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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.
 
Old 06-18-2010, 01:24 PM   #4
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by MTK358 View Post
...I wrote and understood the code myself ...
Do you seriously expect us to possess telepathic abilities ?
 
Old 06-18-2010, 03:11 PM   #5
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
I just thought that one of you might know where the widgets added in the Qt Designer are defined.
 
Old 06-18-2010, 03:12 PM   #6
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by MTK358 View Post
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 ?
 
Old 06-19-2010, 05:49 AM   #7
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
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
 
Old 06-23-2010, 11:27 AM   #8
4play
LQ Newbie
 
Registered: Oct 2003
Location: london
Distribution: Centos
Posts: 27

Rep: Reputation: 15
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.
 
Old 06-23-2010, 12:18 PM   #9
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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

Last edited by MTK358; 06-23-2010 at 12:19 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
QT Creator C4C Linux - Newbie 1 12-26-2009 03:37 PM
Ubuntu :usb startup disk creator problem drmjh Linux - General 18 11-29-2009 11:14 AM
Problem with CD Rom/DVD Drives in Suse 10 and K Audio Creator PaleViper SUSE / openSUSE 1 01-15-2006 05:52 AM
gnome cd creator problem Tuttle Linux - Software 0 09-01-2004 04:55 PM
help with cd creator creid Linux - Hardware 1 06-14-2004 03:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration