Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Will Creator allow me to connect a QspinBox signal to a private slot?
Forum Updated to NodeBB v4.3 + New Features

Will Creator allow me to connect a QspinBox signal to a private slot?

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 3.1k Views 1 Watching
  • 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.
  • D Offline
    D Offline
    DrGreg
    wrote on last edited by
    #1

    I've declared a private slot in the .h file, have the code for it in the .cpp file, and I'd like to tie the "changed" signal from a QspinBox to it. When I use Creator and the signal/slots editor at the bottom, I do find my spinbox listed as a sender and the changed signal as one of the possibles in the dropdown, but in the receiver list I do not find my private slot. Do I have to make such connections by hand? Or is there some way to use Creator to make said connections?

    thanks - greg

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tony
      wrote on last edited by
      #2

      Hi,

      "visually" you can connect just signals and slot that you can see in the Signal/Slots editor, not your private ones.

      I can suggest you to call your private slot in the form reported by the documentation of QMetaObject::connectSlotsByName:

      "QMetaObject::connectSlotsByName":http://doc.trolltech.com/4.6/qmetaobject.html#connectSlotsByName

      So, if you call your private slots (suppose that your QSpinBox is called "mySpinBox")

      void on_mySpinBox_valueChanged(int i)

      it will be automatically connected when you perform the call "setupUi" in your constructor.

      BR,
      Antonio Di Monaco

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DrGreg
        wrote on last edited by
        #3

        Antonio -

        Thanks for the reply... and bloody clever on the Qt developer's part.

        again, thanks - greg

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved