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



  • 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;

    ....
    @



  • Have a look into uihandleconfigwindow.h


Log in to reply
 

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