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. qt autocomplete prompt not showing pointers of my class

qt autocomplete prompt not showing pointers of my class

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
qt 5.3.2qt creator 3.2
2 Posts 2 Posters 940 Views
  • 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.
  • K Offline
    K Offline
    ketjow
    wrote on last edited by
    #1

    The problem is that autocomplete prompt not showing name of my class pointer.

    Fragment of my code

      QFile ingredFile;
        if(loadFileWithDirection(&ingredFile, qApp->applicationDirPath() + MENUINXML + INGREDIENTSFILE ))
        {
            QXmlStreamReader *xmlStream = new QXmlStreamReader(&ingredFile);
    
            while(!xmlStream->atEnd() && !xmlStream->hasError())
            {
                    QXmlStreamReader::TokenType token = xmlStream->readNext();
                    if(token == QXmlStreamReader::StartDocument) {
                            continue;
                    }
                    if(token == QXmlStreamReader::StartElement)
                    {
    
                            if(xmlStream->name() == "id")
                            {
                                    continue;
                            }
                           
                            Ingredient *ingredient = new Ingredient();    
                            // when I'm typing ingre I can see prompt with 
                            // class Ingredient, ingredFile (which is 
                            //  declared  above) but is lack of ingredient 
                            // pointer
    

    If I change code to:

    Ingredient ingredient;
    // now when I'm typing ingre I can see 
    // ingredient on the list of autocomplete prompt 
    

    I tried to build project and run it, but it doesn't change anything.
    What is more strange when I type xml it shows xmlStream on the list of prompt and this is the pointer, the difference is that these class is not created by me.

    What is reason of this behavior ?

    Did you had problems like this with qt?

    I'm using qt Creator, version:

    Qt Creator 3.2.2 (opensource)

    Based on Qt 5.3.2 (MSVC 2010, 32 bit)

    1 Reply Last reply
    0
    • ValentinMicheletV Offline
      ValentinMicheletV Offline
      ValentinMichelet
      wrote on last edited by
      #2

      Have you explicitly added

      #include "Ingredient.h"
      

      in your code? Sometimes it's only a matter of where to find the class definition, even though the compilation works just fine.

      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