added todos
This commit is contained in:
parent
e401b71788
commit
8a81c48606
3 changed files with 6 additions and 5 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
#include "../models/NavigationItemModel.h"
|
#include "../models/NavigationItemModel.h"
|
||||||
#include "../models/NavigationListModel.h"
|
#include "../models/NavigationListModel.h"
|
||||||
|
|
||||||
|
///@todo impelement reaction to item's clicked signal; implement back navigation
|
||||||
NavigationController::NavigationController(QObject *parent) : QObject(parent),
|
NavigationController::NavigationController(QObject *parent) : QObject(parent),
|
||||||
mRootItem(new NavigationItemModel(this)),
|
mRootItem(new NavigationItemModel(this)),
|
||||||
mNavList(new NavigationListModel(this))
|
mNavList(new NavigationListModel(this))
|
||||||
|
|
@ -12,7 +13,7 @@ NavigationController::NavigationController(QObject *parent) : QObject(parent),
|
||||||
|
|
||||||
void NavigationController::init(const QString &rootPath)
|
void NavigationController::init(const QString &rootPath)
|
||||||
{
|
{
|
||||||
|
///@todo create item for each subfolder and append to root;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigationController::setContext(QQmlContext *context)
|
void NavigationController::setContext(QQmlContext *context)
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,7 @@ int main(int argc, char *argv[])
|
||||||
NavigationController navController;
|
NavigationController navController;
|
||||||
navController.setContext(engine.rootContext());
|
navController.setContext(engine.rootContext());
|
||||||
|
|
||||||
|
///@todo call init with test path containing several folders each containing image.jpg
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
NavigationItemModel::NavigationItemModel(QObject *parent) : QObject(parent)
|
NavigationItemModel::NavigationItemModel(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
|
///@todo init imageSource with defaul image from qrc
|
||||||
}
|
}
|
||||||
|
|
||||||
QString NavigationItemModel::getImageSource() const
|
QString NavigationItemModel::getImageSource() const
|
||||||
|
|
@ -25,14 +25,12 @@ void NavigationItemModel::onClicked()
|
||||||
|
|
||||||
bool NavigationItemModel::setPath(const QString &path)
|
bool NavigationItemModel::setPath(const QString &path)
|
||||||
{
|
{
|
||||||
|
|
||||||
//@todo check if image.jpg exist; use default image from qrc otherwise!
|
|
||||||
|
|
||||||
auto dir = QDir(path);
|
auto dir = QDir(path);
|
||||||
if(!dir.exists()) return false;
|
if(!dir.exists()) return false;
|
||||||
|
|
||||||
mPath = path;
|
mPath = path;
|
||||||
|
|
||||||
|
/// @todo move default image to qrc
|
||||||
auto source = dir.filePath("file.jpg");
|
auto source = dir.filePath("file.jpg");
|
||||||
if(QFile(source).exists())
|
if(QFile(source).exists())
|
||||||
mImageSource = source;
|
mImageSource = source;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue