Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. QA Tools
  3. Squish
  4. Public slots not visibl in Squish
Forum Updated to NodeBB v4.3 + New Features

Public slots not visibl in Squish

Scheduled Pinned Locked Moved Solved Squish
7 Posts 5 Posters 3.2k Views 3 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.
  • S Offline
    S Offline
    supot
    wrote on last edited by
    #1

    Hi everyone,
    I have a small applicatio, written in Qt, in which the MainWindow class is having 2 public slots namely:

    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    .
    .
    .
    .
    public slots:
        quint8 GetColorCode();
        QString GetRGBColorCode();
    .
    .
    .
    };
    

    As per the Squish documents, public slots, signals and properties with Q_PROPERTY macro can be accessed directly from Squish environment. Slots and Signals appear under the Squish IDEs method list window.
    But unfortunately I am not able to see the above methods in the Squish IDE method list.
    Is there any specific way to make the public slots available to Squish?

    Regards,
    Bikash

    Pl45m4P C 2 Replies Last reply
    0
    • S supot

      Hi everyone,
      I have a small applicatio, written in Qt, in which the MainWindow class is having 2 public slots namely:

      class MainWindow : public QMainWindow
      {
          Q_OBJECT
      .
      .
      .
      .
      public slots:
          quint8 GetColorCode();
          QString GetRGBColorCode();
      .
      .
      .
      };
      

      As per the Squish documents, public slots, signals and properties with Q_PROPERTY macro can be accessed directly from Squish environment. Slots and Signals appear under the Squish IDEs method list window.
      But unfortunately I am not able to see the above methods in the Squish IDE method list.
      Is there any specific way to make the public slots available to Squish?

      Regards,
      Bikash

      C Offline
      C Offline
      clanhuth
      wrote on last edited by
      #7

      Hello @supot.

      Squish for Qt only exposes "public" APIs. You must declare the desired slots public.

      As a test I added...

      public slots:
          int GetColorCode();
          QString GetRGBColorCode();
      

      ...to squish_dir/examples/qt/addressbook/mainwindow.h, and...

      int MainWindow::GetColorCode()
      {
          return 3;
      }
      
      
      QString MainWindow::GetRGBColorCode()
      {
          return QString("3");
      }
      

      ...to squish_dir/examples/qt/addressbook/mainwindow.cpp, compiled the example and loaded it in Squish.

      Afterwards the "Methods" view showed these two methods when selecting the MainWindow object in the "Application Objects" view.

      Regards

      Clemens

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi and welcome to devnet,

        Something to check but your slots looks rather like accessors and not slots.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        S 1 Reply Last reply
        2
        • S supot

          Hi everyone,
          I have a small applicatio, written in Qt, in which the MainWindow class is having 2 public slots namely:

          class MainWindow : public QMainWindow
          {
              Q_OBJECT
          .
          .
          .
          .
          public slots:
              quint8 GetColorCode();
              QString GetRGBColorCode();
          .
          .
          .
          };
          

          As per the Squish documents, public slots, signals and properties with Q_PROPERTY macro can be accessed directly from Squish environment. Slots and Signals appear under the Squish IDEs method list window.
          But unfortunately I am not able to see the above methods in the Squish IDE method list.
          Is there any specific way to make the public slots available to Squish?

          Regards,
          Bikash

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by Pl45m4
          #3

          @supot said in Public slots not visibl in Squish:

          But unfortunately I am not able to see the above methods in the Squish IDE method list.

          Have you built your app already after you've added your slots? Try a "clean & rebuild".
          Maybe Squish will recognize them then.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          S 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi and welcome to devnet,

            Something to check but your slots looks rather like accessors and not slots.

            S Offline
            S Offline
            supot
            wrote on last edited by
            #4

            @SGaist said in Public slots not visibl in Squish:

            Hi and welcome to devnet,

            Something to check but your slots looks rather like accessors and not slots.

            Thanks @SGaist for the reply. Can this naming convention be an issue here? My intention is to make 2 methods available to Squish by declaring them as public slots.

            1 Reply Last reply
            0
            • Pl45m4P Pl45m4

              @supot said in Public slots not visibl in Squish:

              But unfortunately I am not able to see the above methods in the Squish IDE method list.

              Have you built your app already after you've added your slots? Try a "clean & rebuild".
              Maybe Squish will recognize them then.

              S Offline
              S Offline
              supot
              wrote on last edited by
              #5

              @Pl45m4 said in Public slots not visibl in Squish:

              @supot said in Public slots not visibl in Squish:

              But unfortunately I am not able to see the above methods in the Squish IDE method list.

              Have you built your app already after you've added your slots? Try a "clean & rebuild".
              Maybe Squish will recognize them then.

              Thanks @Pl45m4 for the reply. I am creating a package for test automation team using following steps:

              1. Compiling the code in Release mode (clean build everytime).
              2. Removing all obj/moc .h and .cpp files from release folder leaving only the .exe
              3. Using Windeployqt creating the package. same package is shared with test automation team.
                any issue in the above steps?
              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #6

                As @SGaist already pointed out your slots have a return value for unknown reason. You should try with a slot returning void to make sure Squish will really recognize them as slots. Also you maybe should ask the Squish support - they for sure know what's wrong.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                2
                • S supot

                  Hi everyone,
                  I have a small applicatio, written in Qt, in which the MainWindow class is having 2 public slots namely:

                  class MainWindow : public QMainWindow
                  {
                      Q_OBJECT
                  .
                  .
                  .
                  .
                  public slots:
                      quint8 GetColorCode();
                      QString GetRGBColorCode();
                  .
                  .
                  .
                  };
                  

                  As per the Squish documents, public slots, signals and properties with Q_PROPERTY macro can be accessed directly from Squish environment. Slots and Signals appear under the Squish IDEs method list window.
                  But unfortunately I am not able to see the above methods in the Squish IDE method list.
                  Is there any specific way to make the public slots available to Squish?

                  Regards,
                  Bikash

                  C Offline
                  C Offline
                  clanhuth
                  wrote on last edited by
                  #7

                  Hello @supot.

                  Squish for Qt only exposes "public" APIs. You must declare the desired slots public.

                  As a test I added...

                  public slots:
                      int GetColorCode();
                      QString GetRGBColorCode();
                  

                  ...to squish_dir/examples/qt/addressbook/mainwindow.h, and...

                  int MainWindow::GetColorCode()
                  {
                      return 3;
                  }
                  
                  
                  QString MainWindow::GetRGBColorCode()
                  {
                      return QString("3");
                  }
                  

                  ...to squish_dir/examples/qt/addressbook/mainwindow.cpp, compiled the example and loaded it in Squish.

                  Afterwards the "Methods" view showed these two methods when selecting the MainWindow object in the "Application Objects" view.

                  Regards

                  Clemens

                  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