Detailed explanation of how to solve the problem of event not responding in C ++
Source: Internet
Author: User
In the C ++ development process, you can click the menu, right-click the menu, or click A, but the response is B. When you encounter the above problems, you can analyze them from the following aspects and generally solve them. Here are four solutions:
1. Check whether the event ing table of the menu ID exists. If it does not exist, it will not respond.
2. Check whether the menu ID is repeated with other menu IDs. If the menu ID is repeated, you may see Zhang guanli Dai (click menu A, but respond to Menu B's behavior)
3. Check whether the menu ID is consistent with the ing table ID of the corresponding menu event. The menu ID may be inconsistent with the ID of the event ing table.
4. In Qt, do you forget to write parentheses for the signal function:
Connect (underBtn, SIGNAL (clicked (), this, SLOT (slotUnder ()));
If the slotUnder function in SLOT (slotUnder () forgets to write parentheses, the event cannot respond.
For the fourth point, similar problems may occur in MFC and wxwidgets.
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