資源簡介
QT開發的CAN總線上位機,應該有一些能參考的東西,不貴
代碼片段和文件信息
#include?“fileswindow.h“
#include?“ui_fileswindow.h“
FilesWindow::FilesWindow(QWidget?*parent)?:
????QMainWindow(parent)
????ui(new?Ui::FilesWindow)
{
????ui->setupUi(this);
????model?=?new?QFileSystemModel(this);
????model->setFilter(QDir::QDir::AllEntries);
????//auto?index?=?model->index(QDir::currentPath());
????//ui->listView->setRootIndex(index);
????model->setRootPath(QApplication::applicationDirPath());
????ui->listView->setModel(model);
????ui->listView->setRootIndex(model->index(QApplication::applicationDirPath()));
????//ui->listView->setRootIndex(model->index(QApplication::applicationDirPath()));
????//connect(ui->listView?SIGNAL(doubleClicked(QModelIndex))?this?SLOT(on_listWidget_doubleClicked(QModelIndex)));
}
FilesWindow::~FilesWindow()
{
????delete?ui;
}
void?FilesWindow::on_listView_doubleClicked(const?QModelIndex?&index)
{
????QFileInfo?fileInfo?=?model->fileInfo(index);
????if(fileInfo.fileName()?==?“..“){
????????QDir?dir?=?fileInfo.dir();
????????dir.cdUp();
????????ui->listView->setRootIndex(model->index(dir.absolutePath()));
????}
????else?if(fileInfo.fileName()?==?“.“){
????????ui->listView->setRootIndex(model->index(““));
????}
????else?if(fileInfo.isDir()){
????????ui->listView->setRootIndex(index);
????}
????else?if(fileInfo.isFile()){
????????emit?sendPlotFile(QString(fileInfo.fileName()));
????????//ui->lineEdit->setText(fileInfo.fileName()+“?“+fileInfo.filePath());
????????this->close();
????}
}
void?FilesWindow::on_pushButton_2_clicked()
{
????this->close();
????delete?ui;
}
void?FilesWindow::on_pushButton_clicked()
{
????emit?sendPlotFile(model->fileInfo(ui->listView->currentIndex()).fileName());
????//ui->lineEdit->setText(fileInfo.fileName());
????this->close();
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-05-10?13:15??CAN-BUS-GUI-master\
?????目錄???????????0??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\
?????文件????????1443??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\GUI_for_CHAI.pro
?????文件???????43951??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\GUI_for_CHAI.pro.user
?????文件??????159232??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\chai.dll
?????文件???????10310??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\chai.h
?????文件???????11164??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\chai.lib
?????文件????????1742??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\fileswindow.cpp
?????文件?????????594??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\fileswindow.h
?????文件????????1190??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\fileswindow.ui
?????文件???????19376??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\graphplotwindow.cpp
?????文件????????1968??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\graphplotwindow.h
?????文件???????21899??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\graphplotwindow.ui
?????文件?????????269??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\main.cpp
?????文件???????26782??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\mainwindow.cpp
?????文件????????2842??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\mainwindow.h
?????文件???????23373??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\mainwindow.ui
?????文件????????6859??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\plotfromfile.cpp
?????文件?????????820??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\plotfromfile.h
?????文件????????4014??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\plotfromfile.ui
?????文件?????1118717??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\qcustomplot.cpp
?????文件??????266925??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\qcustomplot.h
?????文件?????????669??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\settingswindow.cpp
?????文件?????????387??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\settingswindow.h
?????文件????????3963??2018-05-10?13:15??CAN-BUS-GUI-master\GUI_for_CHAI\settingswindow.ui
?????文件??????120334??2018-05-10?13:15??CAN-BUS-GUI-master\libgcc_s_dw2-1.dll
?????文件?????1540622??2018-05-10?13:15??CAN-BUS-GUI-master\libstdc++-6.dll
?????文件???????79360??2018-05-10?13:15??CAN-BUS-GUI-master\libwinpthread-1.dll
?????目錄???????????0??2018-05-10?13:15??CAN-BUS-GUI-master\release\
?????文件?????7741645??2018-05-10?13:15??CAN-BUS-GUI-master\release\03.05.18?_?16.04.49.txt
?????文件?????????745??2018-05-10?13:15??CAN-BUS-GUI-master\release\03.05.18?_?16.04.50.txt
............此處省略77個文件信息
- 上一篇:Redis開發與運維 高清完整版
- 下一篇:EMDKfordotNET手冊
評論
共有 條評論