........
QAbstractItemModel* model=ui.futuresTableWidget->model();
ind= model->index(row,col);
QWidget *w =0;
if(it==0) it=dynamic_cast<QDrvAbstractItemDelegate*>ui.futur esTableWidget->itemDelegate());
QStyleOptionViewItem styleIt;
if(it!=0) w=it->createEditor(ui.futuresTableWidget,styleIt,ind) ;
auxLine=qobject_cast<QLineEdit*> (w);
it->setEditorData(auxLine,ind);
connect(auxLine,SIGNAL(cursorPositionChanged ( int, int ) ),this,SLOT(cursorPosChanged(int,int)) );
numPad->setWindowModality(Qt::WindowModal);
numPad->show();
numPad->raise();
........
I use auxLine to manage the text that i send from my numPad which is another widget from that i send numbers to the tablewidget and i want to insert the numbers where the
cursor is
the thing is when i send a number the qtablewidget item turns gray and it inserts items only at its end i dont know if this is relevant
//slot // numPad emits a signal sendText(t); and sends the text here
void catchText(QString text)
{
auxLine.insert(text);
}





Reply With Quote


Bookmarks