久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Qt“私人插槽:"這是什么?

Qt quot;private slots:quot; what is this?(Qt“私人插槽:這是什么?)
本文介紹了Qt“私人插槽:"這是什么?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我知道如何使用它,但它的語法讓我很困擾.什么是私人插槽:"在做什么?

I understand how to use it, but the syntax of it bothers me. What is "private slots:" doing?

我以前從未在類定義中看到 private 關(guān)鍵字和 : 之間的東西.這里有什么奇特的 C++ 魔法嗎?

I have never seen something between the private keyword and the : in a class definition before. Is there some fancy C++ magic going on here?

這里的例子:

 #include <QObject>

 class Counter : public QObject
 {
     Q_OBJECT

 public:
     Counter() { m_value = 0; }

     int value() const { return m_value; }

 public slots:
     void setValue(int value);

 ...

推薦答案

Slots 是 C++ 的 Qt 特定擴展.它僅在通過 Qt 的預(yù)處理器元對象編譯器 (moc) 發(fā)送代碼后才進行編譯.見 http://doc.qt.io/qt-5/moc.html 用于文檔.

Slots are a Qt-specific extension of C++. It only compiles after sending the code through Qt's preprocessor, the Meta-Object Compiler (moc). See http://doc.qt.io/qt-5/moc.html for documentation.

正如弗蘭克指出的,只有鏈接才需要 moc.額外的關(guān)鍵字是用標準預(yù)處理器#defined 去掉的.

As Frank points out, moc is only required for linking. The extra keywords are #defined away with the standard preprocessor.

這篇關(guān)于Qt“私人插槽:"這是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數(shù)據(jù)?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫 for() 循環(huán): for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環(huán)?)
Reusing thread in loop c++(在循環(huán) C++ 中重用線程)
Precise thread sleep needed. Max 1ms error(需要精確的線程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環(huán)形?)
主站蜘蛛池模板: 亚洲九色 | 极品国产视频 | 久久国产精品99久久久久久丝袜 | 成人在线免费视频 | 亚洲国产精品久久久久婷婷老年 | 在线免费观看黄色网址 | 精品欧美一区二区精品久久久 | av网站在线播放 | 成人精品福利 | 成人av观看| 美女张开腿露出尿口 | 婷婷综合五月天 | 亚洲欧美日韩久久久 | 欧美精品v | 啪啪精品 | 精品欧美乱码久久久久久 | 欧美精品在线免费 | 97av在线 | 玖玖在线精品 | www.日本在线 | 精品91| 国产伦精品一区二区三区高清 | 欧美亚洲日本 | 日韩一区二区三区四区五区六区 | 成年人黄色免费视频 | 成人欧美一区二区三区黑人孕妇 | 国产美女网站 | 精品亚洲一区二区三区 | 国产精品久久久久久久久久三级 | 久久大| 久久成人一区 | 亚洲福利一区 | 欧美一级免费 | 免费a网站 | 日韩av成人在线观看 | 欧美毛片免费观看 | 人人干人人舔 | 亚洲国产欧美一区二区三区久久 | 黄色毛片一级 | 福利网站导航 | 亚洲综合一区二区三区 |