Public Member Functions

DirectoryEdit Class Reference

Editor for directories. More...

#include <exporter.h>

Inheritance diagram for DirectoryEdit:
Inheritance graph
[legend]
Collaboration diagram for DirectoryEdit:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DirectoryEdit (QWidget *parent=0)
QString directory ()

Detailed Description

Editor for directories.


Constructor & Destructor Documentation

DirectoryEdit::DirectoryEdit ( QWidget parent = 0  ) 

                                                      : QWidget(parent)
{
    // Setup default dir
    if (!GlobalConst::EXPORT_DIR.exists())
        if(!GlobalConst::EXPORT_DIR.mkpath(GlobalConst::EXPORT_DIR.absolutePath()))
            Q_ASSERT(false);

    // Setup members
    editor = new QLineEdit(GlobalConst::EXPORT_DIR.absolutePath());
    editor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    dirExplorerButton = new QToolButton(this);
    dirExplorerButton->setIcon(QIcon(":/icons/folder_orange"));

    // Setup layout
    QHBoxLayout *layout = new QHBoxLayout;
    layout->addWidget(editor);
    layout->addWidget(dirExplorerButton);
    layout->setContentsMargins(0, 0, 0, 0);
    setLayout(layout);

    //Setup connections
    connect(dirExplorerButton, SIGNAL(clicked()), this, SLOT(onDirExplorerButtonPress()));
}


Member Function Documentation

QString DirectoryEdit::directory (  ) 

{
    Q_ASSERT(!QFileInfo(editor->text()).isFile());
    if (!QDir(editor->text()).exists())
        if (!QDir().mkpath(editor->text()))
            Q_ASSERT(false);
    return editor->text();
}


The documentation for this class was generated from the following files: