Skip to content

Commit

Permalink
New project dialog resize contents of parameter table
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Ribelotta <[email protected]>
  • Loading branch information
martinribelotta committed Sep 4, 2016
1 parent f388ccc commit 6f9c0b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion projectnewdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ ProjectNewDialog::ProjectNewDialog(QWidget *parent) :
QDir defTemplates(":/build/templates/");
QDir localTemplates(QSettings().value("build/templatepath").toString());
ui->setupUi(this);
ui->parameterTable->horizontalHeader()->setStretchLastSection(true);
foreach(QFileInfo info, defTemplates.entryInfoList(QStringList("*.template"))) {
ui->templateFile->addItem(info.baseName(), info.absoluteFilePath());
}
Expand Down Expand Up @@ -198,7 +199,6 @@ void ProjectNewDialog::on_templateFile_editTextChanged(const QString &fileName)
Q_UNUSED(fileName);
QString name = ui->templateFile->currentData(Qt::UserRole).toString();
QString text = readAll(name);
ui->parameterTable->clear();
ui->parameterTable->setRowCount(0);
if (!text.isEmpty()) {
QRegExp re("\\$\\{\\{([a-zA-Z0-9_]+)\\s*([a-zA-Z0-9_]+)*\\s*\\:*(.*)\\}\\}");
Expand All @@ -220,6 +220,7 @@ void ProjectNewDialog::on_templateFile_editTextChanged(const QString &fileName)
ui->parameterTable->setItemDelegateForRow(rows, ed);
idx += re.matchedLength();
}
ui->parameterTable->resizeColumnToContents(0);
}
}

Expand Down

0 comments on commit 6f9c0b9

Please sign in to comment.