diff --git a/CMakeLists.txt b/CMakeLists.txt index 693f0e480..56c64a466 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,29 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.13) project(deepin-album LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) include_directories(${PROJECT_BINARY_DIR}) configure_file(${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h @ONLY) -find_package(DtkDeclarative REQUIRED) +# Find the Qt library +find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core) +message("Using Qt version: ${QT_VERSION_MAJOR}") + +# Select major DTK version. +if(QT_VERSION_MAJOR EQUAL "6") + set(BUILD_WITH_QT6 ON) + set(DTK_VERSION_MAJOR 6) +else() + set(DTK_VERSION_MAJOR "") +endif() + +#find_package(Dtk${DTK_VERSION_MAJOR}Declarative REQUIRED) # Application add_subdirectory(src) diff --git a/debian/control b/debian/control index caecc8058..4f275ee03 100644 --- a/debian/control +++ b/debian/control @@ -4,14 +4,48 @@ Priority: optional Maintainer: Deepin Packages Builder Build-Depends: debhelper (>= 11), - cmake, pkg-config, qtdeclarative5-dev, libdtkdeclarative-dev, qtbase5-dev,libexif-dev, libqt5svg5-dev, qttools5-dev-tools, qttools5-dev, libstartup-notification0-dev, libfreeimage-dev, libudev-dev, libfontconfig1-dev, libglib2.0-dev, libxrender-dev, libdtkgui-dev, libdtkwidget-dev, libgio-qt-dev, libudisks2-qt5-dev, libavformat-dev, libffmpegthumbnailer-dev + cmake, + pkg-config, +# Qt6 + qt6-base-dev, + qt6-tools-dev, + qt6-tools-dev-tools, + qt6-svg-dev, + qt6-declarative-dev, +# Dtk + libdtk6gui-dev, + libdtk6widget-dev, + libdtk6declarative-dev, +# Deepin +# null +# 3rd party + libfreeimage-dev, + libexif-dev, + libstartup-notification0-dev, + libudev-dev, + libfontconfig1-dev, + libglib2.0-dev, + libxrender-dev, +#libgio-qt-dev, +#libudisks2-qt5-dev, + libavformat-dev, + libffmpegthumbnailer-dev Standards-Version: 4.1.3 Homepage: http://www.deepin.org Package: deepin-album Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, qml-module-qt-labs-settings , qml-module-qt-labs-folderlistmodel -Recommends: deepin-ocr +Depends: ${shlibs:Depends}, ${misc:Depends}, + qml6-module-qt-labs-settings, + qml6-module-qt-labs-folderlistmodel, + qml6-module-qtquick-dialogs, + qml6-module-qtquick-layouts, + qml6-module-qtquick-effects, + qml6-module-qtquick-window, + qml6-module-qt5compat-graphicaleffects, + libqt6sql6-sqlite, + qt6-image-formats-plugins +Recommends: qt6-gtk-platformtheme, deepin-ocr Description: Simple description A detailed description. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2e1f0e095..4e97b7b49 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,73 +1,83 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.13) #玲珑构建依赖目录 include_directories(${CMAKE_INSTALL_PREFIX}/include) set(APP_BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin/) set(BIN_NAME ${CMAKE_PROJECT_NAME}) -set(CMAKE_CXX_STANDARD 14) -list (APPEND RESOURCES) - -# Set sources -set(SRC - main.cpp - ) - -# 源文件 -file(GLOB_RECURSE SRCS - ./src/*.h - ./src/*.cpp - ) - -file(GLOB_RECURSE QMLSRC - ./*.qml - ) - -# Find the Qt5Quick library -find_package(Qt5Quick CONFIG REQUIRED) -find_package(Qt5QuickCompiler REQUIRED) -find_package(Qt5DBus CONFIG REQUIRED) -find_package(Qt5Concurrent CONFIG REQUIRED) -find_package(Qt5Svg CONFIG REQUIRED) -find_package(Qt5PrintSupport CONFIG REQUIRED) -find_package(Qt5LinguistTools CONFIG REQUIRED) -find_package(Qt5Sql CONFIG REQUIRED) - -qtquick_compiler_add_resources(RCC_SOURCES ${RESOURCES}) +list(APPEND RESOURCES) + +find_package(Qt${QT_VERSION_MAJOR} CONFIG REQUIRED COMPONENTS + Qml + Quick + DBus + Concurrent + Svg + PrintSupport + LinguistTools + Sql +) + +find_package(Dtk${DTK_VERSION_MAJOR} REQUIRED COMPONENTS + Widget + Declarative +) + +# 三方库 find_package(PkgConfig REQUIRED) pkg_check_modules(3rd_lib REQUIRED - dtkwidget gio-qt udisks2-qt5 libavformat + #[[gio-qt udisks2-qt5]] libavformat ) # 保证 src 目录下头文件全局可见 include_directories(src) -# Translation -file(GLOB TS LIST_DIRECTORIES false translations/${CMAKE_PROJECT_NAME}*.ts) -set_source_files_properties(${TS} PROPERTIES OUTPUT_LOCATION ${PROJECT_SOURCE_DIR}/translations) -qt5_create_translation(QM ${SRC} ${SRCS} ${RCC_SOURCES} ${QMLSRC} ${GLOB}) +# 源文件 +file(GLOB_RECURSE SRCS CONFIGURE_DEPENDS "./*.h" "./*.cpp") +file(GLOB_RECURSE QMLSRC ./*.qml) -if (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug")) - qt5_create_translation(QM ${SRC} ${SRCS} ${RCC_SOURCES} ${QMLSRC} ${TS}) -endif () +if(NOT BUILD_WITH_QT6) + find_package(Qt5QuickCompiler CONFIG REQUIRED) + qtquick_compiler_add_resources(RCC_SOURCES ${RESOURCES}) +endif() + +if(NOT(${CMAKE_BUILD_TYPE} MATCHES "Debug")) + # 调整优化级别 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") -# Add LIB + # Translation + file(GLOB TS LIST_DIRECTORIES false translations/${CMAKE_PROJECT_NAME}*.ts) + set_source_files_properties(${TS} PROPERTIES OUTPUT_LOCATION ${PROJECT_SOURCE_DIR}/translations) + qt_create_translation(QM ${SRCS} ${QMLSRC} ${TS}) +endif() + +# 仅生成 EXE 文件,用以兼容新(5.6.0+dev-1及以上)旧两版本DtkDeclarative库 add_executable(${BIN_NAME} - ${SRC} ${SRCS} ${RCC_SOURCES} ${QM} ${CMAKE_PROJECT_NAME}.qrc res.qrc - ) +) target_include_directories(${BIN_NAME} PUBLIC ${3rd_lib_INCLUDE_DIRS} ) target_link_libraries(${BIN_NAME} - ${DtkDeclarative_LIBRARIES} - Qt5::Quick - Qt5::PrintSupport - Qt5::Gui Qt5::Qml Qt5::Core Qt5::DBus Qt5::Concurrent Qt5::Svg Qt5::Sql GL pthread freeimage + Qt${QT_VERSION_MAJOR}::Quick + Qt${QT_VERSION_MAJOR}::PrintSupport + Qt${QT_VERSION_MAJOR}::Gui + Qt${QT_VERSION_MAJOR}::Qml + Qt${QT_VERSION_MAJOR}::Core + Qt${QT_VERSION_MAJOR}::DBus + Qt${QT_VERSION_MAJOR}::Concurrent + Qt${QT_VERSION_MAJOR}::Svg + Qt${QT_VERSION_MAJOR}::Sql + + Dtk${DTK_VERSION_MAJOR}::Widget + Dtk${DTK_VERSION_MAJOR}::Declarative + GL + pthread + freeimage ${3rd_lib_LIBRARIES} ) @@ -80,19 +90,22 @@ set_target_properties(${BIN_NAME} PROPERTIES INSTALL_RPATH ${DTK_QML_APP_PLUGIN_ set(PREFIX ${CMAKE_INSTALL_PREFIX}) set(AppIconDir ${PREFIX}/share/icons/hicolor/scalable/apps) set(APPSHAREDIR ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}) -install(FILES com.deepin.album.service DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dbus-1/services/) # Add install rule install(TARGETS ${BIN_NAME} DESTINATION ${APP_BIN_INSTALL_DIR}) +install(FILES ${PROJECT_SOURCE_DIR}/src/${CMAKE_PROJECT_NAME}.desktop DESTINATION share/applications) +install(FILES ${PROJECT_SOURCE_DIR}/src/icon/deepin-album.svg DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps) +install(FILES com.deepin.album.service DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dbus-1/services/) + install(TARGETS ${LIB_NAME} DESTINATION ${DTK_QML_APP_PLUGIN_PATH}) install(TARGETS ${LIB_NAME} DESTINATION ${PREFIX}/plugins/imageformats) -#desktop -install(FILES ${PROJECT_SOURCE_DIR}/src/${CMAKE_PROJECT_NAME}.desktop DESTINATION share/applications) -#manual -install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/assets/deepin-album DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-manual/manual-assets/application/) -#icon -install(FILES ${PROJECT_SOURCE_DIR}/src/icon/deepin-album.svg DESTINATION ${AppIconDir}) + #translations install(DIRECTORY ${PROJECT_SOURCE_DIR}/translations DESTINATION ${APPSHAREDIR} FILES_MATCHING PATTERN "*.qm") + +#manual +install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/assets/deepin-album + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-manual/manual-assets/application/ + FILES_MATCHING PATTERN "*") diff --git a/src/main.cpp b/src/main.cpp index 83744dd1f..2b3ea8a94 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,7 +29,7 @@ #include "thumbnailview/thumbnailmodel.h" #include "thumbnailview/qimageitem.h" -#include +#include #include #include @@ -42,6 +42,7 @@ DWIDGET_USE_NAMESPACE DCORE_USE_NAMESPACE +DGUI_USE_NAMESPACE int main(int argc, char *argv[]) { diff --git a/src/qml/AlbumTitle.qml b/src/qml/AlbumTitle.qml index 2a1e2cffb..0b35607a4 100644 --- a/src/qml/AlbumTitle.qml +++ b/src/qml/AlbumTitle.qml @@ -2,12 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 -import QtQuick.Dialogs 1.3 -import Qt.labs.folderlistmodel 2.11 +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Dialogs import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -247,7 +246,10 @@ TitleBar { id: collectionBtnBox Layout.preferredHeight: iconSize property bool refreshVisilbe: false - visible: GStatus.currentViewType === Album.Types.ViewCollecttion && albumControl.getYears(refreshVisilbe).length !== 0 && window.width > showCollComboWidth + visible: { + refreshVisilbe + GStatus.currentViewType === Album.Types.ViewCollecttion && albumControl.getYears().length !== 0 && window.width > showCollComboWidth + } padding: 3 ToolButton { @@ -494,7 +496,10 @@ TitleBar { } ToolButton { id: titleCollectionBtn - property bool canFavorite: albumControl.canFavorite(GStatus.selectedPaths,GStatus.bRefreshFavoriteIconFlag) + property bool canFavorite: { + GStatus.bRefreshFavoriteIconFlag + return albumControl.canFavorite(GStatus.selectedPaths) + } visible: !titleImportBtn.visible && GStatus.currentViewType !== Album.Types.ViewDevice Layout.preferredWidth: iconSize Layout.preferredHeight: iconSize @@ -567,14 +572,14 @@ TitleBar { Connections { target: GStatus - onSigFlushSearchView: { + function onSigFlushSearchView() { searchEdit.executeSearch(true) } } Connections { target: albumControl - onSigRefreshAllCollection: { + function onSigRefreshAllCollection() { if (GStatus.currentViewType === Album.Types.ViewCollecttion) { collectionBtnBox.refreshVisilbe = !collectionBtnBox.refreshVisilbe } diff --git a/src/qml/BottomBar.qml b/src/qml/BottomBar.qml index ef10e40f1..051e8bf0f 100644 --- a/src/qml/BottomBar.qml +++ b/src/qml/BottomBar.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick Item { diff --git a/src/qml/Control/Animation/FadeInoutAnimation.qml b/src/qml/Control/Animation/FadeInoutAnimation.qml index 3ae7ead83..3595224f2 100644 --- a/src/qml/Control/Animation/FadeInoutAnimation.qml +++ b/src/qml/Control/Animation/FadeInoutAnimation.qml @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls Item { id: fadeInoutAnimation diff --git a/src/qml/Control/Animation/SwitchViewAnimation.qml b/src/qml/Control/Animation/SwitchViewAnimation.qml index 8a926ccd1..e759c31ef 100644 --- a/src/qml/Control/Animation/SwitchViewAnimation.qml +++ b/src/qml/Control/Animation/SwitchViewAnimation.qml @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls import org.deepin.album 1.0 as Album @@ -20,7 +20,7 @@ Item { property string idName: "" property real hideOpacity: 0 property real hideX: -width - 20 - property real hideScale: 0.5 + property real hideScale: 1 property int switchType: GStatus.currentSwitchType @@ -30,12 +30,15 @@ Item { if (switchType === Album.Types.FlipScroll) { x = width + 20 switchPropertys = "x,opacity" + hideScale = 1 } else if (switchType === Album.Types.FadeInOut) { x = 0 switchPropertys = "opacity" + hideScale = 1 } else if (switchType === Album.Types.ScaleInOUt) { x = 0 switchPropertys = "scale,opacity" + hideScale = 0.5 } } diff --git a/src/qml/Control/BaseView.qml b/src/qml/Control/BaseView.qml index 81a2b1265..029166376 100644 --- a/src/qml/Control/BaseView.qml +++ b/src/qml/Control/BaseView.qml @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls import "./Animation" FadeInoutAnimation { diff --git a/src/qml/Control/BorderImageEx.qml b/src/qml/Control/BorderImageEx.qml index f30658f75..c8a36c153 100644 --- a/src/qml/Control/BorderImageEx.qml +++ b/src/qml/Control/BorderImageEx.qml @@ -2,9 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts Image { id: boerderImageEx diff --git a/src/qml/Control/DeleteDialog.qml b/src/qml/Control/DeleteDialog.qml index 793b8ef28..be342c74f 100644 --- a/src/qml/Control/DeleteDialog.qml +++ b/src/qml/Control/DeleteDialog.qml @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls import QtQuick.Window 2.10 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 +import QtQuick.Controls +import QtQuick.Layouts import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album diff --git a/src/qml/Control/DeviceLoadDialog.qml b/src/qml/Control/DeviceLoadDialog.qml index 48552c630..032e7533c 100644 --- a/src/qml/Control/DeviceLoadDialog.qml +++ b/src/qml/Control/DeviceLoadDialog.qml @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls import QtQuick.Window 2.10 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 +import QtQuick.Controls +import QtQuick.Layouts import org.deepin.dtk 1.0 as D import org.deepin.dtk 1.0 diff --git a/src/qml/Control/EmptyWarningDialog.qml b/src/qml/Control/EmptyWarningDialog.qml index 5e31442d9..89b1c81ed 100644 --- a/src/qml/Control/EmptyWarningDialog.qml +++ b/src/qml/Control/EmptyWarningDialog.qml @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls import QtQuick.Window 2.10 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 +import QtQuick.Controls +import QtQuick.Layouts import org.deepin.dtk 1.0 as D import org.deepin.dtk 1.0 diff --git a/src/qml/Control/ExportDialog.qml b/src/qml/Control/ExportDialog.qml index 660f672f4..edcdccec5 100644 --- a/src/qml/Control/ExportDialog.qml +++ b/src/qml/Control/ExportDialog.qml @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls import QtQuick.Window 2.10 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 +import QtQuick.Controls +import QtQuick.Layouts import org.deepin.dtk 1.0 as D import org.deepin.dtk 1.0 @@ -84,7 +84,7 @@ DialogWindow { font: DTK.fontManager.t6 focus: true maximumLength: 255 - validator: RegExpValidator {regExp: /^[^\\.\\\\/\':\\*\\?\"<>|%&][^\\\\/\':\\*\\?\"<>|%&]*/ } + validator: RegularExpressionValidator {regularExpression: /^[^\\.\\\\/\':\\*\\?\"<>|%&][^\\\\/\':\\*\\?\"<>|%&]*/ } text: "" selectByMouse: true } diff --git a/src/qml/Control/FilterComboBox.qml b/src/qml/Control/FilterComboBox.qml index b81052f2d..3734f9f6f 100644 --- a/src/qml/Control/FilterComboBox.qml +++ b/src/qml/Control/FilterComboBox.qml @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 -import QtQml 2.11 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts +import QtQml import org.deepin.dtk 1.0 import org.deepin.dtk.style 1.0 as DS diff --git a/src/qml/Control/ListView/ThumbnailListDelegate.qml b/src/qml/Control/ListView/ThumbnailListDelegate.qml index abf070e57..aefcd33fa 100644 --- a/src/qml/Control/ListView/ThumbnailListDelegate.qml +++ b/src/qml/Control/ListView/ThumbnailListDelegate.qml @@ -2,15 +2,15 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 -import QtQml.Models 2.11 -import QtQml 2.11 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts +import QtQml.Models +import QtQml import QtQuick.Shapes 1.10 import org.deepin.dtk 1.0 -import QtGraphicalEffects 1.0 +import Qt5Compat.GraphicalEffects import org.deepin.album 1.0 as Album @@ -30,7 +30,10 @@ Item { property bool bShowDamageIcon: image.null property bool bSelected: model.selected !== undefined ? model.selected : false property bool bHovered: false //属性:是否hover - property bool bFavorited: albumControl.photoHaveFavorited(model.url, GStatus.bRefreshFavoriteIconFlag) + property bool bFavorited: { + GStatus.bRefreshFavoriteIconFlag + return albumControl.photoHaveFavorited(model.url) + } property bool bShowRemainDays: GStatus.currentViewType === Album.Types.ViewRecentlyDeleted && !model.blank property bool bShowVideoLabel: FileControl.isVideo(model.url) && !model.blank property Item selectIcon: null @@ -53,6 +56,7 @@ Item { } fillMode: Album.QImageItem.PreserveAspectFit visible: false + layer.enabled: true } // 图片保存完成,缩略图区域重新加载当前图片 @@ -161,7 +165,7 @@ Item { hoverEnabled: true propagateComposedEvents: true - onClicked: { + onClicked: (mouse)=> { //允许鼠标事件传递给子控件处理,否则鼠标点击缩略图收藏图标不能正常工作 mouse.accepted = false } @@ -357,7 +361,7 @@ Item { anchors.fill: itemFavoriteBtn propagateComposedEvents: true - onClicked: { + onClicked: (mouse)=> { var paths = [] paths.push(modelData.url) diff --git a/src/qml/Control/ListView/ThumbnailListViewAlbum.qml b/src/qml/Control/ListView/ThumbnailListViewAlbum.qml index 9b44f8827..b0b75d248 100644 --- a/src/qml/Control/ListView/ThumbnailListViewAlbum.qml +++ b/src/qml/Control/ListView/ThumbnailListViewAlbum.qml @@ -2,12 +2,12 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.9 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 -import QtQml.Models 2.11 -import QtQml 2.11 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts +import QtQml.Models +import QtQml import QtQuick.Shapes 1.10 import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -174,7 +174,7 @@ FocusScope { Connections { target: thumbnailImage - onEscKeyPressed: { + function onEscKeyPressed() { if (haveSelect) { selectAll(false) } @@ -204,7 +204,7 @@ FocusScope { cPress = mapToItem(gridView.contentItem, pressX, pressY); } - onPressed: { + onPressed: (mouse)=> { // 鼠标点击在垂直滚动条上,不处理点击事件 if (mouse.x >= (parent.width - GStatus.thumbnailListRightMargin - GStatus.thumbnialListCellSpace)) { return; @@ -271,7 +271,7 @@ FocusScope { onCanceled: pressCanceled() - onReleased: { + onReleased: (mouse)=> { // 多选后,单选逻辑处理 if (pressedItem && !pressedItem.blank && mouse.button !== Qt.RightButton && !main.rubberBand) { var pos = mapToItem(pressedItem, mouse.x, mouse.y); @@ -289,7 +289,7 @@ FocusScope { pressCanceled(); } - onPressAndHold: { + onPressAndHold: (mouse)=> { if (mouse.source === Qt.MouseEventSynthesizedByQt) { clearPressState(); if (haveSelect) { @@ -298,7 +298,7 @@ FocusScope { } } - onClicked: { + onClicked: (mouse)=> { clearPressState(); var cPos = mapToItem(gridView.contentItem, mouse.x, mouse.y); @@ -327,7 +327,7 @@ FocusScope { } } - onPositionChanged: { + onPositionChanged: (mouse)=> { gridView.ctrlPressed = (mouse.modifiers & Qt.ControlModifier); gridView.shiftPressed = (mouse.modifiers & Qt.ShiftModifier); @@ -497,11 +497,11 @@ FocusScope { MouseArea { anchors.fill: parent propagateComposedEvents: true - onPositionChanged: { + onPositionChanged: (mouse)=> { mouse.accepted = true } - onWheel: { + onWheel: (wheel)=> { if (!enableMouse) { wheel.accepted = false } @@ -688,7 +688,7 @@ FocusScope { Behavior on contentY { id: smoothY; enabled: false; SmoothedAnimation { velocity: 700 } } - Keys.onPressed: { + Keys.onPressed: (event)=> { switch (event.key) { case Qt.Key_Return: case Qt.Key_Enter: @@ -721,7 +721,7 @@ FocusScope { } } - Keys.onReleased: { + Keys.onReleased: (event)=> { switch (event.key) { case Qt.Key_Shift: shiftPressed = false @@ -773,18 +773,18 @@ FocusScope { Connections { target: GStatus - onSigSelectAll: { + function onSigSelectAll() { if (gridView.visible) selectAll(bSel) } - onSigPageUp: { + function onSigPageUp() { if (gridView.visible) { gridView.executeScrollBar(gridView.scrollDelta) } } - onSigPageDown: { + function onSigPageDown() { if (gridView.visible) { gridView.executeScrollBar(-gridView.scrollDelta) } @@ -888,10 +888,19 @@ FocusScope { Repeater { id: recentFilesInstantiator property bool bRreshEnableState: false - model: albumControl.getAllCustomAlbumId(GStatus.albumChangeList).length + model: { + GStatus.albumChangeList + albumControl.getAllCustomAlbumId().length + } delegate: RightMenuItem { - text: albumControl.getAllCustomAlbumName(GStatus.albumChangeList)[index] - enabled: albumControl.canAddToCustomAlbum(albumControl.getAllCustomAlbumId()[index], GStatus.selectedPaths, recentFilesInstantiator.bRreshEnableState) + text: { + GStatus.albumChangeList + return albumControl.getAllCustomAlbumName()[index] + } + enabled: { + recentFilesInstantiator.bRreshEnableState + return albumControl.canAddToCustomAlbum(albumControl.getAllCustomAlbumId()[index], GStatus.selectedPaths) + } onTriggered:{ // 获取所选自定义相册的Id,根据Id添加到对应自定义相册 var customAlbumId = albumControl.getAllCustomAlbumId()[index] diff --git a/src/qml/Control/ListView/VideoLabel.qml b/src/qml/Control/ListView/VideoLabel.qml index bbb26f1f4..2de1170cc 100644 --- a/src/qml/Control/ListView/VideoLabel.qml +++ b/src/qml/Control/ListView/VideoLabel.qml @@ -2,10 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.9 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.1 -import QtQml 2.11 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQml import org.deepin.dtk 1.0 //视频时长标签 diff --git a/src/qml/Control/MonthImage.qml b/src/qml/Control/MonthImage.qml index 11e990e09..d9a16ea8f 100644 --- a/src/qml/Control/MonthImage.qml +++ b/src/qml/Control/MonthImage.qml @@ -2,9 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts Rectangle { id: monthImage diff --git a/src/qml/Control/NewAlbumDialog.qml b/src/qml/Control/NewAlbumDialog.qml index b224a6303..1030b7005 100644 --- a/src/qml/Control/NewAlbumDialog.qml +++ b/src/qml/Control/NewAlbumDialog.qml @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Window 2.10 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 +import QtQuick +import QtQuick.Controls +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts import org.deepin.dtk 1.0 as D import org.deepin.dtk 1.0 @@ -82,7 +82,7 @@ DialogWindow { font: DTK.fontManager.t6 focus: true maximumLength: 255 - validator: RegExpValidator {regExp: /^[^\\.\\\\/\':\\*\\?\"<>|%&][^\\\\/\':\\*\\?\"<>|%&]*/ } + validator: RegularExpressionValidator {regularExpression: /^[^\\.\\\\/\':\\*\\?\"<>|%&][^\\\\/\':\\*\\?\"<>|%&]*/ } text: qsTr("Unnamed") selectByMouse: true // alertText: qsTr("The file already exists, please use another name") diff --git a/src/qml/Control/RemoveAlbumDialog.qml b/src/qml/Control/RemoveAlbumDialog.qml index d142f9105..6f83c5f58 100644 --- a/src/qml/Control/RemoveAlbumDialog.qml +++ b/src/qml/Control/RemoveAlbumDialog.qml @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls import QtQuick.Window 2.10 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 +import QtQuick.Controls +import QtQuick.Layouts import org.deepin.dtk 1.0 diff --git a/src/qml/Control/RubberBand.qml b/src/qml/Control/RubberBand.qml index 29d1313a0..c239b9884 100755 --- a/src/qml/Control/RubberBand.qml +++ b/src/qml/Control/RubberBand.qml @@ -2,9 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.9 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.1 +import QtQuick +import QtQuick.Window +import QtQuick.Controls //橡皮筋控件 //此处仅预留控制接口,具体控制逻辑由调用方编写 @@ -41,19 +41,19 @@ Item { return x1 !== -1 && y1 !== -1 && x2 !== -1 && y2 !== -1 } - function left() { + function _left() { return Math.min(x1, x2) } - function top() { + function _top() { return Math.min(y1, y2) } - function right() { + function _right() { return Math.max(x1, x2) } - function bottom() { + function _bottom() { return Math.max(y1, y2) } diff --git a/src/qml/Control/VideoInfoDialog.qml b/src/qml/Control/VideoInfoDialog.qml index 2a2ea784a..938fef7d1 100644 --- a/src/qml/Control/VideoInfoDialog.qml +++ b/src/qml/Control/VideoInfoDialog.qml @@ -2,10 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts import org.deepin.dtk 1.0 as D import org.deepin.dtk 1.0 import "../PreviewImageViewer/InformationDialog" diff --git a/src/qml/GlobalVar.qml b/src/qml/GlobalVar.qml index abadaab63..a77689dbb 100644 --- a/src/qml/GlobalVar.qml +++ b/src/qml/GlobalVar.qml @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -25,7 +25,7 @@ Item { // 导入重复文件提示 Connections { target: albumControl - onSigRepeatUrls: { + function onSigRepeatUrls(urls) { if (urls.length > 0) DTK.sendMessage(stackControl, qsTr("The photo/video already exists"), "warning") } @@ -34,7 +34,7 @@ Item { // 导入不支持文件提示 Connections { target: albumControl - onSigInvalidFormat: { + function onSigInvalidFormat() { DTK.sendMessage(stackControl, qsTr("The file format is not supported"), "warning") } } @@ -42,7 +42,7 @@ Item { // 导入不支持文件提示 Connections { target: FileControl - onInvalidFormat: { + function onInvalidFormat() { DTK.sendMessage(stackControl, qsTr("The file format is not supported"), "warning") } } diff --git a/src/qml/MainAlbumView.qml b/src/qml/MainAlbumView.qml index ccc17d349..5621b3256 100644 --- a/src/qml/MainAlbumView.qml +++ b/src/qml/MainAlbumView.qml @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 +import QtQuick +import QtQuick.Window import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -81,7 +81,7 @@ FadeInoutAnimation { Connections { target: titleAlubmRect - onShowHideSideBar: { + function onShowHideSideBar(bShow) { if (bShow) { showSliderAnimation.start() GStatus.sideBarIsVisible = true @@ -95,7 +95,7 @@ FadeInoutAnimation { Connections { target: titleAlubmRect - onSigDeleteClicked: { + function onSigDeleteClicked() { deleteDialog.setDisplay(Album.Types.TrashSel, GStatus.selectedPaths.length) deleteDialog.show() } @@ -103,7 +103,7 @@ FadeInoutAnimation { Connections { target: titleAlubmRect - onShowNewAlbumDialog: { + function onShowNewAlbumDialog() { var x = parent.mapToGlobal(0, 0).x + parent.width / 2 - 190 var y = parent.mapToGlobal(0, 0).y + parent.height / 2 - 89 newAlbum.setX(x) @@ -233,7 +233,7 @@ FadeInoutAnimation { Connections { target: albumControl // 接收外部应用打开信号 - onSigOpenImageFromFiles: { + function onSigOpenImageFromFiles(paths) { openAndImportImages(paths) } diff --git a/src/qml/MenuItemStates.qml b/src/qml/MenuItemStates.qml index 6667a180a..5bc675f2f 100644 --- a/src/qml/MenuItemStates.qml +++ b/src/qml/MenuItemStates.qml @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls import org.deepin.album 1.0 as Album @@ -22,7 +22,10 @@ Item { property bool canViewPhotoInfo: false property bool canViewVideoInfo: false property bool canWallpaper: false - property bool canFavorite: albumControl.canFavorite(GStatus.selectedPaths, GStatus.bRefreshFavoriteIconFlag) && !isInTrash + property bool canFavorite: { + GStatus.bRefreshFavoriteIconFlag + return albumControl.canFavorite(GStatus.selectedPaths) && !isInTrash + } property bool canRotate: true property bool canDisplayInFolder: false property bool canPrint: true diff --git a/src/qml/PopProgress/StandardProgressDialog.qml b/src/qml/PopProgress/StandardProgressDialog.qml index 3319fcd8a..79be0abc4 100644 --- a/src/qml/PopProgress/StandardProgressDialog.qml +++ b/src/qml/PopProgress/StandardProgressDialog.qml @@ -2,10 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Window 2.11 -import QtQml.Models 2.11 +import QtQuick +import QtQuick.Layouts +import QtQuick.Window +import QtQml.Models import org.deepin.dtk 1.0 //import ".." @@ -91,11 +91,11 @@ FloatingPanel { //鼠标按下起始位置 property point mousePosStart: "0,0" - onPressed: { + onPressed: (mouse)=> { mousePosStart = Qt.point(mouse.x, mouse.y) } - onPositionChanged: { + onPositionChanged: (mouse)=> { if (idMouseArea.pressedButtons & Qt.LeftButton) { //计算位移 var difference = Qt.point(mouse.x - mousePosStart.x, mouse.y - mousePosStart.y) diff --git a/src/qml/PreviewImageViewer/Dialog/RemoveDialog.qml b/src/qml/PreviewImageViewer/Dialog/RemoveDialog.qml index 7ceb8d379..2e5d95e83 100644 --- a/src/qml/PreviewImageViewer/Dialog/RemoveDialog.qml +++ b/src/qml/PreviewImageViewer/Dialog/RemoveDialog.qml @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Layouts 1.11 +import QtQuick +import QtQuick.Layouts import org.deepin.dtk 1.0 DialogWindow { diff --git a/src/qml/PreviewImageViewer/FullImageView.qml b/src/qml/PreviewImageViewer/FullImageView.qml index b4de6cde8..f966ffe80 100644 --- a/src/qml/PreviewImageViewer/FullImageView.qml +++ b/src/qml/PreviewImageViewer/FullImageView.qml @@ -2,10 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Window 2.11 -import QtGraphicalEffects 1.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Window +import Qt5Compat.GraphicalEffects import org.deepin.dtk 1.0 import org.deepin.dtk.style 1.0 as DS import org.deepin.image.viewer 1.0 as IV @@ -415,7 +415,7 @@ Item { Connections { target: GStatus - onSigShowToolBar: { + function onSigShowToolBar() { thumbnailViewBackGround.opacity = 0 thumbnailViewBackGround.y = window.height showToolBarAnimationInAlbum.start() diff --git a/src/qml/PreviewImageViewer/ImageAnimation.qml b/src/qml/PreviewImageViewer/ImageAnimation.qml index 5b800387a..07767c89a 100644 --- a/src/qml/PreviewImageViewer/ImageAnimation.qml +++ b/src/qml/PreviewImageViewer/ImageAnimation.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick Item { property real prefferImageScale: 0 diff --git a/src/qml/PreviewImageViewer/ImageDelegate/BaseImageDelegate.qml b/src/qml/PreviewImageViewer/ImageDelegate/BaseImageDelegate.qml index 4d5035dac..11b9ff7b6 100644 --- a/src/qml/PreviewImageViewer/ImageDelegate/BaseImageDelegate.qml +++ b/src/qml/PreviewImageViewer/ImageDelegate/BaseImageDelegate.qml @@ -2,10 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQml 2.11 -import QtQuick.Window 2.11 -import QtGraphicalEffects 1.0 +import QtQuick +import QtQml +import QtQuick.Effects import org.deepin.image.viewer 1.0 as IV import org.deepin.album 1.0 as Album import "../Utils" @@ -150,14 +149,14 @@ Item { source: "image://ThumbnailLoad/" + delegate.source + "#frame_" + delegate.frameIndex } - // MultiEffect { - // anchors.fill: loadImage - // blur: 1.0 - // blurEnabled: true - // blurMax: 4 - // scale: loadImage.scale - // source: loadImage - // } + MultiEffect { + anchors.fill: loadImage + blur: 1.0 + blurEnabled: true + blurMax: 4 + scale: loadImage.scale + source: loadImage + } } // 短时间完成加载的图片内无需模糊延迟效果 diff --git a/src/qml/PreviewImageViewer/ImageDelegate/DamagedImageDelegate.qml b/src/qml/PreviewImageViewer/ImageDelegate/DamagedImageDelegate.qml index 7c5782796..d543b0fe9 100644 --- a/src/qml/PreviewImageViewer/ImageDelegate/DamagedImageDelegate.qml +++ b/src/qml/PreviewImageViewer/ImageDelegate/DamagedImageDelegate.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.dtk 1.0 as DTK BaseImageDelegate { diff --git a/src/qml/PreviewImageViewer/ImageDelegate/DynamicImageDelegate.qml b/src/qml/PreviewImageViewer/ImageDelegate/DynamicImageDelegate.qml index f3cc5fc72..1bf2bb480 100644 --- a/src/qml/PreviewImageViewer/ImageDelegate/DynamicImageDelegate.qml +++ b/src/qml/PreviewImageViewer/ImageDelegate/DynamicImageDelegate.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import "../Utils" BaseImageDelegate { diff --git a/src/qml/PreviewImageViewer/ImageDelegate/MultiImageDelegate.qml b/src/qml/PreviewImageViewer/ImageDelegate/MultiImageDelegate.qml index 2be8c017c..2211fec7e 100644 --- a/src/qml/PreviewImageViewer/ImageDelegate/MultiImageDelegate.qml +++ b/src/qml/PreviewImageViewer/ImageDelegate/MultiImageDelegate.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.image.viewer 1.0 as IV import "../Utils" diff --git a/src/qml/PreviewImageViewer/ImageDelegate/NoPermissionImageDelegate.qml b/src/qml/PreviewImageViewer/ImageDelegate/NoPermissionImageDelegate.qml index 8acc189b7..89fdc4781 100644 --- a/src/qml/PreviewImageViewer/ImageDelegate/NoPermissionImageDelegate.qml +++ b/src/qml/PreviewImageViewer/ImageDelegate/NoPermissionImageDelegate.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.dtk 1.0 import org.deepin.dtk.style 1.0 as DS diff --git a/src/qml/PreviewImageViewer/ImageDelegate/NonexistImageDelegate.qml b/src/qml/PreviewImageViewer/ImageDelegate/NonexistImageDelegate.qml index 5e06edec9..68405bb31 100644 --- a/src/qml/PreviewImageViewer/ImageDelegate/NonexistImageDelegate.qml +++ b/src/qml/PreviewImageViewer/ImageDelegate/NonexistImageDelegate.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.dtk 1.0 import org.deepin.dtk.style 1.0 as DS import org.deepin.image.viewer 1.0 as IV diff --git a/src/qml/PreviewImageViewer/ImageDelegate/NormalImageDelegate.qml b/src/qml/PreviewImageViewer/ImageDelegate/NormalImageDelegate.qml index 9da1db3ed..8406fae1f 100644 --- a/src/qml/PreviewImageViewer/ImageDelegate/NormalImageDelegate.qml +++ b/src/qml/PreviewImageViewer/ImageDelegate/NormalImageDelegate.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.image.viewer 1.0 as IV import "../Utils" diff --git a/src/qml/PreviewImageViewer/ImageDelegate/SvgImageDelegate.qml b/src/qml/PreviewImageViewer/ImageDelegate/SvgImageDelegate.qml index 868b6bd46..74bb482f5 100644 --- a/src/qml/PreviewImageViewer/ImageDelegate/SvgImageDelegate.qml +++ b/src/qml/PreviewImageViewer/ImageDelegate/SvgImageDelegate.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.image.viewer 1.0 as IV import "../Utils" diff --git a/src/qml/PreviewImageViewer/ImageDelegate/ViewDelegateLoader.qml b/src/qml/PreviewImageViewer/ImageDelegate/ViewDelegateLoader.qml index af8ca12ef..767f41a05 100644 --- a/src/qml/PreviewImageViewer/ImageDelegate/ViewDelegateLoader.qml +++ b/src/qml/PreviewImageViewer/ImageDelegate/ViewDelegateLoader.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.image.viewer 1.0 as IV import org.deepin.album 1.0 as Album diff --git a/src/qml/PreviewImageViewer/ImageViewer.qml b/src/qml/PreviewImageViewer/ImageViewer.qml index d744b1281..fa6225e4e 100644 --- a/src/qml/PreviewImageViewer/ImageViewer.qml +++ b/src/qml/PreviewImageViewer/ImageViewer.qml @@ -2,12 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Controls 2.4 -//import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.11 -import QtQuick.Shapes 1.11 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Shapes import org.deepin.dtk 1.0 import org.deepin.image.viewer 1.0 as IV import org.deepin.album 1.0 as Album @@ -35,7 +34,10 @@ Item { property bool targetImageReady: (null !== view.currentImage) && (Image.Ready === view.currentImage.status) //判断图片是否可收藏 - property bool canFavorite: albumControl.canFavorite(GControl.currentSource.toString(), GStatus.bRefreshFavoriteIconFlag) + property bool canFavorite: { + GStatus.bRefreshFavoriteIconFlag + albumControl.canFavorite(GControl.currentSource.toString()) + } property bool bMoveCenterAnimationPlayed: false // 退出全屏展示图片 function escBack() { @@ -347,7 +349,7 @@ Item { Connections { target: GStatus - onSigMoveCenter: { + function onSigMoveCenter(x,y,w,h) { moveCenterAnimation.fromX = x moveCenterAnimation.fromY = y moveCenterAnimation.fromW = w @@ -411,7 +413,7 @@ Item { Connections { target: GStatus - onSigMoveToAlbumAnimation: { + function onSigMoveToAlbumAnimation() { // 以动画方式进入大图,返回相册时才逆向播放退出动画 if (bMoveCenterAnimationPlayed) { moveToAlbumAnimation.start() diff --git a/src/qml/PreviewImageViewer/InformationDialog/ElideLabel.qml b/src/qml/PreviewImageViewer/InformationDialog/ElideLabel.qml index c47c2d860..556d66241 100644 --- a/src/qml/PreviewImageViewer/InformationDialog/ElideLabel.qml +++ b/src/qml/PreviewImageViewer/InformationDialog/ElideLabel.qml @@ -2,9 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Window 2.11 +import QtQuick +import QtQuick.Controls +import QtQuick.Window import org.deepin.dtk 1.0 // 提供自动收缩的标签,鼠标Hover后显示全文,这是由于目前 ToolTip 效果不佳调整的 diff --git a/src/qml/PreviewImageViewer/InformationDialog/InformationDialog.qml b/src/qml/PreviewImageViewer/InformationDialog/InformationDialog.qml index 3f52e63b2..e37e8bcb2 100644 --- a/src/qml/PreviewImageViewer/InformationDialog/InformationDialog.qml +++ b/src/qml/PreviewImageViewer/InformationDialog/InformationDialog.qml @@ -2,9 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts import org.deepin.dtk 1.0 import org.deepin.image.viewer 1.0 as IV diff --git a/src/qml/PreviewImageViewer/InformationDialog/PropertyActionItemDelegate.qml b/src/qml/PreviewImageViewer/InformationDialog/PropertyActionItemDelegate.qml index a838cf1d7..20bd6f3a1 100644 --- a/src/qml/PreviewImageViewer/InformationDialog/PropertyActionItemDelegate.qml +++ b/src/qml/PreviewImageViewer/InformationDialog/PropertyActionItemDelegate.qml @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Layouts 1.11 +import QtQuick +import QtQuick.Layouts import org.deepin.dtk 1.0 import org.deepin.dtk.style 1.0 as DS import org.deepin.image.viewer 1.0 as IV @@ -103,11 +103,11 @@ Control { visible: !showPicLabel.visible // 限制输入特殊字符 - validator: RegExpValidator { - regExp: /^[^ \\.\\\\/\':\\*\\?\"<>|%&][^\\\\/\':\\*\\?\"<>|%&]*/ + validator: RegularExpressionValidator { + regularExpression: /^[^ \\.\\\\/\':\\*\\?\"<>|%&][^\\\\/\':\\*\\?\"<>|%&]*/ } - Keys.onPressed: { + Keys.onPressed: (event)=> { if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) { dealShowPicLabelClick(); } diff --git a/src/qml/PreviewImageViewer/InformationDialog/PropertyItem.qml b/src/qml/PreviewImageViewer/InformationDialog/PropertyItem.qml index 80f78d30c..4d19a9346 100644 --- a/src/qml/PreviewImageViewer/InformationDialog/PropertyItem.qml +++ b/src/qml/PreviewImageViewer/InformationDialog/PropertyItem.qml @@ -2,9 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Layouts 1.11 -import QtQml.Models 2.11 +import QtQuick +import QtQuick.Layouts +import QtQml.Models import org.deepin.dtk 1.0 import org.deepin.dtk.style 1.0 as DS diff --git a/src/qml/PreviewImageViewer/InformationDialog/PropertyItemDelegate.qml b/src/qml/PreviewImageViewer/InformationDialog/PropertyItemDelegate.qml index 268c05429..b05b9d558 100644 --- a/src/qml/PreviewImageViewer/InformationDialog/PropertyItemDelegate.qml +++ b/src/qml/PreviewImageViewer/InformationDialog/PropertyItemDelegate.qml @@ -2,9 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls import org.deepin.dtk 1.0 import org.deepin.dtk.style 1.0 as DS import "../" diff --git a/src/qml/PreviewImageViewer/MainStack.qml b/src/qml/PreviewImageViewer/MainStack.qml index 6dbec26c2..fbbe4b41a 100644 --- a/src/qml/PreviewImageViewer/MainStack.qml +++ b/src/qml/PreviewImageViewer/MainStack.qml @@ -2,12 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Dialogs 1.3 -import org.deepin.dtk 1.0 as DTK -import org.deepin.dtk.impl 1.0 as D +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Dialogs +import org.deepin.dtk 1.0 as D import org.deepin.image.viewer 1.0 as IV import org.deepin.album 1.0 as Album @@ -120,9 +119,9 @@ FadeInoutAnimation { sourceComponent: FileDialog { id: fileDialog - folder: shortcuts.pictures - selectMultiple: true - //fileMode: FileDialog.OpenFiles + currentFolder: shortcuts.pictures + // selectMultiple: true + fileMode: FileDialog.OpenFiles nameFilters: ["Image files (*.jpg *.png *.bmp *.gif *.ico *.jpe " + "*.jps *.jpeg *.jng *.koala *.koa *.lbm " + "*.iff *.mng *.pbm *.pbmraw *.pcd *.pcx " + "*.pgm *.pgmraw *.ppm *.ppmraw *.ras *.tga " + "*.targa *.tiff *.tif *.wbmp *.psd *.cut *.xbm " + "*.xpm *.dds *.fax *.g3 *.sgi *.exr *.pct *.pic " + "*.pict *.webp *.jxr *.mrw *.raf *.mef *.raw *.orf " + "*.djvu *.or2 *.icns *.dng *.svg *.nef *.pef *.pxm *.pnm)"] title: qsTr("Select pictures") diff --git a/src/qml/PreviewImageViewer/NavigationWidget.qml b/src/qml/PreviewImageViewer/NavigationWidget.qml index cabc200f3..55828176c 100644 --- a/src/qml/PreviewImageViewer/NavigationWidget.qml +++ b/src/qml/PreviewImageViewer/NavigationWidget.qml @@ -2,12 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.0 -import QtQml 2.11 -import QtQuick.Window 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.Styles 1.2 -import QtGraphicalEffects 1.0 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import Qt5Compat.GraphicalEffects import org.deepin.image.viewer 1.0 as IV Item { diff --git a/src/qml/PreviewImageViewer/OpenImageWidget.qml b/src/qml/PreviewImageViewer/OpenImageWidget.qml index ad0727dd1..4e531b105 100644 --- a/src/qml/PreviewImageViewer/OpenImageWidget.qml +++ b/src/qml/PreviewImageViewer/OpenImageWidget.qml @@ -2,11 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Dialogs 1.3 -import QtQuick.Layouts 1.11 -import Qt.labs.folderlistmodel 2.11 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts import org.deepin.dtk 1.0 Item { diff --git a/src/qml/PreviewImageViewer/ReName.qml b/src/qml/PreviewImageViewer/ReName.qml index f728dfabe..34b93c1b3 100644 --- a/src/qml/PreviewImageViewer/ReName.qml +++ b/src/qml/PreviewImageViewer/ReName.qml @@ -2,11 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.0 -import QtQuick.Controls 2.0 -import QtQuick.Window 2.10 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts import org.deepin.dtk 1.0 import org.deepin.image.viewer 1.0 as IV @@ -92,11 +91,11 @@ DialogWindow { showAlert: FileControl.isShowToolTip(GControl.currentSource, nameedit.text) width: 380 - validator: RegExpValidator { - regExp: /^[^ \\.\\\\/\':\\*\\?\"<>|%&][^\\\\/\':\\*\\?\"<>|%&]*/ + validator: RegularExpressionValidator { + regularExpression: /^[^ \\.\\\\/\':\\*\\?\"<>|%&][^\\\\/\':\\*\\?\"<>|%&]*/ } - Keys.onPressed: { + Keys.onPressed: (event)=> { switch (event.key) { case Qt.Key_Return: case Qt.Key_Enter: diff --git a/src/qml/PreviewImageViewer/SFadeInOut.qml b/src/qml/PreviewImageViewer/SFadeInOut.qml index 24a6aabd8..f76b4a1a9 100644 --- a/src/qml/PreviewImageViewer/SFadeInOut.qml +++ b/src/qml/PreviewImageViewer/SFadeInOut.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick Item { property url imageSource diff --git a/src/qml/PreviewImageViewer/SliderShow.qml b/src/qml/PreviewImageViewer/SliderShow.qml index 31ed221dc..d334ecf46 100644 --- a/src/qml/PreviewImageViewer/SliderShow.qml +++ b/src/qml/PreviewImageViewer/SliderShow.qml @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls import org.deepin.dtk 1.0 import org.deepin.image.viewer 1.0 as IV diff --git a/src/qml/PreviewImageViewer/ThumbnailDelegate/BaseThumbnailDelegate.qml b/src/qml/PreviewImageViewer/ThumbnailDelegate/BaseThumbnailDelegate.qml index d72c71db9..572aa4bed 100644 --- a/src/qml/PreviewImageViewer/ThumbnailDelegate/BaseThumbnailDelegate.qml +++ b/src/qml/PreviewImageViewer/ThumbnailDelegate/BaseThumbnailDelegate.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.image.viewer 1.0 as IV Item { diff --git a/src/qml/PreviewImageViewer/ThumbnailDelegate/MultiThumnailDelegate.qml b/src/qml/PreviewImageViewer/ThumbnailDelegate/MultiThumnailDelegate.qml index d5beed9bc..2f693c44f 100644 --- a/src/qml/PreviewImageViewer/ThumbnailDelegate/MultiThumnailDelegate.qml +++ b/src/qml/PreviewImageViewer/ThumbnailDelegate/MultiThumnailDelegate.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.image.viewer 1.0 as IV // 用于多页图的缩略图代理 diff --git a/src/qml/PreviewImageViewer/ThumbnailDelegate/NormalThumbnailDelegate.qml b/src/qml/PreviewImageViewer/ThumbnailDelegate/NormalThumbnailDelegate.qml index c7f9c1f8c..e90c894fa 100644 --- a/src/qml/PreviewImageViewer/ThumbnailDelegate/NormalThumbnailDelegate.qml +++ b/src/qml/PreviewImageViewer/ThumbnailDelegate/NormalThumbnailDelegate.qml @@ -2,8 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtGraphicalEffects 1.0 +import QtQuick +import QtQuick.Effects +import Qt5Compat.GraphicalEffects import org.deepin.dtk 1.0 as DTK import org.deepin.image.viewer 1.0 as IV import org.deepin.album 1.0 as Album diff --git a/src/qml/PreviewImageViewer/ThumbnailDelegate/ThumbnailImage.qml b/src/qml/PreviewImageViewer/ThumbnailDelegate/ThumbnailImage.qml index 0a74bb99c..5d4d98c2f 100644 --- a/src/qml/PreviewImageViewer/ThumbnailDelegate/ThumbnailImage.qml +++ b/src/qml/PreviewImageViewer/ThumbnailDelegate/ThumbnailImage.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.image.viewer 1.0 as IV Item { diff --git a/src/qml/PreviewImageViewer/ThumbnailListView.qml b/src/qml/PreviewImageViewer/ThumbnailListView.qml index 158d87338..1dc507eef 100644 --- a/src/qml/PreviewImageViewer/ThumbnailListView.qml +++ b/src/qml/PreviewImageViewer/ThumbnailListView.qml @@ -2,11 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 -import QtGraphicalEffects 1.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Qt5Compat.GraphicalEffects import org.deepin.dtk 1.0 import org.deepin.image.viewer 1.0 as IV import org.deepin.album 1.0 as Album @@ -127,7 +126,6 @@ Control { } else { thumbnailView.imageDeleting = false; } - // 使用后释放对话框 removeDialogLoader.active = false; } diff --git a/src/qml/PreviewImageViewer/Utils/FloatingNotice.qml b/src/qml/PreviewImageViewer/Utils/FloatingNotice.qml index 05c17b648..05af4099f 100644 --- a/src/qml/PreviewImageViewer/Utils/FloatingNotice.qml +++ b/src/qml/PreviewImageViewer/Utils/FloatingNotice.qml @@ -2,9 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQml 2.11 +import QtQuick +import QtQuick.Controls +import QtQml //浮动提示框定义 Item { diff --git a/src/qml/PreviewImageViewer/Utils/ImageInputHandler.qml b/src/qml/PreviewImageViewer/Utils/ImageInputHandler.qml index 2f153c0f8..d4ebfa75e 100644 --- a/src/qml/PreviewImageViewer/Utils/ImageInputHandler.qml +++ b/src/qml/PreviewImageViewer/Utils/ImageInputHandler.qml @@ -2,9 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQml 2.11 +import QtQuick +import QtQuick.Window import org.deepin.image.viewer 1.0 as IV import org.deepin.album 1.0 as Album diff --git a/src/qml/PreviewImageViewer/Utils/RightMenuItem.qml b/src/qml/PreviewImageViewer/Utils/RightMenuItem.qml index 856e30bbe..738fbc87f 100644 --- a/src/qml/PreviewImageViewer/Utils/RightMenuItem.qml +++ b/src/qml/PreviewImageViewer/Utils/RightMenuItem.qml @@ -2,9 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.0 -import QtQuick.Window 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Window +import QtQuick.Controls import org.deepin.dtk 1.0 import org.deepin.image.viewer 1.0 as IV diff --git a/src/qml/PreviewImageViewer/ViewRightMenu.qml b/src/qml/PreviewImageViewer/ViewRightMenu.qml index d479083ea..ea143f61e 100644 --- a/src/qml/PreviewImageViewer/ViewRightMenu.qml +++ b/src/qml/PreviewImageViewer/ViewRightMenu.qml @@ -2,11 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Controls 2.4 -//import QtQuick.Controls 1.4 -import QtQuick.Layouts 1.11 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts import org.deepin.dtk 1.0 import org.deepin.image.viewer 1.0 as IV import org.deepin.album 1.0 as Album diff --git a/src/qml/PreviewImageViewer/ViewTopTitle.qml b/src/qml/PreviewImageViewer/ViewTopTitle.qml index 26e0d3430..84d1f7e84 100644 --- a/src/qml/PreviewImageViewer/ViewTopTitle.qml +++ b/src/qml/PreviewImageViewer/ViewTopTitle.qml @@ -2,10 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts import org.deepin.dtk 1.0 import org.deepin.dtk.style 1.0 as DS import org.deepin.image.viewer 1.0 as IV diff --git a/src/qml/PreviewImageViewer/WindowButtonGroupEx.qml b/src/qml/PreviewImageViewer/WindowButtonGroupEx.qml index f9de7d416..eff1e2317 100644 --- a/src/qml/PreviewImageViewer/WindowButtonGroupEx.qml +++ b/src/qml/PreviewImageViewer/WindowButtonGroupEx.qml @@ -2,10 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import org.deepin.dtk.impl 1.0 as D +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import org.deepin.dtk 1.0 as D +import org.deepin.dtk.style 1.0 as DS import org.deepin.dtk 1.0 RowLayout { diff --git a/src/qml/SideBar/SideBarItem.qml b/src/qml/SideBar/SideBarItem.qml index 6a92b1aa6..035c6ba64 100644 --- a/src/qml/SideBar/SideBarItem.qml +++ b/src/qml/SideBar/SideBarItem.qml @@ -3,11 +3,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import QtQuick.Controls import org.deepin.dtk 1.0 import "../Control" @@ -72,7 +72,7 @@ ColumnLayout { backgroundVisible: false ButtonGroup.group: group } - Keys.onPressed: { + Keys.onPressed: (event)=> { switch (event.key){ case Qt.Key_F2: sideListView.currentItem.rename(); diff --git a/src/qml/SideBar/SideBarItemDelegate.qml b/src/qml/SideBar/SideBarItemDelegate.qml index ab626d3cc..5544062fe 100644 --- a/src/qml/SideBar/SideBarItemDelegate.qml +++ b/src/qml/SideBar/SideBarItemDelegate.qml @@ -2,10 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 -import QtQml.Models 2.11 +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import QtQml.Models import org.deepin.dtk 1.0 import org.deepin.dtk.style 1.0 as DS @@ -17,7 +17,7 @@ ItemDelegate { onDoubleClicked:{ item.rename() } - onClicked: { + onClicked: (mouse)=> { sideListView.currentIndex = index item.forceActiveFocus() control.itemClicked(model.uuid, model.displayName) @@ -83,7 +83,7 @@ ItemDelegate { width: 180 visible: false; maximumLength: 30 - validator: RegExpValidator {regExp: /^[^\\.\\\\/\':\\*\\?\"<>|%&][^\\\\/\':\\*\\?\"<>|%&]*/ } + validator: RegularExpressionValidator {regularExpression: /^[^\\.\\\\/\':\\*\\?\"<>|%&][^\\\\/\':\\*\\?\"<>|%&]*/ } onEditingFinished: { item.checked = true; songName.visible = true; @@ -127,6 +127,6 @@ ItemDelegate { } // 屏蔽空格响应 - Keys.onSpacePressed: { event.accepted=false; } - Keys.onReleased: { event.accepted=(event.key===Qt.Key_Space); } + Keys.onSpacePressed: (event)=> { event.accepted=false; } + Keys.onReleased: (event)=> { event.accepted=(event.key===Qt.Key_Space); } } diff --git a/src/qml/SideBar/Sidebar.qml b/src/qml/SideBar/Sidebar.qml index 000055d03..3f2277d53 100644 --- a/src/qml/SideBar/Sidebar.qml +++ b/src/qml/SideBar/Sidebar.qml @@ -2,10 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import QtQuick.Controls import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -174,7 +174,7 @@ ScrollView { ListElement{checked: false; icon: "trash"; displayName: qsTr("Trash"); uuid: "trash"; editable: false; deleteable: false} } - onItemClicked: { + onItemClicked: (uuid)=> { GStatus.currentViewType = view.currentIndex + 2 // 导航页选中我的收藏时,设定自定相册索引为0,使用CutomAlbum控件按自定义相册界面逻辑显示我的收藏内容 if (GStatus.currentViewType === Album.Types.ViewFavorite) { @@ -201,7 +201,7 @@ ScrollView { Connections { target: deviceSideBar - onRemoveDeviceBtnClicked: { + function onRemoveDeviceBtnClicked(uuid) { var index = deviceSideBar.indexFromUuid(uuid) if (index !== -1) { if (sidebarScrollView.devicePaths.length === 1){ @@ -222,7 +222,7 @@ ScrollView { Connections { target: albumControl - onSigAddDevice: { + function onSigAddDevice(path) { for (var i = 0; i < deviceListModel.length; i++) { if (deviceListModel[i].path === path) { deviceSideBar.view.currentIndex = i @@ -235,7 +235,7 @@ ScrollView { } } - onItemCheckedChanged: { + onItemCheckedChanged: (checked)=> { if (checked) { GStatus.currentDevicePath = deviceListModel.get(index).path GStatus.currentViewType = Album.Types.ViewDevice @@ -282,7 +282,7 @@ ScrollView { } } - onItemClicked: { + onItemClicked: (uuid)=> { GStatus.currentViewType = Album.Types.ViewCustomAlbum GStatus.currentCustomAlbumUId = uuid GStatus.searchEditText = "" @@ -321,7 +321,7 @@ ScrollView { Connections { target: albumControl - onSigAddCustomAlbum: { + function onSigAddCustomAlbum(UID) { for (var i = 0; i < importListModel.count; i++) { if (Number(UID) === Number(importListModel.get(i).uuid)) { importSideBar.view.currentIndex = i @@ -334,11 +334,11 @@ ScrollView { } } - onItemClicked: { + onItemClicked: (uuid)=> { currentImportCustomIndex = importSideBar.indexFromUuid(uuid) } - onItemCheckedChanged: { + onItemCheckedChanged: (checked)=> { if (checked) { GStatus.currentViewType = Album.Types.ViewCustomAlbum GStatus.currentCustomAlbumUId = importListModel.get(index).uuid @@ -363,7 +363,7 @@ ScrollView { group: paneListGroup sideModel: customListModel - onItemClicked: { + onItemClicked: (uuid)=> { currentCustomIndex = customSideBar.indexFromUuid(uuid) GStatus.currentViewType = Album.Types.ViewCustomAlbum GStatus.currentCustomAlbumUId = customListModel.get(currentCustomIndex).uuid @@ -384,7 +384,7 @@ ScrollView { // 数据库监听-刷新设备列表 Connections { target: albumControl - onSigMountsChange: { + function onSigMountsChange() { devicePaths = albumControl.getDevicePaths() if (devicePaths.length === 0 && GStatus.currentViewType === Album.Types.ViewDevice) backCollection() @@ -394,7 +394,7 @@ ScrollView { // 通过自定义相册列表创建相册后,导航到新相册所在行 Connections { target: newAlbum - onSigCreateAlbumDone: { + function onSigCreateAlbumDone() { if (GStatus.currentViewType === Album.Types.ViewCustomAlbum) { for (var i = 0; i < customListModel.count; i++) { if (Number(customListModel.get(i).uuid) === GStatus.currentCustomAlbumUId) { diff --git a/src/qml/StackControl.qml b/src/qml/StackControl.qml index 81599695e..7d1b46c45 100644 --- a/src/qml/StackControl.qml +++ b/src/qml/StackControl.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import "./PreviewImageViewer" import org.deepin.album 1.0 as Album @@ -29,14 +29,6 @@ Item { visible: GStatus.stackControlCurrent === 2 } - //全局幻灯片信号槽 - Connections { - target: mainSliderShow - onBacktrack: { - GStatus.stackControlCurrent = 0 - } - } - //全屏动画 PropertyAnimation { id :showfullAnimation diff --git a/src/qml/StatusBar.qml b/src/qml/StatusBar.qml index 71fc08b4c..60ac55ce9 100644 --- a/src/qml/StatusBar.qml +++ b/src/qml/StatusBar.qml @@ -2,12 +2,12 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.9 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 -import QtQml.Models 2.11 -import QtQml 2.11 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts +import QtQml.Models +import QtQml import QtQuick.Shapes 1.10 import org.deepin.dtk 1.0 diff --git a/src/qml/ThumbnailImageView/CollecttionView/AllCollection.qml b/src/qml/ThumbnailImageView/CollecttionView/AllCollection.qml index 800520777..ebf88ec4c 100644 --- a/src/qml/ThumbnailImageView/CollecttionView/AllCollection.qml +++ b/src/qml/ThumbnailImageView/CollecttionView/AllCollection.qml @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 -import QtQuick.Dialogs 1.3 +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Dialogs import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -101,7 +101,7 @@ SwitchViewAnimation { Connections { target: albumControl - onSigRepeatUrls: { + function onSigRepeatUrls(urls) { if (visible && collecttionView.currentViewIndex === 3) { theView.selectUrls(urls) } @@ -142,7 +142,7 @@ SwitchViewAnimation { MouseArea { anchors.fill: parent - onPressed: { + onPressed: (mouse)=> { theView.selectAll(false) mouse.accepted = false } @@ -166,7 +166,7 @@ SwitchViewAnimation { // 监听缩略图列表选中状态,一旦改变,更新globalVar所有选中路径 Connections { target: theView - onSelectedChanged: { + function onSelectedChanged() { selectedPaths = [] selectedPaths = theView.selectedUrls diff --git a/src/qml/ThumbnailImageView/CollecttionView/CollecttionView.qml b/src/qml/ThumbnailImageView/CollecttionView/CollecttionView.qml index 4b0000908..829cefa8a 100644 --- a/src/qml/ThumbnailImageView/CollecttionView/CollecttionView.qml +++ b/src/qml/ThumbnailImageView/CollecttionView/CollecttionView.qml @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls import org.deepin.album 1.0 as Album diff --git a/src/qml/ThumbnailImageView/CollecttionView/DayCollection.qml b/src/qml/ThumbnailImageView/CollecttionView/DayCollection.qml index 2d3903d87..b66a38d49 100644 --- a/src/qml/ThumbnailImageView/CollecttionView/DayCollection.qml +++ b/src/qml/ThumbnailImageView/CollecttionView/DayCollection.qml @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 -import QtQuick.Dialogs 1.3 +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Dialogs import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -61,7 +61,7 @@ SwitchViewAnimation { Connections { target: collecttionView - onFlushDayViewStatusText: { + function onFlushDayViewStatusText() { if (visible) { if (selectedPaths.length > 0) getSelectedText(selectedPaths) @@ -73,7 +73,7 @@ SwitchViewAnimation { Connections { target: albumControl - onSigRepeatUrls: { + function onSigRepeatUrls(urls) { if (visible && collecttionView.currentViewIndex === 2) { theView.sigUnSelectAll() selectedPaths = urls @@ -86,7 +86,7 @@ SwitchViewAnimation { } //收到导入完成消息 - onSigImportFinished: { + function onSigImportFinished() { if (visible) { //刷新数量显示 getNumLabelText() @@ -334,7 +334,7 @@ SwitchViewAnimation { Connections { target: vbar - onTopDelegateIndexChanged: { + function onTopDelegateIndexChanged(newIndex) { var firstItemIndex = topDelegateIndex; // 使用当前顶部的索引 if (firstItemIndex === -1) return @@ -362,14 +362,14 @@ SwitchViewAnimation { id: theMouseArea - onClicked: { + onClicked: (mouse)=> { //允许鼠标事件传递给子控件处理,否则鼠标点击缩略图收藏图标不能正常工作 //同时propagateComposedEvents需设置为true //注意:不能传递onPressed、onReleased等基础事件,会有bug;合成事件onClicked等可以传递 mouse.accepted = false } - onPressed: { + onPressed: (mouse)=> { if(mouse.button == Qt.RightButton) { mouse.accepted = false return @@ -392,7 +392,7 @@ SwitchViewAnimation { rubberBand.y2 = mouse.y mouse.accepted = true } - onDoubleClicked: { + onDoubleClicked: (mouse)=> { if (GStatus.selectedPaths.length > 0) theView.dbClicked(GStatus.selectedPaths[0]) @@ -401,8 +401,8 @@ SwitchViewAnimation { mouse.accepted = true } - onMouseXChanged: { - if(mouse.button == Qt.RightButton) { + onMouseXChanged: (mouse)=> { + if(mouse.button === Qt.RightButton) { mouse.accepted = false return } @@ -411,8 +411,8 @@ SwitchViewAnimation { mouse.accepted = true } - onMouseYChanged: { - if(mouse.button == Qt.RightButton) { + onMouseYChanged: (mouse)=> { + if(mouse.button === Qt.RightButton) { mouse.accepted = false return } @@ -436,8 +436,8 @@ SwitchViewAnimation { mouse.accepted = true } - onReleased: { - if(mouse.button == Qt.RightButton) { + onReleased: (mouse)=> { + if(mouse.button === Qt.RightButton) { mouse.accepted = false return } @@ -460,7 +460,7 @@ SwitchViewAnimation { mouse.accepted = true } - onWheel: { + onWheel: (wheel)=> { var datla = wheel.angleDelta.y / 2 if (Qt.ControlModifier & wheel.modifiers) { // 按住ctrl,缩放缩略图 @@ -500,14 +500,14 @@ SwitchViewAnimation { rectScrollTimer.stop() } } else if (theView.scrollDirType === Album.Types.ToTop) { - if (rubberBand.top() < 0) { + if (rubberBand._top() < 0) { rectScrollTimer.stop() return } // 矩形顶部向上延展 - if (theView.contentY <= rubberBand.bottom() || rubberBand.bottom() === rubberBand.top()) { - var newTop = rubberBand.top() - theView.rectSelScrollOffset + if (theView.contentY <= rubberBand._bottom() || rubberBand._bottom() === rubberBand._top()) { + var newTop = rubberBand._top() - theView.rectSelScrollOffset if (newTop > 0) { rubberBand.y2 = newTop theView.contentY = theView.contentY - theView.rectSelScrollOffset + theView.originY @@ -520,8 +520,8 @@ SwitchViewAnimation { } } else { // 矩形框底部向上收缩 - var newBottom = rubberBand.bottom() - theView.rectSelScrollOffset - if (newBottom > rubberBand.top()) { + var newBottom = rubberBand._bottom() - theView.rectSelScrollOffset + if (newBottom > rubberBand._top()) { rubberBand.y2 = newBottom theView.contentY = theView.contentY - theView.rectSelScrollOffset + theView.originY } else { @@ -537,13 +537,13 @@ SwitchViewAnimation { } Connections { target: GStatus - onSigPageUp: { + function onSigPageUp() { if (visible) { executeScrollBar(scrollDelta) } } - onSigPageDown: { + function onSigPageDown() { if (visible) { executeScrollBar(-scrollDelta) } @@ -636,8 +636,8 @@ SwitchViewAnimation { Connections { target: rubberBand function onRectSelChanged() { - var pos1 = theMouseArea.mapToItem(theSubView, rubberBand.left(), rubberBand.top()) - var pos2 = theMouseArea.mapToItem(theSubView, rubberBand.right(), rubberBand.bottom()) + var pos1 = theMouseArea.mapToItem(theSubView, rubberBand._left(), rubberBand._top()) + var pos2 = theMouseArea.mapToItem(theSubView, rubberBand._right(), rubberBand._bottom()) var rectsel = albumControl.rect(pos1, pos2) var rectList = Qt.rect(0, 0, theSubView.width, theSubView.height) var rect = albumControl.intersected(rectList, rectsel) @@ -669,7 +669,7 @@ SwitchViewAnimation { function onDbClicked(url) { var openPaths = theSubView.allUrls() if (openPaths.indexOf(url) !== -1) { - var pos = theMouseArea.mapToItem(theSubView, rubberBand.left(), rubberBand.top()) + var pos = theMouseArea.mapToItem(theSubView, rubberBand._left(), rubberBand._top()) theSubView.viewImageFromOuterDbClick(pos.x, pos.y) } } diff --git a/src/qml/ThumbnailImageView/CollecttionView/MonthCollection.qml b/src/qml/ThumbnailImageView/CollecttionView/MonthCollection.qml index df4ff2d24..91b8b0414 100644 --- a/src/qml/ThumbnailImageView/CollecttionView/MonthCollection.qml +++ b/src/qml/ThumbnailImageView/CollecttionView/MonthCollection.qml @@ -2,12 +2,12 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 -import QtQuick.Dialogs 1.3 -import QtGraphicalEffects 1.0 +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Dialogs +import Qt5Compat.GraphicalEffects import org.deepin.dtk 1.0 import "../../Control" import "../../Control/ListView" diff --git a/src/qml/ThumbnailImageView/CollecttionView/YearCollection.qml b/src/qml/ThumbnailImageView/CollecttionView/YearCollection.qml index e48e7e70c..b06e10848 100644 --- a/src/qml/ThumbnailImageView/CollecttionView/YearCollection.qml +++ b/src/qml/ThumbnailImageView/CollecttionView/YearCollection.qml @@ -2,12 +2,12 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 -import QtQuick.Dialogs 1.3 -import QtGraphicalEffects 1.0 +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Dialogs +import Qt5Compat.GraphicalEffects import org.deepin.dtk 1.0 import "../../Control" import "../../Control/ListView" diff --git a/src/qml/ThumbnailImageView/CustomAlbum/CustomAlbum.qml b/src/qml/ThumbnailImageView/CustomAlbum/CustomAlbum.qml index 1698b988f..1143a5f48 100644 --- a/src/qml/ThumbnailImageView/CustomAlbum/CustomAlbum.qml +++ b/src/qml/ThumbnailImageView/CustomAlbum/CustomAlbum.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -116,7 +116,7 @@ BaseView { Connections { target: albumControl - onSigRepeatUrls: { + function onSigRepeatUrls(urls) { if (visible && GStatus.currentCustomAlbumUId !== 0) { theView.selectUrls(urls) } @@ -166,7 +166,7 @@ BaseView { MouseArea { anchors.fill: parent - onPressed: { + onPressed: (mouse)=> { theView.selectAll(false) mouse.accepted = false } @@ -192,7 +192,7 @@ BaseView { // 监听缩略图列表选中状态,一旦改变,更新globalVar所有选中路径 Connections { target: theView - onSelectedChanged: { + function onSelectedChanged() { if (parent.visible) GStatus.selectedPaths = theView.selectedUrls } diff --git a/src/qml/ThumbnailImageView/DeviceAlbum/DeviceAlbum.qml b/src/qml/ThumbnailImageView/DeviceAlbum/DeviceAlbum.qml index 120d1a5c5..0572c29d8 100644 --- a/src/qml/ThumbnailImageView/DeviceAlbum/DeviceAlbum.qml +++ b/src/qml/ThumbnailImageView/DeviceAlbum/DeviceAlbum.qml @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Controls 2.4 +import QtQuick +import QtQuick.Controls import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -98,7 +98,7 @@ BaseView { // 新增挂载设备,显示正在加载对话框 Connections { target: albumControl - onSigAddDevice: { + function onSigAddDevice() { devloaddig.show() } } @@ -106,7 +106,7 @@ BaseView { // 导入重复图片提示 Connections { target: albumControl - onSigRepeatUrls: { + function onSigRepeatUrls(urls) { if (visible && GStatus.currentCustomAlbumUId !== 0) { theView.selectedPaths = urls GStatus.selectedPaths = selectedPaths @@ -209,7 +209,7 @@ BaseView { } MouseArea { anchors.fill: parent - onPressed: { + onPressed: (mouse)=> { theView.selectAll(false) mouse.accepted = false } @@ -235,7 +235,7 @@ BaseView { // 监听缩略图列表选中状态,一旦改变,更新globalVar所有选中路径 Connections { target: theView - onSelectedChanged: { + function onSelectedChanged() { if (parent.visible) GStatus.selectedPaths = theView.selectedUrls } diff --git a/src/qml/ThumbnailImageView/HaveImportedView/HaveImportedView.qml b/src/qml/ThumbnailImageView/HaveImportedView/HaveImportedView.qml index 9bbf7d1be..8cab6e697 100644 --- a/src/qml/ThumbnailImageView/HaveImportedView/HaveImportedView.qml +++ b/src/qml/ThumbnailImageView/HaveImportedView/HaveImportedView.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -28,7 +28,7 @@ BaseView { Connections { target: albumControl - onSigRepeatUrls: { + function onSigRepeatUrls(urls) { if (visible) { theView.sigUnSelectAll() theView.selectedPaths = urls diff --git a/src/qml/ThumbnailImageView/HaveImportedView/ImportedlListView.qml b/src/qml/ThumbnailImageView/HaveImportedView/ImportedlListView.qml index faa7af454..de2daf023 100755 --- a/src/qml/ThumbnailImageView/HaveImportedView/ImportedlListView.qml +++ b/src/qml/ThumbnailImageView/HaveImportedView/ImportedlListView.qml @@ -2,12 +2,12 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.9 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.11 -import QtQml.Models 2.11 -import QtQml 2.11 +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts +import QtQml.Models +import QtQml import QtQuick.Shapes 1.10 import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -31,7 +31,6 @@ Item { property bool isFirstLoad: true signal sigTextUpdated(string str) - signal importedLabelTextUpdated(string str) property int topDelegateIndex: 0 property int topDelegateIndexTmp: 0 @@ -139,7 +138,7 @@ Item { Connections { target: vbar - onTopDelegateIndexChanged: { + function onTopDelegateIndexChanged(newIndex) { var firstItemIndex = topDelegateIndex; // 使用当前顶部的索引 var firstItemLabel = theModel.get(firstItemIndex).title; @@ -163,15 +162,15 @@ Item { property bool ctrlPressed: false // 记录ctrl是否按下 - onClicked: { + onClicked: (mouse)=> { //允许鼠标事件传递给子控件处理,否则鼠标点击缩略图收藏图标不能正常工作 //同时propagateComposedEvents需设置为true //注意:不能传递onPressed、onReleased等基础事件,会有bug;合成事件onClicked等可以传递 mouse.accepted = false } - onPressed: { - if(mouse.button == Qt.RightButton) { + onPressed: (mouse)=> { + if(mouse.button === Qt.RightButton) { mouse.accepted = false return } @@ -193,15 +192,15 @@ Item { rubberBandImport.y2 = mouse.y } - onDoubleClicked: { + onDoubleClicked: (mouse)=> { if (GStatus.selectedPaths.length > 0) theView.dbClicked(GStatus.selectedPaths[0]) rubberBandImport.clearRect() } - onMouseXChanged: { - if(mouse.button == Qt.RightButton) { + onMouseXChanged: (mouse)=> { + if(mouse.button === Qt.RightButton) { mouse.accepted = false return } @@ -211,8 +210,8 @@ Item { } } - onMouseYChanged: { - if(mouse.button == Qt.RightButton) { + onMouseYChanged: (mouse)=> { + if(mouse.button === Qt.RightButton) { mouse.accepted = false return } @@ -240,8 +239,8 @@ Item { sigListViewReleased(gPos.x, gPos.y) } - onReleased: { - if(mouse.button == Qt.RightButton) { + onReleased: (mouse)=> { + if(mouse.button === Qt.RightButton) { mouse.accepted = false return } @@ -256,7 +255,7 @@ Item { theView.scrollDirType = Album.Types.NoType rubberBandImport.clearRect() } - onWheel: { + onWheel: (wheel)=> { // 滚动时,激活滚动条显示 vbar.active = true var datla = wheel.angleDelta.y @@ -308,8 +307,8 @@ Item { } // 矩形顶部向上延展 - if (theView.contentY <= rubberBandImport.bottom() || rubberBandImport.bottom() === rubberBandImport.top()) { - var newTop = rubberBandImport.top() - theView.rectSelScrollOffset + if (theView.contentY <= rubberBandImport._bottom() || rubberBandImport._bottom() === rubberBandImport._top()) { + var newTop = rubberBandImport._top() - theView.rectSelScrollOffset if (newTop > 0) { rubberBandImport.y2 = newTop theView.contentY = theView.contentY - theView.rectSelScrollOffset + theView.originY @@ -322,8 +321,8 @@ Item { } } else { // 矩形框底部向上收缩 - var newBottom = rubberBandImport.bottom() - theView.rectSelScrollOffset - if (newBottom > rubberBandImport.top()) { + var newBottom = rubberBandImport._bottom() - theView.rectSelScrollOffset + if (newBottom > rubberBandImport._top()) { rubberBandImport.y2 = newBottom theView.contentY = theView.contentY - theView.rectSelScrollOffset + theView.originY } else { @@ -340,14 +339,14 @@ Item { Connections { target: GStatus - onSigPageUp: { + function onSigPageUp() { if (visible) { vbar.active = true vbar.decrease() } } - onSigPageDown: { + function onSigPageDown() { if (visible) { vbar.active = true vbar.increase() @@ -392,7 +391,7 @@ Item { Connections { target: importedListView - onSigListViewPressed: { + function onSigListViewPressed(x, y) { var object = importedCheckBox.mapFromGlobal(x,y) if (importedCheckBox.contains(object)) { checkBoxClicked = true @@ -406,7 +405,7 @@ Item { } } - onSigListViewReleased: { + function onSigListViewReleased(x, y) { checkBoxClicked = false } } @@ -431,13 +430,6 @@ Item { importedLabel.text = " " } } - - Connections { - target: vbar - onImportedLabelTextUpdated: { - importedLabel.text = str - } - } } //缩略图网格表 @@ -457,9 +449,9 @@ Item { Connections { target: rubberBandImport - onRectSelChanged: { - var pos1 = theMouseArea.mapToItem(importedGridView, rubberBandImport.left(), rubberBandImport.top()) - var pos2 = theMouseArea.mapToItem(importedGridView, rubberBandImport.right(), rubberBandImport.bottom()) + function onRectSelChanged() { + var pos1 = theMouseArea.mapToItem(importedGridView, rubberBandImport._left(), rubberBandImport._top()) + var pos2 = theMouseArea.mapToItem(importedGridView, rubberBandImport._right(), rubberBandImport._bottom()) var rectsel = albumControl.rect(pos1, pos2) var rectList = Qt.rect(0, 0, importedGridView.width, importedGridView.height) var rect = albumControl.intersected(rectList, rectsel) @@ -471,7 +463,7 @@ Item { // 监听缩略图子控件选中状态,一旦改变,更新已导入视图所有选中路径 Connections { target: importedGridView - onSelectedChanged: { + function onSelectedChanged() { if (index > -1) { theModel.selectedPathObjs[index].paths = importedGridView.selectedUrls } @@ -482,17 +474,17 @@ Item { Connections { target: importedListView - onSigUnSelectAll: { + function onSigUnSelectAll() { importedGridView.selectAll(false) } } Connections { target: theView - onDbClicked: { + function onDbClicked(url) { var openPaths = importedGridView.allUrls() if (openPaths.indexOf(url) !== -1) { - var pos = theMouseArea.mapToItem(importedGridView, rubberBandImport.left(), rubberBandImport.top()) + var pos = theMouseArea.mapToItem(importedGridView, rubberBandImport._left(), rubberBandImport._top()) importedGridView.viewImageFromOuterDbClick(pos.x, pos.y) } } diff --git a/src/qml/ThumbnailImageView/NoPictureView.qml b/src/qml/ThumbnailImageView/NoPictureView.qml index 9b35004b7..1d0d80ff8 100644 --- a/src/qml/ThumbnailImageView/NoPictureView.qml +++ b/src/qml/ThumbnailImageView/NoPictureView.qml @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Layouts 1.11 +import QtQuick +import QtQuick.Layouts import org.deepin.dtk 1.0 @@ -44,7 +44,7 @@ Item { MouseArea { anchors.fill: parent - onPressed: { + onPressed: (mouse)=> { mouse.accepted = true } } diff --git a/src/qml/ThumbnailImageView/RecentlyDeletedView/RecentlyDeletedView.qml b/src/qml/ThumbnailImageView/RecentlyDeletedView/RecentlyDeletedView.qml index c0de3cc6d..be22896f6 100644 --- a/src/qml/ThumbnailImageView/RecentlyDeletedView/RecentlyDeletedView.qml +++ b/src/qml/ThumbnailImageView/RecentlyDeletedView/RecentlyDeletedView.qml @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 +import QtQuick import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -226,7 +226,7 @@ BaseView { MouseArea { id: theMouseArea anchors.fill: parent - onPressed: { + onPressed: (mouse)=> { var gPos = theMouseArea.mapToGlobal(mouse.x, mouse.y) if (!restoreSelectedBtn.contains(restoreSelectedBtn.mapFromGlobal(gPos.x, gPos.y)) && !delSelectedBtn.contains(delSelectedBtn.mapFromGlobal(gPos.x, gPos.y))) { @@ -256,7 +256,7 @@ BaseView { // 监听缩略图列表选中状态,一旦改变,更新globalVar所有选中路径 Connections { target: theView - onSelectedChanged: { + function onSelectedChanged() { if (parent.visible) GStatus.selectedPaths = theView.selectedUrls } diff --git a/src/qml/ThumbnailImageView/SearchView.qml b/src/qml/ThumbnailImageView/SearchView.qml index 616356aca..fcb3a05a3 100644 --- a/src/qml/ThumbnailImageView/SearchView.qml +++ b/src/qml/ThumbnailImageView/SearchView.qml @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 -import QtQuick.Dialogs 1.3 +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Dialogs import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -137,7 +137,7 @@ BaseView { MouseArea { anchors.fill: parent - onPressed: { + onPressed: (mouse)=> { view.selectAll(false) mouse.accepted = false } @@ -162,7 +162,7 @@ BaseView { // 监听缩略图列表选中状态,一旦改变,更新globalVar所有选中路径 Connections { target: view - onSelectedChanged: { + function onSelectedChanged() { if (parent.visible) GStatus.selectedPaths = view.selectedUrls } diff --git a/src/qml/ThumbnailImageView/ThumbnailImage.qml b/src/qml/ThumbnailImageView/ThumbnailImage.qml index f5630a9fa..2291a38b0 100644 --- a/src/qml/ThumbnailImageView/ThumbnailImage.qml +++ b/src/qml/ThumbnailImageView/ThumbnailImage.qml @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.9 -import QtQml.Models 2.11 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.4 -import org.deepin.dtk.impl 1.0 as D +import QtQuick +import QtQml.Models +import QtQuick.Window +import QtQuick.Controls +import org.deepin.dtk 1.0 as D import org.deepin.album 1.0 as Album import "./CollecttionView" diff --git a/src/qml/main.qml b/src/qml/main.qml index c2687113a..e2a939b4a 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -2,12 +2,12 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.11 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 -import QtQuick.Dialogs 1.3 -import Qt.labs.folderlistmodel 2.11 +import QtQml +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Dialogs import org.deepin.dtk 1.0 import org.deepin.album 1.0 as Album @@ -19,8 +19,6 @@ ApplicationWindow { property bool isFullScreen: window.visibility === Window.FullScreen - signal sigTitlePress - // Bug fix: 使用 ListView 替换 PathView 时,出现内部的 mouseArea 鼠标操作会被 DWindow 截取 // 导致 flicking 时拖动窗口,此处使用此标志禁用此行为 DWindow.enableSystemMove: !GStatus.viewFlicking @@ -131,8 +129,8 @@ ApplicationWindow { FileDialog { id: importDialog title: qsTr("All photos and videos") - folder: shortcuts.pictures - selectMultiple: true + currentFolder: shortcuts.pictures + //selectMultiple: true nameFilters: albumControl.getAllFilters() onAccepted: { var bIsCustomAlbumImport = GStatus.currentViewType === Album.Types.ViewCustomAlbum && albumControl.isCustomAlbum(GStatus.currentCustomAlbumUId) @@ -151,7 +149,7 @@ ApplicationWindow { Connections { target: albumControl - onSigActiveApplicationWindow: { + function onSigActiveApplicationWindow() { window.requestActivate() } } diff --git a/src/src/albumControl.cpp b/src/src/albumControl.cpp index 46e9c89d8..aece9667b 100644 --- a/src/src/albumControl.cpp +++ b/src/src/albumControl.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include @@ -26,6 +26,7 @@ #include DWIDGET_USE_NAMESPACE +DGUI_USE_NAMESPACE namespace { static QMap i18nMap { @@ -187,6 +188,7 @@ DBImgInfo AlbumControl::getDBInfo(const QString &srcpath, bool isVideo) void AlbumControl::initDeviceMonitor() { +#ifdef USE_GIO m_vfsManager = new DGioVolumeManager(this); m_diskManager = new DDiskManager(this); m_diskManager->setWatchChanges(true); @@ -206,6 +208,7 @@ void AlbumControl::initDeviceMonitor() for (auto mount : list) { onVfsMountChangedAdd(mount); } +#endif } bool AlbumControl::findPicturePathByPhone(QString &path) @@ -234,7 +237,7 @@ bool AlbumControl::findPicturePathByPhone(QString &path) } return false; } - +#ifdef USE_GIO QList > AlbumControl::getMounts() { static QMutex mutex; @@ -243,7 +246,7 @@ QList > AlbumControl::getMounts() mutex.unlock(); return result; } - +#endif void AlbumControl::getAllInfos() { m_infoList = DBManager::instance()->getAllInfos(); @@ -271,6 +274,7 @@ QString AlbumControl::getAllFilters() void AlbumControl::unMountDevice(const QString &devicePath) { +#ifdef USE_GIO QStringList blDevList = DDiskManager::blockDevices(QVariantMap()); QSharedPointer blkget; QString mountPoint = ""; @@ -352,6 +356,7 @@ void AlbumControl::unMountDevice(const QString &devicePath) } } emit sigMountsChange(); +#endif } QStringList AlbumControl::getAllUrlPaths(const int &filterType) @@ -674,7 +679,7 @@ QStringList AlbumControl::getTimelinesTitle(TimeLineEnum timeEnum, const int &fi if (datelist.count() > 4) { if (ImgInfoList.size() > 0) { date = QString(QObject::tr("%1/%2/%3 %4:%5")).arg(datelist[0]).arg(datelist[1]).arg(datelist[2]).arg(datelist[3]).arg(datelist[4]); - m_importTimeLinePathsMap.insertMulti(date, ImgInfoList); + m_importTimeLinePathsMap.insert(date, ImgInfoList); } } } @@ -704,25 +709,25 @@ QStringList AlbumControl::getTimelinesTitle(TimeLineEnum timeEnum, const int &fi switch (timeEnum) { case TimeLineEnum::Year : if (ImgInfoList.size() > 0) { - tmpInfoMap.insertMulti(QString(QObject::tr("%1").arg(datelist[0])), ImgInfoList); + tmpInfoMap.insert(QString(QObject::tr("%1").arg(datelist[0])), ImgInfoList); } m_yearDateMap = tmpInfoMap; break; case TimeLineEnum::Month : if (ImgInfoList.size() > 0) { - tmpInfoMap.insertMulti(QString(QObject::tr("%1/%2").arg(datelist[0]).arg(datelist[1])), ImgInfoList); + tmpInfoMap.insert(QString(QObject::tr("%1/%2").arg(datelist[0]).arg(datelist[1])), ImgInfoList); } m_monthDateMap = tmpInfoMap; break; case TimeLineEnum::Day : if (ImgInfoList.size() > 0) { - tmpInfoMap.insertMulti(QString(QObject::tr("%1/%2/%3").arg(datelist[0]).arg(datelist[1]).arg(datelist[2])), ImgInfoList); + tmpInfoMap.insert(QString(QObject::tr("%1/%2/%3").arg(datelist[0]).arg(datelist[1]).arg(datelist[2])), ImgInfoList); } m_dayDateMap = tmpInfoMap; break; case TimeLineEnum::All : if (ImgInfoList.size() > 0) { - tmpInfoMap.insertMulti(QString(QObject::tr("%1/%2/%3 %4:%5")).arg(datelist[0]).arg(datelist[1]).arg(datelist[2]).arg(datelist[3]).arg(datelist[4]), ImgInfoList); + tmpInfoMap.insert(QString(QObject::tr("%1/%2/%3 %4:%5")).arg(datelist[0]).arg(datelist[1]).arg(datelist[2]).arg(datelist[3]).arg(datelist[4]), ImgInfoList); } m_timeLinePathsMap = tmpInfoMap; break; @@ -775,7 +780,7 @@ void AlbumControl::startMonitor() QFileInfoList infos = LibUnionImage_NameSpace::getImagesAndVideoInfo(eachItem, false); QStringList currentPaths; std::transform(infos.begin(), infos.end(), std::back_inserter(currentPaths), [](const QFileInfo & info) { - return info.isSymLink() ? info.readLink() : info.absoluteFilePath(); + return info.isSymLink() ? info.readSymLink() : info.absoluteFilePath(); }); //3.1获取已不存在的路径 @@ -851,7 +856,7 @@ void AlbumControl::slotMonitorDestroyed(int UID) //文件夹删除 emit sigDeleteCustomAlbum(UID); } - +#ifdef USE_GIO void AlbumControl::onVfsMountChangedAdd(QExplicitlySharedDataPointer mount) { qDebug() << "挂载设备增加:" << mount->name(); @@ -948,11 +953,13 @@ void AlbumControl::onVfsMountChangedRemove(QExplicitlySharedDataPointermount({}); +#endif } void AlbumControl::onBlockDeviceAdded(const QString &blks) @@ -962,7 +969,7 @@ void AlbumControl::onBlockDeviceAdded(const QString &blks) void AlbumControl::sltLoadMountFileList(const QString &path) { - QTime time; + QElapsedTimer time; time.start(); QString strPath = path; if (!m_PhonePicFileMap.contains(strPath)) { @@ -994,7 +1001,7 @@ void AlbumControl::sltLoadMountFileList(const QString &path) qDebug() << __FUNCTION__ << QString(" load device path:%1 cost [%2]ms").arg(path).arg(time.elapsed()); } - +#ifdef USE_GIO const QList > AlbumControl::getVfsMountList() { getAllDeviceName(); @@ -1016,7 +1023,7 @@ const QList > AlbumControl::getVfsMountL } return result; } - +#endif QJsonObject AlbumControl::createShorcutJson() { //Translations @@ -1170,14 +1177,17 @@ QJsonObject AlbumControl::createShorcutJson() void AlbumControl::getAllDeviceName() { m_blkPath2DeviceNameMap.clear(); +#ifdef USE_GIO QStringList blDevList = DDiskManager::blockDevices(QVariantMap()); for (const QString &blks : blDevList) { updateDeviceName(blks); } +#endif } void AlbumControl::updateDeviceName(const QString &blks) { +#ifdef USE_GIO QSharedPointer blk(DDiskManager::createBlockDevice(blks)); QScopedPointer drv1(DDiskManager::createDiskDevice(blk->drive())); if (!blk->hasFileSystem() && !drv1->mediaCompatibility().join(" ").contains("optical") && !blk->isEncrypted()) { @@ -1240,6 +1250,7 @@ void AlbumControl::updateDeviceName(const QString &blks) } m_blkPath2DeviceNameMap[mountPoint] = udispname; return; +#endif } bool AlbumControl::isSystemAutoImportAlbum(int uid) @@ -2082,7 +2093,8 @@ QString AlbumControl::getFolder() QString fileDir(""); dialog.setDirectory(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)); dialog.setViewMode(QFileDialog::Detail); - dialog.setFileMode(QFileDialog::DirectoryOnly); + dialog.setFileMode(QFileDialog::Directory); + dialog.setOption(QFileDialog::ShowDirsOnly); if (dialog.exec()) { fileDir = dialog.selectedFiles().first(); } @@ -2096,7 +2108,8 @@ bool AlbumControl::getFolders(const QStringList &paths) QString fileDir; dialog.setDirectory(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)); dialog.setViewMode(QFileDialog::Detail); - dialog.setFileMode(QFileDialog::DirectoryOnly); + dialog.setFileMode(QFileDialog::Directory); + dialog.setOption(QFileDialog::ShowDirsOnly); if (dialog.exec()) { fileDir = dialog.selectedFiles().first(); } @@ -2135,7 +2148,8 @@ bool AlbumControl::exportFolders(const QStringList &paths, const QString &dir) QString fileDir; dialog.setDirectory(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)); dialog.setViewMode(QFileDialog::Detail); - dialog.setFileMode(QFileDialog::DirectoryOnly); + dialog.setFileMode(QFileDialog::Directory); + dialog.setOption(QFileDialog::ShowDirsOnly); if (dialog.exec()) { fileDir = dialog.selectedFiles().first(); } @@ -2457,8 +2471,8 @@ void AlbumControl::importFromMountDevice(const QStringList &paths, const int &in for (QString strPath : localPaths) { //取出文件名称 - QStringList pathList = strPath.split("/", QString::SkipEmptyParts); - QStringList nameList = pathList.last().split(".", QString::SkipEmptyParts); + QStringList pathList = strPath.split("/", Qt::SkipEmptyParts); + QStringList nameList = pathList.last().split(".", Qt::SkipEmptyParts); QString strNewPath = QString("%1%2%3%4%5%6").arg(basePath, "/", nameList.first(), QString::number(QDateTime::currentDateTime().toMSecsSinceEpoch()), ".", nameList.last()); //判断新路径下是否存在目标文件,若不存在,继续循环 diff --git a/src/src/albumControl.h b/src/src/albumControl.h index 3488d4aec..e50238b12 100644 --- a/src/src/albumControl.h +++ b/src/src/albumControl.h @@ -11,6 +11,7 @@ #include "dbmanager/dbmanager.h" #include "imageengine/movieservice.h" +#ifdef USE_GIO #include #include #include @@ -19,7 +20,7 @@ #include #include #include - +#endif class FileInotifyGroup; @@ -375,8 +376,10 @@ class AlbumControl : public QObject //寻找手机里面是否有图片 bool findPicturePathByPhone(QString &path); + #ifdef USE_GIO //可重入版本的getMounts QList> getMounts(); + #endif public slots: //监控到改变 @@ -385,12 +388,13 @@ public slots: //自动导入路径被删除 void slotMonitorDestroyed(int UID); + #ifdef USE_GIO //设备增加 void onVfsMountChangedAdd(QExplicitlySharedDataPointer mount); //设备减少 void onVfsMountChangedRemove(QExplicitlySharedDataPointer mount); - + #endif // 硬盘文件系统有增加 void onFileSystemAdded(const QString &dbusPath); // 块设备有增加 @@ -398,10 +402,10 @@ public slots: //加载设备路径的数据 void sltLoadMountFileList(const QString &strPath); - +#ifdef USE_GIO //获得设备合集 const QList> getVfsMountList(); - +#endif //外部使用相册打开图片 void onNewAPPOpen(qint64 pid, const QStringList &arguments); @@ -464,10 +468,11 @@ private : QMap < QString, MovieInfo> m_movieInfos; //movieInfo的合集 FileInotifyGroup *m_fileInotifygroup {nullptr}; //固定文件夹监控 - +#ifdef USE_GIO DGioVolumeManager *m_vfsManager {nullptr};//手机设备监控 DDiskManager *m_diskManager {nullptr};//U盘设备监控 QList> m_mounts; //外部设备挂载 +#endif QMap m_durlAndNameMap; QMap m_blkPath2DeviceNameMap; QMap m_PhonePicFileMap; //外部设备及其全部图片路径 diff --git a/src/src/albumgloabl.h b/src/src/albumgloabl.h index cd0ab1fc5..969f6fa1c 100644 --- a/src/src/albumgloabl.h +++ b/src/src/albumgloabl.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include namespace albumGlobal { diff --git a/src/src/declarative/pathviewrangehandler.cpp b/src/src/declarative/pathviewrangehandler.cpp index 8746ba4d9..a51bf0827 100644 --- a/src/src/declarative/pathviewrangehandler.cpp +++ b/src/src/declarative/pathviewrangehandler.cpp @@ -80,10 +80,10 @@ bool PathViewRangeHandler::eventFilter(QObject *obj, QEvent *event) if (basePoint.isNull()) { // currentIndex 会在拖动时动态变更,因此在切换到受限图片时更新触发限制状态 - basePoint = mouseEvent->pos(); + basePoint = mouseEvent->position(); } else { bool filter = false; - auto newPoint = mouseEvent->pos(); + auto newPoint = mouseEvent->position(); if (!enableForwardFlag && newPoint.x() > (basePoint.x())) { filter = true; } diff --git a/src/src/fileMonitor/fileinotify.cpp b/src/src/fileMonitor/fileinotify.cpp index 22496e0ab..bffe87bb4 100644 --- a/src/src/fileMonitor/fileinotify.cpp +++ b/src/src/fileMonitor/fileinotify.cpp @@ -126,7 +126,7 @@ void FileInotify::getAllPicture(bool isFirst) //提取文件路径 QStringList filePaths; std::transform(list.begin(), list.end(), std::back_inserter(filePaths), [](const QFileInfo & info) { - return info.isSymLink() ? info.readLink() : info.absoluteFilePath(); + return info.isSymLink() ? info.readSymLink() : info.absoluteFilePath(); }); //获取当前已导入的全部文件 diff --git a/src/src/imageengine/movieservice.cpp b/src/src/imageengine/movieservice.cpp index 61f504cdf..711e49901 100644 --- a/src/src/imageengine/movieservice.cpp +++ b/src/src/imageengine/movieservice.cpp @@ -288,7 +288,7 @@ MovieInfo MovieService::parseFromFile(const QFileInfo &fi) mi.resolution = QString("%1x%2").arg(mi.width).arg(mi.height); mi.title = fi.fileName(); //FIXME this mi.filePath = fi.canonicalFilePath(); - mi.creation = fi.created(); + mi.creation = fi.birthTime(); mi.fileSize = fi.size(); mi.fileType = fi.suffix(); diff --git a/src/src/printdialog/printhelper.cpp b/src/src/printdialog/printhelper.cpp index d3c50e2b7..0647a650c 100755 --- a/src/src/printdialog/printhelper.cpp +++ b/src/src/printdialog/printhelper.cpp @@ -169,7 +169,7 @@ void RequestedSlot::paintRequestSync(DPrinter *_printer) if (!img.isNull()) { painter.setRenderHint(QPainter::Antialiasing); painter.setRenderHint(QPainter::SmoothPixmapTransform); - QRect wRect = _printer->pageRect(); + QRectF wRect = _printer->pageRect(QPrinter::DevicePixel); //修复bug98129,打印不完全问题,ratio应该是适应宽或者高,不应该直接适应宽 qreal ratio = 0.0; qDebug() << wRect; diff --git a/src/src/thumbnailload.cpp b/src/src/thumbnailload.cpp index e626e0bcd..7264e7618 100644 --- a/src/src/thumbnailload.cpp +++ b/src/src/thumbnailload.cpp @@ -384,7 +384,7 @@ QImage MultiImageLoad::requestImage(const QString &id, QSize *size, const QSize } // 从后向前查询索引标识 - int index = checkId.lastIndexOf(QRegExp(QString("%1\\d+$").arg(s_tagFrame))); + int index = checkId.lastIndexOf(QRegularExpression(QString("%1\\d+$").arg(s_tagFrame))); if (-1 == index) { return QImage(); } @@ -529,8 +529,7 @@ MultiImageLoad::CacheImage::CacheImage(const QImage &img) } ImagePublisher::ImagePublisher(QObject *parent) - : QObject(parent) - , QQuickImageProvider(Image) + : QQuickImageProvider(Image) { //初始化的时候读取上次退出时的状态 m_loadMode = LibConfigSetter::instance()->value(SETTINGS_GROUP, SETTINGS_DISPLAY_MODE, 0).toInt(); @@ -871,8 +870,7 @@ QImage AsyncImageResponseAlbum::addPadAndScaled(const QImage &src) } AsyncImageProviderAlbum::AsyncImageProviderAlbum(QObject *parent) - : QObject(parent) - , QQuickAsyncImageProvider() + : QQuickAsyncImageProvider() { //初始化的时候读取上次退出时的状态 m_loadMode = LibConfigSetter::instance()->value(SETTINGS_GROUP, SETTINGS_DISPLAY_MODE, 0).toInt(); diff --git a/src/src/thumbnailload.h b/src/src/thumbnailload.h index 278472625..46c274310 100644 --- a/src/src/thumbnailload.h +++ b/src/src/thumbnailload.h @@ -97,7 +97,7 @@ class MultiImageLoad : public QQuickImageProvider }; //缩略图 -class ImagePublisher : public QObject, public QQuickImageProvider +class ImagePublisher : public QQuickImageProvider { Q_OBJECT @@ -206,7 +206,7 @@ class AsyncImageResponseAlbum : public QQuickImageResponse, public QRunnable int m_loadMode; }; -class AsyncImageProviderAlbum : public QObject, public QQuickAsyncImageProvider +class AsyncImageProviderAlbum : public QQuickAsyncImageProvider { Q_OBJECT public: diff --git a/src/src/thumbnailview/eventgenerator.cpp b/src/src/thumbnailview/eventgenerator.cpp index ac7075b13..a944d3e76 100644 --- a/src/src/thumbnailview/eventgenerator.cpp +++ b/src/src/thumbnailview/eventgenerator.cpp @@ -84,8 +84,7 @@ void EventGenerator::sendWheelEvent(QQuickItem *item, QPointF pos(x, y); QPointF globalPos(item->window()->mapToGlobal(item->mapToScene(pos).toPoint())); - //QWheelEvent ev(pos, globalPos, pixelDelta, angleDelta, buttons, modifiers, Qt::ScrollUpdate, false /*not inverted*/); - QWheelEvent ev(pos, globalPos, pixelDelta, angleDelta, 0, Qt::Vertical, buttons, modifiers, Qt::ScrollUpdate); + QWheelEvent ev(pos, globalPos, pixelDelta, angleDelta, buttons, modifiers, Qt::ScrollUpdate, false /*not inverted*/); QGuiApplication::sendEvent(item, &ev); } diff --git a/src/src/thumbnailview/imagedatamodel.cpp b/src/src/thumbnailview/imagedatamodel.cpp index 7a7780f77..e40972b10 100644 --- a/src/src/thumbnailview/imagedatamodel.cpp +++ b/src/src/thumbnailview/imagedatamodel.cpp @@ -184,7 +184,7 @@ DBImgInfo ImageDataModel::dataForIndex(const QModelIndex &index) const void ImageDataModel::loadData(Types::ItemType type) { - QTime time; + QElapsedTimer time; time.start(); ItemType itemType = ItemTypeNull; if (type == Types::All) diff --git a/src/src/thumbnailview/positioner.cpp b/src/src/thumbnailview/positioner.cpp index a2883e837..321edcc8d 100644 --- a/src/src/thumbnailview/positioner.cpp +++ b/src/src/thumbnailview/positioner.cpp @@ -268,6 +268,8 @@ void Positioner::setRangeSelected(int anchor, int to) QHash Positioner::roleNames() const { + if (!m_thumbnialModel) + return QHash(); return m_thumbnialModel->roleNames(); } diff --git a/src/src/thumbnailview/positioner.h b/src/src/thumbnailview/positioner.h index 0d4a768d8..b896f4e12 100644 --- a/src/src/thumbnailview/positioner.h +++ b/src/src/thumbnailview/positioner.h @@ -12,8 +12,8 @@ #define POSITIONER_H #include +#include "thumbnailmodel.h" -class ThumbnailModel; class QTimer; class Positioner : public QAbstractItemModel