Signals | Public Member Functions

TreeItemSelectionBox Class Reference

Is essentialy a selection box for the possible items to be put in the node of ProjectTreeView. More...

#include <treeview.h>

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

List of all members.

Signals

void signal_commitSelection (int newItemId, QString columnName)
void signal_commitSelection (QString newPath)

Public Member Functions

 TreeItemSelectionBox (TreeItem *treeItem, QWidget *parent=0)

Detailed Description

Is essentialy a selection box for the possible items to be put in the node of ProjectTreeView.


Constructor & Destructor Documentation

TreeItemSelectionBox::TreeItemSelectionBox ( TreeItem treeItem,
QWidget parent = 0 
)

                                                                                         : QWidget(parent)
{
    this->treeItem = treeItem;

    QSqlQueryModel *model = new QSqlQueryModel(this);
    setupModel(model);

    setLayout(new QVBoxLayout);
    if (model->rowCount() == 0) {
        QLabel *label = new QLabel("Nothing to add");
        layout()->addWidget(label);
    } else {
        selectionBox = new QComboBox(this);
        selectionBox->setModel(model);
        commitSelection = new QPushButton("Add", this);
        layout()->addWidget(selectionBox);
        layout()->addWidget(commitSelection);
        connect(commitSelection, SIGNAL(clicked()),
                this, SLOT(slot_commitButton_clicked()));
    }
    layout()->setContentsMargins(4,4,4,4);
}


Member Function Documentation

void TreeItemSelectionBox::signal_commitSelection ( int  newItemId,
QString  columnName 
) [signal]
void TreeItemSelectionBox::signal_commitSelection ( QString  newPath  )  [signal]

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