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

做网站用什么样的电脑百度网盘app官方下载

做网站用什么样的电脑,百度网盘app官方下载,南昌网站建设如何,做app网站公司哪家好网页右下角上经常会出现一些提示性的信息,B/S有的东西,C/S当然也可以有,就像QQ的消息提示一样! 实现一个类似的东西并不困难,只要想明白原理实现起来就很简单了! 实现原理: (1&#…

网页右下角上经常会出现一些提示性的信息,B/S有的东西,C/S当然也可以有,就像QQ的消息提示一样! 实现一个类似的东西并不困难,只要想明白原理实现起来就很简单了! 实现原理: (1)显示:右下角缓慢弹出,定时器启动,逐渐改变位置即可,到达相应位置,停止计时器

(2)驻留:定时器启动,让界面停留一定的时间,相应的时间过后停止定时器

(3)退出:可以直接退出,也可以采用改变透明度的形式模糊退出

标题栏:
#include "message_title.h"
#include "setting.h"
MessageTitle::MessageTitle(QWidget *parent): QWidget(parent)
{setFixedHeight(30);title_label = new QLabel();close_button = new PushButton();layout = new QHBoxLayout();  title_label->setObjectName(QString::fromUtf8("labelOne"));QFont title_font = title_label->font();title_font.setBold(true);title_label->setFont(title_font);close_button->loadPixmap("tipclose");close_button->setToolTip(tr("close"));layout->addWidget(title_label);layout->addStretch();layout->addWidget(close_button);layout->setMargin(0);setLayout(layout);connect(close_button, SIGNAL(clicked()), this, SIGNAL(myClose()));
}
void MessageTitle::paintEvent(QPaintEvent *)
{QLinearGradient linear(rect().topLeft(), rect().bottomRight());linear.setColorAt(0, QColor(55, 135, 215));linear.setColorAt(0.5, QColor(140, 120, 185));linear.setColorAt(1, QColor(55, 135, 215));QPainter painter(this);painter.setBrush(QBrush(linear));painter.setPen(Qt::NoPen);painter.drawRect(rect());
}
void MessageTitle::setTitleText(QString title)
{title_label->setText(title);
} 
弹出框界面:#include "message_widget.h"MessageWidget::MessageWidget(QWidget *parent): QWidget(parent)
{setFixedSize(300, 180);setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);message_title = new MessageTitle();content_label = new QLabel();icon_label = new QLabel();timer_show = new QTimer(this);timer_stay = new QTimer(this);timer_close = new QTimer(this);time_count = 0;transparent = 1.0;desktop_height = QApplication::desktop()->height();icon_label->setFixedSize(64, 64);content_label->setWordWrap(true);content_label->setAlignment(Qt::AlignTop);QVBoxLayout *v_layout = new QVBoxLayout();v_layout->addWidget(icon_label);v_layout->addStretch();QVBoxLayout *v_layout2 = new QVBoxLayout();QSpacerItem *spacerItem = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum);v_layout2->addSpacerItem(spacerItem);v_layout2->addWidget(content_label);QHBoxLayout *h_layout = new QHBoxLayout();h_layout->addLayout(v_layout);h_layout->addLayout(v_layout2);QMargins margins = h_layout->contentsMargins();margins.setTop(20);margins.setLeft(10);margins.setRight(10);h_layout->setContentsMargins(margins);QVBoxLayout *main_layout = new QVBoxLayout();main_layout->setMargin(0);main_layout->addWidget(message_title);main_layout->addLayout(h_layout);setLayout(main_layout);connect(timer_show, SIGNAL(timeout()), this, SLOT(myMove()));connect(timer_stay, SIGNAL(timeout()), this, SLOT(myStay()));connect(timer_close, SIGNAL(timeout()), this, SLOT(myClose()));connect(message_title, SIGNAL(myClose()), this, SLOT(close()));
}void MessageWidget::showMsg(QString title, QString content)
{QPixmap pixmap(":/icon/win");icon_label->setPixmap(pixmap);message_title->setTitleText(" " + title);content_label->setText(" " + content);this->showMessage();
}void MessageWidget::paintEvent(QPaintEvent *)
{QBitmap bitmap(this->size());bitmap.fill(Qt::white);QPainter painter(this);painter.setBrush(QBrush(QColor(250, 240, 230)));painter.setPen(QPen(QBrush(QColor(55, 135, 215)), 6));painter.drawRoundedRect(bitmap.rect(), 5, 5);setMask(bitmap);
}
void MessageWidget::showMessage()
{time_count = 0;transparent = 1.0;desktop_height = QApplication::desktop()->height();timer_show->stop();timer_stay->stop();timer_close->stop();setWindowOpacity(1);QDesktopWidget *desktop = QApplication::desktop();desk_rect = desktop->availableGeometry();normal_point.setX(desk_rect.width() - rect().width());normal_point.setY(desk_rect.height() - rect().height());move(normal_point.x(), normal_point.y());showNormal();timer_show->start(5);
}void MessageWidget::myMove()
{desktop_height--;move(normal_point.x(), desktop_height);if(desktop_height <= normal_point.y()){timer_show->stop();timer_stay->start(1000);}
}void MessageWidget::myStay()
{time_count++;if(time_count >= 9){timer_stay->stop();timer_close->start(200);}
}void MessageWidget::myClose()
{transparent -= 0.1;if(transparent <= 0.0){timer_close->stop();this->close();}else{setWindowOpacity(transparent);}   
}

http://www.zhongyajixie.com/news/47128.html

相关文章:

  • 宁海建设局网站seo关键词排名优化怎样收费
  • 吉林市今天消息太原关键词优化报价
  • 做网站如何避免侵权今日竞彩足球最新比赛结果查询
  • 民政府公众信息网站建设如何在百度上做广告宣传
  • 海口网站建设咨询链接买卖
  • 做网站将文字放在图片上seo关键词布局案例
  • 个人建网站首选什么域名好app软件推广怎么做
  • 美国日本韩国欧洲化妆品百度网络优化
  • 西安网站建设招骋山东服务好的seo
  • 做网站 不做源码搜索引擎提交入口网址
  • metadata wordpressseo常用工具网站
  • 做游戏本测评的网站今天国内新闻
  • 做视频导航网站有哪些长沙网站策划
  • 残疾人信息无障碍网站建设收录查询站长工具
  • 邳州建设银行招聘网站百度店铺免费入驻
  • 拼团购物网站开发南宁网站建设优化服务
  • 网站线框图怎样做seo产品优化推广
  • 福建省建设厅网站劳保核定卡中山网站seo优化
  • 芝罘区网优化培训内容
  • 邯郸网站开发北京百度推广优化排名
  • 西安品牌策划合肥百度快速排名优化
  • 网站建设消费者群体分析seo查询爱站
  • 外贸网站 测速什么软件可以推广自己的产品
  • 网站建设公司有哪些方面百度知道问答平台
  • xml做网站源码2022小说排行榜百度风云榜
  • 桂林网站建今日热点新闻事件摘抄2022
  • 个人网站需要备案吗seo是什么职位简称
  • 上街网络推广百度seo费用
  • 做网站需要注册什么类型的公司成都百度推广开户公司
  • 那个做头像的网站好精准客户数据采集软件