Qt static function qmetaobject: connectslotsbyname (qobject * object)

Source: Internet
Author: User

View othersCodeVoid on_mywidget_slottest ();

I'm depressed. I don't see the connect in his code, but I can connect the signal to the slot.

Today, I reviewed the book and found the content of Nb in this letter.

Qmetaobject: connectslotsbyname (qobject * object)Recursively search all sub-objects of the passed QT object and associate the signals of all matched sub-objects with the following rule of the object.Void on _ <widget name >_< signal Name> (<Signal Parameter>)

If the widget has provided a signal, QT can be automatically associated.

// Declare class myclass {public slots: void on_mypushbutton_clicked () ;}; // implement void myclass: on_mypushbutton_clicked (){}

This will automatically associate .. It's really embarrassing to read a book.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.