コード例 #1
0
ファイル: cmdiarea.cpp プロジェクト: betsegaw/bibletime
CMDIArea::CMDIArea(BibleTime *parent)
        : QMdiArea(parent)
        , m_mdiArrangementMode(ArrangementModeManual)
        , m_activeWindow(0)
        , m_bibleTime(parent)
{
    Q_ASSERT(parent != 0);

    #if QT_VERSION >= 0x040500
    // Set document-style tabs (for Mac):
    setDocumentMode(true);
    #endif

    /*
      Activate windows based on the history of activation, e.g. when one has window A
      activated, and activates window B and then closes window B, then window A is activated.
    */
    setActivationOrder(QMdiArea::ActivationHistoryOrder);

    // Show scrollbars only when needed:
    setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);

    connect(this, SIGNAL(subWindowActivated(QMdiSubWindow*)),
            this, SLOT(slotSubWindowActivated(QMdiSubWindow*)));
}
コード例 #2
0
CodeArea::CodeArea(QWidget *parent) :
    QMdiArea(parent), fontSize(10) //TODO make a const
{
    //set up left and right actions to shuffle through buffers
    QAction *leftAction = new QAction(this);
    leftAction->setShortcut( tr("Alt+Left") );
    QAction *rightAction = new QAction(this);
    rightAction->setShortcut( tr("Alt+Right") );

    connect( leftAction, SIGNAL(triggered()),
             this, SLOT(activatePreviousSubWindow()) );
    connect( rightAction, SIGNAL(triggered()),
             this, SLOT(activateNextSubWindow()) );

    addAction(leftAction);
    addAction(rightAction);

    //forward selection changes in mdi
    connect( this, SIGNAL(subWindowActivated(QMdiSubWindow*)),
             this, SLOT(fireSelectRevision(QMdiSubWindow*)) );

    //setup subWindowList() to return stacking order
    //this is to facilitate always getting top window for execution
    setActivationOrder( QMdiArea::StackingOrder );
}
コード例 #3
0
ファイル: Workspace.cpp プロジェクト: corburn/ISIS
  /**
   * Workspace constructor
   *
   * @param parent
   */
  Workspace::Workspace(QWidget *parent) : QMdiArea(parent) {
    p_cubeViewportList = NULL;
    p_cubeViewportList = new QVector< MdiCubeViewport * >;

    connect(this, SIGNAL(subWindowActivated(QMdiSubWindow *)),
            this, SLOT(activateViewport(QMdiSubWindow *)));
    setActivationOrder(ActivationHistoryOrder);
  }
コード例 #4
0
ファイル: Utilities.cpp プロジェクト: acracan/OMEdit
MdiArea::MdiArea(QWidget *pParent)
  : QMdiArea(pParent)
{
  mpMainWindow = qobject_cast<MainWindow*>(pParent);
  setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
  setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
  setActivationOrder(QMdiArea::ActivationHistoryOrder);
  setDocumentMode(true);
#if QT_VERSION >= 0x040800
  setTabsClosable(true);
#endif
}
コード例 #5
0
int QMdiArea::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QAbstractScrollArea::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 14)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 14;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QBrush*>(_v) = background(); break;
        case 1: *reinterpret_cast< WindowOrder*>(_v) = activationOrder(); break;
        case 2: *reinterpret_cast< ViewMode*>(_v) = viewMode(); break;
        case 3: *reinterpret_cast< bool*>(_v) = documentMode(); break;
        case 4: *reinterpret_cast< bool*>(_v) = tabsClosable(); break;
        case 5: *reinterpret_cast< bool*>(_v) = tabsMovable(); break;
        case 6: *reinterpret_cast< QTabWidget::TabShape*>(_v) = tabShape(); break;
        case 7: *reinterpret_cast< QTabWidget::TabPosition*>(_v) = tabPosition(); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setBackground(*reinterpret_cast< QBrush*>(_v)); break;
        case 1: setActivationOrder(*reinterpret_cast< WindowOrder*>(_v)); break;
        case 2: setViewMode(*reinterpret_cast< ViewMode*>(_v)); break;
        case 3: setDocumentMode(*reinterpret_cast< bool*>(_v)); break;
        case 4: setTabsClosable(*reinterpret_cast< bool*>(_v)); break;
        case 5: setTabsMovable(*reinterpret_cast< bool*>(_v)); break;
        case 6: setTabShape(*reinterpret_cast< QTabWidget::TabShape*>(_v)); break;
        case 7: setTabPosition(*reinterpret_cast< QTabWidget::TabPosition*>(_v)); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 8;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}