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. How to define an OnClick event handler for a button from within Qt Creator when in the form it is not appear(I cant add it from there....)?
Qt 6.11 is out! See what's new in the release blog

How to define an OnClick event handler for a button from within Qt Creator when in the form it is not appear(I cant add it from there....)?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
qpushbuttononclick
2 Posts 2 Posters 1.2k Views
  • 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.
  • R Offline
    R Offline
    RuWex
    wrote on last edited by
    #1

    I defined a QPushButton in the MainWindow constructor:

    QPushButton *testFewCommands = new QPushButton("&start testing few commands", this);
    

    and now, I want to add OnClick function In the designer this button doesn't appear, how can I do it?

    JonBJ 1 Reply Last reply
    0
    • R RuWex

      I defined a QPushButton in the MainWindow constructor:

      QPushButton *testFewCommands = new QPushButton("&start testing few commands", this);
      

      and now, I want to add OnClick function In the designer this button doesn't appear, how can I do it?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @RuWex
      I don't know that you can given that the button is not in the Designer, and it wouldn't work even if you could. Why would you want to anyway? If you add a button in code do the connect() in code for sure.

      1 Reply Last reply
      1

      • Login

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