QT GUI Programmming
Hi everybody,
I am just starting QT GUI programming in Linux. I am stuck at a point where there are two forms and I have to relate them as follows:- One form has a next button when the button is clicked current form will disappear and another form will be displayed. Although this should be very simple I will be glad to have a code snippent from you. Thanks Shibdas;) |
why not make your own slot on the class that you try to hide..
//written in langly++ //currentwindow.code public slot: void nextWindow(){ this->hide(); nextwindow->show(); } //where the button is currentwindow *a; connect(button,SIGNAL(clicked()),a,SLOT(nextWindow())); Hmm.. This is the best you can get from me at the moment, hope you figure out what I meant.. :) or you could simply do this: connect(button,SIGNAL(clicked()),windowopen,SLOT(hide())); connect(button,SIGNAL(clicked()),windownext,SLOT(show())); all offcouse written in langlycode<tm> so don't expect it to work :D Greets Langly.. and send me an mail if you need more help.. Maybe I'm better earlier at the day :) |
Thanks langly for your cute code. I have done it but I think you are missing something or it may be obvious to you. The thing is simply hide and show seems to have some problem you have to set the main widget of the application to the next window as follows:-
//meta-code //in the slot of the buttob of current window currentwindow->accept(); nextwindows next; //qApp is a global variable set by QT for the application qApp->setMainWidget(next); next.show(); I am cuurently coding in qt2.3. Maybe in qt 3.0 or latter your code will not need any modification. Thanks again for the code. Shibdas |
hmmm..
Do you need to set the mainWidget, just try to hide the old one and show the new without the setMainWidget(this).. Hopes it will work.. :) |
arent there any good books on Qt ?????
|
Sams theach yourself QT in 24 Hours is a good one
|
Qt Programming by O'Reilly publishing is good. However, the online docs are just about as helpful.
|
All times are GMT -5. The time now is 05:27 AM. |