Skip to content

Commit

Permalink
Fix some deprecation errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
elysia-best committed Oct 16, 2024
1 parent 468fa95 commit 48a503a
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 3.20)

add_compile_options(-Wall -Werror)
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050F00)

set(PROJECT_NAME LingmoUI)
set(MODULE_VERSION_MAJOR 3)
set(MODULE_VERSION_MINOR 0)
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set(TARGET_SOURCES
LingmoFrameless.cpp
LingmoTools.cpp
LingmoDefines.h
LingmoTheme.cpp
)

target_include_directories(${TARGET} PRIVATE desktop)
Expand Down
17 changes: 17 additions & 0 deletions src/Controls/LingmoAppBar.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Window
import QtQuick.Layouts
import LingmoUI

Rectangle {
property string title: ""
property string darkText : qsTr("Dark")
property string lightText : qsTr("Light")
property string minimizeText : qsTr("Minimize")
property string restoreText : qsTr("Restore")
property string maximizeText : qsTr("Maximize")
property string closeText : qsTr("Close")
property string stayTopText : qsTr("Sticky on Top")
property string stayTopCancelText : qsTr("Cancel Sticky on Top")
}
5 changes: 5 additions & 0 deletions src/LingmoTheme.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "LingmoTheme.h"

LingmoTheme::LingmoTheme()
{
}
11 changes: 11 additions & 0 deletions src/LingmoTheme.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef LINGMOTHEME_H
#define LINGMOTHEME_H

#include <QObject>

class LingmoTheme {
public:
LingmoTheme();
};

#endif // LINGMOTHEME_H
2 changes: 1 addition & 1 deletion src/desktop/menupopupwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ bool MenuPopupWindow::event(QEvent* event)
QRect rect = QRect(QPoint(), size());
QTouchEvent* touch = static_cast<QTouchEvent*>(event);
QTouchEvent::TouchPoint point = touch->touchPoints().first();
if ((point.state() == Qt::TouchPointPressed) && !rect.contains(point.pos().toPoint())) {
if ((point.state() == QEventPoint::State::Pressed) && !rect.contains(point.pos().toPoint())) {
// first default handling
bool result = QQuickWindow::event(event);
// now specific broken case
Expand Down
2 changes: 1 addition & 1 deletion src/newiconitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void NewIconItem::loadPixmap()

result = icon.pixmap(size * qApp->devicePixelRatio());
} else if (!m_icon.isNull()) {
result = m_icon.pixmap(window(), size * qApp->devicePixelRatio());
result = m_icon.pixmap(size * qApp->devicePixelRatio(), qApp->devicePixelRatio());
} else if (!m_image.isNull()) {
result = QPixmap::fromImage(m_image);
} else {
Expand Down

0 comments on commit 48a503a

Please sign in to comment.