c++ - getting text from Qtabewidgetitem changed in qtablewidget -
i have qtablewidget has 3 colomumns.it've changed it's first tow columns label i've inherited qlabeland it's third column qspinbox.
class table:public qtablewidget { q_object private: std::vector < std::vector <std::string> > food; public slots: // qstring get_number(); public: int row; table(qwidget* parent=0,int row=0,int x=0,int y=0,int weight=10,std::vector <std::vector <std::string> > food=std::vector<std::vector<std::string> >()); // qstring * get_number(table *); qstring getorder(); }; now i'm trying text of third , first column specific rows in button class have array of table objects in class. if (this->item(i,2)->text()!="0")
but in part of code (just text ()) programs stops running.
can body me why happens , how can text?
i got answer. should this:
string temp=dynamic_cast<qspinbox*>(this->cellwidget(j,2))->text().tostdstring(); if(temp!="0")...
Comments
Post a Comment