예제 #1
0
BtBookshelfWidget::BtBookshelfWidget(QWidget *parent, Qt::WindowFlags flags)
        : QWidget(parent, flags)
        , m_sourceModel(nullptr)
        , m_treeModel(nullptr)
        , m_leftCornerWidget(nullptr)
        , m_rightCornerWidget(nullptr)
{
    // Setup post-filter:
    m_postFilterModel = new BtBookshelfFilterModel(this);

    // Init widgets and such:
    initActions();
    initMenus();
    initWidgets();

    // Connect treeview to model:
    m_treeView->setModel(m_postFilterModel);

    retranslateUi();

    BT_CONNECT(m_nameFilterEdit,  SIGNAL(textEdited(QString)),
               m_postFilterModel, SLOT(setNameFilterFixedString(QString)));
    BT_CONNECT(m_treeView, SIGNAL(contextMenuActivated(QPoint)),
               this,       SLOT(slotShowContextMenu(QPoint)));
    BT_CONNECT(m_treeView,
               SIGNAL(moduleContextMenuActivated(CSwordModuleInfo *, QPoint)),
               this, SLOT(slotShowItemContextMenu(CSwordModuleInfo *, QPoint)));
}
예제 #2
0
bool AttachDialog::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: contextMenuActivated((int)static_QUType_int.get(_o+1)); break;
    case 1: rightButtonClicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    default:
	return AppDialog::qt_invoke( _id, _o );
    }
    return TRUE;
}
예제 #3
0
bool Document::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0:
        contextMenuActivated((int)static_QUType_int.get(_o+1));
        break;
    case 1:
        rescale((int)static_QUType_int.get(_o+1));
        break;
    default:
        return QMainWindow::qt_invoke( _id, _o );
    }
    return TRUE;
}