Home

Awesome

libui-qtlike

Qt-like library for libui.

libui is a C lightweight multi-platform UI library using native widgets on Linux (Gtk), OS X, and Windows.
libui-qtlike provides a C++ interface to libui

Instead of inventing a new class design, the interface is as close as possible to the Qt one.
As a welcome side effect it should be easier to start a project with libui and -- if the project gets bigger and needs a more powerful library -- switch to Qt.

Of course, the UI of a libui-qtlike program will not look like Qt, except if you are using the Qt backend (which is not in libui yet).

For small projects, using libui will produce much smaller executables for Windows and OS X.

The initial implementation aims at getting one of the basic Qt examples to run: http://doc.qt.io/qt-5/qtwidgets-mainwindows-application-example.html

Current state

Currently, it's possible to create a main window with a menu:

#include "libui-qtlike/libui-qtlike.h"
#include <vector>

using namespace std;

class MainWindow : public UI::MainWindow
{
public:
    MainWindow();
private:
    void createActions();
};

MainWindow::MainWindow()
{
    createActions();
}

void MainWindow::createActions()
{
    UI::Menu *fileMenu = menuBar()->addMenu("_File");
    UI::Action *newAction = new UI::Action("_New", this);
    fileMenu->addAction(newAction);
}

int main(int argc, char *argv[])
{

    UI::Application app(argc, argv);

    MainWindow mainWin;
    mainWin.show();
    return app.exec();
}

Building

On Linux:

Differences to Qt

Todo

Next tasks

Other tasks

Long term