Home > Mobile >  QT small white for help! Thank you all for the great god
QT small white for help! Thank you all for the great god

Time:10-02

In qt study on the road to see a piece of code, emergency help! Excuse me "start the was not declared in this scope" how to solve? The same end also have this problem, how to declare the variable?
# # ifndef SHAPE_H
# define SHAPE_H

#include

The namespace Ui {
The class Shape;
}

The class Shape: public QMainWindow
{
Q_OBJECT

Public:
Explicit Shape (QWidget * parent=0);
To Shape ();
Enum Code {Line, the Rect}; Shape ();

Void setStart (QPoint s)
{
Start=s;
}
Void setEnd (QPoint e)
{
End=e;
}
The QPoint the startPoint ()
{
Return the start;
}
The QPoint endPoint ()
{
Return the end;
}
Void virtual paint (QPainter & amp; Painter)=0;
Private:
Ui: : Shape * Ui;
};

# endif//SHAPE_H

CodePudding user response:

Add QPoint class start;

CodePudding user response:

Private:
Ui: : Shape * Ui;
The QPoint start;
The QPoint end;

Not defined by the start and end

CodePudding user response:

Thank you very much! Successfully solved
  •  Tags:  
  • Qt
  • Related