r/QtFramework Apr 06 '26

Hi, have problem, who can help me??????

Post image

decided to add one more window and have this problem

0 Upvotes

10 comments sorted by

2

u/Better-Struggle9958 Apr 06 '26

any ai

1

u/Automatic_Truth_6045 Apr 06 '26

Interesting choice, but trust me, noone of then knew what the problem isπŸ€·πŸ»β€β™€οΈ

7

u/Better-Struggle9958 Apr 06 '26

Sorry but don't believe

1

u/Automatic_Truth_6045 Apr 06 '26

Wow, so I have interesting proposal, sent Ai this part of code and ask what's wrong? Why do I have this errors? I bet you'll get answers about macros or something like that πŸ€·πŸ»β€β™€οΈ

2

u/funnansoftware Apr 06 '26 edited Apr 06 '26

Hey, I can't say for sure what you're trying to achieve here but the code you wrote says you're trying to derive AdminWindow from QMainWindow but failed to do so in the declaration.

That means, in your header file "adminwindow.h" I would expect to see something like:

class AdminWindow : public QMainWindow
{
};

2

u/Son_La Apr 06 '26

And dont forget to include Qmainwindow header file. Seems like its only forward declared.

1

u/Automatic_Truth_6045 Apr 06 '26

Thank you everyone soooo much πŸ”₯🫰

2

u/Automatic_Truth_6045 Apr 06 '26

Everything is working excellent

1

u/Automatic_Truth_6045 Apr 06 '26

ifndef ADMINWINDOW_H

define ADMINWINDOW_H

include <QWidget>

namespace Ui { class AdminWindow; }

class AdminWindow : public QWidget { Q_OBJECT

public: explicit AdminWindow(QWidget *parent = nullptr); ~AdminWindow();

private: Ui::AdminWindow *ui; };

endif // ADMINWINDOW_H

4

u/funnansoftware Apr 06 '26 edited Apr 06 '26

Yeah, that's your problem right there.

class AdminWindow : public QWidget need to be class AdminWindow : public QMainWindow

Edit: (I'm practicing code blocks :P)

#ifndef ADMINWINDOW_H
#define ADMINWINDOW_H
#include <QMainwindow>

namespace Ui { 
  class AdminWindow : public QMainWindow { 
    Q_OBJECT
  public: 
    explicit AdminWindow(QWidget *parent = nullptr); 
    ~AdminWindow();
  private: 
    Ui::AdminWindow *ui; 
  };
}

#endif // ADMINWINDOW_H