[QT4] Variables in .ui file



  • Hi there,

    my current task at work is to port a quite complex program (with over 40 classes) from Qt 3 to Qt 4.
    The project contains several QDialogs, which have been created using Qt Creator.

    To explain my question easier, I take a QDialog as an example (let's call it dialog ;-) ).
    dialog.ui (Qt3) contains several <variable> tags (<variable access="public">int temp;</variable>).
    UIC builds the file dialog.h which contains these variables as public members of class dialog.

    Afaik these <variable> tags are no longer supported in Qt 4.

    Since there are many classes which use these public members, I wonder if there is a possibility to get them into the Qt4 - dialog.ui so that UIC declares them in ui_dialog.h.
    The only alternative I can imagine is to implement a class that inherits Ui_dialog and declares the missing members. But I want to avoid this way

    Do you have an idea how I can solve it?

    Regards
    Patrick


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You can find "here":http://qt-project.org/doc/qt-4.8/porting4-designer.html a guide to post Qt 3 UI files to Qt 4.

    You might also want to consider going with Qt 5 directly

    Hope it helps


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.