Phase zero - [X] Handwritten bindings Phase 1 - [X] Parse headers - [ ] Generate types - [X] Convert parameter pointer types to binding types - [X] Basic methods - [X] Special methods - [X] Constructors - [X] Prevent calling ctor of abstract class - [X] ~~Destructors~~ We only need .Delete() - [X] Copy-constructors - [X] Operator overloading - [ ] Move-constructors (e.g. QWidgetData) - [X] Class inheritance - [X] Detect in AST - [X] ~~Downcast helper methods~~ Direct type available - [ ] Types - [X] ~~PVoid typedefs~~ Removed/no longer needed as CGo supports pointers to incomplete C types - [X] Class types passed by pointer - [X] For parameters (want to call `cPointer()`) - [X] For return types - [X] Class types passed by value - [X] For parameters (need to dereference) e.g. `_SetIcon()` - [X] For return types (e.g. `_Icon()`) - ~~want to copy-construct into Go-provided memory~~ Go can't allocate a C++ type - Return as a heap pointer instead, convert to fake value-type using SetFinalizer - [X] QString type conversion - [X] For input parameters - [ ] For output parameters by pointer (e.g. QLockInfo::getLockInfo) - [X] For return types - [X] QList type conversion (e.g. QWidget::Actions()) - [X] For parameters - [ ] For output parameters by pointer (n.b. does this happen??) - [X] For return types - [X] Combinations - [X] QList - [X] For parameters - [X] For return types - [X] QList of value types - [X] For parameters - [X] For return types - [ ] COMBINATION: Need to use SetFinalizer? - [X] QStringList combination type conversion - [X] For parameters - [X] For return types - [X] ~~QByteArray type conversion~~ Seems to be fine as a non-templated type - [X] C array style used by QApplication constructor (int& argc, char** argv) - [ ] Typedefs - [X] Simple typedefs e.g. WId (hardcoded) - [X] QRgb (hardcoded) - [X] Parse from AST - [ ] Generic replacement - [X] Hide private methods - [X] Optional parameters - [X] Overloaded methods - [X] Static methods (e.g. QWidget::setTabOrder) - [ ] Signals - [X] Add `connect` wrappers for each signal - [ ] Argument marshalling - [ ] Overload disambiguation (e.g. QProcess signals) - [ ] Automatic memory management - [ ] Disconnect() - [ ] Public member variables - [ ] Qt:: namespace enums/const values - e.g. Qt::WindowFlags (global) - e.g. QWidget::RenderFlag (per-class) - [ ] Free functions - [X] QtCore - [X] QtGui - [X] QtWidgets - Successful `go build` of 409 C++ headers first achieved 2024-08-25. - [ ] Minimal example - [ ] Calling connect - [X] Pick a name for the package - [ ] Make github repo, rename module - [ ] v0 Public release Phase 2 - [X] ~~QString / QList helper functions~~ Lean on native Go types - [ ] Other Qt template containers - [X] QVector // Seems to mostly work identically using QList code - [ ] QPair (e.g. QGradientStop) - [ ] QMap / QHash - [ ] QSet - [ ] Nested templates e.g. QList> (e.g. ...) - [ ] Test edge cases - Exercising QString interop - Exercising QList interop - QList return (...), parameter (...) - QList return (QByteArray::split ), parameter (...) - QStringList return (QColor_ColorNames), parameter (QIcon.SetThemeSearchPaths) - QList return (QImage_ColorTable), parameter (...) - Calling methods on base class - Anything where we use runtime.SetFinalizer - Check mallocs/frees match in all cases - Run under valgrind to ensure no Qt memory leakage - [ ] Documentation - [ ] Adapt examples from other Go Qt bindings - [ ] Document comparison with other Qt binding packages - [ ] Document use for Windows/macOS/Linux Wishlist - [ ] Check compilation on x86_32/ARM32 architecture with 32-bit pointer width - [ ] Exception-safety? Does Qt rely on exceptions anywhere? - Advanced Qt functionality - [ ] Subclassing (e.g. render delegates) - [ ] Test of model-view list rendering - [ ] Custom Q_PROPERTY support - Usability - [X] QPaintEngine::fix_neg_rect should have a better name - [ ] Project DeprecatedAttr as `// Deprecated` comment - [ ] Consider projecting QByteArray as []byte - [ ] Consider projecting QDate/QTime/QDateTime as *time.Time - [ ] Use clang ast's `mangledName` to make a dlsym/LazyDLL cgo-free version - [ ] Copy Qt documentation into function doc comments for IDE hinting - What license is the Qt documentation under, what are the license implications of this? - [ ] Generate bindings for all current Qt versions (Debian Qt / Qt LTS), expose as git tags - Outreach/community - [ ] Dockerize a reproducible build process - [ ] CI action to rebuild bindings - [ ] Reuse CABI to generate Qt bindings for other non-Go languages - Performance - [ ] Convert generated cpp files to amalgamation build for faster compilation - https://github.com/golang/go/issues/9887 - [ ] Move some inlined generated code into helper functions to reduce total compile workload / binary size - [ ] Reduce necessary memory copies around ABI boundaries - [ ] Bypass malloc/free for zero-length strings - [ ] Bypass malloc/free for zero-length arrays - Broader coverage - [ ] Get 100% of all QtCore, QtGui, QtWidgets binding - [ ] Generate other Qt libraries e.g. QtSvg - [ ] Document process for binding more libraries e.g. QScintilla, QZXing - [ ] Add public QFoo_FromCPointer(uintptr) to ease interop with extra generated classes - [ ] Template inherited classes e.g. QMatrix3x3 is a QGenericMatrix<> - [ ] Get down to zero ErrTooComplex skips - Support other Qt ecosystem tooling - [ ] Qt Creator integration - [ ] uic implementation