Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Missing Expected Behaviour in Qt Designer

    General and Desktop
    3
    6
    2713
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      subin last edited by

      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

      1 Reply Last reply Reply Quote 0
      • G
        goetz last edited by

        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.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply Reply Quote 0
        • S
          subin last edited by

          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

          1 Reply Last reply Reply Quote 0
          • G
            goetz last edited by

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

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply Reply Quote 0
            • T
              tobias.hunger last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • S
                subin last edited by

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

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post