hi all,
i m implementing a stack. the contents of which are class stack.
definition of class stack :
Code:
//stack.h class cellSpec { int row,col; public: cellSpec(int,int); void operator=(const cellSpec & temp); }; class stack { QString lastAction; QTableWidget *table; QStringList Contents; QList<cellSpec> cellAdd; public: // stack(const stack &); // stack operator=(stack &); };
Code:
//stack.cpp #include "Stack.h" cellSpec::cellSpec(int r,int c) { row = r; col = c; } void cellSpec::operator=(const cellSpec & temp) { row = temp.row; col = temp.col; } { lastAction = lastAction; table = table; Contents << Contents; cellAdd = cellAdd; } /* stack::stack(const stack &stack) { // return stack; } /* stack stack::operator=(stack &stack) { return stack; } */
i m receiving error :
Code:
C:/Qt/4.1.2/include\QtCore/../../src/corelib/tools/qvector.h(323) : error C2512: 'stack' : no appropriate default constructor available C:/Qt/4.1.2/include\QtCore/../../src/corelib/tools/qlist.h(179) : while compiling class-template member function 'void __thiscall QVector<class stack>::realloc(int,int)' C:/Qt/4.1.2/include\QtCore/../../src/corelib/tools/qvector.h(362) : error C2512: 'stack' : no appropriate default constructor available C:/Qt/4.1.2/include\QtCore/../../src/corelib/tools/qlist.h(179) : while compiling class-template member function 'void __thiscall QVector<class stack>::realloc(int,int)' Stack.cpp
main prg
Code:
{ QStack<stack> undoStack; cellSpec cell(row,col); QList<cellSpec> cellList; cellList << cell; cellList.append(cell); stack row1(Contents,table,cellList,lastAction); undoStack.push(row1); }
What can be the problem