I simply don't see why this error's popping up.
Widget.cpp: In constructor 'Widget::Widget(Generic, char*, int, int, int, QObject*)':
Widget.cpp:13: error: invalid conversion from 'const char*' to 'char*'
Nowhere do I have a 'const char*' in terms of Widget's constructor.
class Widget: public QObject {
Q_OBJECT
Q_PROPERTY(char *col READ getCol WRITE setCol)
Q_PROPERTY(char *row READ getRow WRITE setRow)
Generic visitor;
char *_name;
char *_widget_base;
int _row;
int _col;
int _type;
public:
Widget(Generic visitor, char *name, int row, int col, int type, QObject *parent);
char* widgetBase() const;
QString getCol() const;
void setCol(const QString &col);
QString getRow() const;
void setRow(const QString &row);
};
Widget::Widget(Generic v, char *name, int row, int col, int type,
QObject *parent = 0 ) {
visitor = v;
std::string str(name);
int pos1 = str.find(":");
int pos2 = str.rfind(":");
_widget_base = str.substr(pos1, pos2-pos1).c_str();
_name = name;
_row = row;
_col = col;
_type = type;
}