qt-scene-editor/FinalProject/mainwindow.cpp
Linloir 02f6ec97e6
Modulization
- Abstract out frameless window
2022-12-14 15:19:27 +08:00

29 lines
603 B
C++

#include <qpainterpath.h>
#include <qscreen.h>
#include <qlabel.h>
#include "mainwindow.h"
#include "pushbutton.h"
#include "logger.h"
#define MAX_MOUSE_MOVEMENT 300
MainWindow::MainWindow(QWidget *parent)
: FramelessWidget(20, parent)
{
PushButton* btn = new PushButton(new QLabel("Button"), this);
btn->setFixedSize(100, 100);
btn->move(100, 100);
btn->show();
connect(btn, &PushButton::onClick, this, [=]() {
if (btn->isSelected()) {
btn->deselect();
}
else {
btn->select();
}
});
}
MainWindow::~MainWindow() {
}