Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
Qt MianWindow 去除标题栏 拖曳问题
社区开发
1862
views ·
2
replies ·
To
floor
Go
chinaos
deepin
2014-04-26 00:01
Author
Qt MianWindow 去除标题栏 后, 无法将Mianwindow 拖曳到屏幕以外, 在Linux下。
Windows 下面是可以的。
自定义 拖动的方法 是网上找的
void LoginDialog::mousePressEvent(QMouseEvent *event)
{
if(event->button() == Qt:
eftButton)
{
mouse_press = true;
//鼠标相对于窗体的位置(或者使用event->globalPos() - this->pos())
move_point = event->pos();;
}
}
void LoginDialog::mouseMoveEvent(QMouseEvent *event)
{
//若鼠标左键被按下
if(mouse_press)
{
//鼠标相对于屏幕的位置
QPoint move_pos = event->globalPos();
//移动主窗体位置
this->move(move_pos - move_point);
}
}
请问这个问题 如何破?
Reply
Like 0
Favorite
View the author
All Replies
anchowee
deepin
2014-04-26 03:26
#1
去官网看吧,这里不是交流这个的吧!
Reply
Like 0
View the author
a287740928
deepin
2014-04-27 02:43
#2
这个问题确实有,我之前找了很久也没找到解决方法,deepin有4个桌面区,所以应该是无法移出左上角,不知道大神是如何解决的
Reply
Like 0
View the author
Please
sign
in first
Featured Collection
Change
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
Bright is not working on deepin25, it is stuck
Nvidia Drivers in Fresh installed V25.0.10 with Secure Boot on.
Popular Events
More
Windows 下面是可以的。
自定义 拖动的方法 是网上找的
void LoginDialog::mousePressEvent(QMouseEvent *event)
{
if(event->button() == Qt:
{
mouse_press = true;
//鼠标相对于窗体的位置(或者使用event->globalPos() - this->pos())
move_point = event->pos();;
}
}
void LoginDialog::mouseMoveEvent(QMouseEvent *event)
{
//若鼠标左键被按下
if(mouse_press)
{
//鼠标相对于屏幕的位置
QPoint move_pos = event->globalPos();
//移动主窗体位置
this->move(move_pos - move_point);
}
}
请问这个问题 如何破?