Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dtk6declarative] Titlebar 未响应双击切换窗口状态 #192

Open
rb-union opened this issue Aug 1, 2024 · 1 comment
Open

[dtk6declarative] Titlebar 未响应双击切换窗口状态 #192

rb-union opened this issue Aug 1, 2024 · 1 comment

Comments

@rb-union
Copy link

rb-union commented Aug 1, 2024

SUMMARY | 问题概要

Titlebar 未响应双击切换窗口状态(普通/最大化)

DTK and OS VERSIONS | DTK&系统版本信息

Distribution: deepin v23 0719
Package: libdtk6declarative 6.0.16+u003

Minimal Reproducible Case Code | 最小复现案例代码

使用 libdtk6declarative-dev 提供的项目模板,在 qtcreator 创建Dtk6 QtQuick Application 编译运行可复现。
相同环境使用 libdtkdeclarative5-dev 项目模板无此问题。

OBSERVED RESULT | 观察到的结果

Titlebar 未响应双击切换窗口状态

doubleclick_titlebar.mp4

EXPECTED RESULT | 期望的结果

Titlebar 能够响应双击切换窗口状态,和Dtk5一致

ADDITIONAL INFORMATION | 额外补充

No response

@kegechen
Copy link
Contributor

kegechen commented Aug 22, 2024

标题栏支持窗口移动需要不处理鼠标 pressed 事件( mouse.accepted = false )方便鼠标事件转发到 window 上,但是不处理 pressed 事件 就无法收到后续鼠标事件(如 releaseddoubleclicked

import QtQuick 2.15
import QtQuick.Window 2.15

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("MouseArea test")

    MouseArea {
        anchors.fill: parent
        onPressed: function(mouse) {
            console.log("onPressed...")
            mouse.accepted = false
        }

        onReleased: {
            console.log("onReleased...")
        }

        onDoubleClicked: {
            console.log("onDoubleClicked...")
        }
    }
}

qt5 qml 会收到 onDoubleClicked, qt6 qml 则收不到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants