Merge pull request #7002 from spycrab/qt_rtc_seconds

Qt/AdvancedPane: Show seconds in custom RTC
This commit is contained in:
spycrab 2018-05-28 14:26:42 +02:00 committed by GitHub
commit 6865921286
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -72,6 +72,11 @@ void AdvancedPane::CreateLayout()
rtc_options->layout()->addWidget(m_custom_rtc_checkbox);
m_custom_rtc_datetime = new QDateTimeEdit();
// Show seconds
m_custom_rtc_datetime->setDisplayFormat(m_custom_rtc_datetime->displayFormat().replace(
QStringLiteral("mm"), QStringLiteral("mm:ss")));
if (!m_custom_rtc_datetime->displayFormat().contains(QStringLiteral("yyyy")))
{
// Always show the full year, no matter what the locale specifies. Otherwise, two-digit years