December 22, 2011

Himanshupradhan Himanshuprad..
Lab Rat
15 posts

how can we open 2 qwidget simulatenously

 

i have taken a tcp/ip server client code from Qtexample[Fortune], and a analog clock example, firstly i run a tcp server and client program, now in tcp server program , in file server.cpp, in function send fortune, i am calling analog clock code[clock.show()], so it comes just for .1 second and disappear, i want to show this clock also, means that clock stay there.

2 replies

December 22, 2011

miroslav miroslav
Lab Rat
228 posts

A common mistake is to create the widget variable on the stack, instead of using new. Showing multiple top-level widgets is not a problem in Qt.

 Signature 

Mirko Boehm | .(JavaScript must be enabled to view this email address) | KDE e.V.
FSFE Fellow
Qt Certified Specialist

December 22, 2011

fluca1978 fluca1978
Lab Rat
529 posts

Can you post the code that opens/shows the clock? I suspect that either you are allocating it on the stack, as miroslav suggested, or you are opening it thru a widget that is going to be deleted.

 
  ‹‹ How to run "Network chat client example" in QT demos ?      qmake INCLUDEPATH problem ››

You must log in to post a reply. Not a member yet? Register here!