День добрый! Есть такой класс...
| Код | #ifndef QGSRECT_H #define QGSRECT_H
#include <QObject> #include <QPointF>
class QGSRect { public: QGSRect() { QGSRect(0.0, 0.0, 0.0, 0.0); }
~QGSRect() { xmin = NULL; xmax = NULL; ymin = NULL; ymax = NULL; }
QGSRect(QString xMin = "0", QString yMin = "0", QString xMax = "0", QString yMax = "0") { this->xmin = xMin.toDouble(); this->xmax = xMax.toDouble(); this->ymin = yMin.toDouble(); this->ymax = yMax.toDouble(); }
QGSRect(double xMin = 0.0, double yMin = 0.0, double xMax = 0.0, double yMax = 0.0) { this->xmin = xMin; this->xmax = xMax; this->ymin = yMin; this->ymax = yMax; }
QGSRect(int xMin = 0, int yMin = 0, int xMax = 0, int yMax = 0) { this->xmin = (double)xMin; this->xmax = (double)xMax; this->ymin = (double)yMin; this->ymax = (double)yMax; }
double xMin(); double xMax(); double yMin(); double yMax();
QPointF center(); void clearPlus();
signals:
public slots:
private:
double xmin; double ymin; double xmax; double ymax;
};
#endif // QGSRECT_H #ifndef QGSRECT_H #define QGSRECT_H
#include <QObject> #include <QPointF>
class QGSRect { public: QGSRect() { QGSRect(0.0, 0.0, 0.0, 0.0); }
~QGSRect() { xmin = NULL; xmax = NULL; ymin = NULL; ymax = NULL; }
QGSRect(QString xMin = "0", QString yMin = "0", QString xMax = "0", QString yMax = "0") { this->xmin = xMin.toDouble(); this->xmax = xMax.toDouble(); this->ymin = yMin.toDouble(); this->ymax = yMax.toDouble(); }
QGSRect(double xMin = 0.0, double yMin = 0.0, double xMax = 0.0, double yMax = 0.0) { this->xmin = xMin; this->xmax = xMax; this->ymin = yMin; this->ymax = yMax; }
QGSRect(int xMin = 0, int yMin = 0, int xMax = 0, int yMax = 0) { this->xmin = (double)xMin; this->xmax = (double)xMax; this->ymin = (double)yMin; this->ymax = (double)yMax; }
double xMin(); double xMax(); double yMin(); double yMax();
QPointF center(); void clearPlus();
signals:
public slots:
private:
double xmin; double ymin; double xmax; double ymax;
};
#endif // QGSRECT_H
|
При использовании типа:
| Код | QGSMapInfo(QString name, QGSRect boundingBox) { mapName = name; mapBoundingBox = boundingBox; //QGSRect mapBoundingBox }
|
выдает следующую ругань:
| Код | qgsmapinfo.h:15: error: call of overloaded 'QGSRect()' is ambiguous
|
Не подскажете в чем дело? |