-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
30 lines (23 loc) · 767 Bytes
/
main.cpp
File metadata and controls
30 lines (23 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <QApplication>
#include <QPushButton>
#include <QVBoxLayout>
#include "Window.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
// Create main window
Window w;
w.resize(800, 500); // Set initial size
QWidget* content = w.contentArea();
QVBoxLayout* layout = new QVBoxLayout(content);
layout->setAlignment(Qt::AlignCenter);
QPushButton* toggleThemeBtn = new QPushButton("Toggle Dark/Light Mode", content);
layout->addWidget(toggleThemeBtn);
QObject::connect(toggleThemeBtn, &QPushButton::clicked, [&w]() {
w.setDarkMode(!w.isDarkMode());
});
QPushButton* testBtn = new QPushButton("Test Button", content);
layout->addWidget(testBtn);
w.show();
return app.exec();
}