当前位置: 首页 > news >正文

建设银行网站流水账单怎么打推广下载

建设银行网站流水账单怎么打,推广下载,温州网站建设怎么样,wordpress添加域名Qt圆角窗口 问题:自己重写了一个窗口,发现用qss设置圆角了,但是都不生效,不过子窗口圆角都生效了。 无边框移动窗口 bool eventFilter(QObject *watched, QEvent *evt) {static QPoint mousePoint;static bool mousePressed f…

Qt圆角窗口

问题:自己重写了一个窗口,发现用qss设置圆角了,但是都不生效,不过子窗口圆角都生效了。

无边框移动窗口

bool eventFilter(QObject *watched, QEvent *evt) {static QPoint mousePoint;static bool mousePressed = false;QMouseEvent *event = static_cast<QMouseEvent *>(evt);if (event->type() == QEvent::MouseButtonPress) {if (event->button() == Qt::LeftButton) {mousePressed = true;mousePoint = event->globalPos() - this->pos();return true;} else {return true;}} else if (event->type() == QEvent::MouseButtonRelease) {mousePressed = false;return true;} else if (event->type() == QEvent::MouseMove) {if (mousePressed && (event->buttons() && Qt::LeftButton)) {this->move(event->globalPos() - mousePoint);return true;}}return QWidget::eventFilter(watched, event);
}

1.当前窗口背景隐藏,使用子窗口圆角

红色背景为原来的窗口,里面的子窗口可以看到有圆角窗口了,隐藏掉就行setAttribute(Qt::WA_TranslucentBackground);
在这里插入图片描述
实现效果:
窗口还是存在的,只是透明了
在这里插入图片描述
代码:

void StyleSheetWidget::setRoundedRectangle1()
{setWindowFlags(Qt::FramelessWindowHint);setAttribute(Qt::WA_TranslucentBackground);//隐藏背景this->resize(200, 200);QFrame* title = new QFrame;QWidget* left = new QWidget;QWidget* mid = new QWidget;QWidget* right = new QWidget;// 布局QVBoxLayout *layoutMain = new QVBoxLayout;layoutMain->setContentsMargins(10, 10, 10, 10);QVBoxLayout *midLayout = new QVBoxLayout;midLayout->setContentsMargins(0,0,0,0);QWidget* midWid = new QWidget;midWid->setLayout(midLayout);layoutMain->addWidget(midWid);QHBoxLayout *hLayout_1 = new QHBoxLayout;hLayout_1->addWidget(left);hLayout_1->addWidget(mid);hLayout_1->addWidget(right);midLayout->addWidget(title);midLayout->addLayout(hLayout_1);title->setStyleSheet("background-color:green;border-bottom:3px solid black;");left->setStyleSheet("background-color:green;");mid->setStyleSheet("background-color:yellow;");right->setStyleSheet("background-color:blue;color:white");QLabel* label = new QLabel();label->setText("你好啊");QFormLayout* formLayout = new QFormLayout;formLayout->addRow(label);formLayout->addRow(new QLabel("你真的好啊,白云"));right->setLayout(formLayout);this->setLayout(layoutMain);this->setStyleSheet("border-radius: 8px;background-color:red;border: 1px solid #d9d9d9;");
}

2.使用paintEvent()绘制圆角

注意:使用paintEvent绘制圆角时候,布局之间要留一点距离,不然上层的绘制会把下面绘制的圆角给遮住了。如:

layoutMain->setContentsMargins(10,10,10,10);

设置布局间距离为10的效果:
在这里插入图片描述
设置为0效果:

    QVBoxLayout *layoutMain = new QVBoxLayout;layoutMain->setContentsMargins(0,0,0,0);

在这里插入图片描述
代码:

void StyleSheetWidget::paintEvent(QPaintEvent *event)
{QPainter painter(this);painter.setRenderHint(QPainter::Antialiasing);painter.setBrush(QColor(255,255,255));      //背景颜色//painter.setPen(Qt::red);//Qt::transparent); //边框颜色QPen pen;pen.setColor(Qt::red);pen.setWidth(3);painter.setPen(pen);QRect rect = this->rect();rect.setWidth(rect.width());rect.setHeight(rect.height());painter.drawRoundedRect(rect, 15, 15);QWidget::paintEvent(event);
}
http://www.hkea.cn/news/258983/

相关文章:

  • 做网站需要花钱吗海南百度推广运营中心
  • 做的网站显示图片很慢百度运营公司
  • 青州哪里做网站公司推广渠道
  • 网站面包屑导航怎么做的网推接单平台有哪些
  • 宜昌网站建设兼职百度关键词排名软件
  • 如何让百度快照找到自己的网站营销策划方案ppt模板
  • php网站超市广告软文是什么意思
  • b2c跨境电商宣城网站seo
  • 网站建设一流公司免费网站开发平台
  • 网站开发模式名词外贸谷歌优化
  • 网站素材 下载产品推广渠道
  • 网站后台维护怎么做seo专员工资一般多少
  • 中国网站推广黄页名录微商推广哪家好
  • 哈尔滨网站开发电话电商培训基地
  • 如何用php数据库做网站搜索seo优化托管
  • 中国城乡建设部人力网站首页优化落实疫情防控
  • 做网站到底能不能赚钱网络优化工程师前景
  • 乌镇网站建设标书百度站长工具域名查询
  • 制作公司网站价格腾讯广告代理商加盟
  • 大学生活动网站开发文案苏州seo门户网
  • 阿里云认证网站建设题库seo助理
  • 凤岗网站仿做靠谱seo外包定制
  • xampp安装wordpress说明徐州seo外包
  • 啥网站都能看的浏览器下载百度收录查询工具
  • 福田附近公司做网站建设哪家效益快奶糖 seo 博客
  • 临沂免费自助建站模板品牌整合营销
  • iis做本地视频网站找客户资源的网站
  • 做调查用哪个网站网络推广有多少种方法
  • 开发一个交易网站多少钱在线工具
  • 网站平台怎么建立的软文范例