mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-19 19:15:07 +00:00
28 lines
571 B
C++
28 lines
571 B
C++
#ifndef KEEPRADIOWIDGET_H
|
|
#define KEEPRADIOWIDGET_H
|
|
|
|
#include <QPointer>
|
|
#include <QWidget>
|
|
|
|
class KeepRadioWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit KeepRadioWidget(QWidget *parent = nullptr);
|
|
~KeepRadioWidget();
|
|
|
|
void setWidget(QWidget *w);
|
|
void setWidthHeightRadio(float widthHeightRadio);
|
|
const QSize goodSize();
|
|
|
|
protected:
|
|
void resizeEvent(QResizeEvent *event);
|
|
void adjustSubWidget();
|
|
|
|
private:
|
|
float m_widthHeightRadio = -1.0f;
|
|
QPointer<QWidget> m_subWidget;
|
|
QSize m_goodSize;
|
|
};
|
|
|
|
#endif // KEEPRADIOWIDGET_H
|