mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
The never ending, futile fight for whitespace consistency
I just need to write a tool that does this... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7757363953
commit
115e5e5fbc
16 changed files with 116 additions and 130 deletions
|
@ -51,15 +51,14 @@ QSize StarWidgetsDelegate::sizeHint(const QStyleOptionViewItem& option, const QM
|
|||
|
||||
QWidget* TankInfoDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
||||
{
|
||||
QComboBox *comboDelegate = new QComboBox(parent);
|
||||
QComboBox *comboDelegate = new QComboBox(parent);
|
||||
TankInfoModel *model = new TankInfoModel;
|
||||
QString data = index.model()->data(index, Qt::DisplayRole).toString();
|
||||
comboDelegate->setModel(model);
|
||||
int i;
|
||||
for(i = 0; i < model->rowCount(); i++){
|
||||
if (model->data(model->index(i,0), Qt::DisplayRole).toString() == data){
|
||||
for (i = 0; i < model->rowCount(); i++) {
|
||||
if (model->data(model->index(i,0), Qt::DisplayRole).toString() == data)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i != model->rowCount())
|
||||
comboDelegate->setCurrentIndex(i);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue