LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   app made in qt designer doesn't do anything when started (https://www.linuxquestions.org/questions/programming-9/app-made-in-qt-designer-doesnt-do-anything-when-started-69592/)

dfuse 07-02-2003 12:30 PM

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?

kev82 07-02-2003 12:49 PM

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.

dfuse 07-02-2003 12:53 PM

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();
}

kev82 07-02-2003 01:10 PM

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

dfuse 07-02-2003 01:44 PM

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.


All times are GMT -5. The time now is 11:07 AM.