202 Star 588 Fork 223

风木 / QQLikeUI

 / 详情

推荐使用纯Qt方法

待办的
创建于  
2015-02-11 16:47

看了一下代码,发现还是有一些平台相关代码。比如窗口移动事件的处理部分。

//moveableframelesswindow.cpp line 31.
bool shouldMove=isPointInDragnWidget(getDragnWidget(),event->pos());

    if(shouldMove){
        if (ReleaseCapture()){
            SendMessage(HWND(this->winId()), WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
        }
    }

可以考虑将其换成Qt库的处理方式,这样在别的平台也可以编译学习。

评论 (4)

开始也是为了图省事,这样可以少些两个鼠标事件, 而且调用windows的接口效率也高那么一点。以后会做改进。

状态更改为 已关闭

状态更改为 重新打开

建议在Windows下做无边框窗体的移动还是用Windows的接口,可以过滤WM_NCHITTEST事件。我开始的时候也是用的鼠标事件,但是鼠标事件不好实现窗体的大小调节,当移动窗体的时候如果按下super等快捷键就会出现bug(因为没有Capture)。
而在Linux系统上因为GNOME KDE等各个桌面环境之间的差异,无边框窗体可能会达不到预定的效果。我在编译的程序在CentOS上就没有无边框效果。所以后来Linux平台就干脆不做无边框。

Qt::FramelessWindowHint 0x00000800 Produces a borderless window. The user cannot move or resize a borderless window via the window system. **On X11, the result of the flag is dependent on the window manager and its ability to understand Motif and/or NETWM hints. **Most existing modern window managers can handle this.

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(3)
96492 kyyblabla 1578917311 145274 chengjianxi 1687771735 3635 jakes 1578914193
C++
1
https://gitee.com/kyyblabla/QQLikeUI.git
git@gitee.com:kyyblabla/QQLikeUI.git
kyyblabla
QQLikeUI
QQLikeUI

搜索帮助