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

杭州网站推广大全seo网络推广经理

杭州网站推广大全,seo网络推广经理,马尔康网站建设,建立个人网站有什么好处效果 在程序启动后,有时不会进入到工作页面,会进入到产品展示页面。 动画如下: 首页展示 页面操作 当不点击时,一秒自动刷新一次;当点击时,会自动跳转到对应页面;点击上一页、下一页、及跳转页…

效果

在程序启动后,有时不会进入到工作页面,会进入到产品展示页面。
动画如下:

首页展示

页面操作

  • 当不点击时,一秒自动刷新一次;
  • 当点击时,会自动跳转到对应页面;
  • 点击上一页、下一页、及跳转页数,会自动跳转。

UI设计

在这里插入图片描述

示例

注释在代码中,代码可运行。
.h

#ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QMainWindow>#include <QMap>
#include <QRadioButton>
#include <QButtonGroup>
namespace Ui {
class MainWindow;
}class MainWindow : public QMainWindow
{Q_OBJECTpublic:explicit MainWindow(QWidget *parent = nullptr);~MainWindow();private:Ui::MainWindow *ui;// 用于管理选择按钮QMap<int, QRadioButton*>    m_mapRadios;// 加入组QButtonGroup*               m_pBtnGroup;
};#endif // MAINWINDOW_H

.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"#include <QDebug>
#include <QLabel>
#include <QFont>#include <QTimer>MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent),ui(new Ui::MainWindow)
{ui->setupUi(this);ui->pushButton->setStyleSheet("QPushButton {background-color: #eeeeee; outline: none;}");ui->pushButton_2->setStyleSheet("QPushButton {background-color: #eeeeee; outline: none;}");m_pBtnGroup = new QButtonGroup(this);ui->horizontalLayout->addStretch();// 循环创建按钮for (int var = 0; var < 5; ++var) {QRadioButton* pR = new QRadioButton(QString::number(var+1));m_mapRadios.insert(var, pR);ui->horizontalLayout->addWidget(pR);// 加入组m_pBtnGroup->addButton(pR, var);}ui->horizontalLayout->addStretch();// 加入mapm_mapRadios.value(m_mapRadios.keys().first())->setChecked(true);// 循环创建展示界面for (int var = 0; var < 5; ++var) {// 设置信息QLabel* pLabel = new QLabel(this);pLabel->setText(QString("第%1页面").arg(var+1));pLabel->resize(150, 100);QFont font = pLabel->font();font.setPointSize(23);font.setBold(true);pLabel->setFont(font);pLabel->setStyleSheet("QLabel{color:#ff0000;}");pLabel->move(width()/2, height()/2);ui->stackedWidget->insertWidget(ui->stackedWidget->count(), pLabel);}ui->stackedWidget->setCurrentIndex(0);// 根据点击按钮,同步展示页面connect(m_pBtnGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, [=](int nId){ui->stackedWidget->setCurrentIndex(nId);});// 定时器QTimer* pTimer = new QTimer(this);connect(pTimer, &QTimer::timeout, this, [=](){// 每一秒更新一次int nIndex = ui->stackedWidget->currentIndex();if(nIndex < 4){ui->stackedWidget->setCurrentIndex(nIndex+1);m_mapRadios.value(nIndex+1)->setChecked(true);}else{ui->stackedWidget->setCurrentIndex(0);m_mapRadios.value(0)->setChecked(true);}});connect(ui->pushButton, &QPushButton::clicked, this, [=](){int nIndex = ui->stackedWidget->currentIndex();if(nIndex > 0){ui->stackedWidget->setCurrentIndex(nIndex-1);m_mapRadios.value(nIndex-1)->setChecked(true);}});connect(ui->pushButton_2, &QPushButton::clicked, this, [=](){int nIndex = ui->stackedWidget->currentIndex();if(nIndex < 4){ui->stackedWidget->setCurrentIndex(nIndex+1);m_mapRadios.value(nIndex+1)->setChecked(true);}});pTimer->start(1000);}MainWindow::~MainWindow()
{delete ui;
}

结论

可将每页显示的改为产品或者介绍图,实现业务。

http://www.wangmingla.cn/news/60323.html

相关文章:

  • 领优惠券的网站怎么做免费域名的网站
  • 网站建设指引免费建立个人网站
  • 外贸工具大全网站线上引流的八种推广方式
  • 凡科网站建设推广百度站长工具查询
  • 纪委网站建设的建议2345网址导航安装
  • 做网站深紫色搭配什么颜色a站
  • 本地镇江网站建设站长之家域名查询
  • 中山手机网站建设报价合肥关键词快速排名
  • 南京4a广告公司seo建站的步骤
  • 企业网站建站 优帮云天津百度推广中心
  • 网站建设自己在家接单如何做好网络营销?
  • 鄂州做网站公司青岛 google seo
  • 张店网站建设定制八大营销模式有哪几种
  • app界面设计的软件成都关键词优化服务
  • dw怎么做网站首页windows优化软件排行
  • php和织梦那个做网站好aso安卓优化公司
  • 企业网站每个月流量费如何制作自己的网站教程
  • 上海高端网站建设服务公做网络推广好吗
  • 长沙网站搜索引擎优化廊坊今日头条新闻
  • 公司网站怎么做备案网店如何推广
  • 网站建设网页的长宽安卓优化大师历史版本
  • 网站建设策略seo推广小分享
  • 医院内网网站建设推广营销软件
  • 新疆工程建设云app下载郑州seo网站排名
  • 网站建设公司骗人百度统计数据分析
  • wordpress 注册会员默认权限灰色词seo排名
  • 武汉武昌做网站推广今年疫情最新消息
  • 电子商务网站建设 实验分析seo营销推广多少钱
  • 关闭wordpress更新提示seo关键词排名教程
  • java网站开发面试题电视剧百度搜索风云榜