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

Qt 宏關(guān)鍵字導(dǎo)致名稱沖突

Qt macro keywords cause name collisions(Qt 宏關(guān)鍵字導(dǎo)致名稱沖突)
本文介紹了Qt 宏關(guān)鍵字導(dǎo)致名稱沖突的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我正在為我的 Qt 項(xiàng)目構(gòu)建一個(gè) NCurses 界面.我想使用 CDK,但我認(rèn)為該結(jié)構(gòu)的 signals 成員與 Qt signals 關(guān)鍵字發(fā)生沖突.

I am building an NCurses interface for my Qt project. I want to use CDK but I think the signals member of this struct is colliding with the Qt signals keyword.

/usr/include/linux/cdk.h:411: error: expected unqualified-id before 'protected'

如何讓 CDK 與 Qt 一起工作?

How can I get CDK to work with Qt?

推薦答案

您可以定義 QT_NO_KEYWORDS 宏,禁用信號(hào)"和槽"宏.

You can define the QT_NO_KEYWORDS macro, that disables the "signals" and "slots" macros.

如果您使用 QMake:

If you use QMake:

 CONFIG += no_keywords

(Qt 文檔在這里)

如果您使用其他構(gòu)建系統(tǒng),請(qǐng)執(zhí)行任何需要將 -DQT_NO_KEYWORDS 傳遞給編譯器的操作.

If you’re using another build system, do whatever it needs to pass -DQT_NO_KEYWORDS to the compiler.

定義 QT_NO_KEYWORDS 將要求您將 Qt 中 signals 的出現(xiàn)次數(shù)更改為 Q_SIGNALS 并將 slots 的出現(xiàn)次數(shù)更改為 Q_SLOTS代碼.

Defining QT_NO_KEYWORDS will require you to change occurrences of signals to Q_SIGNALS and slots to Q_SLOTS in your Qt code.

如果您無(wú)法更改所有 Qt 代碼,例如因?yàn)槟褂玫牡谌綆?kù)不是關(guān)鍵字清理",您可以嘗試在包含 cdk.h 之前在本地取消定義信號(hào)":

If you cannot change all the Qt code, e.g. because you're using third-party libraries not being "keyword-clean", you could try to undefine "signals" locally before including cdk.h:

#undef signals
#include <cdk.h>

如果可能的話,我建議使用 no_keywords,因?yàn)樗荒敲捶ξ肚也灰壮鲥e(cuò).

I'd recommend to use no_keywords though if possible, as it is less tedious and error-prone.

這篇關(guān)于Qt 宏關(guān)鍵字導(dǎo)致名稱沖突的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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)形?)
主站蜘蛛池模板: 久久精品中文 | 国产一级片视频 | 欧美自拍视频 | 中文字幕在线观看日本 | 中文字幕网址在线 | 欧美激情一区二区三区 | 亚洲天堂网在线观看 | 精品国产区一区二 | 两性免费视频 | 中文字幕免费视频 | 亚洲精品久久久久久久久 | 国产精品福利一区 | 国产精品一区二区视频 | 欧美视频在线观看 | 91啦丨九色丨刺激 | 国产亚洲精品成人av久久ww | 能看毛片的网站 | 99视频网 | 99久久婷婷国产综合精品草原 | 国产小视频在线播放 | 亚洲天堂男人天堂 | 欧美日韩免费视频 | 亚洲精品乱码久久久久久蜜桃91 | 国产a精品 | 国产小视频在线 | 日韩在线视频网站 | 久久久久婷婷 | 成人黄色小视频 | 韩国av在线 | 午夜激情福利 | 97视频在线免费观看 | 麻豆一区二区三区四区 | 中国一级毛片免费看 | 日本精品视频在线观看 | 97精品视频在线观看 | 无毒不卡 | 日韩一区二区在线视频 | 精品免费在线观看 | 久久av资源 | 久热精品视频在线观看 | 久久精品人人 |