Esempio n. 1
0
QRect WWidgetGroup::layoutContentsMargins() const {
    QLayout* pLayout = layout();
    QMargins margins = pLayout ? pLayout->contentsMargins() :
            contentsMargins();
    return QRect(margins.left(), margins.top(),
                 margins.right(), margins.bottom());
}
Esempio n. 2
0
bool Drawer::eventFilter(QObject *obj, QEvent *event)
{
    const QEvent::Type type = event->type();

    if (QEvent::Move == type || QEvent::Resize == type) {
        QLayout *t = layout();
        if (t && 16 != t->contentsMargins().right()) {
            t->setContentsMargins(0, 0, 16, 0);
        }
    }
    return OverlayWidget::eventFilter(obj, event);
}
Esempio n. 3
0
int drv_layout(int drvid, void *a0, void* a1, void* a2, void* a3, void* a4, void* a5, void* a6, void* a7, void* a8, void* a9)
{
    handle_head* head = (handle_head*)a0;
    QLayout *self = (QLayout*)head->native;
    switch (drvid) {
    case LAYOUT_ADDLAYOUT: {
        self->addItem(drvGetLayout(a1));
        break;
    }
    case LAYOUT_ADDWIDGET: {
        self->addWidget(drvGetWidget(a1));
        break;
    }
    case LAYOUT_SETSPACING: {
        self->setSpacing(drvGetInt(a1));
        break;
    }
    case LAYOUT_SPACING: {
        drvSetInt(a1,self->spacing());
        break;
    }
    case LAYOUT_SETMARGINS: {
        self->setContentsMargins(drvGetMargins(a1));
        break;
    }
    case LAYOUT_MARGINS: {
        drvSetMargins(a1,self->contentsMargins());
        break;
    }
    case LAYOUT_SETMENUBAR: {
        self->setMenuBar(drvGetWidget(a1));
        break;
    }
    case LAYOUT_MENUBAR: {
        drvSetHandle(a1,self->menuBar());
        break;
    }
    default:
        return 0;
    }
    return 1;
}
Esempio n. 4
0
QMargins NLayoutPrototype::contentsMargins()
{
	QLayout *layout = qscriptvalue_cast<QLayout *>(thisObject());
	return layout->contentsMargins();
}