Reputation:
I'm using Qt 2009.03 with the Visual Studio addon 1.0.2. I'm writing an application that has commands to open non-modal windows, and multiple windows can be opened 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.
I'm not sure what is the correct workflow in QtDesigner. I thought it might be a "Frame" but that doesn't seem to be a window, with your standard close / minimize tabs and menu bar. I thought perhaps it was (from Visual Studio) File / New Project / Qt4 Projects / Qt4 Designer plugin. That generates some classes, but there's no .ui
file for me to design with.
Upvotes: 1
Views: 2016
Reputation: 1799
Usually you use a QMainWindow for the main window in your application. This will give you your minimise, and close buttons. In your QMainWindow you can add or remove a menu bar by right clicking on the form in QtDesigner.
For a non-model window, you would normally use a QDialog. This will also give you your minimise, and close buttons.
Are you definately using the visual studio add-in (opens ui files in Qt Designer)?
There is also the visual studio integration. (opens ui files within visual studio and provides tools to edit it)
Upvotes: 1
Reputation: 7787
Taking your example:
You create a Qt designer UI (VS 2003) by right clicking your project in the solution explorer, clicking "Add" and selecting "Add Qt GUI class".
Upvotes: 1
Reputation: 4529
In Visual Studio, the workflow I use when I want to design a new window is to add a Qt GUI class with Project->Add Class...->Qt4 Classes->Qt4GuiClass.
Then, fill out the form as necessary and the VS add-in will add the appropriate ui and moc files. Double clicking on the ui file will bring up Qt Designer, which you can use to lay your window out.
Upvotes: 3
Reputation: 7258
Consider restating the question, I'm not sure I understood what the problem is -- how to create a ui file? How to create ui file inside VS? (or Creator?) What Qt class to base your window on? Something else?
Do you use QtCreator or VS with Qt integration? (Or is there hybrid approach? O_o)
Anyway, you can always open QtDesigner separately and create ui file inside. Then add it to .pro file (assuming you are using .pro and not VS solution directly).
For base window you can even use QWidget. Decorations (titlebar, system menu, minimize, etc) depend on window flags passed into constructor.
Upvotes: 2