Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. What "Parentheses" am I missing ?
Forum Updated to NodeBB v4.3 + New Features

What "Parentheses" am I missing ?

Scheduled Pinned Locked Moved Unsolved C++ Gurus
4 Posts 3 Posters 532 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
    #1

    Complier / linked give no errors.
    Code runs with TWO problems

    In run time I get missing parentheses
    and
    I am not sure what "trigger" am I expecting.

    I am just highlighting the selection
    but I have a check box I like to see as a trigger.

    Will probably work better AFTER I fix the Parentheses issue .

    PLEASE
    NO suggestions to use lambda, maybe later.

    for (int index = 0; index < list_hcitool.size(); ++index)
                    {
                        text = "Add subsubmenu";
                        subtempmenu = new QMenu();
                        subtempmenu->setTitle(list_hcitool[index] + " #" + QString::number(index));
                        subMenu[index]  = tempmenu; //m_ui->menuWindow_cpntrol;
                        subAction[index] = subMenu[index]->addMenu(subtempmenu);
                        subAction[index]->setVisible(true);
                        subAction[index]->setCheckable(true);
    
                        qDebug() << list_hcitool[index];
    
                        // connect here ??
                        connect(subAction[index],SIGNAL(triggered),this,SLOT(testSlot()));
    
                    }
    
    
    

    Here is run time message...

    QObject::connect: Parentheses expected, signal QAction::triggered in mainwindow_Bluetooth.cpp:1587
    QObject::connect:  (receiver name: 'MainWindow_Bluetooth')
    "command   hcitool   dev "
    
    A 1 Reply Last reply
    0
    • A Anonymous_Banned275

      Complier / linked give no errors.
      Code runs with TWO problems

      In run time I get missing parentheses
      and
      I am not sure what "trigger" am I expecting.

      I am just highlighting the selection
      but I have a check box I like to see as a trigger.

      Will probably work better AFTER I fix the Parentheses issue .

      PLEASE
      NO suggestions to use lambda, maybe later.

      for (int index = 0; index < list_hcitool.size(); ++index)
                      {
                          text = "Add subsubmenu";
                          subtempmenu = new QMenu();
                          subtempmenu->setTitle(list_hcitool[index] + " #" + QString::number(index));
                          subMenu[index]  = tempmenu; //m_ui->menuWindow_cpntrol;
                          subAction[index] = subMenu[index]->addMenu(subtempmenu);
                          subAction[index]->setVisible(true);
                          subAction[index]->setCheckable(true);
      
                          qDebug() << list_hcitool[index];
      
                          // connect here ??
                          connect(subAction[index],SIGNAL(triggered),this,SLOT(testSlot()));
      
                      }
      
      
      

      Here is run time message...

      QObject::connect: Parentheses expected, signal QAction::triggered in mainwindow_Bluetooth.cpp:1587
      QObject::connect:  (receiver name: 'MainWindow_Bluetooth')
      "command   hcitool   dev "
      
      A Offline
      A Offline
      Anonymous_Banned275
      wrote on last edited by
      #2

      @AnneRanch said in What "Parentheses" am I missing ?:

      SIGNAL(triggered)

      THis is the parenttheses issue,

      SIGNAL(triggered() )

      and then I am miss WHO will trigger

      SIGNAL(triggered(... actual trigger here ...) )

      JoeCFDJ Axel SpoerlA 2 Replies Last reply
      0
      • A Anonymous_Banned275

        @AnneRanch said in What "Parentheses" am I missing ?:

        SIGNAL(triggered)

        THis is the parenttheses issue,

        SIGNAL(triggered() )

        and then I am miss WHO will trigger

        SIGNAL(triggered(... actual trigger here ...) )

        JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by JoeCFD
        #3

        @AnneRanch https://doc.qt.io/qt-5/qaction.html#triggered
        you need a bool there.

        1 Reply Last reply
        1
        • A Anonymous_Banned275

          @AnneRanch said in What "Parentheses" am I missing ?:

          SIGNAL(triggered)

          THis is the parenttheses issue,

          SIGNAL(triggered() )

          and then I am miss WHO will trigger

          SIGNAL(triggered(... actual trigger here ...) )

          Axel SpoerlA Offline
          Axel SpoerlA Offline
          Axel Spoerl
          Moderators
          wrote on last edited by
          #4

          @AnneRanch
          The recommended way is:
          connect(subAction[index], &yourClass::triggered, this, &thisClass::testSlot);

          Software Engineer
          The Qt Company, Oslo

          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