Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 06-20-2003, 02:06 PM   #1
Registered: Jun 2003
Posts: 32

Rep: Reputation: 15
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.

Old 06-20-2003, 02:34 PM   #2
LQ Newbie
Registered: Jan 2003
Distribution: RH8.0; FreeBSD;
Posts: 17

Rep: Reputation: 0
why not make your own slot on the class that you try to hide..

//written in langly++
public slot:
void nextWindow(){

//where the button is
currentwindow *a;

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:


all offcouse written in langlycode<tm> so don't expect it to work

Greets Langly.. and send me an mail if you need more help.. Maybe I'm better earlier at the day
Old 06-22-2003, 12:33 PM   #3
Registered: Jun 2003
Posts: 32

Original Poster
Rep: Reputation: 15
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:-

//in the slot of the buttob of current window
nextwindows next;
//qApp is a global variable set by QT for the application

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.

Old 06-22-2003, 12:45 PM   #4
LQ Newbie
Registered: Jan 2003
Distribution: RH8.0; FreeBSD;
Posts: 17

Rep: Reputation: 0
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..
Old 06-27-2003, 11:51 PM   #5
Registered: Dec 2002
Location: Bangalore, India
Distribution: Ubuntu 5.*
Posts: 241

Rep: Reputation: 30
arent there any good books on Qt ?????
Old 06-28-2003, 06:56 AM   #6
LQ Newbie
Registered: Jan 2003
Distribution: RH8.0; FreeBSD;
Posts: 17

Rep: Reputation: 0
Sams theach yourself QT in 24 Hours is a good one
Old 07-02-2003, 06:50 AM   #7
LQ Newbie
Registered: Jun 2003
Location: Cleveland, TN, USA
Distribution: RedHat
Posts: 1

Rep: Reputation: 0
Qt Programming by O'Reilly publishing is good. However, the online docs are just about as helpful.


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
[Ubuntu GUI] Changing GUI from Gnome to wmaker MangaManiac Linux - Laptop and Netbook 8 05-08-2005 03:17 PM
KDE gui vs. Gnome GUI Curt6000 Linux - Newbie 11 11-10-2004 01:37 PM
Isn't Windows 95 or 98 a better GUI solution for old machines than an old Linux GUI lynchmob09 General 10 04-20-2004 01:24 AM
Where's the GUI??? soundprizm Linux - Newbie 2 04-03-2003 01:25 PM
need GUI kraven Linux - Software 8 03-26-2003 11:47 PM

All times are GMT -5. The time now is 04:47 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration