https://github.com/buganini/cppui
C++ Declarative UI Framework. CPPUI doesn't do UI itself, it turns imperative UI libraries into declarative flavor with virtual DOM and aims to maintain interoperability.
https://github.com/buganini/cppui
Last synced: about 1 year ago
JSON representation
C++ Declarative UI Framework. CPPUI doesn't do UI itself, it turns imperative UI libraries into declarative flavor with virtual DOM and aims to maintain interoperability.
- Host: GitHub
- URL: https://github.com/buganini/cppui
- Owner: buganini
- Created: 2024-05-08T01:42:27.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-22T05:25:45.000Z (almost 2 years ago)
- Last Synced: 2024-12-26T14:27:57.138Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Warning!
Pre-alpha status, not ready for use
# What is CPPUI
CPPUI is a declarative UI framework with two-way data binding.
CPPUI doesn't do UI itself, it turns imperative UI libraries into declarative flavor with virtual DOM and aims to maintain interoperability.
[Slides for SciWork 2023](https://speakerdeck.com/buganini/pui-declarative-ui-framework-for-python)
[PUI: Python Version](https://github.com/buganini/PUI)
# View Hierarchy Construction
```c++
#include
#include "../../cppui/qt/application.hpp"
#include "../../cppui/qt/window.hpp"
#include "../../cppui/qt/label.hpp"
using namespace CPPUI;
class UI: public Application {
public:
UI(int argc, char *argv[]): Application(argc, argv) {
}
void content(void) {
for(auto _: Window().id("window1")) {
for(auto _: HBox()) {
Label("label1").id("label1");
Label("label2").id("label2");
Label("label3");
}
}
std::cout << *this << std::endl;
}
};
int main(int argc, char *argv[]) {
UI app(argc, argv);
app.id("app").run();
}
```
Output | c++filt -t:
```
UI#app {
CPPUI::Qt::Window#window1 {
CPPUI::Qt::HBox {
CPPUI::Qt::Label#label1 {
}
CPPUI::Qt::Label#label2 {
}
CPPUI::Qt::Label {
}
}
}
}
```