BtOpenWorkActionMenu::BtOpenWorkActionMenu(QWidget *parent)
    : BtMenuView(parent), m_treeModel(0), m_postFilterModel(0)
{
    // Setup models:
    const BtBookshelfDockWidget *bookshelfDock(BtBookshelfDockWidget::getInstance());
    m_treeModel = new BtBookshelfTreeModel(bookshelfDock->groupingOrder(), this);
    m_postFilterModel = new BtBookshelfFilterModel(this);
    m_postFilterModel->setSourceModel(m_treeModel);
    setModel(m_postFilterModel);

    connect(this, SIGNAL(triggered(QModelIndex)),
            this, SLOT(slotIndexTriggered(QModelIndex)));
    connect(bookshelfDock, SIGNAL(groupingOrderChanged(BtBookshelfTreeModel::Grouping)),
            m_treeModel,   SLOT(setGroupingOrder(BtBookshelfTreeModel::Grouping)));

}
Ejemplo n.º 2
0
BtOpenWorkActionMenu::BtOpenWorkActionMenu(const QString &groupingConfigKey,
                                           QWidget *parent)
    : BtMenuView(parent)
    , m_treeModel(0)
    , m_postFilterModel(0)
    , m_groupingMenu(0)
    , m_groupingConfigKey(groupingConfigKey)
{
    // Setup models:
    m_treeModel = new BtBookshelfTreeModel(groupingConfigKey, this);
    m_postFilterModel = new BtBookshelfFilterModel(this);
    m_postFilterModel->setSourceModel(m_treeModel);
    setModel(m_postFilterModel);

    connect(this, SIGNAL(triggered(QModelIndex)),
            this, SLOT(slotIndexTriggered(QModelIndex)));
}