Qt-interest Archive, February 2007
dialog and event problems?
Message 1 in thread
Hi
I am a Qt newbie..
I have 2 problems
1.
I just wanted to open a new dialog data.ui from my main window
main_win.ui. My code is working perfectly on Windows but not in Linux 9.(It
is also working on my friends linux system but I dont know what the
difference is..)
I have a button on main_win.ui whose slot is is show_data() where
#include "data.h"
void main_win::show_data()
{
data *d=new data(this);
d->show();
}
Also..I am leaving the default values..so the dialog is
modeless..right?
The system just hangs up when I click the data button and I have to
restart...
2.
Even on a system where the code IS working...there is completely
different(or so I think) problem.
I have a start_slot() triggered by a start button whose job is to
continuously perform some processing(I am using a infinite while loop for
this which is supposed to break only when a particular event triggered
by the stop button takes place).But I am not even able to click the
stop button ...coz the while loop never stops....I used usleep() in the
while loop I am not able to click the stop button...(The stop button too
is on the same dialog....as the start button)
Any help will be truly appreciated...thx.
---------------------------------
Here?s a new way to find what you're looking for - Yahoo! Answers
Message 2 in thread
On 10.02.07 13:01:16, kaavya kaavya wrote:
> #include "data.h"
> void main_win::show_data()
> {
> data *d=new data(this);
> d->show();
> }
> Also..I am leaving the default values..so the dialog is
> modeless..right?
Yeap.
> The system just hangs up when I click the data button and I have to
> restart...
Thats weird.
> I have a start_slot() triggered by a start button whose job is to
> continuously perform some processing(I am using a infinite while loop for
> this which is supposed to break only when a particular event triggered
> by the stop button takes place).But I am not even able to click the
> stop button ...coz the while loop never stops....I used usleep() in the
> while loop I am not able to click the stop button...(The stop button too
> is on the same dialog....as the start button)
For this to work you need to do the processing in a separate thread. See
QThread class and find some docs on multithreaded programming.
Andreas
--
[ signature omitted ]
Message 3 in thread
Hi,
> The system just hangs up when I click the data button and I have to
> restart...
What do you mean exactly by "the system just hangs"? The whole computer?
If so it's an operating system bug.
Also what exactly do you have to restart? Do you have to reboot the
computer?
--
[ signature omitted ]
Message 4 in thread
Hey thx for the Qthreadclass thing...
I agree its weird ....
But the problem occurs ONLY when I try to open up a new dialog....so can anyone think of ANYTHING else....thx
> #include "data.h"
> void main_win::show_data()
> {
> data *d=new data(this);
> d->show();
> }
> The system just hangs up when I click the data button and I have to
> restart...
---------------------------------
Here?s a new way to find what you're looking for - Yahoo! Answers