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();
|
y -= margins.top();
|
||||||
Base::move(style::RightToLeft() ? x : ((outerw > 0 ? outerw : Base::parentWidget()->width()) - x - Base::width()), y);
|
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) {
|
void setGeometryToLeft(int x, int y, int w, int h, int outerw = 0) {
|
||||||
auto margins = getMargins();
|
auto margins = getMargins();
|
||||||
x -= margins.left();
|
x -= margins.left();
|
||||||
|
|
@ -62,6 +65,9 @@ public:
|
||||||
h -= margins.top() - margins.bottom();
|
h -= margins.top() - margins.bottom();
|
||||||
Base::setGeometry(style::RightToLeft() ? ((outerw > 0 ? outerw : Base::parentWidget()->width()) - x - w) : x, y, w, h);
|
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) {
|
void setGeometryToRight(int x, int y, int w, int h, int outerw = 0) {
|
||||||
auto margins = getMargins();
|
auto margins = getMargins();
|
||||||
x -= margins.right();
|
x -= margins.right();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue