Hi,
I'm writing a project with a model and an item delegate to work on model's data.
The model is a tree. When I click on an item, I obtain a data editor in the middle
of a window. In order to set the graphical parameters of the editor, I reimplemented
the slot updateEditorGeometry.


Qt Code:
  1. void TableDataDelegate::updateEditorGeometry(QWidget *editor,
  2. const QStyleOptionViewItem &option, const QModelIndex &/* index */) const
  3. {
  4. // LUTEditor *editorInstance = static_cast<LUTEditor*>(editor);
  5. // if(!editorInstance->NameLabel->text().isEmpty()/*.contains("LUT")*/)
  6. // editor->setGeometry(0,0,800,800);
  7. // else
  8.  
  9. editor->setGeometry(0,0,400,800);
  10.  
  11. editor->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
  12. editor->setParent(pedit);
  13. editor->show();
  14. }
To copy to clipboard, switch view to plain text mode 

In this way, the slot fixes the size to 400x800,
for all the editors opened.
This is my problem:
I have different kinds of editors, and I'd like to set a different size
for each type (or at least for 2 types), but I don't know how to distinguish
the different types from this slot.
I tried with static_cast, as you can see in the comments,
but this gives some problems (the executable crashes).

Can someone give me a suggestion on how to solve this problem?

Than you very much,
QAlex