Who can save my code-completion?



  • Hey,Guy. I am getting into a trouble now.

    I hava set the completethis shortcut.So When I create a target as follow:

    QLabel* label = new QLabel("Help me!");

    When I input la and use the completethis shortcut, la becomes label.

    There is no problem here.

    But when I input label-> and use the completethis shortcut,nothing happened!

    I've looked up a lot of information and sloved nothing.

    Who comes to save the poor Chinese ?


  • Moderators

    @#include <QLabel>@



  • @#include <QApplication>
    #include <QLabel> // Hover the <QLabel> and It prompts
    //No such file or directory

    int main(int argc , char* argv[])
    {
    QApplication app(argc,argv);
    QLabel* label = new QLabel(
    "<h2>Hello</h2>"
    "<a >oschina</a>"
    "<h3><font color=red>Qt</font></h3>");
    label->setOpenExternalLinks(true);
    label->show();
    return app.exec();
    }
    @
    Thanks your answer.But I think I should provide more information.
    There is no error occured in above-mentioned code. But when my mouse
    hovers on the code #include <QLabel>,it prompts No such file or directory.
    But I can debug with no error.And I'am so sorry that upload a picture is so
    diff.
    What's more , when I try to press F4 so I can go to the QLabel.h,I failed once more.So I think there is some matter with my environment variable,
    But I don't know how to deal with it.Thanks, Amen.



  • [quote author="brsfjzzfxl" date="1394442702"]@#include <QApplication>
    #include <QLabel> // Hover the <QLabel> and It prompts
    //No such file or directory

    int main(int argc , char* argv[])
    {
    QApplication app(argc,argv);
    QLabel* label = new QLabel(
    "<h2>Hello</h2>"
    "<a >oschina</a>"
    "<h3><font color=red>Qt</font></h3>");
    label->setOpenExternalLinks(true);
    label->show();
    return app.exec();
    }
    @
    Thanks your answer.But I think I should provide more information.
    There is no error occured in above-mentioned code. But when my mouse
    hovers on the code #include <QLabel>,it prompts No such file or directory.
    But I can debug with no error.And I'am so sorry that upload a picture is so
    diff.
    What's more , when I try to press F4 so I can go to the QLabel.h,I failed once more.So I think there is some matter with my environment variable,
    But I don't know how to deal with it.Thanks, Amen.
    [/quote]



  • Have you added widgets to CONFIG in your .pro file
    @
    CONFIG += widgets
    @


  • Moderators

    What version(s) of Qt did you install?

    [quote author="andreyc" date="1394477883"]Have you added widgets to CONFIG in your .pro file
    @
    CONFIG += widgets
    @[/quote]It should be "QT += widgets", not "CONFIG += widgets".



  • Right.
    I should never publish without unit-testing. I should never publish without unit-testing.I should never publish without unit-testing.
    :-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.