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 implement new signal / slot ?
Forum Updated to NodeBB v4.3 + New Features

How to implement new signal / slot ?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 335 Views 2 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by Anonymous_Banned275
    #1

    OK,
    I have a cut and paste code "adding new action " to MDI.
    I cannot find anywhere how to add new signal / slot utilizing BOTH QtCreator and QDesigner.

    I am looking for something like flow chart

    1. add "slot " (declaration ? ) to class header under

    private slots:
    void on_actionAddWindow_triggered();
    // add
    void on_TEST_Action();

    1. code "slot" (definition ?) in class .cpp file

    etc....

    I can figure out piece parts , but I am not sure "who is on first" sequence of additions.

    ADDENDUM
    After what seems typical in Qt development - few dead ends and realization that mixing QtCreator and QDesigner is not good idea.
    Yes and for you who member - I have asked this way back when I started with Qt. Not much changed since. There are very few "connections" between QtCreator and QDesiger when it comes to Qt main features - GUI and event processing It looks as three separate development groups who do not care to talk to each other.
    Too bad.
    .

    JKSHJ 1 Reply Last reply
    0
    • A Anonymous_Banned275

      OK,
      I have a cut and paste code "adding new action " to MDI.
      I cannot find anywhere how to add new signal / slot utilizing BOTH QtCreator and QDesigner.

      I am looking for something like flow chart

      1. add "slot " (declaration ? ) to class header under

      private slots:
      void on_actionAddWindow_triggered();
      // add
      void on_TEST_Action();

      1. code "slot" (definition ?) in class .cpp file

      etc....

      I can figure out piece parts , but I am not sure "who is on first" sequence of additions.

      ADDENDUM
      After what seems typical in Qt development - few dead ends and realization that mixing QtCreator and QDesigner is not good idea.
      Yes and for you who member - I have asked this way back when I started with Qt. Not much changed since. There are very few "connections" between QtCreator and QDesiger when it comes to Qt main features - GUI and event processing It looks as three separate development groups who do not care to talk to each other.
      Too bad.
      .

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @AnneRanch said in How to implement new signal / slot ?:

      I am looking for something like flow chart

      1. add "slot " (declaration ? ) to class header under

      private slots:
      void on_actionAddWindow_triggered();
      // add
      void on_TEST_Action();

      1. code "slot" (definition ?) in class .cpp file

      etc....

      The steps you described above are correct for slots. You do exactly the same thing as if you're implementing a new function/method.

      Just make sure that the name and parameters in the .h file match those in the .cpp file:

      // .h
      
      MainWindow : public QMainWindow {
         /* ... */
      
      private slots:
          void on_actionAddWindow_triggered();
      };
      
      // .cpp
      void MainWindow::on_actionAddWindow_triggered() {
          // Add your logic here
      }
      

      I cannot find anywhere how to add new signal / slot utilizing BOTH QtCreator and QDesigner.

      Qt Designer is mainly for setting the visual layout. You don't need it to implement new signals/slots.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      2

      • Login

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