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.
-
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.