1.简易QQ登录页面
实际效果
qss界面代码
#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
this->setWindowTitle("QQ"); /*设置窗口标题*/
this->setWindowIcon(QIcon(":/pic/qq.png")); /*设置窗口图标*/
this->setWindowFlag(Qt::FramelessWindowHint);/*设置纯净窗口*/
this->resize(430,330);/*设置大小*/
/*设置窗口可移动*/
}
Widget::~Widget()
{
delete ui;
}
/*鼠标按压事件*/
void Widget::mousePressEvent(QMouseEvent *event)
{
p = event->pos();
}
/*鼠标移动事件*/
void Widget::mouseMoveEvent(QMouseEvent *event)
{
if(event->buttons() == Qt::LeftButton)
{
this->move(event->globalPos() - p);
}
}