Commit 6c637b89 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make compile against qt6

parent 7ee7cdb0
Pipeline #188848 passed with stage
in 44 seconds
......@@ -282,7 +282,7 @@ void Kontrast::gotColorResponse(uint response, const QVariantMap &results)
if (results.contains(QLatin1String("color"))) {
auto color = qdbus_cast<ColorRGB>(results.value(QLatin1String("color")));
m_grabbedColor = QColor(color.red * 256, color.green * 256, color.blue * 256);
emit grabbedColorChanged();
Q_EMIT grabbedColorChanged();
}
} else {
qWarning() << "Failed to take screenshot";
......
......@@ -27,7 +27,9 @@ const QString DRIVER(QStringLiteral("QSQLITE"));
Q_DECL_EXPORT int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
#ifndef Q_OS_ANDROID
QApplication app(argc, argv);
#else
......@@ -52,9 +54,9 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
QGuiApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("org.kde.kontrast")));
Q_ASSERT(QSqlDatabase::isDriverAvailable(DRIVER));
Q_ASSERT(QDir().mkpath(QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::DataLocation))));
Q_ASSERT(QDir().mkpath(QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation))));
QSqlDatabase db = QSqlDatabase::addDatabase(DRIVER);
const auto path = QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QStringLiteral("/") + qApp->applicationName());
const auto path = QDir::cleanPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QStringLiteral("/") + qApp->applicationName());
db.setDatabaseName(path);
if (!db.open()) {
qCritical() << db.lastError() << "while opening database at" << path;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment