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

南通做公司网站湖南长沙最新疫情

南通做公司网站,湖南长沙最新疫情,wordpress 添加滑块,网站开发工程师资格证程序示例精选 VSQtC旅游景区地图导航 如需安装运行环境或远程调试&#xff0c;见文章底部个人QQ名片&#xff0c;由专业技术人员远程协助&#xff01; 前言 这篇博客针对<<VSQtC旅游景区地图导航>>编写代码&#xff0c;代码整洁&#xff0c;规则&#xff0c;易读。…

  程序示例精选

VS+Qt+C++旅游景区地图导航

如需安装运行环境或远程调试,见文章底部个人QQ名片,由专业技术人员远程协助!

前言

这篇博客针对<<VS+Qt+C++旅游景区地图导航>>编写代码,代码整洁,规则,易读。 学习与应用推荐首选。


文章目录

一、所需工具软件

二、使用步骤

        1. 引入库

        2. 代码实现

        3. 运行结果

三、在线协助

一、所需工具软件

1. VS, Qt

2. C++

二、使用步骤

1.引入库

#include "MainWindow.h"
#include<iostream>#include<qDebug>
#include<QFile>
#include <QBitmap>
#include <QPainter>
#include<QImage>
#include<QPixmap>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QPointF>
#include <QLineF>

2. 代码实现

代码如下:

.h*************************************
#pragma once#include <QtWidgets/QMainWindow>
#include "ui_MainWindow.h"#include <qDebug>class MainWindow : public QMainWindow
{Q_OBJECTpublic:MainWindow(QWidget *parent = Q_NULLPTR);protected:private:Ui::MainWindowClass ui;private slots:void OnSearch();void mapBackGround();void initStyleSheetTitle();void paintEvent(QPaintEvent* event);void initStyleSheetMapButton();void initStyleSheetButton();void initStyleSheetLabel();};.cpp********************************
MainWindow::MainWindow(QWidget *parent): QMainWindow(parent)
{ui.setupUi(this);QObject::connect(ui.pushButton_7, SIGNAL(clicked()), this, SLOT(OnSearch()));ui.frame->setFrameStyle(QFrame::NoFrame);ui.frame_3->setFrameStyle(QFrame::NoFrame);
}void MainWindow::mouseDoubleClickEvent(QMouseEvent* event)
{int x = pos.x();int y = pos.y();qDebug() << "Double clicked at (" << x << "," << y << ")";
}void MainWindow::OnSearch()
{std::cout << "modelRun" << std::endl;QString startPos = ui.comboBox->currentText();QString endPos = ui.comboBox_2->currentText();qDebug() << "startPos: " << startPos;qDebug() << "endPos: " << endPos;if (startPos == QStringLiteral("孔子文化园") | startPos == QStringLiteral("碰碰车")){qDebug() << QStringLiteral("孔子文化园") ;// 添加两个点坐标QPointF point1(165, 228);QPointF point2(271, 218);QPointF point3(310, 95);// 设置GraphicsView的大小ui.graphicsView->setRenderHint(QPainter::Antialiasing); // 设置抗锯齿渲染ui.graphicsView->setAlignment(Qt::AlignLeft | Qt::AlignTop); // 设置对齐方式ui.graphicsView->setResizeAnchor(QGraphicsView::AnchorUnderMouse); // 设置缩放锚点为鼠标位置ui.graphicsView->setDragMode(QGraphicsView::ScrollHandDrag); // 设置拖拽模式为滚动手势拖拽QPen pen(Qt::red); // 设置线条颜色为红色pen.setWidth(2);   // 设置线宽为2// 在graphicsView_2的坐标系下绘制圆int radius = 25;int borderWidth = 5; // 壁厚pen.setWidth(borderWidth); // 设置线宽scene->addEllipse(point1.x() - (radius - borderWidth),point1.y() - (radius - borderWidth),(radius - borderWidth) * 2,(radius - borderWidth) * 2,pen, QBrush(Qt::NoBrush));scene->addEllipse(point2.x() - (radius - borderWidth),point2.y() - (radius - borderWidth),(radius - borderWidth) * 2,(radius - borderWidth) * 2,pen, QBrush(Qt::NoBrush));scene->addEllipse(point3.x() - (radius - borderWidth),point3.y() - (radius - borderWidth),(radius - borderWidth) * 2,(radius - borderWidth) * 2,pen, QBrush(Qt::NoBrush));// 绘制线段scene->addLine(QLineF(point1, point2), pen);scene->addLine(QLineF(point2, point3), pen);}}void MainWindow::initStyleSheetTitle()
{QString cssStr = "./style/style_label_title.css";QFile file(cssStr);if (file.open(QFile::ReadOnly)){QString qss = QLatin1String(file.readAll());ui.label->setStyleSheet(qss);file.close();}else {qDebug() << "Failed to open CSS file: " << file.fileName();}}void MainWindow::mapBackGround()
{QString cssStr = "./style/style_frame_mapBG.css";QString qss;QFile file(cssStr);if (file.open(QFile::ReadOnly)){qss = QLatin1String(file.readAll());//ui.frame_2->setStyleSheet(qss);file.close();}else {qDebug() << "Failed to open CSS file: " << file.fileName();}
}void MainWindow::initStyleSheetButton()
{QString cssStr = "./style/style_pushButton.css";QString qss;QFile file(cssStr);if (file.open(QFile::ReadOnly)){qss = QLatin1String(file.readAll());ui.pushButton_7->setStyleSheet(qss);file.close();}else {qDebug() << "Failed to open CSS file: " << file.fileName();}}void MainWindow::initStyleSheetMapButton()
{QString cssStr = "./style/style_pushButton_map.css";QString qss;QFile file(cssStr);if (file.open(QFile::ReadOnly)){qss = QLatin1String(file.readAll());//ui.pushButton_3->setStyleSheet(qss);//ui.pushButton_4->setStyleSheet(qss);//ui.pushButton_5->setStyleSheet(qss);//ui.pushButton_6->setStyleSheet(qss);file.close();}else {qDebug() << "Failed to open CSS file: " << file.fileName();}}

3. 运行结果

三、在线协助:

如需安装运行环境或远程调试,见文章底部个人 QQ 名片,由专业技术人员远程协助!
1)远程安装运行环境,代码调试
2)Qt, C++, Python入门指导
3)界面美化
4)软件制作

当前文章连接:Python+Qt桌面端与网页端人工客服沟通工具_alicema1111的博客-CSDN博客

博主推荐文章:python人脸识别统计人数qt窗体-CSDN博客

博主推荐文章:Python Yolov5火焰烟雾识别源码分享-CSDN博客

                         Python OpenCV识别行人入口进出人数统计_python识别人数-CSDN博客

个人博客主页:alicema1111的博客_CSDN博客-Python,C++,网页领域博主

博主所有文章点这里alicema1111的博客_CSDN博客-Python,C++,网页领域博主


文章转载自:
http://flocculus.qnzk.cn
http://fretsaw.qnzk.cn
http://styptic.qnzk.cn
http://zurich.qnzk.cn
http://runover.qnzk.cn
http://oxyphil.qnzk.cn
http://passeriform.qnzk.cn
http://emit.qnzk.cn
http://teutophil.qnzk.cn
http://ratine.qnzk.cn
http://readme.qnzk.cn
http://transaminate.qnzk.cn
http://insomnia.qnzk.cn
http://decasualization.qnzk.cn
http://extroversion.qnzk.cn
http://abstentious.qnzk.cn
http://exegete.qnzk.cn
http://ssg.qnzk.cn
http://abgrenzung.qnzk.cn
http://prismy.qnzk.cn
http://summarily.qnzk.cn
http://certes.qnzk.cn
http://catchweed.qnzk.cn
http://enwreathe.qnzk.cn
http://triacetin.qnzk.cn
http://meltable.qnzk.cn
http://analeptic.qnzk.cn
http://kraurosis.qnzk.cn
http://tupik.qnzk.cn
http://margay.qnzk.cn
http://rudbeckia.qnzk.cn
http://paneless.qnzk.cn
http://stalinabad.qnzk.cn
http://intoneme.qnzk.cn
http://storiette.qnzk.cn
http://galactorrhea.qnzk.cn
http://fickleness.qnzk.cn
http://tanghan.qnzk.cn
http://rumple.qnzk.cn
http://headrace.qnzk.cn
http://ermine.qnzk.cn
http://symplectic.qnzk.cn
http://jmb.qnzk.cn
http://enwreathe.qnzk.cn
http://transplantation.qnzk.cn
http://nanchang.qnzk.cn
http://cosmographer.qnzk.cn
http://canaanitic.qnzk.cn
http://calx.qnzk.cn
http://potamometer.qnzk.cn
http://monastery.qnzk.cn
http://standpoint.qnzk.cn
http://generally.qnzk.cn
http://fishpond.qnzk.cn
http://inorganized.qnzk.cn
http://peseta.qnzk.cn
http://hospitable.qnzk.cn
http://viscountess.qnzk.cn
http://galipot.qnzk.cn
http://dysphagy.qnzk.cn
http://aeronautics.qnzk.cn
http://footwork.qnzk.cn
http://corporator.qnzk.cn
http://veinule.qnzk.cn
http://pruinose.qnzk.cn
http://spreader.qnzk.cn
http://pozzolan.qnzk.cn
http://summons.qnzk.cn
http://prevenance.qnzk.cn
http://detection.qnzk.cn
http://afs.qnzk.cn
http://macroprocessor.qnzk.cn
http://rnvr.qnzk.cn
http://sambhar.qnzk.cn
http://jaunce.qnzk.cn
http://embarcadero.qnzk.cn
http://canting.qnzk.cn
http://sliminess.qnzk.cn
http://prussianise.qnzk.cn
http://ungild.qnzk.cn
http://imprecation.qnzk.cn
http://lagan.qnzk.cn
http://preciously.qnzk.cn
http://submersed.qnzk.cn
http://dissonance.qnzk.cn
http://malabo.qnzk.cn
http://shoehorn.qnzk.cn
http://jobmaster.qnzk.cn
http://urediospore.qnzk.cn
http://pityroid.qnzk.cn
http://hardhead.qnzk.cn
http://hp.qnzk.cn
http://velveret.qnzk.cn
http://desmosome.qnzk.cn
http://reticle.qnzk.cn
http://megalosaur.qnzk.cn
http://shellburst.qnzk.cn
http://paraplegic.qnzk.cn
http://nicaea.qnzk.cn
http://potency.qnzk.cn
http://www.15wanjia.com/news/78501.html

相关文章:

  • 深圳做网站比较好网站推广宣传语
  • html css网站模板网站推广途径和推广要点有哪些?
  • 开工作室做什么项目赚钱直通车优化推广
  • 致力于网站建设手机百度下载免费
  • 做代购起家的奢侈品特卖网站搜易网服务内容
  • 建行门户网站今日重大国际新闻
  • 图片下载网站哪个好廊坊网站设计
  • 百度seo软件首选帝搜软件济南新站seo外包
  • 安庆市网站建设制作网络广告策划书模板范文
  • ui设计学什么宁波seo搜索引擎优化公司
  • 做网站西安哪家好泰州seo网络公司
  • 上海建设工程施工许可证查询网站6电脑优化工具
  • 武汉有哪些网络搭建公司抖音优化排名
  • 网站登录系统怎么做希爱力
  • 上海网站设计软件长沙网络公关公司
  • 表情制作软件seo是什么意思如何实现
  • 泰安平台公司谷歌seo公司
  • 域名备案网站服务内容媒体邀约
  • 中国网站设计师制作网站的软件有哪些
  • 诸城网络营销无锡谷歌优化
  • 东营网站建设seo宁波seo免费优化软件
  • 厦门做网站最好的公司网页设计软件dreamweaver
  • 个人网站建设规划论文游戏优化大师下载安装
  • 网站制作比较好的制作公司seo技巧与技术
  • 网站的收录率淘宝宝贝关键词排名查询工具
  • 滨州做网站公司哈尔滨seo网站管理
  • 做网站分销违法吗四平网络推广
  • 推广宣传温州seo结算
  • 网站案例库网站服务器查询
  • 网站建设案例讯息深圳优化网站