mirror of
https://github.com/Linloir/SceneEditor.git
synced 2025-12-17 07:28:12 +08:00
29 lines
603 B
C++
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() {
|
|
} |