PDA

View Full Version : How to launch a dialog?



rakkar
24th August 2009, 00:22
I'm using QT 2009.03 with the Visual Studio addin 1.0.2. I'm writing an application that has commands to open non-modal windows, and multiple windows can be open at the same time.

These windows themselves need to be designed in QTDesigner. An example of what I'm looking for can be found in Firefox. If I go to Tools / Addons it opens a child window.

Is the correct way to use QT Designer / File / New / Dialog, save it, then drag the resource to the Visual Studio solution under Form Files?

How would I launch this new dialog from a button press? Do I have to do it in C++? Or is there a way I can do it within QTDesigner? I tried using the Signa/Slot Editor in QT Designer but my the new dialog I made didn't show up as a Receiver

franz
24th August 2009, 07:23
How would I launch this new dialog from a button press? Do I have to do it in C++?

Yes. You also need to define behavior for your newly designed dialog, so you'll be making a class that uses the generated header file. Non-modal showing of windows can be done using QWidget::show() (http://doc.trolltech.com/4.5/qwidget.html#show).

rakkar
25th August 2009, 17:20
It sounds like I'd also have to send signals from the child window to slots in the main window in C++, and can't do it in QTDesigner.