mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-01 18:16:10 +00:00
Add a MiniQtHelper to set spacing/margins on layouts
This commit is contained in:
@@ -307,6 +307,30 @@ void MiniQtHelper::InsertWidget(QWidget *parent, int32_t index, QWidget *child)
|
||||
box->insertWidget(qMin(qMax(0, index), box->count()), child);
|
||||
}
|
||||
|
||||
void MiniQtHelper::SetLayoutSpacing(QWidget *layout, int spacing)
|
||||
{
|
||||
if(!layout)
|
||||
return;
|
||||
|
||||
QLayout *l = layout->layout();
|
||||
if(!l)
|
||||
return;
|
||||
|
||||
l->setSpacing(spacing);
|
||||
}
|
||||
|
||||
void MiniQtHelper::SetLayoutMargins(QWidget *layout, int horizontal, int vertical)
|
||||
{
|
||||
if(!layout)
|
||||
return;
|
||||
|
||||
QLayout *l = layout->layout();
|
||||
if(!l)
|
||||
return;
|
||||
|
||||
l->setContentsMargins(horizontal, vertical, horizontal, vertical);
|
||||
}
|
||||
|
||||
void MiniQtHelper::SetWidgetText(QWidget *widget, const rdcstr &text)
|
||||
{
|
||||
if(!widget)
|
||||
|
||||
Reference in New Issue
Block a user