Score
0
Watch 190 Star 444 Fork 163

颜不改 / QQLikeUIC++

推荐使用纯Qt方法

Open
Jakes Lee  Opened this issue

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

//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库的处理方式,这样在别的平台也可以编译学习。

96492 kyyblabla 1578917311 145274 chengjianxi 1578919450 3635 jakes 1578914193 total 3 participants

Comments (4)

96492 kyyblabla 1578917311
颜不改 2015-02-11 16:53 owner

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

96492 kyyblabla 1578917311
颜不改 2015-02-24 22:03 owner

Status changed to closed

96492 kyyblabla 1578917311
颜不改 2015-02-24 22:03 owner

Status changed to reopened

145274 chengjianxi 1578919450
Zero 2015-06-03 11:28

建议在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.

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority