2 #include "ui_datetimehelp.h"
9 int count = tableView->verticalHeader()->count();
10 int scrollBarHeight = 0;
11 if (tableView->horizontalScrollBar()->isVisible())
13 scrollBarHeight = tableView->horizontalScrollBar()->height();
15 int horizontalHeaderHeight = tableView->horizontalHeader()->height();
16 int rowTotalHeight = 0;
17 for (
int i = 0; i <
count; ++i)
20 if (!tableView->verticalHeader()->isSectionHidden(i))
22 rowTotalHeight += tableView->verticalHeader()->sectionSize(i);
25 tableView->setMinimumHeight(horizontalHeaderHeight + rowTotalHeight + scrollBarHeight);
38 connect(
ui->exampleDateTimeDateTimeEdit, &QDateTimeEdit::dateTimeChanged,
this,
39 [
this]() { refreshExample(); });
41 connect(
ui->exampleFormatStringLineEdit, &QLineEdit::textChanged,
this,
42 [
this]() { refreshExample(); });
44 connect(
_parent, &QDialog::finished,
this, [
this]() {
45 if (
ui->autoCloseCheckBox->isChecked())
59 auto dateTime =
ui->exampleDateTimeDateTimeEdit->dateTime();
60 auto formatString =
ui->exampleFormatStringLineEdit->text();
61 ui->resultLineEdit->setText(dateTime.toString(formatString));