Mercurial > minori
diff src/gui/dialog/information.cpp @ 65:26721c28bf22
*: avoid usage of (to|from)StdString
in Qt5 (and probably Qt6 as well) these functions are only
available (or even usable) if Qt and Minori were built with the
*same standard headers*, which may not be the case in some
circumstances. hence, we'll use our own conversion functions,
which we probably should use anyway.
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 01 Oct 2023 23:26:35 -0400 |
parents | fe719c109dbc |
children | 6481c5aed3e1 |
line wrap: on
line diff
--- a/src/gui/dialog/information.cpp Sun Oct 01 23:15:43 2023 -0400 +++ b/src/gui/dialog/information.cpp Sun Oct 01 23:26:35 2023 -0400 @@ -67,7 +67,7 @@ id = anime.GetId(); /* anime title header text */ TextWidgets::Title* anime_title = - new TextWidgets::Title(QString::fromStdString(anime.GetUserPreferredTitle()), main_widget); + new TextWidgets::Title(Strings::ToQString(anime.GetUserPreferredTitle()), main_widget); /* tabbed widget */ QTabWidget* tabbed_widget = new QTabWidget(main_widget); @@ -150,7 +150,7 @@ QStringList string_list; for (unsigned int i = 0; i < ARRAYSIZE(Anime::ListStatuses); i++) - string_list.append(QString::fromStdString(Translate::ToString(Anime::ListStatuses[i]))); + string_list.append(Strings::ToQString(Translate::ToString(Anime::ListStatuses[i]))); QComboBox* combo_box = new QComboBox(subsection); combo_box->addItems(string_list); @@ -178,9 +178,9 @@ QLineEdit* line_edit = new QLineEdit(subsection); connect(line_edit, &QLineEdit::textChanged, this, [this](const QString& text) { /* this sucks but I don't really want to implement anything smarter :) */ - notes = text.toStdString(); + notes = Strings::ToUtf8String(text); }); - line_edit->setText(QString::fromStdString(notes = anime.GetUserNotes())); + line_edit->setText(Strings::ToQString(notes = anime.GetUserNotes())); line_edit->setPlaceholderText(tr("Enter your notes about this anime")); subsection->layout()->addWidget(line_edit); }); @@ -230,7 +230,7 @@ CREATE_FULL_WIDTH_SUBSECTION({ subsection->layout()->addWidget(new QLabel(tr("Alternative titles:"), subsection)); - QLineEdit* line_edit = new QLineEdit(QString::fromStdString(anime.GetUserNotes()), subsection); + QLineEdit* line_edit = new QLineEdit(Strings::ToQString(anime.GetUserNotes()), subsection); line_edit->setPlaceholderText( tr("Enter alternative titles here, separated by a semicolon (i.e. Title 1; Title 2)")); subsection->layout()->addWidget(line_edit);