Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QtCreator - some basics questions...



  • Hey

    So I never picked the qt creator/designer workflow. Always somehow did stuff myself and now I got curious so I'm learning the thing...

    I'm in CMake mode...

    Some thing I'd like to ask for...

    1. Say in creator I click Add New > Qt > Qt Designer Form > next/next Ok. Now it creates the .ui file, but does not add it to project, is that correct? I have to hand add it ? I have configured to add it to project, but nothing gerts added to cmake/cant see file... Is that normal? Do I hand add it?
    2. Same as above but lets add Qt Design Form class Same issue as above, I get new files but nothing added to project?
    3. How can I convert a item I made in point 2 from QDialog to lets say QMainWindow, or QScrollBar or QWidget? I keep clicking around in Design but nothing happens... Any hints?

    I think I'll come with more hiccups as I delve in, but for now, any ideas? :- )

    TIA!


  • Lifetime Qt Champion

    Hi
    Not a cmake fan so never used it with Qt. But as far as i know, you have manually add new files.
    There is
    https://cmake.org/cmake/help/v3.14/prop_tgt/AUTOUIC.html
    that should be used to process the ui files.

    This is just what i have understood reading on forum. Sadly i dont know the full details.



  • @mrjj said in QtCreator - some basics questions...:

    Hi
    Not a cmake fan so never used it with Qt. But as far as i know, you have manually add new files.
    There is
    https://cmake.org/cmake/help/v3.14/prop_tgt/AUTOUIC.html
    that should be used to process the ui files.

    This is just what i have understood reading on forum. Sadly i dont know the full details.

    Hey

    Thanks, yeah I'm adding files by hand for now.

    In any case do you know maybe how to change initial type of file from QWidget to QDialog/etc/etc?

    TIA


  • Lifetime Qt Champion

    @Dariusz said in QtCreator - some basics questions...:

    maybe how to change initial type of file from QWidget to QDialog/etc/etc?

    If you mean how to change the .h, cpp and UI file to be other type ?

    You will have to change in 3 places

    .h

    class MainWindow : public QMainWindow <<< change here

    .cpp
    MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent) <<<< change here to new type

    .ui
    This you have to do outside creator, and its best if you close it.
    Open the ui file in other editor. ( its text)
    alt text