Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. New to Qt Creator..question about custom slot code generation

New to Qt Creator..question about custom slot code generation

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.5k 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.
  • P Offline
    P Offline
    phyrexian
    wrote on last edited by
    #1

    Hi All,
    So I've been experimenting with Qt Creator, and started with created a dialog based application. Switched to designer mode, added a push button. Switched to signal/slot editor, and connected the signal clicked() to a custom slot called CustomButtonHandler(). I'm used to other IDEs filling in some declaration/definition (skeleton) code for me. Is it normal that Qt creator does not add "CustomButtonHandler()" to the slot section of the Dialog class declaration, and by the same token, not create the definition of the method in the cpp file? Is this meant to be all done manually?

    Thanks.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      It does not do that. You need to add your custom slot code to dialog class.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gyll
        wrote on last edited by
        #3

        You basically have two types of signals/slots that can be automatically added by creator to your code:

        1. buttons, widgets, etc: place the button/widget/etc on your form, right-click your button/widget/etc, select "Got to slot...", then select the action you want to implement. Once you selected an action the signal/slot code is automatically inserted to your code
        2. Menu items: Add the menu item you want to your window, and at the bottom of Creator's Design mode screen select the "Action Editor" tab. You will now see your menu item listed in the list of actions, right click the action and select "Go to slot...". Again, Creator will automatically insert the code template for that action in your code
        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