[Qt-interest] How to add a dialog to a project?
Andreas Pakulat
apaku at gmx.de
Sat May 23 12:32:09 CEST 2009
On 23.05.09 12:09:51, Piotr Dobrogost wrote:
> Andreas Pakulat wrote:
>
> > I don't use QtCreator myself, but the header you're talking about
> > (ui_foo.h if you have a foo.ui) is auto-generated when you build the
> > project. So you can just put the
>
> I'm not talking about ui_foo.h but about foo.h.
> For example after creating a new project there are
>
> mainwindow.ui
> ui_mainwindow.h
>
> AND
>
> mainwindow.h
>
> which looks like this
>
> #ifndef MAINWINDOW_H
> #define MAINWINDOW_H
>
> #include <QtGui/QMainWindow>
>
> namespace Ui
> {
> class MainWindow;
> }
>
> class MainWindow : public QMainWindow
> {
> Q_OBJECT
>
> public:
> MainWindow(QWidget *parent = 0);
> ~MainWindow();
>
> private:
> Ui::MainWindow *ui;
> };
>
> #endif // MAINWINDOW_H
>
>
> I think this kind of a header file should be generated too.
Well, as I said I don't know QtCreator and wether it has support for
generating new classes. However uic the tool that creates ui_foo.h from
foo.ui doesn't and shouldn't generate such a header because it cannot
know what should be in it. In worst case you need to create a new file
and write this yourself.
Andreas
--
You have been selected for a secret mission.
More information about the Qt-interest-old
mailing list