PDA

View Full Version : How to change only part of an application with signals/button clicked?



ada
4th December 2010, 16:15
Hi, I am really new in Qt and I am trying to make a window application which has search and go to date on top of the page, it always stays there, and buttons on the left, they change the middle of the page. I can't figure out how to do it since the whole mid area should change. And there is nothing in my .cpp file. Just a few lines of code. I choose window application when I first started the project. Is it true?
Can you please help me about this? I only want to change the middle area completely as it is going to open like a new panel in Java but I don't know what it is in Qt. How can I do this when certain buttons are clicked?

Sorry about my English.

Added after 1 39 minutes:

Any replies, please? I can't think Qt way, I mix it with Visual Studio & C#.

I would be really happy if you can direct me to a link or video about how to do that

ChrisW67
4th December 2010, 22:28
The "middle of the page" sounds like a candidate for a QStackedWidget with the "buttons on the left" switching between pages of the stacked widget. The equivalent of a Java panel would be, I assume, a QWidget with a layout of subordinate widgets. The code to construct the UI that you are looking for is generated on your behalf from the UI file created by Designer (which I assume you are using). Behaviours associated with the widget events in your UI are yours to write. You need to read the signals and slots information in the Assistant manuals.