自定义内存分配池
This commit is contained in:
@@ -21,11 +21,11 @@ Frame_Less_Widget::Frame_Less_Widget(QWidget* parent) : QWidget(parent) {
|
||||
bottom_margin = 16;
|
||||
right_margin = 16;
|
||||
left_margin = 16;
|
||||
shapes.append({Qt::SizeFDiagCursor, Qt::SizeVerCursor, Qt::SizeBDiagCursor,
|
||||
Qt::SizeHorCursor, Qt::ArrowCursor, Qt::SizeHorCursor,
|
||||
Qt::SizeBDiagCursor, Qt::SizeVerCursor, Qt::SizeFDiagCursor,
|
||||
Qt::ArrowCursor});
|
||||
change_sizes.append({[this]() {
|
||||
shapes = {Qt::SizeFDiagCursor, Qt::SizeVerCursor, Qt::SizeBDiagCursor,
|
||||
Qt::SizeHorCursor, Qt::ArrowCursor, Qt::SizeHorCursor,
|
||||
Qt::SizeBDiagCursor, Qt::SizeVerCursor, Qt::SizeFDiagCursor,
|
||||
Qt::ArrowCursor};
|
||||
change_sizes = {[this]() {
|
||||
// R11
|
||||
setGeometry(start_x + dx, start_y + dy, qMax(start_w - dx, get_min_width()), qMax(start_h - dy, get_min_height()));
|
||||
},
|
||||
@@ -62,7 +62,7 @@ Frame_Less_Widget::Frame_Less_Widget(QWidget* parent) : QWidget(parent) {
|
||||
},
|
||||
[]() {
|
||||
// null
|
||||
}});
|
||||
}};
|
||||
}
|
||||
int Frame_Less_Widget::get_min_width() {
|
||||
return 0;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#include <QColor>
|
||||
#include <QDebug>
|
||||
#include <QLinearGradient>
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <QPixmap>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
@@ -39,8 +39,8 @@ public:
|
||||
int start_w{};
|
||||
int start_h{};
|
||||
int dx{}, dy{};
|
||||
QList<Qt::CursorShape> shapes;
|
||||
QList<change_size> change_sizes;
|
||||
std::vector<Qt::CursorShape> shapes;
|
||||
std::vector<change_size> change_sizes;
|
||||
int radius;
|
||||
QColor background_color = QColor(150, 150, 150, 130);
|
||||
virtual int get_min_width();
|
||||
|
||||
Reference in New Issue
Block a user