1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/test/treeviewtest/mainwindow.cpp
tianduanrui 56b95be626 update
2018-06-13 18:03:16 +08:00

30 lines
746 B
C++

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "QFileSystemModel"
#include "QDirModel"
#include <QApplication>
#include <qqtsqltreemodel.h>
MainWindow::MainWindow ( QWidget* parent ) :
QMainWindow ( parent ),
ui ( new Ui::MainWindow )
{
ui->setupUi ( this );
QFileSystemModel* model = new QFileSystemModel ( this );
//model->setRootPath ( "xxxxxx" );
QDirModel* model2 = new QDirModel ( this );
ui->tv0->setModel ( model2 );
ui->tv0->setRootIndex ( model2->index ( qApp->applicationDirPath() ) );
QQtSqlTreeModel* md0 = new QQtSqlTreeModel ( this );
ui->tv1->setModel ( md0 );
md0->setAbsoluteFilePath ( "Manager.db" );
md0->query();
}
MainWindow::~MainWindow()
{
delete ui;
}