#include
#include "OxApplication.h"
#include "OxWidget.h"
#include "OxMainWindow.h"
#include "OxPushButton.h"
class Window : public Ox::MainWindow
{
public:
Window();
private:
void changeTitle(Object *sender){ setWindowTitle("Clicked!"); }
Ox::PushButton *button;
};
Window::Window()
{
button = new Ox::PushButton("Button", centralWidget());
connect(button->clicked, &Window::changeTitle);
resize(Ox::Size(300, 300));
setWindowTitle("Ox::Widget Test");
}
int WINAPI WinMain(HINSTANCE hIn, HINSTANCE, LPSTR cmdLine, int show)
{
Ox::Application app;
Window mainWindow;
app.connect(mainWindow.destroyed, &Ox::Application::exit);
mainWindow.show();
return app.exec();
}
[/source]
So my latest random for-fun project is the most infeasible yet - a Qt-inspired Win32 wrapper. It'll never work. It's stupid.
Most interesting part really is the reimplementation from scratch of the old type-safe signals/slots mechanism with templates. Quite happy with the syntax for connecting. Ox::Object under the hood maintains a list of Slot objects so that disconnection is automatic when the owing object goes out of scope.
The only annoyance is that I have to have Ox::Signal, Ox::Signal1
Not really a template metaprogrammer so quite pleased to have got it working anyway. Current stupid plan is to develop this to the point where its sort of vaguely working, then use it to re-write Opus, the 3D modeller, from scratch as I'm bored with the current version and want all the goodness I get from Qt at work without all the hassle of, y'know, actually having to use Qt.
Stupid plan, stupid project, stupid idea.
Somehow, as neat and well-thoughtout the Qt libraries are, it always makes the parts of my code that use it feel cludgy and messy. Maybe I have trouble embracing Qt paradynes or something.
Your library is looking good!