494 d->userBottomMargin = bottom; |
494 d->userBottomMargin = bottom; |
495 invalidate(); |
495 invalidate(); |
496 } |
496 } |
497 |
497 |
498 /*! |
498 /*! |
|
499 \since 4.6 |
|
500 |
|
501 Sets the \a margins to use around the layout. |
|
502 |
|
503 By default, QLayout uses the values provided by the style. On |
|
504 most platforms, the margin is 11 pixels in all directions. |
|
505 |
|
506 \sa contentsMargins() |
|
507 */ |
|
508 void QLayout::setContentsMargins(const QMargins &margins) |
|
509 { |
|
510 setContentsMargins(margins.left(), margins.top(), margins.right(), margins.bottom()); |
|
511 } |
|
512 |
|
513 /*! |
499 \since 4.3 |
514 \since 4.3 |
500 |
515 |
501 Extracts the left, top, right, and bottom margins used around the |
516 Extracts the left, top, right, and bottom margins used around the |
502 layout, and assigns them to *\a left, *\a top, *\a right, and *\a |
517 layout, and assigns them to *\a left, *\a top, *\a right, and *\a |
503 bottom (unless they are null pointers). |
518 bottom (unless they are null pointers). |
516 Q_D(const QLayout); |
531 Q_D(const QLayout); |
517 d->getMargin(left, d->userLeftMargin, QStyle::PM_LayoutLeftMargin); |
532 d->getMargin(left, d->userLeftMargin, QStyle::PM_LayoutLeftMargin); |
518 d->getMargin(top, d->userTopMargin, QStyle::PM_LayoutTopMargin); |
533 d->getMargin(top, d->userTopMargin, QStyle::PM_LayoutTopMargin); |
519 d->getMargin(right, d->userRightMargin, QStyle::PM_LayoutRightMargin); |
534 d->getMargin(right, d->userRightMargin, QStyle::PM_LayoutRightMargin); |
520 d->getMargin(bottom, d->userBottomMargin, QStyle::PM_LayoutBottomMargin); |
535 d->getMargin(bottom, d->userBottomMargin, QStyle::PM_LayoutBottomMargin); |
|
536 } |
|
537 |
|
538 /*! |
|
539 \since 4.6 |
|
540 |
|
541 Returns the margins used around the layout. |
|
542 |
|
543 By default, QLayout uses the values provided by the style. On |
|
544 most platforms, the margin is 11 pixels in all directions. |
|
545 |
|
546 \sa setContentsMargins() |
|
547 */ |
|
548 QMargins QLayout::contentsMargins() const |
|
549 { |
|
550 int left, top, right, bottom; |
|
551 getContentsMargins(&left, &top, &right, &bottom); |
|
552 return QMargins(left, top, right, bottom); |
521 } |
553 } |
522 |
554 |
523 /*! |
555 /*! |
524 \since 4.3 |
556 \since 4.3 |
525 |
557 |