Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. A class declared by a macro can not be shown with all members in Class View of QtCreator
Forum Updated to NodeBB v4.3 + New Features

A class declared by a macro can not be shown with all members in Class View of QtCreator

Scheduled Pinned Locked Moved Qt Creator and other tools
class declaredclass view
1 Posts 1 Posters 414 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JohnYork
    wrote on last edited by JohnYork
    #1

    Hello, every one.
    I'm declaring some classes with a macro, because these classes have same member variables and functions. My macro is defined as follow:

    #define DECL_SENTENCE_CLASS(_SentenceClass, _DataType, ...)             \
    class _SentenceClass : public BasicSentence                             \
    {                                                                       \
    public:                                                                 \
       _DataType data;                                                      \
    protected:                                                              \
       virtual bool isThisFrame(char const* pfrmbuff, int bytesAvailable);  \
       virtual int composeFrame(char* pfrmbuff, int maxbytes,               \
                                logstream::LogStream* plogstream = NULL);   \
       virtual bool extractDatas(char const* pfrmbuff, int bytes,           \
                                 logstream::LogStream* plogstream = NULL);  \
    public:                                                                 \
       _SentenceClass(__VA_ARGS__);                                       \
       ~_SentenceClass();                                                   \
       virtual U2 totalSentenceCount(void)                                  \
       { return data.msginfo.r.TotalMsgCnt; }                               \
       virtual void setTotalSentenceCount(U2 count)                         \
       { data.msginfo.x.TotalMsgCnt = count; }                              \
       virtual U2 currentSentenceCount(void)                                \
       { return data.msginfo.r.LastProcessNum; }                            \
       virtual void setCurrentSentenceCount(U2 count)                       \
       { data.msginfo.x.ProcessedCnt = count; }                             \
    };
    

    When I use this macro to declare a class, for example:
    DECL_SENTENCE_CLASS(TestSentence, _tTestSentenceData)
    The class named 'TestSentece' can be shown in classview of QtCreator, but only constructor and destructor can be shown in the subtree of the class, the others, such as member variable 'data', virtual member function 'totalSentenceCount' can not be found in the subtree.

    I think maybe this is a small bug in classview plugin, could anyone check it?
    BTW: I'm using QtCreator v3.4.1, which is compiled with MinGW-w64 4.9.2 in MSYS2

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved