设置边框拉伸
```c++
setWindowFlags(Qt::FramelessWindowHint);
bool nativeEvent(const QByteArray & eventType, void * message, long * result)
{
bool flag = false;
#ifdef Q_OS_WIN
do {
if (this->isMaximized() || this->isFullScreen())
break;
MSG *msg = static_cast<MSG*>(message);
switch (msg->message)
{
case WM_NCHITTEST: {
int xPos = this->cursor().pos().x() - this->frameGeometry().x();
int yPos = this->cursor().pos().y() - this->frameGeometry().y();
// 左上角
if (xPos < BOUNDARY_WIDTH && yPos < BOUNDARY_WIDTH)
*result = HTTOPLEFT;
// 右上角
else if (xPos >= this->width() - BOUNDARY_WIDTH && yPos < BOUNDARY_WIDTH)
*result = HTTOPRIGHT;
// 左下角
else if (xPos < BOUNDARY_WIDTH && yPos >= this->height() - BOUNDARY_WIDTH)
*result = HTBOTTOMLEFT;
// 右下角
else if (xPos >= this->width() - BOUNDARY_WIDTH && yPos >= this->height() - BOUNDARY_WIDTH)
*result = HTBOTTOMRIGHT;
// 左边
else if (xPos < BOUNDARY_WIDTH)
*result = HTLEFT;
// 右边
else if (xPos >= this->width() - BOUNDARY_WIDTH)
*result = HTRIGHT;
// 上边
else if (yPos < BOUNDARY_WIDTH)
*result = HTTOP;
// 下边
else if (yPos >= this->height() - BOUNDARY_WIDTH)
*result = HTBOTTOM;
else
break;
flag = true;
}
break;
default:
break;
}
} while (0);
#endif // Q_OS_WIN
return flag;
}
```