十、Qt三维图表

news2024/10/6 8:32:06

一、Data Visualization模块概述

Data Visualization的三维显示功能主要有三种三维图形来实现,三各类的父类都是QAbstract3DGraph,从QWindow继承而来。这三类分别是:
  • 三维柱状图Q3DBar
  • 三维空间散点Q3DScatter
  • 三维曲面Q3DSurface

1、相关类的继承关系

(1)图形类

QWindow
	QAbstract3DGraph
		Q3DBar
		Q3DScatter
		Q3DSurface

(2)数据序列类

QAbstract3DSeries
	QBar3DSeries
	QScatter3DSeries
	QSurface3DSeries

(3)轴类

QAbstract3DAxis
	QCategory3DAxis
	QValue3DAxis

(4)数据代理类

数据代理类与序列对应,用于存储序列的数据的类。
QAbstractDataProxy
	QBarDataProxy
		QItemModelBarDataProxy
	QScatterDataProxy
		QItemModelScatterDataProxy
	QSurfaceDataProxy
		QHeightMapSurfaceDataProxy
		QItemModelSurfaceDataProxy

2、使用方法

(1)工程添加

QT += datavisualization

(2)代码中添加头文件与命名空间

#include <QtDataVisualization>
using namespace QtDataVisualization;

二、三维柱状图

1、实现程序

在这里插入图片描述

(1)创建项目,基于QMainWindow

(2)添加组件

在这里插入图片描述

(3)初始化

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QSplitter *splitter = new QSplitter(Qt::Horizontal);
    splitter->addWidget(ui->groupBox);


    initGraph3D();
    splitter->addWidget(createWindowContainer(graph3D));
    setCentralWidget(splitter);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::initGraph3D()
{
    graph3D = new Q3DBars;

    // 创建坐标系统
    QStringList rowLabs, colLabs;
    rowLabs << "row1" << "row2" << "row3";
    colLabs << "col1" << "col2" << "col3" << "col4" << "col5";

    QValue3DAxis *axisV = new QValue3DAxis;
    axisV->setTitle("Value");
    axisV->setTitleVisible(true);

    QCategory3DAxis * axisCol = new QCategory3DAxis;
    axisCol->setTitle("Column");
    axisCol->setTitleVisible(true);
    axisCol->setLabels(colLabs);

    QCategory3DAxis * axisRow = new QCategory3DAxis;
    axisRow->setTitle("Row");
    axisRow->setTitleVisible(true);
    axisRow->setLabels(rowLabs);

    graph3D->setValueAxis(axisV);
    graph3D->setColumnAxis(axisCol);
    graph3D->setRowAxis(axisRow);

    // 创建数据序列
    QBar3DSeries *series = new QBar3DSeries;
    series->setMesh(QAbstract3DSeries::MeshCylinder); // 形状
    series->setItemLabelFormat("(@rowLabel,@colLabel):%.1f");

    // 添加数据
    QBarDataArray *dataArray = new QBarDataArray;
    dataArray->reserve(rowLabs.count()); // 三行数据

    qsrand(QTime::currentTime().second());

    for (int i = 0; i < rowLabs.count(); ++i)
    {
        QBarDataRow *dataRow = new QBarDataRow;

        for (int j = 0; j < 5; ++j)
        {
            (*dataRow) << (qrand() % 10);
        }

        dataArray->append(dataRow);
    }

    series->dataProxy()->resetArray(dataArray);
    graph3D->addSeries(series);
}

在这里插入图片描述

(4)实现功能

void MainWindow::on_cboxCarmera_currentIndexChanged(int index)
{
    graph3D->scene()->activeCamera()->setCameraPreset(Q3DCamera::CameraPreset(index));
}

void MainWindow::on_hSliderLevel_valueChanged(int value)
{
    Q_UNUSED(value);
    int xRot = ui->hSliderLevel->value();
    int yRot = ui->hSliderVertical->value();
    int zoom = ui->hSliderScale->value();
    graph3D->scene()->activeCamera()->setCameraPosition(xRot, yRot, zoom);
}

void MainWindow::on_hSliderVertical_valueChanged(int value)
{
    Q_UNUSED(value);
    int xRot = ui->hSliderLevel->value();
    int yRot = ui->hSliderVertical->value();
    int zoom = ui->hSliderScale->value();
    graph3D->scene()->activeCamera()->setCameraPosition(xRot, yRot, zoom);
}

void MainWindow::on_hSliderScale_valueChanged(int value)
{
    Q_UNUSED(value);
    int xRot = ui->hSliderLevel->value();
    int yRot = ui->hSliderVertical->value();
    int zoom = ui->hSliderScale->value();
    graph3D->scene()->activeCamera()->setCameraPosition(xRot, yRot, zoom);
}

void MainWindow::on_cboxTheme_currentIndexChanged(int index)
{
    graph3D->activeTheme()->setType(Q3DTheme::Theme(index));
}

void MainWindow::on_cboxStyle_currentIndexChanged(int index)
{
    QBar3DSeries *series = graph3D->seriesList().at(0);
    series->setMesh(QAbstract3DSeries::Mesh(index));
}

void MainWindow::on_cboxMode_currentIndexChanged(int index)
{
    graph3D->setSelectionMode(QAbstract3DGraph::SelectionFlags(index));
}

void MainWindow::on_spinBoxFontSize_valueChanged(int arg1)
{
    QFont font = graph3D->activeTheme()->font();
    font.setPointSize(arg1);
    graph3D->activeTheme()->setFont(font);
}

#include <QColorDialog>
void MainWindow::on_btnItemColor_clicked()
{
    QBar3DSeries *series = graph3D->seriesList().at(0);
    QColor color = series->baseColor();
    color = QColorDialog::getColor(color);
    if(color.isValid())
    {
        series->setBaseColor(color);
    }
}

void MainWindow::on_checkBoxBack_clicked(bool checked)
{
    graph3D->activeTheme()->setBackgroundEnabled(checked);
}

void MainWindow::on_checkBoxBackNetwork_clicked(bool checked)
{
    graph3D->activeTheme()->setGridEnabled(checked);
}

void MainWindow::on_checkBoxSmooth_clicked(bool checked)
{
    QBar3DSeries *series = graph3D->seriesList().at(0);
    series->setMeshSmooth(checked);
}

void MainWindow::on_checkBoxReflection_clicked(bool checked)
{
    graph3D->setReflection(checked);
}

void MainWindow::on_checkBoxValueAxis_clicked(bool checked)
{
    graph3D->valueAxis()->setReversed(checked);
}

void MainWindow::on_checkBoxItemLabel_clicked(bool checked)
{
    QBar3DSeries *series = graph3D->seriesList().at(0);
    series->setItemLabelVisible(checked);
}

void MainWindow::on_checkBoxAxisBack_clicked(bool checked)
{
    graph3D->valueAxis()->setTitleVisible(checked);
    graph3D->rowAxis()->setTitleVisible(checked);
    graph3D->columnAxis()->setTitleVisible(checked);
}

void MainWindow::on_checkBoxAxisLabelBack_clicked(bool checked)
{
    graph3D->activeTheme()->setLabelBackgroundEnabled(checked);
}

三、三维散点图

1、实现程序

在这里插入图片描述

(1)创建项目,基于QMainWindow

(2)实现功能

#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QSplitter>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QSplitter *splitter = new QSplitter(Qt::Horizontal);
    splitter->addWidget(ui->groupBox);


    initGraph3D();
    splitter->addWidget(createWindowContainer(graph3D));
    setCentralWidget(splitter);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::initGraph3D()
{
    graph3D = new Q3DScatter;

    // 创建坐标系统
    graph3D->axisX()->setTitle("X轴");
    graph3D->axisX()->setTitleVisible(true);
    graph3D->axisY()->setTitle("Y轴");
    graph3D->axisY()->setTitleVisible(true);
    graph3D->axisZ()->setTitle("Z轴");
    graph3D->axisZ()->setTitleVisible(true);

    // 创建数据序列
    QScatterDataProxy *porxy = new QScatterDataProxy;
    QScatter3DSeries *series = new QScatter3DSeries(porxy);
    //    series->setMesh(QAbstract3DSeries::MeshCylinder); // 形状
    series->setItemLabelFormat("(@rowLabel,@colLabel):%.1f");
    series->setItemSize(0.2);
    graph3D->addSeries(series);

    // 添加数据
    int N = 41;
    QScatterDataArray *dataArray = new QScatterDataArray;
    dataArray->resize(N * N);
    QScatterDataItem *item = &dataArray->first();


    // 摩西跟草帽算法
    float x, y, z;
    x = -10;
    for (int i = 0; i < N; ++i)
    {
        y = -10;
        for (int j = 1; j <= N; ++j)
        {
            z = qSqrt(x * x + y * y);
            if(z != 0)
            {
                z = 10 * qSin(z) / z;
            }
            else
            {
                z = 10;
            }
            // 图形库的坐标系
            item->setPosition(QVector3D(x, z, y));
            item++;
            y += 0.5;
        }
        x += 0.5;
    }

    series->dataProxy()->resetArray(dataArray);
}

void MainWindow::on_cboxCarmera_currentIndexChanged(int index)
{
    graph3D->scene()->activeCamera()->setCameraPreset(Q3DCamera::CameraPreset(index));
}

void MainWindow::on_hSliderLevel_valueChanged(int value)
{
    Q_UNUSED(value);
    int xRot = ui->hSliderLevel->value();
    int yRot = ui->hSliderVertical->value();
    int zoom = ui->hSliderScale->value();
    graph3D->scene()->activeCamera()->setCameraPosition(xRot, yRot, zoom);
}

void MainWindow::on_hSliderVertical_valueChanged(int value)
{
    Q_UNUSED(value);
    int xRot = ui->hSliderLevel->value();
    int yRot = ui->hSliderVertical->value();
    int zoom = ui->hSliderScale->value();
    graph3D->scene()->activeCamera()->setCameraPosition(xRot, yRot, zoom);
}

void MainWindow::on_hSliderScale_valueChanged(int value)
{
    Q_UNUSED(value);
    int xRot = ui->hSliderLevel->value();
    int yRot = ui->hSliderVertical->value();
    int zoom = ui->hSliderScale->value();
    graph3D->scene()->activeCamera()->setCameraPosition(xRot, yRot, zoom);
}

void MainWindow::on_cboxTheme_currentIndexChanged(int index)
{
    graph3D->activeTheme()->setType(Q3DTheme::Theme(index));
}

void MainWindow::on_cboxStyle_currentIndexChanged(int index)
{
    QScatter3DSeries *series = graph3D->seriesList().at(0);
    series->setMesh(QAbstract3DSeries::Mesh(index));
}

void MainWindow::on_cboxMode_currentIndexChanged(int index)
{
    graph3D->setSelectionMode(QAbstract3DGraph::SelectionFlags(index));
}

void MainWindow::on_spinBoxFontSize_valueChanged(int arg1)
{
    QFont font = graph3D->activeTheme()->font();
    font.setPointSize(arg1);
    graph3D->activeTheme()->setFont(font);
}

#include <QColorDialog>
void MainWindow::on_btnItemColor_clicked()
{
    QScatter3DSeries *series = graph3D->seriesList().at(0);
    QColor color = series->baseColor();
    color = QColorDialog::getColor(color);
    if(color.isValid())
    {
        series->setBaseColor(color);
    }
}

void MainWindow::on_checkBoxBack_clicked(bool checked)
{
    graph3D->activeTheme()->setBackgroundEnabled(checked);
}

void MainWindow::on_checkBoxBackNetwork_clicked(bool checked)
{
    graph3D->activeTheme()->setGridEnabled(checked);
}

void MainWindow::on_checkBoxSmooth_clicked(bool checked)
{
    QScatter3DSeries *series = graph3D->seriesList().at(0);
    series->setMeshSmooth(checked);
}

void MainWindow::on_checkBoxReflection_clicked(bool checked)
{
    graph3D->setReflection(checked);
}

void MainWindow::on_checkBoxValueAxis_clicked(bool checked)
{
    graph3D->axisY()->setReversed(checked);
}

void MainWindow::on_checkBoxItemLabel_clicked(bool checked)
{
    QScatter3DSeries *series = graph3D->seriesList().at(0);
    series->setItemLabelVisible(checked);
}

void MainWindow::on_checkBoxAxisBack_clicked(bool checked)
{
    graph3D->axisY()->setTitleVisible(checked);
    graph3D->axisX()->setTitleVisible(checked);
    graph3D->axisZ()->setTitleVisible(checked);
}

void MainWindow::on_checkBoxAxisLabelBack_clicked(bool checked)
{
    graph3D->activeTheme()->setLabelBackgroundEnabled(checked);
}

四、三维曲面图

1、实现程序

在这里插入图片描述

(1)创建项目,基于QMainWindow

(2)添加组件

在这里插入图片描述

(3)初始化

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QSplitter *splitter = new QSplitter;
    splitter->addWidget(ui->groupBox);
    init3DGraph();
    splitter->addWidget(createWindowContainer(graph3D));
    setCentralWidget(splitter);

    // 设置按钮的渐变色
    QLinearGradient lgColor1(0, 0, 100, 0);
    lgColor1.setColorAt(1.0, Qt::black);
    lgColor1.setColorAt(0.67, Qt::blue);
    lgColor1.setColorAt(0.33, Qt::red);
    lgColor1.setColorAt(0, Qt::yellow);
    QPixmap mp(160, 20);
    QPainter painter(&mp);
    painter.setBrush(lgColor1);
    painter.drawRect(0, 0, 160, 20);
    ui->btnColors1->setIcon(QIcon(mp));
    ui->btnColors1->setIconSize(QSize(160, 20));

    lgColor1.setColorAt(1.0, Qt::darkBlue);
    lgColor1.setColorAt(0.5, Qt::yellow);
    lgColor1.setColorAt(0.2, Qt::red);
    lgColor1.setColorAt(0, Qt::darkRed);
    painter.setBrush(lgColor1);
    painter.drawRect(0, 0, 160, 20);
    ui->btnColors2->setIcon(QIcon(mp));
    ui->btnColors2->setIconSize(QSize(160, 20));
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::init3DGraph()
{
    graph3D = new Q3DSurface;

    graph3D->axisX()->setTitle("X轴");
    graph3D->axisX()->setTitleVisible(true);
    graph3D->axisX()->setRange(-11, 11);
    graph3D->axisY()->setTitle("Y轴");
    graph3D->axisY()->setTitleVisible(true);
    graph3D->axisZ()->setTitle("Z轴");
    graph3D->axisZ()->setTitleVisible(true);
    graph3D->axisZ()->setRange(-11, 11);


    QSurfaceDataProxy *proxy = new QSurfaceDataProxy;
    series = new QSurface3DSeries(proxy);
    series->setDrawMode(QSurface3DSeries::DrawSurface);
    series->setMeshSmooth(true); // 光滑曲面
    graph3D->addSeries(series);

    QSurfaceDataArray *dataArray = new QSurfaceDataArray;

    // 摩西跟草帽算法
    int N = 41;
    dataArray->reserve(N);
    float x, y, z;
    x = -10;
    for (int i = 0; i < N; ++i)
    {
        QSurfaceDataRow *newRow = new QSurfaceDataRow(N);

        y = -10;
        int index = 0;
        for (int j = 1; j <= N; ++j)
        {
            z = qSqrt(x * x + y * y);
            if(z != 0)
            {
                z = 10 * qSin(z) / z;
            }
            else
            {
                z = 10;
            }
            // 图形库的坐标系
            (*newRow)[index++].setPosition(QVector3D(x, z, y));
            y += 0.5;
        }
        x += 0.5;
        *dataArray << newRow;
    }

    series->dataProxy()->resetArray(dataArray);

}

(4)设置颜色

#include <QColorDialog>
void MainWindow::on_btnOneColor_clicked()
{
    QColor color = series->baseColor();
    color = QColorDialog::getColor(color);
    if(color.isValid())
    {
        series->setBaseColor(color);
        series->setColorStyle(Q3DTheme::ColorStyleUniform);
    }
}

void MainWindow::on_btnColors1_clicked()
{
    QLinearGradient lgColor1(0, 0, 100, 0);
    lgColor1.setColorAt(1.0, Qt::black);
    lgColor1.setColorAt(0.67, Qt::blue);
    lgColor1.setColorAt(0.33, Qt::red);
    lgColor1.setColorAt(0, Qt::yellow);
    series->setBaseGradient(lgColor1);
    series->setColorStyle(Q3DTheme::ColorStyleRangeGradient); //设置渐变色
}

void MainWindow::on_btnColors2_clicked()
{
    QLinearGradient lgColor1(0, 0, 100, 0);
    lgColor1.setColorAt(1.0, Qt::darkBlue);
    lgColor1.setColorAt(0.5, Qt::yellow);
    lgColor1.setColorAt(0.2, Qt::red);
    lgColor1.setColorAt(0, Qt::darkRed);
    series->setBaseGradient(lgColor1);
    series->setColorStyle(Q3DTheme::ColorStyleRangeGradient);
}

五、三维地形图

1、实现程序

在这里插入图片描述

(1)拷贝上一个项目

(2)添加图片资源文件

(3)实现功能

#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QSplitter>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QSplitter *splitter = new QSplitter;
    splitter->addWidget(ui->groupBox);
    init3DGraph();
    splitter->addWidget(createWindowContainer(graph3D));
    setCentralWidget(splitter);

    // 设置按钮的渐变色
    QLinearGradient lgColor1(0, 0, 100, 0);
    lgColor1.setColorAt(1.0, Qt::black);
    lgColor1.setColorAt(0.67, Qt::blue);
    lgColor1.setColorAt(0.33, Qt::red);
    lgColor1.setColorAt(0, Qt::yellow);
    QPixmap mp(160, 20);
    QPainter painter(&mp);
    painter.setBrush(lgColor1);
    painter.drawRect(0, 0, 160, 20);
    ui->btnColors1->setIcon(QIcon(mp));
    ui->btnColors1->setIconSize(QSize(160, 20));

    lgColor1.setColorAt(1.0, Qt::darkBlue);
    lgColor1.setColorAt(0.5, Qt::yellow);
    lgColor1.setColorAt(0.2, Qt::red);
    lgColor1.setColorAt(0, Qt::darkRed);
    painter.setBrush(lgColor1);
    painter.drawRect(0, 0, 160, 20);
    ui->btnColors2->setIcon(QIcon(mp));
    ui->btnColors2->setIconSize(QSize(160, 20));
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::init3DGraph()
{
    graph3D = new Q3DSurface;

    graph3D->axisX()->setTitle("东--西");
    graph3D->axisX()->setTitleVisible(true);
    graph3D->axisX()->setLabelFormat("%.2f米");
    graph3D->axisZ()->setTitle("南--北");
    graph3D->axisZ()->setTitleVisible(true);
    graph3D->axisY()->setTitle("海拔");
    graph3D->axisY()->setTitleVisible(true);

    QImage mapImage(":/images/images/map.png");
    QHeightMapSurfaceDataProxy *proxy = new QHeightMapSurfaceDataProxy(mapImage);
    proxy->setValueRanges(-5000, 5000, -5000, 5000);
    series = new QSurface3DSeries(proxy);
    series->setDrawMode(QSurface3DSeries::DrawSurface);
    graph3D->addSeries(series);
}

void MainWindow::on_cboxSurfaceStyle_currentIndexChanged(int index)
{
    series->setDrawMode(QSurface3DSeries::DrawFlags(index + 1));
}

#include <QColorDialog>
void MainWindow::on_btnOneColor_clicked()
{
    QColor color = series->baseColor();
    color = QColorDialog::getColor(color);
    if(color.isValid())
    {
        series->setBaseColor(color);
        series->setColorStyle(Q3DTheme::ColorStyleUniform);
    }
}

void MainWindow::on_btnColors1_clicked()
{
    QLinearGradient lgColor1(0, 0, 100, 0);
    lgColor1.setColorAt(1.0, Qt::black);
    lgColor1.setColorAt(0.67, Qt::blue);
    lgColor1.setColorAt(0.33, Qt::red);
    lgColor1.setColorAt(0, Qt::yellow);
    series->setBaseGradient(lgColor1);
    series->setColorStyle(Q3DTheme::ColorStyleRangeGradient); //设置渐变色
}

void MainWindow::on_btnColors2_clicked()
{
    QLinearGradient lgColor1(0, 0, 100, 0);
    lgColor1.setColorAt(1.0, Qt::darkBlue);
    lgColor1.setColorAt(0.5, Qt::yellow);
    lgColor1.setColorAt(0.2, Qt::red);
    lgColor1.setColorAt(0, Qt::darkRed);
    series->setBaseGradient(lgColor1);
    series->setColorStyle(Q3DTheme::ColorStyleRangeGradient);
}

void MainWindow::on_cboxMode_currentIndexChanged(int index)
{
    switch (index)
    {
    case 0:
        graph3D->setSelectionMode(QAbstract3DGraph::SelectionNone);
        break;
    case 1:
        graph3D->setSelectionMode(QAbstract3DGraph::SelectionItem);
        break;
    case 2:
        graph3D->setSelectionMode(QAbstract3DGraph::SelectionRow |
                                  QAbstract3DGraph::SelectionSlice);
        break;
    case 3:
        graph3D->setSelectionMode(QAbstract3DGraph::SelectionColumn |
                                  QAbstract3DGraph::SelectionSlice);
        break;
    default:
        break;
    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1428309.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

窥探向量乘矩阵的存内计算原理—基于向量乘矩阵的存内计算

在当今计算领域中&#xff0c;存内计算技术凭借其出色的向量乘矩阵操作效能引起了广泛关注。本文将深入研究基于向量乘矩阵的存内计算原理&#xff0c;并探讨几个引人注目的代表性工作&#xff0c;如DPE、ISAAC、PRIME等&#xff0c;它们在神经网络和图计算应用中表现出色&…

【笔记】Android 常用编译模块和输出产物路径

模块&产物路径 具体编译到软件的路径要看编译规则的分区&#xff0c;代码中模块编译输出的产物基本对应。 Android 代码模块 编译产物路径设备adb路径Comment 模块device/mediatek/system/common/ 资源overlay/telephony/frameworks/base/core 文件举例res/res/values-m…

Java项目:基于SSM框架实现的教务管理系统(ssm+B/S架构+源码+数据库+毕业论文)

一、项目简介 本项目是一套ssm813基于SSM框架实现的教务管理系统&#xff0c;主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的Java学习者。 包含&#xff1a;项目源码、数据库脚本等&#xff0c;该项目附带全部源码可作为毕设使用。 项目都经过严格调试&#x…

增加Vscode引用路径

增加Vscode引用路径 增加Vscode引用路径问题说明解决思路1在Vscode中进行配置缺点 解决思路2 增加Vscode引用路径 问题说明 在嵌入式开发中需要经常用到库函数(SPL), Vscode需要配置引用路径才能对函数名或变量进行跳转 解决思路1 与Keil5 MDK类似, 在配置C/C的json文件中添…

论在线测径仪在胶管生产行业的投资与回报!

关键词&#xff1a;在线测径仪,胶管测径仪,双轴测径仪,双向测径仪,测径仪,胶管外径检测 胶管种类多、应用广&#xff0c;在胶管生产行业中&#xff0c;在不断加深其自动化程度&#xff0c;在加深的过程中&#xff0c;先要考虑到的是其投入产出比&#xff0c;是否值得投入。在胶…

【自动化测试】---Selenium+Java

1.自动化测试分类 接口自动化测试UI自动化测试&#xff08;移动端自动化测试、Web端自动化测试&#xff09; 2.选择Selenium作为web自动化工具原因&#xff08;面试题&#xff09; 开源免费支持多个浏览器支持多个系统支持多语言Selenium包提供很多供测试使用的API 3.自动化是什…

从零开始学Linux之gcc链接

目录 创建静态库并使用 创建动态库(共享库)并使用 链接&#xff1a;将.o目标文件链接起来生成一个可执行程序文件&#xff0c;可分为静态链接和动态链接 静态链接&#xff1a;链接器会找出程序所需的函数&#xff0c;然后将它们拷贝到执行文件&#xff0c;由于这种拷贝是完整…

echarts step line

https://ppchart.com/#/ <template><div class"c-box" ref"jsEchart"></div> </template><script> import * as $echarts from echarts // 事件处理函数 export default {props: {// 需要传递的数据data: {type: Array,defa…

单臂路由实验(思科)

一&#xff0c;实验目的 在路由器的一个接口上通过配置子接口的方式&#xff0c;实现相互隔离的不同vlan之间互通。 二&#xff0c;设备配置 Switch1 Switch>enable 全局模式 Switch#configure terminal 配置模式 Switch(config)#vlan 10 …

【文件上传WAF绕过】<?绕过、.htaccess木马、.php绕过

&#x1f36c; 博主介绍&#x1f468;‍&#x1f393; 博主介绍&#xff1a;大家好&#xff0c;我是 hacker-routing &#xff0c;很高兴认识大家~ ✨主攻领域&#xff1a;【渗透领域】【应急响应】 【python】 【VulnHub靶场复现】【面试分析】 &#x1f389;点赞➕评论➕收藏…

蓝桥杯-常用STL(二)

常用STL &#x1f388;1.集合&#x1f388;2.set的基础使用&#x1f52d;2.1引入库&#x1f52d;2.2插入元素&#x1f52d;2.3删除元素&#x1f52d;2.4判断元素是否存在&#x1f52d;2.5遍历元素&#x1f52d;2.6清空 &#x1f388;3.set与结构体 &#x1f388;1.集合 &#x…

Java把列表数据导出为PDF文件,同时加上PDF水印

一、实现效果 二、遇到的问题 实现导出PDF主体代码参考&#xff1a;Java纯代码实现导出PDF功能&#xff0c;下图是原作者实现的效果 导出报错Font STSong-Light with UniGB-UCS2-H is not recognized.。参考&#xff1a;itext 生成 PDF(五) 使用外部字体 网上都是说jar包的版本…

Java项目:基于SSM框架实现的西安旅游管理系统(ssm+B/S架构+源码+数据库+毕业论文)

一、项目简介 本项目是一套ssm811基于SSM框架实现的西安旅游管理系统&#xff0c;主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的Java学习者。 包含&#xff1a;项目源码、数据库脚本等&#xff0c;该项目附带全部源码可作为毕设使用。 项目都经过严格调试&am…

Vue学习笔记14 --自定义hook函数/toRef/provide/inject等

9.自定义hook函数 什么是hook&#xff1f;—— 本质是一个函数&#xff0c;把setup函数中使用的Composition API进行了封装。 类似于vue2.x中的mixin。 自定义hook的优势: 复用代码, 让setup中的逻辑更清楚易懂。 10.toRef 作用&#xff1a;创建一个 ref 对象&#xff0c;其…

T113-Pro的buildroot添加gdisk ( GPT disks )出现gptfdisk needs a toolchain w/ C++的解决方法

问题背景&#xff1a; 最近入手了百问网的全志T113-Pro&#xff0c;用Emmc启动发现一张32GB的SD卡在烧录了百问网镜像 100ask-t113-pro_sdcard.img 的系统后&#xff0c;仅有200多M的存储空间。第一时间上百问网论坛看是否有板友也出现类似情况&#xff0c;发现了一个帖子正是描…

Qt/C++音视频开发65-切换声卡/选择音频输出设备/播放到不同的声音设备/声卡下拉框

一、前言 近期收到一个用户需求&#xff0c;要求音视频组件能够切换声卡&#xff0c;首先要在vlc上实现&#xff0c;于是马不停蹄的研究起来&#xff0c;马上查阅对应vlc有没有自带的api接口&#xff0c;查看接口前&#xff0c;先打开vlc播放器&#xff0c;看下能不能切换&…

算法学习——华为机考题库1(HJ1 - HJ10)

算法学习——华为机考题库1&#xff08;HJ1 - HJ10&#xff09; HJ1 字符串最后一个单词的长度 描述 计算字符串最后一个单词的长度&#xff0c;单词以空格隔开&#xff0c;字符串长度小于5000。&#xff08;注&#xff1a;字符串末尾不以空格为结尾&#xff09; 输入描述&…

MySQL原理(三)锁定机制(2)表锁行锁与页锁

前面提到&#xff0c;mysql锁按照操作颗粒分类&#xff0c;一般认为有表级锁、行级锁、页面锁三种。其实还有一种特殊的全局锁。 锁场景问题全局锁全库逻辑备份加了全局锁之后&#xff0c;整个数据库都是【只读状态】&#xff0c;如果数据库里有很多数据&#xff0c;备份就会花…

撰写出色的时事政治新闻资讯稿:窍门和技巧

撰写出色的时事政治新闻资讯稿&#xff1a;窍门和技巧 文章大纲写新闻/资讯&#xff08;结构部分&#xff09;较为复杂的标题&#xff08;额外扩展&#xff09;相关案例去除引题去除引题和副题注意事项讲一下什么叫导语。叙述式结论式描写式提问式摘要式 主体一要新二要“小”三…

C++多线程3

生产者消费者模型 OS经典问题&#xff0c;生产者消费者模型,empty和full还有mutex对应到C上如何处理看代码即可 #include <iostream> #include <thread> #include <mutex> #include <condition_variable> #include <queue> using namespace st…