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. Includes not found
Qt 6.11 is out! See what's new in the release blog

Includes not found

Scheduled Pinned Locked Moved General and Desktop
7 Posts 5 Posters 3.5k 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.
  • C Offline
    C Offline
    cloudbuster
    wrote on last edited by
    #1

    OK but where does it say (Qt documentation) that the following will give inclusion errors

    @
    #ifndef LOTTERY_H
    #define LOTTERY_H

    #include <QtGui/QWidget>
    #include "ui_lottery.h"
    #include <QMap>
    #include <QPaintEvent>
    #include <iostream>...........................................// unresolved inclusion
    #include <fstream>...........................................// unresolved inclusion
    //using namespace std;
    ofstream fout("/home/qt4user/landon.txt");......// ofstream could not be resolved
    class Lottery : public QWidget
    {
    Q_OBJECT

    public:
    Lottery(QWidget *parent = 0);
    ~Lottery();

    private:
    Ui::LotteryClass ui;........................................// Ui::LotteryClass could not be resolved
    void paintEvent( QPaintEvent * );
    QMap<int,int> histo;
    QPaintEvent* qpaintevent;
    void drawShapes( QPainter *p );
    private slots:
    void selectClicked();
    };

    #endif // LOTTERY_H
    @

    [EDIT: please wrap code in @-tags, Volker]

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Some administrative remarks first:

      • I split off your question off "this older thread":/forums/viewthread/12088 where you had posted it first. Please do not add new questions to old threads, especially in case they are marked "solved" already
      • please wrap your code in @-tags, this way it is formatted nicely

      #including iostream and fstream shouldn't lead to any errors. Try with a simple main method only, without any Qt related stuff to double check this.

      If your Ui::LotteryClass is not known, check in the designer if your form is named LotteryClass.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        bq. OK but where does it say (Qt documentation) that the following will give inclusion errors

        Why would you expect the Qt documentation to tell you how why your compiler pre-processor does not find standard C++ headers? This has nothing to do with Qt.

        As for Ui::LotteryClass, that's dependent on the include file ui_lottery.h generated from your lottery.ui file. Since the pre-processor finds ui_lottery.h it is clear that the top object defined in your UI is not call LotteryClass.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cloudbuster
          wrote on last edited by
          #4

          I'm sorry but what are @-tage???

          1 Reply Last reply
          0
          • C Offline
            C Offline
            cloudbuster
            wrote on last edited by
            #5

            guessing @-tags

            @source
            lda
            sta
            x=y
            @source

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mlong
              wrote on last edited by
              #6

              You simply place a single @ character on the line immediately before and immediately after a block of code. That forces the code to be formatted differently. If you hit edit on your initial post, you can see how Volker inserted them around your code block above.

              Software Engineer
              My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                koahnig
                wrote on last edited by
                #7

                There is also some description in the "forum help":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01

                Vote the answer(s) that helped you to solve your issue(s)

                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