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. Why does the slot function not respond when the Qt child widget sends Update signal?
Forum Updated to NodeBB v4.3 + New Features

Why does the slot function not respond when the Qt child widget sends Update signal?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 219 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.
  • M Offline
    M Offline
    mirro
    wrote on last edited by mirro
    #1
    #include <QPushButton>
     
    test::test(QWidget *parent)
        : QWidget(parent)
    {
        ui.setupUi(this);
        QPushButton* pButton = new QPushButton;
        pButton->setParent(this);
        //
        QObject::connect(pButton, SIGNAL(update),
            this,SLOT(onSubWidgetUpdade));
    }
     
    test::~test()
    {
     
    }
     
    void test::onSubWidgetUpdade()
    {
        int J = 0;
    }
    
    mrjjM 1 Reply Last reply
    0
    • M mirro
      #include <QPushButton>
       
      test::test(QWidget *parent)
          : QWidget(parent)
      {
          ui.setupUi(this);
          QPushButton* pButton = new QPushButton;
          pButton->setParent(this);
          //
          QObject::connect(pButton, SIGNAL(update),
              this,SLOT(onSubWidgetUpdade));
      }
       
      test::~test()
      {
       
      }
       
      void test::onSubWidgetUpdade()
      {
          int J = 0;
      }
      
      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      @mirro
      Hi
      QPushButton do not have an update signal ??
      It wont send a signal when it draws. (PaintEvent)

      What do you try to do ?

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

        Hi,

        Beside what @mrjj wrote, you will have a runtime warning about your connection call. Its content is wrong.

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

        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