欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

橡皮筋界面在QT开发中的应用

最编程 2024-08-14 15:44:57
...

将橡皮筋界面类放入项目文件夹中

1、pro中添加

include(FramelessWindow/FramelessWindow.pri)

2、头文件中添加

#include "FramelessWindow/frameless_helper.h"

使用函数声明

void enableDragAbleWidget();//橡皮筋界面

3、使用函数,构造函数中添加

void Core::enableDragAbleWidget()
{
    this->setWindowFlags(this->windowFlags() | Qt::FramelessWindowHint);
    FramelessHelper *pHelper = new FramelessHelper(this);
    pHelper->activateOn(this);
    pHelper->setTitleHeight(TITLE_MAX_HEIGHT);//标题栏高度,40
    pHelper->setRubberBandOnMove(true);
    pHelper->setRubberBandOnResize(true);
}

 

推荐阅读