Luna is a QML components library (Buttons, CheckBoxes, SpinBoxes, etc.) aimed to desktop usage.
- Based on QtQuickControls 2.
- Fixes various behaviors for default QML components.
- Adds support for a much needed
DoubleSpinBox
, to handle doubles (the standard one handles only integers). - Provides a
TreeView
. - Provides a
Vector3dEditor
to handleQVector3D
objects. - Lots of animations and graphical effects.
These new components are not 100% pure QML: they're based on C++ classes for the backend and logic, for performance reasons.
Compatibility: tested on Windows and macOS.
Table of Contents
-
Link with the
luna
library. -
If you're statically linking, initialize the lib's resources:
#include <luna/ResourceInitialization.hpp> luna::initializeResources();
-
Declare the library to the QML engine to be able to use it:
#include <luna/QmlEngineConfig.hpp> luna::registerQmlModule(engine);
-
In QML files, import the library as needed, where
<Module>
is a QMLluna
module:import Luna.<Module> 1.0 as <Module>
Modules are:
Containers
Controls
Dialogs
MainWindow
Styles
Utils
For detaied information about modules, read the dedicated section below.
Expander
: Allows to hide/show UI with a nice animation.Panel
ScrollView
: Improved ScrollView that will scroll automatically to the item that gets active focus.
BusyIndicator
Button
CheckBox
ComboBox
DoubleSpinBox
: Input field, with drag up/down support, that accepts doubles.IntegerSpinBox
: Input field, with drag up/down support, that accepts integers.LayoutSpacer
: Same as QtWidgets's QSpacerItem.ListView
ListViewItem
Menu
MenuItem
MenuSeparator
ProgressBar
ScrollBar
Separator
Slider
SpinBox
: Default (integer) SpinBox with +/- buttons.Switch
Text
TextField
TreeView
TreeViewArrow
Vector3dEditor
: Composed of 3 DoubleSpinBox and uses aQVector3D
as value.
AnimationUtils
: Allows to start an animation on a property.BindingUtils
: Allows to change a value without breaking existing bindings.ButtonShape
: Generic shape for buttons.EventLoopUtils
: Allows to schedule a task.FocusBorder
: Animated keyboard focus indicator.GeometryUtils
: Various computations of item sizes.InputShape
: Generic shape for text input fields.MenuUtils
: Utilities to handle menus in QML.Platform
: Get current OS from QML.QtObject2
: QtObject that allows nesting of other QtObjects.ScrollUtils
: Utilities to handle ScrollView behaviors.SvgIcon
: Same as SvgImage but allows to change the overlay color.SvgImage
: An image that takes source from a SVG file and scales correctly.Tooltip
: Animated tooltip.
Olivier Cléro | email | website
Luna is available under the MIT license. See the LICENSE file for more info.