예제 #1
0
void UIMachineViewScale::updateSliders()
{
    if (horizontalScrollBarPolicy() != Qt::ScrollBarAlwaysOff)
        setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    if (verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff)
        setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
예제 #2
0
void QIDetailsBrowser::updateScrollBars()
{
    /* Some Qt issue prevents scroll-bars from update.. */
    Qt::ScrollBarPolicy horizontalPolicy = horizontalScrollBarPolicy();
    Qt::ScrollBarPolicy verticalPolicy = verticalScrollBarPolicy();
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setHorizontalScrollBarPolicy(horizontalPolicy);
    setVerticalScrollBarPolicy(verticalPolicy);
}
예제 #3
0
    QSize sizeHint() const {
        int f = 2 * frameWidth();
        QSize sz(f, f);
        int h = fontMetrics().height();

        if (widget()) {
             if (!widgetSize.isValid())
                 widgetSize = widgetResizable() ? widget()->sizeHint() : widget()->size();
             sz += widgetSize;
         } else {
             sz += QSize(12 * h, 8 * h);
         }
         if (verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOn)
             sz.setWidth(sz.width() + verticalScrollBar()->sizeHint().width());
         if (horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOn)
             sz.setHeight(sz.height() + horizontalScrollBar()->sizeHint().height());

         return sz; // .boundedTo(QSize(36 * h, 24 * h));
    }
int QAbstractScrollArea::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QFrame::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 4)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 4;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< Qt::ScrollBarPolicy*>(_v) = verticalScrollBarPolicy(); break;
        case 1: *reinterpret_cast< Qt::ScrollBarPolicy*>(_v) = horizontalScrollBarPolicy(); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setVerticalScrollBarPolicy(*reinterpret_cast< Qt::ScrollBarPolicy*>(_v)); break;
        case 1: setHorizontalScrollBarPolicy(*reinterpret_cast< Qt::ScrollBarPolicy*>(_v)); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 2;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}