Bug 541229 - Open Declaration does not find Qt's class definition, caused by Q_WIDGETS_EXPORT macro
Summary: Open Declaration does not find Qt's class definition, caused by Q_WIDGETS_EXP...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 9.5.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-16 03:50 EST by Daniel Schürmann CLA
Modified: 2020-09-04 15:21 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Schürmann CLA 2018-11-16 03:50:07 EST
Qt Classes are defined as: 

class QApplication;
...
class Q_WIDGETS_EXPORT QApplication : public QGuiApplication
{


The "Open Declaration" feature picks the prototype and not the class definition. 
If I remove Q_WIDGETS_EXPORT it works. 

Q_WIDGETS_EXPORT is finally defined as __declspec(dllexport)

My workaround is to define __declspec(dllexport) as "" in 
"C/C++ General"->"Paths and Symbols"->"Symbols"
Comment 1 Nathan Ridge CLA 2018-11-17 16:59:15 EST
It works fine in this simple example:


#define Q_WIDGETS_EXPORT __declspec(dllexport) 

class QApplication;

class Q_WIDGETS_EXPORT QApplication {
    
};

int main() {
    QApplication qa;
}


so there must be something else going on that just the macro expanding to an attribute.