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. '<class>' does not name a type...
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.6k 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.
  • Z Offline
    Z Offline
    Zerby
    wrote on last edited by
    #1

    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
    0
    • F Offline
      F Offline
      franku
      wrote on last edited by
      #2

      Have a look into uihandleconfigwindow.h

      This, Jen, is the internet.

      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