Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    '<class>' does not name a type...

    General and Desktop
    2
    2
    1520
    Loading More Posts
    • 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.
    • Z
      Zerby last edited by

      Well, it struct me, and I can't seem to figure out what's wrong.

      My project is big, so I can't post all the code, but this is what's giving me the error:

      @#ifndef COMPARESELECT_H
      #define COMPARESELECT_H

      #include <QComboBox>
      #include <QObject>
      #include <QtWidgets>

      #include "uihandleconfigwindow.h"
      #include "taskCondition.h"

      class compareSelect : public QComboBox
      {

      Q_OBJECT
      

      private:
      friend class UIhandleConfigWindow;
      int selection;
      UIhandleConfigWindow& ui_parent; // <- THIS: 'UIhandleConfigWindow' does not name a type

      taskCondition *compare;
      

      public:
      compareSelect(UIhandleConfigWindow& ui_parent);
      ~compareSelect() {};

      int get_selection();
      void update_compare();
      

      public slots:

      private slots:
      void valueChanged();

      };

      #endif // COMPARESELECT_H
      @

      EDIT: Well, I got rid of it by declaring the class in the compareSelect.h file, like this:

      @
      #ifndef COMPARESELECT_H
      #define COMPARESELECT_H

      #include <QComboBox>
      #include <QObject>
      #include <QtWidgets>

      #include "uihandleconfigwindow.h"
      #include "taskCondition.h"

      class UIhandleConfigWindow;

      class compareSelect : public QComboBox
      {

      Q_OBJECT
      

      private:
      UIhandleConfigWindow& ui_parent;

      ....
      @

      1 Reply Last reply Reply Quote 0
      • F
        franku last edited by

        Have a look into uihandleconfigwindow.h

        This, Jen, is the internet.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post