Skip to content
Snippets Groups Projects
Commit dce88573 authored by andreas's avatar andreas
Browse files

fixed initialization of FileBrowser member variables

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2586 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent a416e1b4
Branches
Tags
No related merge requests found
...@@ -55,7 +55,11 @@ ...@@ -55,7 +55,11 @@
namespace ost { namespace gui { namespace ost { namespace gui {
FileBrowser::FileBrowser(QWidget* parent): FileBrowser::FileBrowser(QWidget* parent):
Widget(NULL, parent) Widget(NULL, parent),
menu_(new QComboBox(this)),
model_(new QDirModel),
view_(new QListView(this)),
action_list_()
{ {
QString path=QDir::currentPath(); QString path=QDir::currentPath();
QDir dir(QCoreApplication::applicationDirPath()); QDir dir(QCoreApplication::applicationDirPath());
...@@ -90,23 +94,24 @@ FileBrowser::FileBrowser(QWidget* parent): ...@@ -90,23 +94,24 @@ FileBrowser::FileBrowser(QWidget* parent):
} }
FileBrowser::FileBrowser(const QString& path, QWidget* parent): FileBrowser::FileBrowser(const QString& path, QWidget* parent):
Widget(NULL, parent) Widget(NULL, parent),
menu_(new QComboBox(this)),
model_(new QDirModel),
view_(new QListView(this)),
action_list_()
{ {
this->Init(path); this->Init(path);
} }
void FileBrowser::Init(const QString& path) void FileBrowser::Init(const QString& path)
{ {
model_=new QDirModel;
model_->setSorting(QDir::Name|QDir::DirsFirst|QDir::IgnoreCase); model_->setSorting(QDir::Name|QDir::DirsFirst|QDir::IgnoreCase);
view_=new QListView(this);
view_->setModel(model_); view_->setModel(model_);
view_->setRootIndex(model_->index(path)); view_->setRootIndex(model_->index(path));
view_->setAttribute(Qt::WA_MacShowFocusRect, false); view_->setAttribute(Qt::WA_MacShowFocusRect, false);
view_->setContextMenuPolicy(Qt::CustomContextMenu); view_->setContextMenuPolicy(Qt::CustomContextMenu);
connect(view_,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(ShowContextMenu(const QPoint&))); connect(view_,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(ShowContextMenu(const QPoint&)));
menu_= new QComboBox(this);
UpdateMenu(path); UpdateMenu(path);
QVBoxLayout* l=new QVBoxLayout(this); QVBoxLayout* l=new QVBoxLayout(this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment