4 ms·
This is what you can with Qt: #include <QApplication> #include <QWidget> #include <QPainter> class widget : public QWidget { void paintEve
by coffeeaddict1 4mo ago
This is what you can with Qt:
#include <QApplication>
#include <QWidget>
#include <QPainter>
class widget : public QWidget {
void paintEvent(QPaintEvent*) override {
QPainter(this).drawEllipse(QPoint(320, 240), 100, 100);
}
};
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
widget w;
w.resize(640, 480);
w.show();
return app.exec();
}
It doesn't seem too complicated to me.
- ecshafer 4mo agoThat doesn't seem too bad, I agree. Maybe that's why QT is used. I haven't really used QT, but the more modern Windows apis, vulkan, etc all are pretty complicated.
- jetbalsa 4mo agoThats why I've always like pytk from tkinter import \* root = Tk() a = Label(root, text ="Hello World") a.pack() root.mainloop()
- cwillu 4mo agoFWIW, vulkan is not a GUI library; if you're reaching for it without a clear understanding of why you're doing so, yeah, it'll seem like a very complicated way of doing things.
- nandomrumber 4mo agoIt’s Qt and pronounced ‘cute’. https://en.wikipedia.org/wiki/Qt_(software) https://en.wikipedia.org/wiki/Qt_(software)
- TheRoque 4mo agoVulkan is a graphics API, not a UI library or framework. It's way lower level and if your goal is to make a user interface, you're not really supposed to do it with Vulkan (but you could i guess)
- nnevatie 4mo agoYeah, it doesn't look too bad on the surface. However, Qt is bad and I'd advice moving away from it if you can. This is based on ~20 years of experience using it in various projects. The licensing is trying to paint a picture of LGPL being somehow uncertain/evil, the way Qt advocates non-idiomatic C++ practices - I could go on for days, but shall digress.