QWidget* EditDelegate::createEditor(
QWidget* parent,
const QStyleOptionViewItem& option,
const QModelIndex& index) const
{
QLineEdit* editor = NULL;
if(index.isValid())
{
editor->resize(50,1000); //this can not work in win7
}
return editor;
}
EditDelegate는 QItemDelegate의 하위 클래스입니다.
당신은이 질문에 대해 어떻게 생각합니까?QLineEdit이 편집기로 사용될 때 어떻게 크기를 조정할 수 있습니까?
왜 당신은 크기를 조정하려고? 일반적으로 Qt는 사용중인 뷰에 따라 모든 것을 처리 할 것입니다. – Chris
왜 1000 픽셀 높이로 편집기를 설정하려고하는지 묻습니다. – Karlson
그냥 내 실수 –