#include "dialog.h"
#include "ui_dialog.h"
#include
#include
#include
#include
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
model = new QDirModel(this);
model->setReadOnly(false);
ui->treeView->setModel(model);
QModelIndex index = model->index("/");
ui->treeView->expand(index);
ui->treeView->scrollTo(index);
ui->treeView->setCurrentIndex(index);
ui->treeView->resizeColumnToContents(0);
}
Dialog::~Dialog()
{
delete ui;
}
void Dialog::on_pushButton_clicked()
{
QModelIndex index = ui->treeView->currentIndex();
if(!index.isValid()) return;
QString name = QInputDialog::getText(this,"Makedir A file ","Name");
if(name.isEmpty()) return;
model->mkdir(index,name);
}
void Dialog::on_pushButton_2_clicked()
{
}
#include "ui_dialog.h"
#include
#include
#include
#include
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
model = new QDirModel(this);
model->setReadOnly(false);
ui->treeView->setModel(model);
QModelIndex index = model->index("/");
ui->treeView->expand(index);
ui->treeView->scrollTo(index);
ui->treeView->setCurrentIndex(index);
ui->treeView->resizeColumnToContents(0);
}
Dialog::~Dialog()
{
delete ui;
}
void Dialog::on_pushButton_clicked()
{
QModelIndex index = ui->treeView->currentIndex();
if(!index.isValid()) return;
QString name = QInputDialog::getText(this,"Makedir A file ","Name");
if(name.isEmpty()) return;
model->mkdir(index,name);
}
void Dialog::on_pushButton_2_clicked()
{
}