Examples: replace QDate::longMonthName()/longDayName()
QDate::longMonthName()/longDayName was deprecated in 5.10 and replaced by QLocale::system().monthName()/dayName() in this case Change-Id: I666cccfa1b8a437cc830804bbe3504511265ea9b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
1c33e8945d
commit
10db31f933
@ -66,7 +66,7 @@ MainWindow::MainWindow()
|
|||||||
QComboBox *monthCombo = new QComboBox;
|
QComboBox *monthCombo = new QComboBox;
|
||||||
|
|
||||||
for (int month = 1; month <= 12; ++month)
|
for (int month = 1; month <= 12; ++month)
|
||||||
monthCombo->addItem(QDate::longMonthName(month));
|
monthCombo->addItem(QLocale::system().monthName(month));
|
||||||
|
|
||||||
QDateTimeEdit *yearEdit = new QDateTimeEdit;
|
QDateTimeEdit *yearEdit = new QDateTimeEdit;
|
||||||
yearEdit->setDisplayFormat("yyyy");
|
yearEdit->setDisplayFormat("yyyy");
|
||||||
@ -168,7 +168,7 @@ void MainWindow::insertCalendar()
|
|||||||
QTextTableCell cell = table->cellAt(0, weekDay-1);
|
QTextTableCell cell = table->cellAt(0, weekDay-1);
|
||||||
//! [11] //! [12]
|
//! [11] //! [12]
|
||||||
QTextCursor cellCursor = cell.firstCursorPosition();
|
QTextCursor cellCursor = cell.firstCursorPosition();
|
||||||
cellCursor.insertText(QString("%1").arg(QDate::longDayName(weekDay)), boldFormat);
|
cellCursor.insertText(QLocale::system().dayName(weekDay), boldFormat);
|
||||||
}
|
}
|
||||||
//! [12]
|
//! [12]
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ void MainWindow::insertCalendar()
|
|||||||
cursor.endEditBlock();
|
cursor.endEditBlock();
|
||||||
//! [14]
|
//! [14]
|
||||||
setWindowTitle(tr("Calendar for %1 %2"
|
setWindowTitle(tr("Calendar for %1 %2"
|
||||||
).arg(QDate::longMonthName(selectedDate.month())
|
).arg(QLocale::system().monthName(selectedDate.month())
|
||||||
).arg(selectedDate.year()));
|
).arg(selectedDate.year()));
|
||||||
}
|
}
|
||||||
//! [14]
|
//! [14]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user