mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-25 07:05:48 +00:00
Add MiniQtHelper functions for scrolling widgets
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <QProgressBar>
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
#include <QScrollBar>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
#include "Code/QRDUtils.h"
|
||||
@@ -412,6 +413,26 @@ rdcstr MiniQtHelper::GetWidgetText(QWidget *widget)
|
||||
return widget->windowTitle();
|
||||
}
|
||||
|
||||
void MiniQtHelper::ScrollToTop(QWidget *widget)
|
||||
{
|
||||
if(!widget)
|
||||
return;
|
||||
|
||||
QAbstractScrollArea *w = qobject_cast<QAbstractScrollArea *>(widget);
|
||||
if(w)
|
||||
w->verticalScrollBar()->setSliderPosition(w->verticalScrollBar()->minimum());
|
||||
}
|
||||
|
||||
void MiniQtHelper::ScrollToBottom(QWidget *widget)
|
||||
{
|
||||
if(!widget)
|
||||
return;
|
||||
|
||||
QAbstractScrollArea *w = qobject_cast<QAbstractScrollArea *>(widget);
|
||||
if(w)
|
||||
w->verticalScrollBar()->setSliderPosition(w->verticalScrollBar()->maximum());
|
||||
}
|
||||
|
||||
void MiniQtHelper::SetWidgetFont(QWidget *widget, const rdcstr &font, int32_t fontSize, bool bold,
|
||||
bool italic)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user