communi / libcommuni

A cross-platform IRC framework for Qt
https://communi.github.io
BSD 3-Clause "New" or "Revised" License
83 stars 37 forks source link

Nicer command creation in QML #43

Open jpnurmi opened 9 years ago

jpnurmi commented 9 years ago

The static IrcCommand::createXxx() convenience API might work fine in C++, but it's clumsy in QML given that one has to create a command instance to be able to call the methods. Perhaps a QML singleton (has to be a different name than IrcCommand to avoid clashes) or extend the Irc API in QML?

var cmd = IrcCommand.part(channel, reason) // clashes with the IrcCommand QML type name
var cmd = Irc.partCommand(channel, reason)

The latter kinda matches with the Qt QML "namespace" but then needs a QML specific documentation...