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

做公司网站的公重庆seo关键词排名

做公司网站的公,重庆seo关键词排名,青海网站制作哪家好,百度快照什么意思添加资源文件&#xff0c;新建资源文件夹&#xff0c;命名resource&#xff0c;然后点下一步&#xff0c;点完成 资源&#xff0c;右键add Prefix 添加现有文件 展示的label图片切换 QLabel *led_show; #include "mainwindow.h" #include<QLabel> #include&l…

添加资源文件,新建资源文件夹,命名resource,然后点下一步,点完成

资源,右键add Prefix

 

添加现有文件

展示的label图片切换

QLabel *led_show;

#include "mainwindow.h"
#include<QLabel>
#include<QPixmap>
MainWindow::MainWindow(QWidget *parent): QMainWindow(parent)
{setWindowTitle("鼠标事件");            //设置窗体的标题statusLabel = new QLabel;             //创建QLabel用于显示在状态栏中statusLabel->setText("当前位置:");    //设置QLabel显示内容statusLabel->setFixedWidth(100);     //设置固定宽度为100MousePosLabel = new QLabel;          //显示鼠标按下或释放时的位置MousePosLabel->setText(tr(""));      //初始化不显示任何内容MousePosLabel->setFixedWidth(100);   //设置固定宽度为100statusBar()->addPermanentWidget(statusLabel);  //状态栏中增加控件statusBar()->addPermanentWidget(MousePosLabel);//状态栏中增加控件this->setMouseTracking(true);     //设置窗体追踪鼠标resize(400,200);    //调整窗体大小,宽度为400,高度为200led_show= new QLabel;led_show->setFixedWidth(40);led_show->setFixedHeight(40);statusBar()->addPermanentWidget(led_show);
}MainWindow::~MainWindow()
{
}
char* images[2] = {":/photo/image/red.jpg",":/photo/image/green.jpg"};
//鼠标按下事件响应函数
void MainWindow::mousePressEvent(QMouseEvent *e)
{QString str="("+QString::number(e->x())+","+QString::number(e->y()) +")"; //(x,y)if(e->button()==Qt::LeftButton){statusBar()->showMessage(tr("左键:")+str);//左键:(x,y)//QPixmap pix(":/photo/image/red.jpg");led_show->clear();QPixmap pix(images[1]);led_show->setPixmap(pix);led_show->show();}else if(e->button()==Qt::RightButton){statusBar()->showMessage(tr("右键:")+str);//右键:(x,y)led_show->clear();QPixmap pix(images[0]);led_show->setPixmap(pix);led_show->show();}else if(e->button()==Qt::MiddleButton){statusBar()->showMessage(tr("中键:")+str);//中键:(x,y)}
}//鼠标移动事件响应函数
void MainWindow::mouseMoveEvent(QMouseEvent *e)
{MousePosLabel->setText("("+QString::number(e->x())+","+QString::number(e->y())+")");//显示内容(x,y)
}//鼠标松开事件响应函数
void MainWindow::mouseReleaseEvent(QMouseEvent *e)
{QString str="("+QString::number(e->x())+","+QString::number(e->y()) +")";statusBar()->showMessage(tr("释放在:")+str,1000); //释放在:(x,y),显示1000ms后隐藏
}//鼠标双击事件响应函数
void MainWindow::mouseDoubleClickEvent(QMouseEvent *e)
{statusBar()->showMessage("双击");
}

Qt控件label中显示图片并按比例缩放

    QPixmap pixmap(":/img/start_confirm_title.png");
    // 510,40 当前label大小
  pixmap=pixmap.scaled(510, 40, Qt::KeepAspectRatio, Qt::SmoothTransformation); //按比例缩放
    ui->label_2->setPixmap(pixmap);

按钮的背景切换

void MainWindow::on_pushButton_clicked()
{if(ui->pushButton->text() == "连接"){ui->pushButton->setFixedSize(100,40);//固定样式ui->pushButton->setStyleSheet("QPushButton{""color:rgba(255,0,0);"//红色"border: 2px solid rgb(178, 34, 34);""}""QPushButton:hover{""border: 2px solid rgb(255, 165, 0);""}");ui->pushButton->setText("断开");}else if(ui->pushButton->text()=="断开"){ui->pushButton->setFixedSize(100, 40);ui->pushButton->setStyleSheet("QPushButton{""color:rgba(0,0,0);" //黑色"border: 2px solid rgb(54, 100, 139);""}""QPushButton:hover{""border: 2px solid rgb(0, 150, 136);"//橘红色"}");ui->pushButton->setText("连接");//ui->pushButton->setStyleSheet("font: 11pt \"微软雅黑\";");}
}

Qt设置PushButton的颜色当指示灯用 

//通过调色板      红色-- Qt::red    绿色-- Qt::green
QPalette pal = ui.pushButtonBitDisp->palette();
pal.setColor(QPalette::Button, Qt::red);
ui.pushButtonBitDisp->setPalette(pal);
ui.pushButtonBitDisp->setAutoFillBackground(true);
ui.pushButtonBitDisp->setFlat(true);

http://www.hkea.cn/news/245446/

相关文章:

  • 网站的做网站公司哪家好网络优化大师app
  • 国内外包网站今日头条(官方版本)
  • 外网建筑设计网站线上渠道推广有哪些方式
  • 厦门做网站公司排名电工培训机构
  • 武汉网站设计制作外包公司的人好跳槽吗
  • 网站建设哪里最好页面关键词优化
  • 清远建设网站制作seo系统培训课程
  • 网站的网页建设知识ppt北大青鸟职业技术学院简介
  • 巫山网站设计aso优化榜单
  • 关于节约化建设网站的表态发言网站制作报价表
  • 建行网站是多少呢故事式的软文广告例子
  • 阳江市住房和城乡规划建设局网站一级消防工程师考试
  • 做课件的网站有哪些用html制作淘宝网页
  • 网站开发前后台整个流程品牌宣传的推广
  • 深圳市门户网站建设网站推广优化方法
  • 中山公司注册网页怎么优化
  • 网站建设怎么分录2022年新闻摘抄简短
  • 江西景德镇建设厅网站太原关键词排名推广
  • 番禺做网站自媒体发布平台有哪些
  • 用dede做的网站首页电子商务网络营销
  • 最好的做任务赚钱网站网络域名怎么查
  • 建设部规范网站百度app关键词优化
  • 骏域网站百度怎么收录网站
  • 网站robots.txt查看九江seo公司
  • 建设阿里妈妈网站搜索引擎排名优化seo
  • 自学网站建设作业创建网站免费
  • 营销网站定制的优势成品网站源码的优化技巧
  • 高职学院网站建设方案广告制作
  • table表格 做的网站营销案例分析报告模板
  • pc端网站做移动适配教育培训机构管理系统