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

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

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

問題描述

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

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

我以前從未在類定義中看到 private 關鍵字和 : 之間的東西.這里有什么奇特的 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 的預處理器元對象編譯器 (moc) 發送代碼后才進行編譯.見 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.額外的關鍵字是用標準預處理器#defined 去掉的.

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

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

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

相關文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數據?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫 for() 循環: for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環?)
Reusing thread in loop c++(在循環 C++ 中重用線程)
Precise thread sleep needed. Max 1ms error(需要精確的線程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環形?)
主站蜘蛛池模板: 最新av在线播放 | 亚洲综合网站 | 欧美色偷偷| 色综合色综合色综合 | 激情六月天 | 久久精品欧美 | 人人看人人干 | 欧美一区二区免费 | 中文字幕1区 | 日韩免费高清视频 | 欧美黄网站 | 欧美成人精品欧美一级私黄 | 免费在线观看av | 黄色毛毛片 | 成年网站在线观看 | 欧美成人精品一区二区三区在线看 | 日本理论片午伦夜理片在线观看 | 最新国产视频 | 成人黄色在线观看 | 天堂网中文字幕 | 国产一区在线视频 | 日韩欧美国产精品 | 成人免费看片在线观看 | 久热精品在线 | 在线日韩欧美 | 久久久久久av | 天天综合永久入口 | 狠狠干综合网 | 在线观看中文字幕 | 国产69精品久久久久久 | 国产精品福利一区 | 99国产精品99久久久久久粉嫩 | 日本免费在线观看 | 福利网站在线观看 | 欧美一级网站 | 色婷婷在线播放 | 日韩专区在线观看 | 欧美成人激情视频 | 午夜免费福利 | 最新超碰 | 免费激情网站 |