程序示例精选
VS+QT+C++ VTK三维多模型鼠标悬浮高亮-点击变色
如需安装运行环境或远程调试,见文章底部个人QQ名片,由专业技术人员远程协助!
前言
这篇博客针对《VS+QT+C++ VTK三维多模型鼠标悬浮高亮-点击变色》编写代码,代码整洁,规则,易读。 学习与应用推荐首选。
文章目录
一、所需工具软件
二、使用步骤
1. 主要代码
2. 运行结果
三、在线协助
一、所需工具软件
1. VS+Qt
2. C++
二、使用步骤
代码如下(示例):
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
this->initStyleSheetDockWidget1();
QObject::connect(ui.actionOpen, SIGNAL(triggered()), this, SLOT(openRun1()));
QGridLayout* gridLayout = ui.gridLayout; gridLayout->setContentsMargins(0, 0, 0, 0);
gridLayout->setSpacing(0);
QGridLayout* gridLayout2 = ui.gridLayout_2; gridLayout2->setContentsMargins(0, 0, 0, 0);
gridLayout2->setSpacing(0);
QGridLayout* gridLayout3= ui.gridLayout_3; gridLayout3->setContentsMargins(7, 7, 7, 7);
gridLayout3->setSpacing(0);
QGridLayout* gridLayout4 = ui.gridLayout_4; gridLayout4->setContentsMargins(0, 0, 0, 0);
gridLayout4->setSpacing(0);
QGridLayout* gridLayout5= ui.gridLayout_5; gridLayout5->setContentsMargins(0, 0, 0, 0);
gridLayout5->setSpacing(0);
QWidget* frame = ui.frame; QGridLayout* gridLayoutT = qobject_cast<QGridLayout*>(frame->layout());
if (gridLayoutT) {
qDebug() << "GridLayout name: " << gridLayoutT->objectName();
}
else {
qDebug() << "frame控件没有GridLayout布局。";
}
}
void MainWindow::initStyleSheetDockWidget1()
{
QString cssStr = "./style/style_dockWidget.css";
QString qss;
QFile file(cssStr);
if (file.open(QFile::ReadOnly))
{
qss = QLatin1String(file.readAll());
ui.dockWidget_2->setStyleSheet(qss);
ui.dockWidget_3->setStyleSheet(qss);
file.close();
}
else {
qDebug() << "Failed to open CSS file: " << file.fileName();
}
}
void MainWindow::openRun1()
{
std::cout << "test_ " << std::endl;
QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Open Files"), QString("./model"), tr("Text Files (*.*)"));
qDebug() << "fileNames:"<< fileNames;
for (const QString& filePath : fileNames) {
std::string filePathStd = filePath.toStdString();
std::cout << "FilePath: " << filePathStd << std::endl;
}
}
运行结果
三、在线协助:
如需安装运行环境或远程调试,见文章底部个人 QQ 名片,由专业技术人员远程协助!
1)远程安装运行环境,代码调试
2)Visual Studio, Qt, C++, Python编程语言入门指导
3)界面美化
4)软件制作
5)云服务器申请
6)网站制作
当前文章连接:https://blog.csdn.net/alicema1111/article/details/132666851
个人博客主页:https://blog.csdn.net/alicema1111?type=blog
博主所有文章点这里:https://blog.csdn.net/alicema1111?type=blog
博主推荐:
Python人脸识别考勤打卡系统:
https://blog.csdn.net/alicema1111/article/details/133434445
Python果树水果识别:https://blog.csdn.net/alicema1111/article/details/130862842
Python+Yolov8+Deepsort入口人流量统计:https://blog.csdn.net/alicema1111/article/details/130454430
Python+Qt人脸识别门禁管理系统:https://blog.csdn.net/alicema1111/article/details/130353433
Python+Qt指纹录入识别考勤系统:https://blog.csdn.net/alicema1111/article/details/129338432
Python Yolov5火焰烟雾识别源码分享:https://blog.csdn.net/alicema1111/article/details/128420453
Python+Yolov8路面桥梁墙体裂缝识别:https://blog.csdn.net/alicema1111/article/details/133434445
Python+Yolov5道路障碍物识别:https://blog.csdn.net/alicema1111/article/details/129589741
Python+Yolov5跌倒检测 摔倒检测 人物目标行为 人体特征识别:https://blog.csdn.net/alicema1111/article/details/129272048