Added some convenient overload methods to RpWidget.
This commit is contained in:
parent
2404225e09
commit
0662809cd2
1 changed files with 6 additions and 0 deletions
|
|
@ -54,6 +54,9 @@ public:
|
|||
y -= margins.top();
|
||||
Base::move(style::RightToLeft() ? x : ((outerw > 0 ? outerw : Base::parentWidget()->width()) - x - Base::width()), y);
|
||||
}
|
||||
void setGeometryToLeft(const QRect &r, int outerw = 0) {
|
||||
setGeometryToLeft(r.x(), r.y(), r.width(), r.height(), outerw);
|
||||
}
|
||||
void setGeometryToLeft(int x, int y, int w, int h, int outerw = 0) {
|
||||
auto margins = getMargins();
|
||||
x -= margins.left();
|
||||
|
|
@ -62,6 +65,9 @@ public:
|
|||
h -= margins.top() - margins.bottom();
|
||||
Base::setGeometry(style::RightToLeft() ? ((outerw > 0 ? outerw : Base::parentWidget()->width()) - x - w) : x, y, w, h);
|
||||
}
|
||||
void setGeometryToRight(const QRect &r, int outerw = 0) {
|
||||
setGeometryToRight(r.x(), r.y(), r.width(), r.height(), outerw);
|
||||
}
|
||||
void setGeometryToRight(int x, int y, int w, int h, int outerw = 0) {
|
||||
auto margins = getMargins();
|
||||
x -= margins.right();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue