Messing around with a new datafilesdialog

pull/21/head
Pieter van der Kloet 14 years ago
parent 082902473b
commit 74eef82902

@ -1,12 +1,14 @@
set(LAUNCHER set(LAUNCHER
datafilesdialog.cpp datafilesdialog.cpp
datafilesmodel.cpp datafilesmodel.cpp
datafilesitem.cpp
lineedit.cpp lineedit.cpp
main.cpp main.cpp
maindialog.cpp maindialog.cpp
settingsdialog.cpp settingsdialog.cpp
datafilesdialog.h datafilesdialog.h
datafilesmodel.h datafilesmodel.h
datafilesitem.h
lineedit.h lineedit.h
maindialog.h maindialog.h
settingsdialog.h settingsdialog.h
@ -14,6 +16,8 @@ set(LAUNCHER
SET(MOC_HDRS SET(MOC_HDRS
datafilesdialog.h datafilesdialog.h
datafilesmodel.h
datafilesitem.h
lineedit.h lineedit.h
maindialog.h maindialog.h
settingsdialog.h settingsdialog.h

@ -3,27 +3,34 @@
#include "datafilesdialog.h" #include "datafilesdialog.h"
#include "datafilesmodel.h" #include "datafilesmodel.h"
#include "datafilesitem.h"
using namespace ESM; using namespace ESM;
//DataFilesDialog::DataFilesDialog(QWidget *parent)
// : QDialog(parent)
DataFilesDialog::DataFilesDialog() DataFilesDialog::DataFilesDialog()
{ {
//QWidget *centralWidget = new QWidget; //dataFilesModel = new DataFilesModel(this);
dataFilesModel = new DataFilesModel(); dataFilesModel = new DataFilesModel();
dataFilesModel->setReadOnly(true); // Prevent changes to files
dataFilesModel->setRootPath("data"); for (int row = 0; row < 4; ++row) {
for (int column = 0; column < 4; ++column) {
QList<QVariant> test;
test << QString("%0").arg(i);
DataFilesItem *item = new DataFilesItem(test);
dataFilesModel->setItem(row, column, item);
}
}
//dataFilesModel->setReadOnly(true); // Prevent changes to files
//dataFilesModel->setRootPath("data");
// sortModel = new QSortFilterProxyModel(); // sortModel = new QSortFilterProxyModel();
// sortModel->setSourceModel(dataFilesModel); // sortModel->setSourceModel(dataFilesModel);
selectionModel = new QItemSelectionModel(dataFilesModel); //selectionModel = new QItemSelectionModel(dataFilesModel);
// selectionModel = new QItemSelectionModel(sortModel); // selectionModel = new QItemSelectionModel(sortModel);
// First, show only plugin files and sort them /* First, show only plugin files and sort them
QStringList acceptedfiles = (QStringList() << "*.esp"); QStringList acceptedfiles = (QStringList() << "*.esp");
dataFilesModel->setNameFilters(acceptedfiles); dataFilesModel->setNameFilters(acceptedfiles);
dataFilesModel->setNameFilterDisables(false); // Hide all other files dataFilesModel->setNameFilterDisables(false); // Hide all other files
@ -35,58 +42,33 @@ DataFilesDialog::DataFilesDialog()
acceptedfiles = (QStringList() << "*.esm" << "*.esp"); acceptedfiles = (QStringList() << "*.esm" << "*.esp");
dataFilesModel->setNameFilters(acceptedfiles); dataFilesModel->setNameFilters(acceptedfiles);
dataFilesModel->setFilter(QDir::Files); dataFilesModel->setFilter(QDir::Files);
*/
// Column 1 // Column 1
QVBoxLayout *dialogLayout = new QVBoxLayout(this); QVBoxLayout *dialogLayout = new QVBoxLayout(this);
QHBoxLayout *groupsLayout = new QHBoxLayout();
QGroupBox *groupFiles = new QGroupBox(tr("Morrowind Files"), this); QGroupBox *groupFiles = new QGroupBox(tr("Morrowind Files"), this);
groupFiles->setMinimumWidth(450); groupFiles->setMinimumWidth(450);
QVBoxLayout *groupFilesLayout = new QVBoxLayout(groupFiles); QVBoxLayout *groupFilesLayout = new QVBoxLayout(groupFiles);
QSpacerItem *vSpacer1 = new QSpacerItem(20, 2, QSizePolicy::Minimum, QSizePolicy::Fixed); //QSpacerItem *vSpacer1 = new QSpacerItem(20, 2, QSizePolicy::Minimum, QSizePolicy::Fixed);
QHBoxLayout *filterLayout = new QHBoxLayout(); /*QHBoxLayout *filterLayout = new QHBoxLayout();
QLabel *labelFilter = new QLabel(tr("Filter:"), groupFiles); QLabel *labelFilter = new QLabel(tr("Filter:"), groupFiles);
lineFilter = new LineEdit(groupFiles); lineFilter = new LineEdit(groupFiles);
filterLayout->addWidget(labelFilter); filterLayout->addWidget(labelFilter);
filterLayout->addWidget(lineFilter); filterLayout->addWidget(lineFilter);
*/
// View for the game files // View for the game files
dataFilesView = new QTableView(groupFiles); //dataFilesView = new QTreeView(groupFiles);
dataFilesView = new QTreeView(groupFiles);
dataFilesView->setModel(dataFilesModel);
// Put everything in the correct layouts // Put everything in the correct layouts
groupFilesLayout->addLayout(filterLayout); //groupFilesLayout->addLayout(filterLayout);
groupFilesLayout->addItem(vSpacer1); //groupFilesLayout->addItem(vSpacer1);
groupFilesLayout->addWidget(dataFilesView); groupFilesLayout->addWidget(dataFilesView);
groupsLayout->addWidget(groupFiles);
// Column 2
QGroupBox *groupInfo = new QGroupBox(tr("File Information"), this);
groupInfo->setFixedWidth(250);
QVBoxLayout *groupInfoLayout = new QVBoxLayout(groupInfo);
QSpacerItem *vSpacer2 = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Fixed);
QLabel *labelAuthor = new QLabel(tr("Author:"), groupInfo);
lineAuthor = new QLineEdit(groupInfo);
lineAuthor->setReadOnly(true);
QSpacerItem *vSpacer3 = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Fixed);
QLabel *labelDesc = new QLabel(tr("Description:"), groupInfo);
textDesc = new QPlainTextEdit(groupInfo);
textDesc->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
textDesc->setMinimumHeight(180);
textDesc->setReadOnly(true);
QSpacerItem *vSpacer4 = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Fixed);
QLabel *labelDepends = new QLabel(tr("Dependencies:"), groupInfo);
textDepends = new QPlainTextEdit(groupInfo);
textDepends->setFixedHeight(80);
textDepends->setReadOnly(true);
QHBoxLayout *buttonsLayout = new QHBoxLayout(); QHBoxLayout *buttonsLayout = new QHBoxLayout();
QSpacerItem *horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); QSpacerItem *horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
@ -98,27 +80,13 @@ DataFilesDialog::DataFilesDialog()
buttonsLayout->addItem(horizontalSpacer); buttonsLayout->addItem(horizontalSpacer);
buttonsLayout->addWidget(buttonBox); buttonsLayout->addWidget(buttonBox);
// Put everything in the correct layouts dialogLayout->addWidget(groupFiles);
groupInfoLayout->addItem(vSpacer2);
groupInfoLayout->addWidget(labelAuthor);
groupInfoLayout->addWidget(lineAuthor);
groupInfoLayout->addItem(vSpacer3);
groupInfoLayout->addWidget(labelDesc);
groupInfoLayout->addWidget(textDesc);
groupInfoLayout->addItem(vSpacer4);
groupInfoLayout->addWidget(labelDepends);
groupInfoLayout->addWidget(textDepends);
groupsLayout->addWidget(groupInfo);
dialogLayout->addLayout(groupsLayout);
dialogLayout->addLayout(buttonsLayout); dialogLayout->addLayout(buttonsLayout);
setWindowTitle(tr("Data Files")); setWindowTitle(tr("Data Files"));
// Signals and slots // Signals and slots
//connect(dataFilesModel, SIGNAL(directoryLoaded(const QString &)), this, SLOT(setupView())); /*connect(dataFilesModel, SIGNAL(directoryLoaded(const QString &)), this, SLOT(setupView()));
connect(dataFilesView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(setCheckstate(QModelIndex))); connect(dataFilesView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(setCheckstate(QModelIndex)));
connect(selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(changeData(QModelIndex, QModelIndex))); connect(selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(changeData(QModelIndex, QModelIndex)));
@ -128,14 +96,14 @@ DataFilesDialog::DataFilesDialog()
connect(buttonBox->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked()), this, SLOT(restoreDefaults())); connect(buttonBox->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked()), this, SLOT(restoreDefaults()));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(writeConfig())); connect(buttonBox, SIGNAL(accepted()), this, SLOT(writeConfig()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(close())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(close()));
*/
readConfig(); //readConfig();
setupView(); //setupView();
} }
void DataFilesDialog::changeData(QModelIndex index, QModelIndex bottom) void DataFilesDialog::changeData(QModelIndex index, QModelIndex bottom)
{ {
if (!index.isValid()) { /*if (!index.isValid()) {
return; return;
} }
@ -176,7 +144,7 @@ void DataFilesDialog::changeData(QModelIndex index, QModelIndex bottom)
void DataFilesDialog::setupView() void DataFilesDialog::setupView()
{ {
// The signal directoryLoaded is emitted after all files are in the model /* The signal directoryLoaded is emitted after all files are in the model
dataFilesView->setModel(dataFilesModel); dataFilesView->setModel(dataFilesModel);
// dataFilesView->setModel(sortModel); // dataFilesView->setModel(sortModel);
@ -203,13 +171,13 @@ void DataFilesDialog::setupView()
dataFilesView->horizontalHeader()->setStretchLastSection(true); dataFilesView->horizontalHeader()->setStretchLastSection(true);
//sortModel->setSortCaseSensitivity(Qt::CaseInsensitive); //sortModel->setSortCaseSensitivity(Qt::CaseInsensitive);*/
} }
void DataFilesDialog::readConfig() void DataFilesDialog::readConfig()
{ {
QString filename; /* QString filename;
QString path = "data/"; // TODO: Should be global QString path = "data/"; // TODO: Should be global
QFile file("openmw.cfg"); // Specify filepath later QFile file("openmw.cfg"); // Specify filepath later
@ -250,12 +218,12 @@ void DataFilesDialog::readConfig()
// File is found in model, set it to checked // File is found in model, set it to checked
dataFilesModel->setData(index, Qt::Checked, Qt::CheckStateRole); dataFilesModel->setData(index, Qt::Checked, Qt::CheckStateRole);
} }
} }*/
} }
void DataFilesDialog::writeConfig() void DataFilesDialog::writeConfig()
{ {
// Custom write method: We cannot use QSettings because it does not accept spaces /* Custom write method: We cannot use QSettings because it does not accept spaces
// QList<QPersistentModelIndex> checkeditems = dataFilesModel->getCheckedItems().toList(); // QList<QPersistentModelIndex> checkeditems = dataFilesModel->getCheckedItems().toList();
QStringList checkeditems = dataFilesModel->getCheckedItems(); QStringList checkeditems = dataFilesModel->getCheckedItems();
@ -318,12 +286,12 @@ void DataFilesDialog::writeConfig()
file.close(); file.close();
close(); // Exit dialog close(); // Exit dialog*/
} }
void DataFilesDialog::restoreDefaults() void DataFilesDialog::restoreDefaults()
{ {
// Uncheck all checked items /* // Uncheck all checked items
dataFilesModel->checkedItems.clear(); dataFilesModel->checkedItems.clear();
QModelIndexList indexlist; // Make a list of default master files QModelIndexList indexlist; // Make a list of default master files
@ -337,12 +305,12 @@ void DataFilesDialog::restoreDefaults()
dataFilesModel->setData(index, Qt::Checked, Qt::CheckStateRole); dataFilesModel->setData(index, Qt::Checked, Qt::CheckStateRole);
} }
} }
dataFilesModel->submit(); // Force refresh of view dataFilesModel->submit(); // Force refresh of view*/
} }
void DataFilesDialog::setCheckstate(QModelIndex index) void DataFilesDialog::setCheckstate(QModelIndex index)
{ {
// No check if index is valid: doubleclicked() always returns /* No check if index is valid: doubleclicked() always returns
// a valid index when emitted // a valid index when emitted
//index = QModelIndex(sortModel->mapToSource(index)); // Get a valid index //index = QModelIndex(sortModel->mapToSource(index)); // Get a valid index
@ -357,11 +325,12 @@ void DataFilesDialog::setCheckstate(QModelIndex index)
dataFilesModel->setData(index, Qt::Unchecked, Qt::CheckStateRole); dataFilesModel->setData(index, Qt::Unchecked, Qt::CheckStateRole);
} else { } else {
dataFilesModel->setData(index, Qt::Checked, Qt::CheckStateRole); dataFilesModel->setData(index, Qt::Checked, Qt::CheckStateRole);
} }*/
} }
void DataFilesDialog::setFilter() void DataFilesDialog::setFilter()
{ {
/*
QStringList filefilter = (QStringList() << "*.esm" << "*.esp"); QStringList filefilter = (QStringList() << "*.esm" << "*.esp");
QStringList currentfilefilter; QStringList currentfilefilter;
@ -390,5 +359,5 @@ void DataFilesDialog::setFilter()
// readConfig(); // readConfig();
// dataFilesModel->submit(); // dataFilesModel->submit();
// dataFilesModel->setData(); // dataFilesModel->setData();
*/
} }

@ -1,20 +1,21 @@
#ifndef DATAFILESDIALOG_H #ifndef DATAFILESDIALOG_H
#define DATAFILESDIALOG_H #define DATAFILESDIALOG_H
#include <QDialog>
#include <QModelIndex>
#include <QLineEdit>
#include <QPlainTextEdit>
#include "lineedit.h" #include "lineedit.h"
class DataFilesModel; class DataFilesModel;
class QStringList;
class QTableView; /*class QStringList;
class QTreeView;
class QLineEdit; class QLineEdit;
class QPlainTextEdit; class QPlainTextEdit;
class QItemSelectionModel; class QItemSelectionModel;
class QSortFilterProxyModel; class QSortFilterProxyModel;
*/
#include <QDialog>
#include <QModelIndex>
class QTreeView;
class DataFilesDialog : public QDialog class DataFilesDialog : public QDialog
{ {
@ -27,14 +28,14 @@ public:
private: private:
DataFilesModel *dataFilesModel; DataFilesModel *dataFilesModel;
QTableView *dataFilesView; QTreeView *dataFilesView;
QItemSelectionModel *selectionModel; //QItemSelectionModel *selectionModel;
QSortFilterProxyModel *sortModel; //QSortFilterProxyModel *sortModel;
QLineEdit *lineAuthor; //QLineEdit *lineAuthor;
LineEdit *lineFilter; //LineEdit *lineFilter;
QPlainTextEdit *textDesc; //QPlainTextEdit *textDesc;
QPlainTextEdit *textDepends; //QPlainTextEdit *textDepends;
public slots: public slots:

@ -1,145 +1,155 @@
#include <QtGui>
#include "datafilesitem.h"
#include "datafilesmodel.h" #include "datafilesmodel.h"
//DataFilesModel::DataFilesModel(const QString &data, QObject *parent)
DataFilesModel::DataFilesModel(QObject *parent) DataFilesModel::DataFilesModel(QObject *parent)
: QFileSystemModel(parent) : QAbstractItemModel(parent)
{ {
QList<QVariant> rootData;
rootData << " ";
//rootItem = new DataFilesItem(rootData);
rootItem = new DataFilesItem(rootData);
//setupModelData(data.split(QString("\n")), rootItem);
} }
QVariant DataFilesModel::data(const QModelIndex &index, int role) const DataFilesModel::~DataFilesModel()
{ {
if (index.isValid() && role == Qt::DecorationRole) { delete rootItem;
if (index.column() == 2) {
QFileIconProvider fip;
QIcon fileIcon = fip.icon(fileInfo(index));
return fileIcon;
}
else {
return QIcon();
} }
int DataFilesModel::columnCount(const QModelIndex &parent) const
{
if (parent.isValid())
return static_cast<DataFilesItem*>(parent.internalPointer())->columnCount();
else
return rootItem->columnCount();
} }
if (index.isValid() && role == Qt::DisplayRole) { QVariant DataFilesModel::data(const QModelIndex &index, int role) const
if (index.column() == 2) { {
//qDebug() << index.data(Qt::DisplayRole); if (!index.isValid())
if (fileInfo(index).suffix().toLower() == "esp") { return QVariant();
return QString("Plugin File");
}
else if (fileInfo(index).suffix().toLower() == "esm") {
return QString("Master File");
} if (role != Qt::DisplayRole)
} return QVariant();
}
if (index.isValid() && role == Qt::CheckStateRole && index.column() == 0) { DataFilesItem *item = static_cast<DataFilesItem*>(index.internalPointer());
// Put a checkbox in the first column
if (index.isValid())
if (checkedItems.contains(filePath(index))) { return item->data(index.column());
// if (checkedItems.contains(index)) {
return Qt::Checked;
}
else {
return Qt::Unchecked;
} }
Qt::ItemFlags DataFilesModel::flags(const QModelIndex &index) const
{
if (!index.isValid())
return 0;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
} }
return QFileSystemModel::data(index, role);
QVariant DataFilesModel::headerData(int section, Qt::Orientation orientation,
int role) const
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
return rootItem->data(section);
return QVariant();
} }
bool DataFilesModel::setData(const QModelIndex& index, const QVariant& value, int role) QModelIndex DataFilesModel::index(int row, int column, const QModelIndex &parent)
const
{ {
if (!hasIndex(row, column, parent))
return QModelIndex();
if (index.isValid() && role == Qt::CheckStateRole && index.column() == 0) { DataFilesItem *parentItem;
// QPersistentModelIndex pindex(index);
// qDebug() << pindex; if (!parent.isValid())
parentItem = rootItem;
else
parentItem = static_cast<DataFilesItem*>(parent.internalPointer());
if (value == Qt::Checked) { DataFilesItem *childItem = parentItem->child(row);
//checkedItems.insert(pindex); if (childItem)
checkedItems.append(filePath(index)); return createIndex(row, column, childItem);
} else { else
// checkedItems.remove(pindex); return QModelIndex();
checkedItems.removeAll(filePath(index));
} }
emit dataChanged(index, index); QModelIndex DataFilesModel::parent(const QModelIndex &index) const
return true; {
} if (!index.isValid())
return QModelIndex();
return QFileSystemModel::setData(index, value, role); DataFilesItem *childItem = static_cast<DataFilesItem*>(index.internalPointer());
} DataFilesItem *parentItem = childItem->parent();
if (parentItem == rootItem)
return QModelIndex();
return createIndex(parentItem->row(), 0, parentItem);
}
Qt::ItemFlags DataFilesModel::flags(const QModelIndex &index) const int DataFilesModel::rowCount(const QModelIndex &parent) const
{ {
return QFileSystemModel::flags(index) | Qt::ItemIsUserCheckable; DataFilesItem *parentItem;
} if (parent.column() > 0)
return 0;
if (!parent.isValid())
parentItem = rootItem;
else
parentItem = static_cast<DataFilesItem*>(parent.internalPointer());
return parentItem->childCount();
}
/*QVariant DataFilesModel::headerData(int section, Qt::Orientation orientation, int role) const /*void DataFilesModel::setupModelData(const QStringList &lines, DataFilesItem *parent)
{ {
switch (role) { QList<DataFilesItem*> parents;
case Qt::DecorationRole: QList<int> indentations;
if (section == 0) { parents << parent;
// ### TODO oh man this is ugly and doesn't even work all the way! indentations << 0;
// it is still 2 pixels off
QImage pixmap(16, 1, QImage::Format_Mono);
pixmap.fill(0);
pixmap.setAlphaChannel(pixmap.createAlphaMask());
return pixmap;
}
break;
case Qt::TextAlignmentRole:
return Qt::AlignLeft;
}
if (orientation != Qt::Horizontal || role != Qt::DisplayRole) int number = 0;
return QAbstractItemModel::headerData(section, orientation, role);
QString returnValue; while (number < lines.count()) {
switch (section) { int position = 0;
case 0: returnValue = tr("TES3 File"); while (position < lines[number].length()) {
break; if (lines[number].mid(position, 1) != " ")
case 1: returnValue = tr("Size");
break;
case 2: returnValue = tr("Status");
break; break;
case 3: returnValue = tr("Date Modified"); position++;
break;
default: return QVariant();
}
return returnValue;
} }
*/
/*test QString lineData = lines[number].mid(position).trimmed();
void DataFilesModel::setCheckedItems(const QStringList &gameFiles)
{
qDebug() << "test";
qDebug() << gameFiles.join("lol");
if (!lineData.isEmpty()) {
// Read the column data from the rest of the line.
QStringList columnStrings = lineData.split("\t", QString::SkipEmptyParts);
QList<QVariant> columnData;
for (int column = 0; column < columnStrings.count(); ++column)
columnData << columnStrings[column];
}*/ if (position > indentations.last()) {
// The last child of the current parent is now the new parent
// unless the current parent has no children.
/*void DataFilesModel::unCheckAll() if (parents.last()->childCount() > 0) {
{ parents << parents.last()->child(parents.last()->childCount()-1);
checkedItems.clear(); indentations << position;
// data(); }
emit dataChanged(QModelIndex(), QModelIndex()); } else {
submit(); while (position < indentations.last() && parents.count() > 0) {
}*/ parents.pop_back();
indentations.pop_back();
}
}
const QStringList DataFilesModel::getCheckedItems() // Append a new item to the current parent's list of children.
//const QList<QPersistentModelIndex> DataFilesModel::getCheckedItems() parents.last()->appendChild(new DataFilesItem(columnData, parents.last()));
//const QSet<QPersistentModelIndex> DataFilesModel::getCheckedItems()
{
return checkedItems;
} }
/*void DataFilesModel::sort(int column, Qt::SortOrder order) number++;
{ }
qDebug() << "Sort!";
}*/ }*/

@ -1,38 +1,35 @@
#ifndef DATAFILESMODEL_H #ifndef DATAFILESMODEL_H
#define DATAFILESMODEL_H #define DATAFILESMODEL_H
#include <QFileSystemModel> #include <QAbstractItemModel>
#include <QFileIconProvider> #include <QModelIndex>
#include <QVariant>
#include <QDebug> class DataFilesItem;
class DataFilesModel : public QFileSystemModel class DataFilesModel : public QAbstractItemModel
{ {
Q_OBJECT
public: public:
//DataFilesModel(const QString &data, QObject *parent = 0);
DataFilesModel(QObject *parent = 0); DataFilesModel(QObject *parent = 0);
~DataFilesModel() {}; ~DataFilesModel();
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QVariant data(const QModelIndex &index, int role) const;
Qt::ItemFlags flags(const QModelIndex &index) const; Qt::ItemFlags flags(const QModelIndex &index) const;
QVariant headerData(int section, Qt::Orientation orientation,
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); int role = Qt::DisplayRole) const;
QModelIndex index(int row, int column,
// void sort(int column, Qt::SortOrder order); const QModelIndex &parent = QModelIndex()) const;
//test QModelIndex parent(const QModelIndex &index) const;
// void setCheckedItems(const QStringList& files); int rowCount(const QModelIndex &parent = QModelIndex()) const;
// void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); int columnCount(const QModelIndex &parent = QModelIndex()) const;
// void unCheckAll();
private:
// const QSet<QPersistentModelIndex> getCheckedItems(); //void setupModelData(const QStringList &lines, TreeItem *parent);
// const QList<QPersistentModelIndex> getCheckedItems();
const QStringList getCheckedItems(); DataFilesItem *rootItem;
// QVariant headerData(int section, Qt::Orientation orientation, int role) const;
// QSet<QPersistentModelIndex> checkedItems;
// QList<QPersistentModelIndex> checkedItems;
QStringList checkedItems;
}; };
#endif #endif

@ -1,5 +1,5 @@
###################################################################### ######################################################################
# Automatically generated by qmake (2.01a) Sun Mar 27 19:33:07 2011 # Automatically generated by qmake (2.01a) Tue Mar 29 22:56:27 2011
###################################################################### ######################################################################
TEMPLATE = app TEMPLATE = app
@ -9,15 +9,17 @@ INCLUDEPATH += .
# Input # Input
HEADERS += datafilesdialog.h \ HEADERS += datafilesdialog.h \
datafilesitem.h \
datafilesmodel.h \ datafilesmodel.h \
lineedit.h \ lineedit.h \
maindialog.h \ maindialog.h \
settingsdialog.h settingsdialog.h
SOURCES += datafilesdialog.cpp \ SOURCES += datafilesdialog.cpp \
datafilesitem.cpp \
datafilesmodel.cpp \ datafilesmodel.cpp \
lineedit.cpp \ lineedit.cpp \
main.cpp \ main.cpp \
maindialog.cpp \ maindialog.cpp \
qrc_resources.cxx \
settingsdialog.cpp settingsdialog.cpp
RESOURCES += resources.qrc RESOURCES += resources.qrc
RC_FILE = launcher.rc
Loading…
Cancel
Save