TD: port to Qt6
* in QtConcurrent::run the order of 1st and 2nd argument are swapped * QtConcurrent::run asserts that the argument of the passed function pointer is not non-const * Used methods of QFontDatabase are static in Qt5 and Qt6 * QTextStream::setCodec() has been removed in Qt6 * Argument of enterEvent() has changed from QEvent to QEnterEvent * QTextCharFormat::setFamily() is deprecated
This commit is contained in:
@@ -201,8 +201,7 @@ MRichTextEdit::MRichTextEdit(QWidget *parent, QString textIn) : QWidget(parent)
|
||||
|
||||
// font size
|
||||
|
||||
QFontDatabase db;
|
||||
const auto sizes = db.standardSizes();
|
||||
const auto sizes = QFontDatabase::standardSizes();
|
||||
for(int size: sizes) {
|
||||
f_fontsize->addItem(QString::number(size));
|
||||
}
|
||||
@@ -430,7 +429,11 @@ void MRichTextEdit::textStyle(int index) {
|
||||
}
|
||||
if (index == ParagraphMonospace) {
|
||||
fmt = cursor.charFormat();
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,13,0)
|
||||
fmt.setFontFamily(QString::fromUtf8("Monospace"));
|
||||
#else
|
||||
fmt.setFontFamilies(QStringList() << QString::fromUtf8("Monospace"));
|
||||
#endif
|
||||
fmt.setFontStyleHint(QFont::Monospace);
|
||||
fmt.setFontFixedPitch(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user