LinuxQuestions.org
Visit Jeremy's Blog.
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 07-02-2003, 01:30 PM   #1
dfuse
Member
 
Registered: May 2003
Location: Leuven, Belgium
Distribution: Gentoo Linux
Posts: 42

Rep: Reputation: 15
app made in qt designer doesn't do anything when started


Hey,
I started programming in qt designer, for testing I made a simple app which doesn't do anything, only a mainform with some widgets on it, after making a main.cpp file, running qmake and make without any errors, I try to execute the app from a xterm, but nothing happens. When I look with top, the status of the app is T, I have to kill it with kill -9 pid, nothing else works. I think this is really weird since I didn't even write code into the app, maybe I'm doing something wrong?
 
Old 07-02-2003, 01:49 PM   #2
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 50
ive never used qt designer but when widgets are created they default to invisible you have to call show on them, check the main.cpp file to see if show is being called.
 
Old 07-02-2003, 01:53 PM   #3
dfuse
Member
 
Registered: May 2003
Location: Leuven, Belgium
Distribution: Gentoo Linux
Posts: 42

Original Poster
Rep: Reputation: 15
Since the main is generated by the designer, I presume it is correct, the show method for the mainform is called.

#include <qapplication.h>
#include "mainform.h"

int main( int argc, char ** argv )
{
QApplication a( argc, argv );
MainForm w;
w.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}
 
Old 07-02-2003, 02:10 PM   #4
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 50
im only learning qt myself but i thought all applications needed a main widget. see what happens if you comment out the connect line and before w.show(); add a.setMainWidget(&w); if that doesnt help then i dont know, maybe theres something in the faq for qt designer
 
Old 07-02-2003, 02:44 PM   #5
dfuse
Member
 
Registered: May 2003
Location: Leuven, Belgium
Distribution: Gentoo Linux
Posts: 42

Original Poster
Rep: Reputation: 15
Look like I found the problem, it was something rather stupid. I had to start the app with ./appname, not appname, don't know why it doesn't give an error though.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Check if an app is running and if it's not launch this app Coume Linux - General 3 07-28-2008 03:34 AM
Do you use QT designer? DJOtaku Programming 6 04-24-2005 05:56 PM
DB Designer ewinandar LinuxQuestions.org Member Success Stories 0 11-17-2004 08:59 PM
Qt designer Rozi Linux - Software 0 05-19-2004 10:49 AM
New app install, or, I've d/l'd the app, now what? Dani Linux - Newbie 4 01-06-2002 09:24 PM


All times are GMT -5. The time now is 02:35 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration