Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem with sample program
Forum Updated to NodeBB v4.3 + New Features

Problem with sample program

Scheduled Pinned Locked Moved General and Desktop
qt sample probl
3 Posts 2 Posters 633 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.
  • G Offline
    G Offline
    Gravak
    wrote on last edited by Gravak
    #1

    Hello,

    I just learn C++ and I read a book about it.
    Now, I am at the chapter about QT and this sample doesn't work:

    ´´´
    #include <QtWidgets/QApplication>
    #include <QtWidgets/QLabel>
    #include <iostream>

    class MeinLabel : public QLabel
    {
    public:
    MeinLabel(const char *text) : QLabel(text)
    {
    }

    ~MeinLabel()
    {
        std::cout << "Destruktor ~MeinLabel gerufen!" << std::endl;
    }
    

    };

    int main(int argc, char *argv[])
    {
    QApplication application(argc, argv);
    MeinLabel *mlabel = new MeinLabel("Erstes Qt-Programm");
    mlabel->show();

    delete mlabel;
    return application.exec();
    

    }
    ´´´

    Why?

    QT Creator show me 59 errors.

    Sorry for my bad english.

    T 1 Reply Last reply
    0
    • G Gravak

      Hello,

      I just learn C++ and I read a book about it.
      Now, I am at the chapter about QT and this sample doesn't work:

      ´´´
      #include <QtWidgets/QApplication>
      #include <QtWidgets/QLabel>
      #include <iostream>

      class MeinLabel : public QLabel
      {
      public:
      MeinLabel(const char *text) : QLabel(text)
      {
      }

      ~MeinLabel()
      {
          std::cout << "Destruktor ~MeinLabel gerufen!" << std::endl;
      }
      

      };

      int main(int argc, char *argv[])
      {
      QApplication application(argc, argv);
      MeinLabel *mlabel = new MeinLabel("Erstes Qt-Programm");
      mlabel->show();

      delete mlabel;
      return application.exec();
      

      }
      ´´´

      Why?

      QT Creator show me 59 errors.

      Sorry for my bad english.

      T Offline
      T Offline
      t3685
      wrote on last edited by
      #2

      @Gravak

      Hi,

      The errors Qt creators shows are from your C++ compiler. The errors contain useful information about what is not working. You need to post those errors here before anyone can help you.

      Greetings,

      t3685

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Gravak
        wrote on last edited by
        #3

        Problem solved.

        The Qt Project file was empty.

        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