久久久久久久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)形?)
主站蜘蛛池模板: www精品美女久久久tv | 91资源在线 | 久久久久久久av麻豆果冻 | 久久不卡| 操到爽| av成年人网站 | 日韩精品一区二区三区四区 | 亚洲精品乱码久久久久久蜜桃91 | 天天久| 欧美国产精品 | 高清人人天天夜夜曰狠狠狠狠 | 一区二区视频在线观看 | 欧洲av一区 | 日干夜操| 一级大黄| 亚洲午夜在线 | 欧美一区二区三区在线观看视频 | 视频在线观看亚洲 | 色资源在线视频 | 欧美成人免费在线视频 | 人人性人人性碰国产 | 亚洲精品一区二三区不卡 | 综合精品 | 国产专区在线 | 亚洲精品九九 | 久久国产精品免费一区二区三区 | 凹凸日日摸日日碰夜夜 | 国产精品久久久久久久久久免费 | 亚洲精品视频在线 | a级大片 | 国产真实精品久久二三区 | 久久久久国产精品午夜一区 | 国产不卡在线观看 | 狠狠干美女 | 国产精品入口 | 综合欧美亚洲 | 久视频在线观看 | 亚洲精品在线视频 | 国产精品久久在线观看 | 日本欧美大片 | 亚洲综合色视频在线观看 |