Avoid unqualified `std` calls in `qtsettings.cpp`

This commit is contained in:
Martchus 2023-10-14 20:09:06 +02:00
parent a1f50456e8
commit dcc6f71f1e
1 changed files with 5 additions and 7 deletions

View File

@ -33,8 +33,6 @@
#include <memory> #include <memory>
#include <optional> #include <optional>
using namespace std;
namespace QtUtilities { namespace QtUtilities {
struct QtSettingsData { struct QtSettingsData {
@ -91,7 +89,7 @@ inline QtSettingsData::QtSettingsData()
* system-default. * system-default.
*/ */
QtSettings::QtSettings() QtSettings::QtSettings()
: m_d(make_unique<QtSettingsData>()) : m_d(std::make_unique<QtSettingsData>())
{ {
} }
@ -266,11 +264,11 @@ void QtSettings::apply()
if (m_d->customStyleSheet && !m_d->styleSheetPath.isEmpty()) { if (m_d->customStyleSheet && !m_d->styleSheetPath.isEmpty()) {
auto file = QFile(m_d->styleSheetPath); auto file = QFile(m_d->styleSheetPath);
if (!file.open(QFile::ReadOnly)) { if (!file.open(QFile::ReadOnly)) {
cerr << "Unable to open the specified stylesheet \"" << m_d->styleSheetPath.toLocal8Bit().data() << "\"." << endl; std::cerr << "Unable to open the specified stylesheet \"" << m_d->styleSheetPath.toLocal8Bit().data() << "\"." << std::endl;
} }
styleSheet.append(file.readAll()); styleSheet.append(file.readAll());
if (file.error() != QFile::NoError) { if (file.error() != QFile::NoError) {
cerr << "Unable to read the specified stylesheet \"" << m_d->styleSheetPath.toLocal8Bit().data() << "\"." << endl; std::cerr << "Unable to read the specified stylesheet \"" << m_d->styleSheetPath.toLocal8Bit().data() << "\"." << std::endl;
} }
} }
@ -306,8 +304,8 @@ void QtSettings::apply()
if (auto *const qapp = qobject_cast<QApplication *>(QApplication::instance())) { if (auto *const qapp = qobject_cast<QApplication *>(QApplication::instance())) {
qapp->setStyleSheet(styleSheet); qapp->setStyleSheet(styleSheet);
} else { } else {
cerr << "Unable to apply the specified stylesheet \"" << m_d->styleSheetPath.toLocal8Bit().data() std::cerr << "Unable to apply the specified stylesheet \"" << m_d->styleSheetPath.toLocal8Bit().data()
<< "\" because no QApplication has been instantiated." << endl; << "\" because no QApplication has been instantiated." << std::endl;
} }
if (m_d->customPalette) { if (m_d->customPalette) {
QGuiApplication::setPalette(m_d->palette); QGuiApplication::setPalette(m_d->palette);