passing a variable to QTableWidget Delegate in createEditor QT [SOLVED] -


my custom delegate item (item of qtablewidget) need know variable parent dialog how can retrieve it?

qwidget* customdelegate::createeditor ( qwidget* parent , const qstyleoptionviewitem& option , const qmodelindex& index ) const {     qwidget* delegate = qitemdelegate::createeditor(parent, option, index);     if(index.column() == 1)     {         qdoublespinbox* spin = new qdoublespinbox(parent);         spin->setdecimals(1);         ...     }     else if(index.column() == 2)     {         if (???variable parent dialog???)         {             qlineedit* timeobj = new qlineedit(parent);             timeobj->setinputmask("99");             qregexp rx("[0-9\\s][0-9\\s]");             qvalidator *myvalidat = new qregexpvalidator(rx, 0);             timeobj->setvalidator(myvalidat);             return timeobj;         }         qlineedit* timeobj = new qlineedit(parent);         timeobj->setinputmask("99:99");         ....     } } else     return delegate; 


Comments