PDA

View Full Version : Qt GUI Application



selva kumar
29th July 2013, 07:38
Hi Everybody,
I am new to Qt development.I have to develop a Qt GUI Application with one parent and multiple windows.what i want exactly one main window called home window like one frame which contains home page and menus,controls.when i click a menu,a new panel has to come and remove a home panel and data has to be transfer between panels.i know java swing,thats why i am talking about panels and frames.what is the equivalent of frame and panels in qt.i referred some qt mainwindow examples.i referred layouts.but i couldn't develop anything.i am able to create separate window applications.And i am facing difficulty with layout also.

Anybody help me to develop a GUI Application with multiple panels or windows(i referred MDI also.that is not applicable for me).can u give small applicatin source or what alse i have to do?guide me please...

Qt version: 4.8
Os :fedora 16

anda_skoa
29th July 2013, 08:49
If you want a window to have different content depending on the application state have a look at QStackedWidget.
It is basically a stack of pages and the program decides which page is "on top" and thus visible.

If I remember Swing correctly, a panel is just a container so the euqivalent would be QWidget.
If you need a top level window just pass 0 as the parent argument to the constructor of any QWidget class.

Cheers,
_

selva kumar
31st July 2013, 11:40
Thank you for your reply.

Which is equivalent to component?.because i have to remove old widget,while loading new widget.
I need one home page.so i will make home page as QMainwindow.how do i change home page to next window or widget?.

anda_skoa
1st August 2013, 08:42
I guess the closest thing is QWidget.

But I am not sure why you need to remove something? Conserving memory?

Cheers,
_

selva kumar
5th August 2013, 08:26
I am not going to remove a window.just overriding the new window or hide the old one,show the new one.
how to do it?.

ChrisW67
5th August 2013, 09:46
You already have the answer: QStackedWidget

selva kumar
13th August 2013, 06:36
I have a mainwindow,which contains header on top,frame in center and statusbar on the bottom.i tired to add some layout on the frame.but i could not add,and it says "QLayout: Attempting to add QLayout "" to MainWindow "MainWindow", which already has a layout".how to add my layout on the frame?.

->i have one more frame with some layouts.i want to remove or hide that previous frame,and show the new frame.how to do it?.

Lesiok
13th August 2013, 06:51
Just read how QWidget::setLayout is working.

anda_skoa
13th August 2013, 11:15
I have a mainwindow,which contains header on top,frame in center and statusbar on the bottom.i tired to add some layout on the frame.but i could not add,and it says "QLayout: Attempting to add QLayout "" to MainWindow "MainWindow", which already has a layout".how to add my layout on the frame?.

by setting the layout on the frame, not on the main window.
or by passing the frame to the layout's constructor, which basically does the same. Just don't use the main window if you don't want to affect the main window.



->i have one more frame with some layouts.i want to remove or hide that previous frame,and show the new frame.how to do it?.

You know, this is getting old.
Repeating the question will not change the answer, it is just becoming very annoying.

Cheers,
_