Missing Expected Behaviour in Qt Designer



  • Hi All,

    I've just moved to Qt designer as an experiment. I've added a Qt form class to my empty project (as a QMainWindow) and added a QPushButton and a QLineEdit to the main form. In my QMainWindow class, I've added a public slot named setText() which does nothing but set the text inside QLineEdit object to some string. In the Qt designer, I've switched to signals/slots editing mode. Then I tried to connect the buttton's clicked() signal to my custom slot setText() - which is already defined in my MainWindow class. But strangely, I cannot see my slot listed there in the list!

    As I searched around on the web, I got "this video":http://www.youtube.com/watch?v=Ca8ItRtU0AA. But, in that video too, that guy adds his own slot into the list of slots manually typing in. I think it would be great if Qt designer updates the list of slots dynamically as the code changes. Also, please let me know if there is any workaround.

    Thanks



  • Qt Designer does not know of your C++ implementation and therefore cannot know of your custom slot. This will not change.

    If you need that slot frequently in different projects, you should consider making a "Designer plugin":/doc/qt-4.7/designer-creating-custom-widgets.html from it.



  • Volker,
    I was not using Qt designer separately. I just used to Add ->Qt Form Class -> Design mode. So I was having an impression that, Qt creator collects all information about the project via the .pro file.

    Thank You



  • The design component of Qt Creator is more or less just an embedded Qt Designer.


  • Moderators

    Write a "feature request":http://bugreports.qt.nokia.com/ if you want this changed. We happily ignore requests made in the forum (mostly since we can not find them when planing;-).

    Of course a feature request is not guaranteed to get implemented either, but at least it will be noticed when developers consider what to do next.



  • Tobias,
    Ok, I'll be doing this immediately.
    Thanks


Log in to reply
 

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