csvivek
30th May 2008, 11:19
Is it possible to setValidator for each cell in a table?
if yes..? how? please enlighten me on this..
--
Thanks in advance
QWidget* MyItemDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
QWidget* editor = QItemDelegate::createEditor(parent, option, index);
if (QLineEdit* lineEdit = dynamic_cast<QLineEdit*>(editor))
{
QValidator* validator = ...
...
lineEdit->setValidator(validator);
}
return editor;
}
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.