Good day to all! With Qt newbie, something stupid. So there is a class declaration:
#include <QLabel> #include <QDialog> #include <gst/gst.h> #include "pipeline.h" namespace Ui { class Draw; } class Draw : public QDialog { Q_OBJECT public: int MaxCounter; QLabel *Label; GstBuffer *Buffer; private: Ui::Draw *ui; Pipeline *pPipe; int VidCounter; public: Draw(Pipeline *, QWidget *parent = 0); int DrawBuffer(void); private: }; Implementation:
#include "draw.h" Draw::Draw(Pipeline *p, QWidget *parent) : QDialog(parent), ui(new Ui::Draw) { pPipe = p; VidCounter = 0; QLabel mode; mode.setPixmap(QPixmap(QString::fromUtf8(":/icons/mode1.png"))); mode.setGeometry(QRect(42, 40, 49, 69)); mode.show(); while(1); } However, when trying to compile, it produces 2 errors: error: invalid use of incomplete type 'struct Ui :: Draw' and error: forward declaration of 'struct Ui :: Draw'.
How to deal with this mind I will not put it .. If I remove inheritance, then QLabel is not displayed on the screen, only the cursor in the center of the screen is visible.
Thanks for any help and thoughts!
PS Corrected. However, there was another issue with compilation. Definition:
namespace Ui { class Draw; } class Ui::Draw : public QDialog { Q_OBJECT public: int MaxCounter; QLabel *Label; GstBuffer *Buffer; private: Ui::Draw *ui; Pipeline *pPipe; int VidCounter; public: Draw(Pipeline *, QWidget *parent = 0); int DrawBuffer(void); private: }; Implementation:
Ui::Draw::Draw(Pipeline *p, QWidget *parent) : QDialog(parent), ui(new Ui::Draw) { pPipe = p; VidCounter = 0; QLabel mode; mode.setPixmap(QPixmap(QString::fromUtf8(":/icons/mode1.png"))); mode.setGeometry(QRect(42, 40, 49, 69)); mode.show(); while(1); } But now it does not compile with the following errors:
error: no matching function for call to 'Ui::Draw::Draw()' candidates are: Ui::Draw::Draw(Pipeline*, QWidget*) note: Ui::Draw::Draw(const Ui::Draw&) Something I'm in a stupor .. I do not understand what is wrong for him?
int DrawBuffer(void);(by the way, why there, it is possible and without void) - KoVadimUi::Drawand::Draw. - user194374#include "ui_draw.h"in.cpp. This file in the build process creates a utility utilityuicfrom yourdraw.ui- aleks.andr