- Home
- Installation
- Using Livekeys
- Plugins
- Developer
group lvview
Contains core fucntionality for the user interface.
Summary
Members | Descriptions |
---|---|
public void toQml (const MLNode & n,QJSValue & result,QJSEngine * engine) |
Simple function that outputs the given MLNode in the form of a Qml object. |
public void fromQml (const QJSValue & value,MLNode & n) |
Simple function that converts the given Qml object into a LiveKeys-friendly MLNode shape. |
public inline std::ostream & operator<< (std::ostream & stream,const QChar & val) |
Stream output operator for QChars |
public inline std::ostream & operator<< (std::ostream & stream,const QString & val) |
Stream output operator for QStrings |
public inline std::ostream & operator<< (std::ostream & stream,const QByteArray & val) |
Stream output operator for QByteArrays |
public inline std::ostream & operator<< (std::ostream & stream,const QStringRef & val) |
Stream output operator for QStringRefs |
public inline void visualLogMessageHandler (QtMsgType type,const QMessageLogContext & ctx,const QString & msg) |
Message handler for typical Qt-based messages |
class lv::Extensions |
Object used to store all the extensions of LiveKeys. |
class lv::KeyMap |
Abstraction of a map which pairs up commands with key shortcuts used to run them. |
class lv::WorkspaceExtension |
The class within Qml to be used when we want to add an extension. |
class lv::ErrorHandler |
Object used inside QML that stops an error from passing it. |
class lv::IncubationController |
Extends the QmlIncubationController. |
class lv::QmlObjectList |
Contains a list of objects with a user buffer. |
class lv::QmlVariantList |
Contains a custom list of values with a user buffer. |
class lv::Settings |
General settings (on top of Editor settings) that uses a settings folder. |
class lv::FatalException |
Subclass of the lv::Exception used for unrecoverable errors. |
class lv::InputException |
Subclass of the lv::Exception used for configuration errors. |
class lv::ViewEngine |
Main Qml engine. |
class lv::VisualLogEntry |
Struct-like class for storing relevant data about a log entry. |
class lv::VisualLogBaseModel |
Abstract model of a set of visual log entries, to be extended for concrete usage by the VisualLogModel and VisualLogFilter. |
class lv::VisualLogFilter |
An implementation of the VisualLogBaseModel to represent a filtered set of log entries. |
class lv::VisualLogModel |
Main model used in visualizing log entries within LiveKeys when the log window is opened. |
class lv::VisualLogNetworkSender |
Implementation of VisualLog::Transport used for sending log messages over a network. |
class lv::VisualLogQmlObject |
Contains methods to present a Qml output for the visual log. |
Members
public void
toQml
(const MLNode & n,QJSValue & result,QJSEngine * engine)
Simple function that outputs the given MLNode in the form of a Qml object.
Since MLNodes can contain other MLNodes, this can be done recursively
public void
fromQml
(const QJSValue & value,MLNode & n)
Simple function that converts the given Qml object into a LiveKeys-friendly MLNode shape.
public inline std::ostream &
operator<<
(std::ostream & stream,const QChar & val)
Stream output operator for QChars
public inline std::ostream &
operator<<
(std::ostream & stream,const QString & val)
Stream output operator for QStrings
public inline std::ostream &
operator<<
(std::ostream & stream,const QByteArray & val)
Stream output operator for QByteArrays
public inline std::ostream &
operator<<
(std::ostream & stream,const QStringRef & val)
Stream output operator for QStringRefs
public inline void
visualLogMessageHandler
(QtMsgType type,const QMessageLogContext & ctx,const QString & msg)
Message handler for typical Qt-based messages
class lv::Extensions
class lv::Extensions
: public QObject
Object used to store all the extensions of LiveKeys.
Summary
Members | Descriptions |
---|---|
public Extensions ( ViewEngine * engine,const QString & settingsPath,QObject * parent) |
Default constructor. |
public ~Extensions () |
Default destructor |
public inline QQmlPropertyMap * globals () |
Globals getter |
public inline QMap< std::string, WorkspaceExtension * >::iterator begin () |
Begin iterator of extensions |
public inline QMap< std::string, WorkspaceExtension * >::iterator end () |
End iterator of extensions |
public const QString & path () const |
Members
public
Extensions
(
ViewEngine
* engine,const QString & settingsPath,QObject * parent)
Default constructor.
public
~Extensions
()
Default destructor
public inline QQmlPropertyMap *
globals
()
Globals getter
public inline QMap< std::string,
WorkspaceExtension
* >::iterator
begin
()
Begin iterator of extensions
public inline QMap< std::string,
WorkspaceExtension
* >::iterator
end
()
End iterator of extensions
public const QString &
path
() const
class lv::KeyMap
class lv::KeyMap
: public QObject
Abstraction of a map which pairs up commands with key shortcuts used to run them.
Summary
Members | Descriptions |
---|---|
public KeyMap (const QString & settingsPath,QObject * parent) |
Default constructor |
public ~KeyMap () |
Default destructor |
public QString locateCommand ( KeyCode key) |
Returns the command paired with the given key |
public QList< StoredCommand > locateCommands ( KeyCode key) |
|
public void store ( KeyCode key,const QString & command,QJSValue when,bool isDefault) |
Store function which pairs the given command with the given key, unless it's not overriding a default command. |
public void store (const QString & keydescription,const QString & command,QJSValue when,bool isDefault) |
Store function which pairs the key (given by a description) with a given command |
public void store (const QJSValue & keyObject,bool isDefault) |
Store command given by the QJSValue object |
public void store (quint32 os,quint32 key,quint32 localModifer,const QString & command,QJSValue when,bool isDefault) |
Store command under the key given by its components |
public inline QMap< KeyCode , QList< StoredCommand > > & commandMap () |
Exposes the command mp |
public QString getKeyCodeDescription ( KeyCode kc) |
Creates a description of a key code e.g. Ctrl+K |
{signal} public void keymapChanged () |
Signals a change in the keymap |
{slot} public QString locateCommand (quint32 key,quint32 modifiers) |
Locate command for a key given by its components |
{slot} public quint32 localModifier (quint32 modifier) |
Returns the modifier containing flags corresponding to the background OS and keys |
{slot} public Modifier
controlOrCommand () |
Returns Control or Command depending on the background OS |
{slot} public void readFile () |
Adds contents of a file to the keymap |
enum Modifier |
List of all possible modifiers |
enum Os |
List of operating systems |
typedef KeyCode |
unsigned long long |
Members
public
KeyMap
(const QString & settingsPath,QObject * parent)
Default constructor
public
~KeyMap
()
Default destructor
public QString
locateCommand
(
KeyCode
key)
Returns the command paired with the given key
public QList< StoredCommand >
locateCommands
(
KeyCode
key)
public void
store
(
KeyCode
key,const QString & command,QJSValue when,bool isDefault)
Store function which pairs the given command with the given key, unless it's not overriding a default command.
The main store function which eventually gets called by all the other variants.
public void
store
(const QString & keydescription,const QString & command,QJSValue when,bool isDefault)
Store function which pairs the key (given by a description) with a given command
public void
store
(const QJSValue & keyObject,bool isDefault)
Store command given by the QJSValue object
public void
store
(quint32 os,quint32 key,quint32 localModifer,const QString & command,QJSValue when,bool isDefault)
Store command under the key given by its components
public inline QMap<
KeyCode
, QList< StoredCommand > > &
commandMap
()
Exposes the command mp
public QString
getKeyCodeDescription
(
KeyCode
kc)
Creates a description of a key code e.g. Ctrl+K
{signal} public void
keymapChanged
()
Signals a change in the keymap
{slot} public QString
locateCommand
(quint32 key,quint32 modifiers)
Locate command for a key given by its components
{slot} public quint32
localModifier
(quint32 modifier)
Returns the modifier containing flags corresponding to the background OS and keys
{slot} public
Modifier
controlOrCommand
()
Returns Control or Command depending on the background OS
{slot} public void
readFile
()
Adds contents of a file to the keymap
enum
Modifier
Values | Descriptions |
---|---|
Control | |
Alt | |
Command | |
Shift | |
Meta |
List of all possible modifiers
enum
Os
Values | Descriptions |
---|---|
Windows | |
Linux | |
Mac |
List of operating systems
typedef
KeyCode
unsigned long long
class lv::WorkspaceExtension
class lv::WorkspaceExtension
: public QObject
The class within Qml to be used when we want to add an extension.
Summary
Members | Descriptions |
---|---|
public explicit WorkspaceExtension (QObject * parent) |
Default contructor |
public inline QObject * globals () const |
Returns globals |
public inline QJSValue interceptLanguage () const |
Returns language interceptor |
public inline QJSValue commands () const |
Returns commands |
public inline QJSValue configuration () const |
Returns configuration |
public inline QJSValue keyBindings () const |
Returns key bindings |
public inline QJSValue menuInterceptors () const |
Returns the menu interceptor |
public inline QJSValue interceptFile () const |
Returns the file interceptor |
public inline QJSValue panes () const |
Returns the panes |
public inline QJSValue themes () const |
Returns the themes |
public inline void setGlobals (QObject * globals) |
Globals setter |
public inline void setInterceptLanguage (QJSValue interceptLanguage) |
Language interceptor setter |
public inline void setCommands (QJSValue commands) |
Commands setter |
public inline void setConfiguration (QJSValue configuration) |
Configuration setter |
public inline void setKeyBindings (QJSValue keybindings) |
Key bindings setter |
public inline void setMenuInterceptors (QJSValue menuInterceptors) |
Set given intercept menu |
public inline void setInterceptFile (QJSValue interceptFile) |
Sets the intercept file callback handler |
public inline void setPanes (QJSValue panes) |
Sets the panes |
public inline void setThemes (QJSValue themes) |
Sets the themes |
public inline void setIdentifiers (const std::string & name,const std::string & path) |
Identifiers setters (name and path that identify the extension) |
public inline const std::string & name () const |
Name getter |
public inline const std::string & path () const |
Path getter |
public bool hasFileInterceptor () const |
Returns true if a file interceptor has been set |
public QJSValue callFileInterceptor (const QJSValueList & values) |
Calls the file interceptor with the given values as args |
public bool hasLanguageInterceptor () const |
Shows if we have a language interceptor |
public QObject * callLanguageInterceptor (const QJSValueList & values) |
Calls the language interceptor on the set of given values |
public bool hasMenuInterceptors () const |
Shows if we have a menu interceptor |
public QJSValue callMenuInterceptors (const QJSValueList & values) |
Calls the menu interceptor on the given set of values |
{signal} public void globalsChanged () |
Signals that globals changed |
{signal} public void interceptLanguageChanged () |
Signals that language interceptor changed |
{signal} public void commandsChanged () |
Signals that comannds changed |
{signal} public void configurationChanged () |
Signals that config changed |
{signal} public void keyBindingsChanged () |
Signals that key bindings changed |
{signal} public void menuInterceptorsChanged () |
Signals that menu interceptor changed |
{signal} public void interceptFileChanged () |
Signals that the file interceptor changed |
{signal} public void panesChanged () |
Signals that the panes property has changed |
{signal} public void themesChanged () |
Signals that the themes property has changed |
Members
public explicit
WorkspaceExtension
(QObject * parent)
Default contructor
public inline QObject *
globals
() const
Returns globals
public inline QJSValue
interceptLanguage
() const
Returns language interceptor
public inline QJSValue
commands
() const
Returns commands
public inline QJSValue
configuration
() const
Returns configuration
public inline QJSValue
keyBindings
() const
Returns key bindings
public inline QJSValue
menuInterceptors
() const
Returns the menu interceptor
public inline QJSValue
interceptFile
() const
Returns the file interceptor
public inline QJSValue
panes
() const
Returns the panes
public inline QJSValue
themes
() const
Returns the themes
public inline void
setGlobals
(QObject * globals)
Globals setter
public inline void
setInterceptLanguage
(QJSValue interceptLanguage)
Language interceptor setter
public inline void
setCommands
(QJSValue commands)
Commands setter
public inline void
setConfiguration
(QJSValue configuration)
Configuration setter
public inline void
setKeyBindings
(QJSValue keybindings)
Key bindings setter
public inline void
setMenuInterceptors
(QJSValue menuInterceptors)
Set given intercept menu
public inline void
setInterceptFile
(QJSValue interceptFile)
Sets the intercept file callback handler
public inline void
setPanes
(QJSValue panes)
Sets the panes
public inline void
setThemes
(QJSValue themes)
Sets the themes
public inline void
setIdentifiers
(const std::string & name,const std::string & path)
Identifiers setters (name and path that identify the extension)
public inline const std::string &
name
() const
Name getter
public inline const std::string &
path
() const
Path getter
public bool
hasFileInterceptor
() const
Returns true if a file interceptor has been set
public QJSValue
callFileInterceptor
(const QJSValueList & values)
Calls the file interceptor with the given values as args
public bool
hasLanguageInterceptor
() const
Shows if we have a language interceptor
public QObject *
callLanguageInterceptor
(const QJSValueList & values)
Calls the language interceptor on the set of given values
public bool
hasMenuInterceptors
() const
Shows if we have a menu interceptor
public QJSValue
callMenuInterceptors
(const QJSValueList & values)
Calls the menu interceptor on the given set of values
{signal} public void
globalsChanged
()
Signals that globals changed
{signal} public void
interceptLanguageChanged
()
Signals that language interceptor changed
{signal} public void
commandsChanged
()
Signals that comannds changed
{signal} public void
configurationChanged
()
Signals that config changed
{signal} public void
keyBindingsChanged
()
Signals that key bindings changed
{signal} public void
menuInterceptorsChanged
()
Signals that menu interceptor changed
{signal} public void
interceptFileChanged
()
Signals that the file interceptor changed
{signal} public void
panesChanged
()
Signals that the panes property has changed
{signal} public void
themesChanged
()
Signals that the themes property has changed
class lv::ErrorHandler
class lv::ErrorHandler
: public QObject
: public QQmlParserStatus
Object used inside QML that stops an error from passing it.
Summary
Members | Descriptions |
---|---|
public explicit ErrorHandler (QObject * parent) |
Default constructor |
public ~ErrorHandler () |
Default destructor |
public void componentComplete () |
Implementation of a QQmlParserStatus method |
public inline void classBegin () |
Blank implementation of a QQmlParserStatus method |
public void signalError (const QJSValue & error) |
Used by the QML view engine to signal error |
public void signalWarning (const QJSValue & error) |
Used by the QML view engine to signal warning |
public void setTarget (QObject * target) |
Sets the target object within the QML hierarchy that it attaches itself to |
public inline QObject * target () const |
Target getter |
{signal} public void error (QJSValue e) |
Signals an error |
{signal} public void fatal (QJSValue e) |
Signals a fatal error |
{signal} public void warning (QJSValue e) |
Signals a warning |
{signal} public void targetChanged (QObject * target) |
Signals a target change |
{slot} public void skip (const QJSValue & error) |
Skips the error handler and propagates the error further |
Members
public explicit
ErrorHandler
(QObject * parent)
Default constructor
public
~ErrorHandler
()
Default destructor
public void
componentComplete
()
Implementation of a QQmlParserStatus method
public inline void
classBegin
()
Blank implementation of a QQmlParserStatus method
public void
signalError
(const QJSValue & error)
Used by the QML view engine to signal error
public void
signalWarning
(const QJSValue & error)
Used by the QML view engine to signal warning
public void
setTarget
(QObject * target)
Sets the target object within the QML hierarchy that it attaches itself to
public inline QObject *
target
() const
Target getter
{signal} public void
error
(QJSValue e)
Signals an error
{signal} public void
fatal
(QJSValue e)
Signals a fatal error
{signal} public void
warning
(QJSValue e)
Signals a warning
{signal} public void
targetChanged
(QObject * target)
Signals a target change
{slot} public void
skip
(const QJSValue & error)
Skips the error handler and propagates the error further
class lv::IncubationController
class lv::IncubationController
: public QObject
: public QQmlIncubationController
Extends the QmlIncubationController.
Summary
Members | Descriptions |
---|---|
public IncubationController (QObject * parent) |
Default constructor |
public ~IncubationController () |
Default destructor |
protected inline virtual void timerEvent (QTimerEvent *) |
Implementation of QObject function |
Members
public
IncubationController
(QObject * parent)
Default constructor
public
~IncubationController
()
Default destructor
protected inline virtual void
timerEvent
(QTimerEvent *)
Implementation of QObject function
class lv::QmlObjectList
class lv::QmlObjectList
: public lv::Shared
Contains a list of objects with a user buffer.
This class is a wrapper for a variety of object containers to which we pass the usual methods to manipulate the data inside. It's to be used universally throughout LiveKeys as a container since it offers greater flexibility than usual Qml arrays. They can also be modifiable or read-only, depending on whether we provide modifier methods.
Summary
Members | Descriptions |
---|---|
public explicit QmlObjectList (QObject * parent) |
Default contructor. |
public QmlObjectList (void * data,const std::type_info * typeInfo,std::function< int( QmlObjectList *)> itemCount,std::function< QObject *( QmlObjectList *, int)> itemAt,std::function< void( QmlObjectList *, QObject *)> appendItem,std::function< void( QmlObjectList *, int)> removeItemAt,std::function< void( QmlObjectList *)> clearItems,QObject * parent) |
Constructor for a modifiable list. |
public QmlObjectList (void * data,const std::type_info * typeInfo,std::function< int( QmlObjectList *)> itemCount,std::function< QObject *( QmlObjectList *, int)> itemAt,QObject * parent) |
Constructor for a read-only list. |
public ~QmlObjectList () |
Default destructor. |
public QQmlListProperty< QObject > items () |
Returns the items this list contains. |
public inline bool isConst () const |
Checks if the list is non-modifiable. |
public inline void * data () |
Returns the pointer to the data structure. |
public template<> bool canCast () const |
Shows if the underlying type is matching the one we're passing. |
public template<> T * dataAs () |
Returns the data pointer cast to the type we provide. |
public template<> void populateObjectList (void * data,std::function< int( QmlObjectList *)> itemCount,std::function< QObject *( QmlObjectList *, int)> itemAt,std::function< void( QmlObjectList *, QObject *)> appendItem,std::function< void( QmlObjectList *, int)> removeItemAt,std::function< void( QmlObjectList *)> clearItems) |
Sets the parameters for an existing object list. |
public void setClone (std::function< QmlObjectList](#classlv_1_1QmlObjectList) *(const [QmlObjectList *)> clone) |
Sets a clone function for the list. |
public void setAssignAt (std::function< void( QmlObjectList *, int, QObject *)> assignAt) |
|
{slot} public QObject * itemAt (int index) |
Returns the item at the given index. |
{slot} public int itemCount () |
Returns the item count. |
{slot} public void clearItems () |
Clear a modifiable list. |
{slot} public void appendItem (QObject * item) |
Append item to modifiable list. |
{slot} public void removeItemAt (int index) |
Remove an item from a modifiable list at the given index. |
{slot} public void assignAt (int index,QObject * item) |
|
{slot} public lv::QmlObjectListModel * model () |
Return a data model for this list. |
{slot} public lv::QmlObjectList * cloneConst () const |
Creates a const clone of our modifiable list. |
{slot} public lv::QmlObjectList * clone () const |
Clone a modifiable list. |
{slot} public QJSValue toArray () |
Converts the list to a js array. |
Members
public explicit
QmlObjectList
(QObject * parent)
Default contructor.
The default QmlObjectList is actually a wrapped list of QObjects.
public
QmlObjectList
(void * data,const std::type_info * typeInfo,std::function< int(
QmlObjectList
*)> itemCount,std::function< QObject *(
QmlObjectList
*, int)> itemAt,std::function< void(
QmlObjectList
*, QObject *)> appendItem,std::function< void(
QmlObjectList
*, int)> removeItemAt,std::function< void(
QmlObjectList
*)> clearItems,QObject * parent)
Constructor for a modifiable list.
public
QmlObjectList
(void * data,const std::type_info * typeInfo,std::function< int(
QmlObjectList
*)> itemCount,std::function< QObject *(
QmlObjectList
*, int)> itemAt,QObject * parent)
Constructor for a read-only list.
We don't pass the functions which would allow us to modify the list in any way
public
~QmlObjectList
()
Default destructor.
If a clear
method is provided, we clear the container items as well
public QQmlListProperty< QObject >
items
()
Returns the items this list contains.
public inline bool
isConst
() const
Checks if the list is non-modifiable.
public inline void *
data
()
Returns the pointer to the data structure.
public template<>
bool
canCast
() const
Shows if the underlying type is matching the one we're passing.
public template<>
T *
dataAs
()
Returns the data pointer cast to the type we provide.
Should be used simultaneously with a canCast
check to avoid errors
public template<>
void
populateObjectList
(void * data,std::function< int(
QmlObjectList
*)> itemCount,std::function< QObject *(
QmlObjectList
*, int)> itemAt,std::function< void(
QmlObjectList
*, QObject *)> appendItem,std::function< void(
QmlObjectList
*, int)> removeItemAt,std::function< void(
QmlObjectList
*)> clearItems)
Sets the parameters for an existing object list.
We pass the data and the associated data modification functions
public void
setClone
(std::function<
QmlObjectList](#classlv_1_1QmlObjectList) *(const [QmlObjectList
*)> clone)
Sets a clone
function for the list.
public void
setAssignAt
(std::function< void(
QmlObjectList
*, int, QObject *)> assignAt)
{slot} public QObject *
itemAt
(int index)
Returns the item at the given index.
{slot} public int
itemCount
()
Returns the item count.
{slot} public void
clearItems
()
Clear a modifiable list.
If a list is read-only, this will throw an exception
{slot} public void
appendItem
(QObject * item)
Append item to modifiable list.
If a list is read-only, this will throw an exception
{slot} public void
removeItemAt
(int index)
Remove an item from a modifiable list at the given index.
If a list is read-only, this will throw an exception
{slot} public void
assignAt
(int index,QObject * item)
{slot} public lv::QmlObjectListModel *
model
()
Return a data model for this list.
{slot} public
lv::QmlObjectList
*
cloneConst
() const
Creates a const clone of our modifiable list.
If there's no clone
function, this will throw an exception
{slot} public
lv::QmlObjectList
*
clone
() const
Clone a modifiable list.
If there's no clone
function, this will throw an exception
{slot} public QJSValue
toArray
()
Converts the list to a js array.
class lv::QmlVariantList
class lv::QmlVariantList
: public lv::Shared
Contains a custom list of values with a user buffer.
This class is a wrapper for a variety of value containers to which we pass the usual methods to manipulate the data inside. It's to be used universally throughout LiveKeys as a container since it offers greater flexibility than usual Qml arrays. They can also be modifiable or read-only, depending on whether we provide modifier methods.
Summary
Members | Descriptions |
---|---|
public explicit QmlVariantList (QObject * parent) |
Default contructor. |
public QmlVariantList (void * data,const std::type_info * typeInfo,std::function< QVariantList( QmlVariantList *)> itemList,std::function< int( QmlVariantList *)> itemCount,std::function< QVariant( QmlVariantList *, int)> itemAt,std::function< void( QmlVariantList *, QVariant)> appendItem,std::function< void( QmlVariantList *, int)> removeItemAt,std::function< void( QmlVariantList *)> clearItems,QObject * parent) |
Constructor where we provide every wrapper method for the given data container. |
public QmlVariantList (void * data,const std::type_info * typeInfo,std::function< QVariantList( QmlVariantList *)> itemList,std::function< int( QmlVariantList *)> itemCount,std::function< QVariant( QmlVariantList *, int)> itemAt,QObject * parent) |
Constructor for a read-only container. |
public ~QmlVariantList () |
Default destructor. |
public inline void * data () |
Returns the pointer to the data structure. |
public template<> bool canCast () const |
Shows if the underlying type is matching the one we're passing. |
public template<> T * dataAs () |
Returns the data pointer cast to the type we provide. |
public void setItems (const QVariantList & items) |
Sets items for a modifiable list. |
public void setClone (std::function< QmlVariantList](#classlv_1_1QmlVariantList) *(const [QmlVariantList *)> clone) |
Sets a clone function for the list. |
public void setQuickAssign (std::function< void( QmlVariantList *, QVariantList)> qa) |
Sets a quick assign function for the list. |
{slot} public QVariantList items () |
Returns the items this list contains. |
{slot} public QVariant itemAt (int index) |
Returns the item at the given index. |
{slot} public int itemCount () |
Returns the item count. |
{slot} public inline bool isConst () const |
Checks if the list is non-modifiable. |
{slot} public QmlVariantList * cloneConst () const |
Creates a const clone of our modifiable list. |
{slot} public QmlVariantList * clone () const |
Clone a modifiable list. |
{slot} public void clearItems () |
Clear a modifiable list. |
{slot} public void appendItem (QVariant item) |
Append item to modifiable list. |
{slot} public void removeItemAt (int index) |
Remove an item from a modifiable list at the given index. |
{slot} public QmlVariantListModel * model () |
Return a data model for this list. |
Members
public explicit
QmlVariantList
(QObject * parent)
Default contructor.
The default QmlVariantList is actually a wrapped QVariantList.
public
QmlVariantList
(void * data,const std::type_info * typeInfo,std::function< QVariantList(
QmlVariantList
*)> itemList,std::function< int(
QmlVariantList
*)> itemCount,std::function< QVariant(
QmlVariantList
*, int)> itemAt,std::function< void(
QmlVariantList
*, QVariant)> appendItem,std::function< void(
QmlVariantList
*, int)> removeItemAt,std::function< void(
QmlVariantList
*)> clearItems,QObject * parent)
Constructor where we provide every wrapper method for the given data container.
public
QmlVariantList
(void * data,const std::type_info * typeInfo,std::function< QVariantList(
QmlVariantList
*)> itemList,std::function< int(
QmlVariantList
*)> itemCount,std::function< QVariant(
QmlVariantList
*, int)> itemAt,QObject * parent)
Constructor for a read-only container.
For this type of container, we don't have to provide the modifier methods
public
~QmlVariantList
()
Default destructor.
If a clear
method is provided, we clear the container items as well
public inline void *
data
()
Returns the pointer to the data structure.
public template<>
bool
canCast
() const
Shows if the underlying type is matching the one we're passing.
public template<>
T *
dataAs
()
Returns the data pointer cast to the type we provide.
Should be used simultaneously with a canCast
check to avoid errors
public void
setItems
(const QVariantList & items)
Sets items for a modifiable list.
public void
setClone
(std::function<
QmlVariantList](#classlv_1_1QmlVariantList) *(const [QmlVariantList
*)> clone)
Sets a clone
function for the list.
public void
setQuickAssign
(std::function< void(
QmlVariantList
*, QVariantList)> qa)
Sets a quick assign function for the list.
{slot} public QVariantList
items
()
Returns the items this list contains.
{slot} public QVariant
itemAt
(int index)
Returns the item at the given index.
{slot} public int
itemCount
()
Returns the item count.
{slot} public inline bool
isConst
() const
Checks if the list is non-modifiable.
{slot} public
QmlVariantList
*
cloneConst
() const
Creates a const clone of our modifiable list.
If there's no clone
function, this will throw an exception
{slot} public
QmlVariantList
*
clone
() const
Clone a modifiable list.
If there's no clone
function, this will throw an exception
{slot} public void
clearItems
()
Clear a modifiable list.
If a list is read-only, this will throw an exception
{slot} public void
appendItem
(QVariant item)
Append item to modifiable list.
If a list is read-only, this will throw an exception
{slot} public void
removeItemAt
(int index)
Remove an item from a modifiable list at the given index.
If a list is read-only, this will throw an exception
{slot} public QmlVariantListModel *
model
()
Return a data model for this list.
class lv::Settings
class lv::Settings
: public QObject
General settings (on top of Editor settings) that uses a settings folder.
Summary
Members | Descriptions |
---|---|
public ~Settings () |
Default destructor |
public inline const QString & path () const |
Returns the path of the config folder |
{slot} public QObject * file (const QString & key) |
Returns the file under the given key |
{slot} public void addConfigFile (const QString & key,QObject * object) |
Adds a config file with a given key |
Members
public
~Settings
()
Default destructor
public inline const QString &
path
() const
Returns the path of the config folder
{slot} public QObject *
file
(const QString & key)
Returns the file under the given key
{slot} public void
addConfigFile
(const QString & key,QObject * object)
Adds a config file with a given key
class lv::FatalException
class lv::FatalException
: public lv::Exception
Subclass of the lv::Exception used for unrecoverable errors.
Summary
Members | Descriptions |
---|---|
public inline FatalException (const std::string & message, Exception::Code code) |
Default costructor |
public inline FatalException (const QString & message, Exception::Code code) |
QString overload of the default constructor |
public inline virtual ~FatalException () |
Default destructor |
Members
public inline
FatalException
(const std::string & message,
Exception::Code
code)
Default costructor
public inline
FatalException
(const QString & message,
Exception::Code
code)
QString overload of the default constructor
public inline virtual
~FatalException
()
Default destructor
class lv::InputException
class lv::InputException
: public lv::Exception
Subclass of the lv::Exception used for configuration errors.
Summary
Members | Descriptions |
---|---|
public inline InputException (const std::string & message, Exception::Code code) |
Defautlt constructor |
public inline InputException (const QString & message, Exception::Code code) |
QString overload of the default constructor |
public inline virtual ~InputException () |
Default destructor |
Members
public inline
InputException
(const std::string & message,
Exception::Code
code)
Defautlt constructor
public inline
InputException
(const QString & message,
Exception::Code
code)
QString overload of the default constructor
public inline virtual
~InputException
()
Default destructor
class lv::ViewEngine
class lv::ViewEngine
: public QObject
Main Qml engine.
Summary
Members | Descriptions |
---|---|
public explicit ViewEngine (QQmlEngine * engine,QObject * parent) |
Default constructor |
public ~ViewEngine () |
Default destructor |
public inline bool isLoading () const |
Shows if the engine is loading |
public inline void setIsLoading (bool isLoading) |
Sets the loading indicator of the object |
public void useEngine (std::function< void(QQmlEngine *)> call) |
Locks the engine for use until the passed function finishes |
public const QList< QQmlError > & lastErrors () const |
Displays the errors the engine had previously |
public inline QQmlEngine * engine () |
The contained QQmlEngine |
public inline QMutex * engineMutex () |
The engine mutex, which is used to lock the engine for use |
public inline Memory * memory () |
Retrieves the memory object |
public QJSValue evaluate (const QString & jsCode,const QString & fileName,int lineNumber) |
Evaluates the piece of code given the filename and line number |
public void throwError (const lv::QmlError & error) |
|
public void throwError (const Exception * e,QObject * object) |
Function analogue to throwing an exception in regular cpp code, but propagated through javascript. |
public bool hasErrorHandler (QObject * object) |
Shows if the given object has an associated error handler |
public void registerErrorHandler (QObject * object, ErrorHandler * handler) |
Registers a handler for the given object |
public void removeErrorHandler (QObject * object) |
Removes the handler for the given object |
public template<> MetaInfo::Ptr registerQmlTypeInfo (const std::function< void(const T &, MLNode &)> & serializeFunction,const std::function< void(const MLNode &, T &)> & deserializeFunction,const std::function< QObject *()> & constructorFunction,bool canLog) |
Allows the engine to register info about a type. |
public MetaInfo::Ptr typeInfo (const QMetaObject * type) const |
Returns the type info for a given meta-object |
public MetaInfo::Ptr typeInfo (const QByteArray & typeName) const |
Returns the type info for a given type name |
public MetaInfo::Ptr typeInfo (const QMetaType & metaType) const |
Returns the type info for a given meta-type by extracting the meta-object and calling the appropriate variant of the getter |
public ComponentDeclaration
rootDeclaration (QObject * object) const |
|
public QObject * createObject (const QByteArray & qmlCode,QObject * parent,const QUrl & file,bool clearCache) |
Creates an object from the given qmlcode synchronously. |
public QObject * createObject (const char * qmlCode,QObject * parent,const QUrl & file,bool clearCache) |
|
public QJSValue toJSErrors (const QList< QQmlError > & errors) const |
|
public QJSValue toJSError (const QQmlError & error) const |
|
public inline const PackageGraph * packageGraph () const |
Returns the package graph of the engine |
public void setPackageGraph ( PackageGraph * pg) |
|
public QmlError
findError (const QString & message) const |
|
public QmlError
findError (QJSValue error) const |
|
public ComponentResult::Ptr createPluginObject (const QString & filePath,QObject * parent) |
|
public ComponentResult::Ptr createObject (const QString & filePath,QObject * parent,QQmlContext * context) |
|
public ComponentResult::Ptr createObject (const QUrl & filePath,QObject * parent,QQmlContext * context) |
|
public ComponentResult::Ptr createObject (const QString & filePath,const QByteArray & source,QObject * parent,QQmlContext * context) |
|
public ComponentResult::Ptr compileJsModule (const QByteArray & imports,const QByteArray & source,const QString & moduleFile) |
|
{signal} public void aboutToCreateObject (const QUrl & file) |
Signals before compiling a new object. |
{signal} public void objectAcquired (const QUrl & file,QObject * reference) |
Signals after acquiring a new object, assuring no errors were found. |
{signal} public void isLoadingChanged (bool isLoading) |
Loading indicator has changed |
{signal} public void objectReady (QObject * object,const QUrl & file,QObject * reference,QQmlContext * context) |
Object was created |
{signal} public void objectCreationError (QJSValue errors,const QUrl & file,QObject * reference,QQmlContext * context) |
Error in object creation |
{signal} public void applicationError (QJSValue error) |
Emitted when the error is propagated all the way to the application |
{signal} public void applicationWarning (QJSValue warning) |
Emitted when the warning is propagated all the way to the application |
{slot} public void createObjectAsync (const QString & qmlCode,QObject * parent,const QUrl & file,QObject * reference,QQmlContext * context,bool clearCache) |
Main function of the engine, where we pass the code to be compiled asynchronously. |
{slot} public QObject * createObject (const QString & qmlCode,QObject * parent,const QUrl & file,bool clearCache) |
Creates an object from the given qmlcode synchronously. |
{slot} public QQmlComponent * createComponent (const QString & qmlCode,const QUrl & file) |
|
{slot} public void engineWarnings (const QList< QQmlError > & warnings) |
Throws errors on these warnings which don't have their own object |
{slot} public void throwError (const QJSValue & error,QObject * object) |
Variant of the same-named function that uses a QJSValue object along with the calling object. |
{slot} public QJSValue unwrapError (QJSValue error) const |
Members
public explicit
ViewEngine
(QQmlEngine * engine,QObject * parent)
Default constructor
public
~ViewEngine
()
Default destructor
public inline bool
isLoading
() const
Shows if the engine is loading
public inline void
setIsLoading
(bool isLoading)
Sets the loading indicator of the object
public void
useEngine
(std::function< void(QQmlEngine *)> call)
Locks the engine for use until the passed function finishes
public const QList< QQmlError > &
lastErrors
() const
Displays the errors the engine had previously
public inline QQmlEngine *
engine
()
The contained QQmlEngine
public inline QMutex *
engineMutex
()
The engine mutex, which is used to lock the engine for use
public inline Memory *
memory
()
Retrieves the memory object
public QJSValue
evaluate
(const QString & jsCode,const QString & fileName,int lineNumber)
Evaluates the piece of code given the filename and line number
public void
throwError
(const
lv::QmlError
& error)
public void
throwError
(const
Exception
* e,QObject * object)
Function analogue to throwing an exception in regular cpp code, but propagated through javascript.
We use a simple macro, CREATE_EXCEPTION
, to create exceptions in LiveKeys, which will include the metadata of the code where it was thrown. Usage example of this function can be found in qcalibratedebevec.cpp.
lv::Exception lve = CREATE_EXCEPTION(lv::Exception, e.what(), e.code);
lv::ViewContext::instance().engine()->throwError(&lve, this);
Calling the throwError manages to capture all the relevant data such as line number, type of error, and even the object from which it was thrown, and also the stacktrace containing even the relevant Javascript info. The error is propagated until we reach a relevant error handler ( See also: lv::ErrorHandler).
public bool
hasErrorHandler
(QObject * object)
Shows if the given object has an associated error handler
public void
registerErrorHandler
(QObject * object,
ErrorHandler
* handler)
Registers a handler for the given object
public void
removeErrorHandler
(QObject * object)
Removes the handler for the given object
public template<>
MetaInfo::Ptr
registerQmlTypeInfo
(const std::function< void(const T &,
MLNode
&)> & serializeFunction,const std::function< void(const
MLNode
&, T &)> & deserializeFunction,const std::function< QObject *()> & constructorFunction,bool canLog)
Allows the engine to register info about a type.
Store a constructor, serialization functions and a logging flag for this type.
public MetaInfo::Ptr
typeInfo
(const QMetaObject * type) const
Returns the type info for a given meta-object
public MetaInfo::Ptr
typeInfo
(const QByteArray & typeName) const
Returns the type info for a given type name
public MetaInfo::Ptr
typeInfo
(const QMetaType & metaType) const
Returns the type info for a given meta-type by extracting the meta-object and calling the appropriate variant of the getter
public
ComponentDeclaration
rootDeclaration
(QObject * object) const
public QObject *
createObject
(const QByteArray & qmlCode,QObject * parent,const QUrl & file,bool clearCache)
Creates an object from the given qmlcode synchronously.
public QObject *
createObject
(const char * qmlCode,QObject * parent,const QUrl & file,bool clearCache)
public QJSValue
toJSErrors
(const QList< QQmlError > & errors) const
public QJSValue
toJSError
(const QQmlError & error) const
public inline const
PackageGraph
*
packageGraph
() const
Returns the package graph of the engine
public void
setPackageGraph
(
PackageGraph
* pg)
public
QmlError
findError
(const QString & message) const
public
QmlError
findError
(QJSValue error) const
public ComponentResult::Ptr
createPluginObject
(const QString & filePath,QObject * parent)
public ComponentResult::Ptr
createObject
(const QString & filePath,QObject * parent,QQmlContext * context)
public ComponentResult::Ptr
createObject
(const QUrl & filePath,QObject * parent,QQmlContext * context)
public ComponentResult::Ptr
createObject
(const QString & filePath,const QByteArray & source,QObject * parent,QQmlContext * context)
public ComponentResult::Ptr
compileJsModule
(const QByteArray & imports,const QByteArray & source,const QString & moduleFile)
{signal} public void
aboutToCreateObject
(const QUrl & file)
Signals before compiling a new object.
{signal} public void
objectAcquired
(const QUrl & file,QObject * reference)
Signals after acquiring a new object, assuring no errors were found.
{signal} public void
isLoadingChanged
(bool isLoading)
Loading indicator has changed
{signal} public void
objectReady
(QObject * object,const QUrl & file,QObject * reference,QQmlContext * context)
Object was created
{signal} public void
objectCreationError
(QJSValue errors,const QUrl & file,QObject * reference,QQmlContext * context)
Error in object creation
{signal} public void
applicationError
(QJSValue error)
Emitted when the error is propagated all the way to the application
{signal} public void
applicationWarning
(QJSValue warning)
Emitted when the warning is propagated all the way to the application
{slot} public void
createObjectAsync
(const QString & qmlCode,QObject * parent,const QUrl & file,QObject * reference,QQmlContext * context,bool clearCache)
Main function of the engine, where we pass the code to be compiled asynchronously.
Of extreme importance to the live coding part of LiveKeys, since we use it to compile our custom code. clearCache is used to indicate that we've changed one of the non-active files which are cached, so the cache has to be cleared since it's invalid after a change.
{slot} public QObject *
createObject
(const QString & qmlCode,QObject * parent,const QUrl & file,bool clearCache)
Creates an object from the given qmlcode synchronously.
{slot} public QQmlComponent *
createComponent
(const QString & qmlCode,const QUrl & file)
{slot} public void
engineWarnings
(const QList< QQmlError > & warnings)
Throws errors on these warnings which don't have their own object
{slot} public void
throwError
(const QJSValue & error,QObject * object)
Variant of the same-named function that uses a QJSValue object along with the calling object.
{slot} public QJSValue
unwrapError
(QJSValue error) const
class lv::VisualLogEntry
Struct-like class for storing relevant data about a log entry.
Summary
Members | Descriptions |
---|---|
public QString prefix |
|
public QString tag |
|
public quint8 level |
|
public QString location |
|
public QString data |
|
public QVariant * objectData |
|
public mutable QQmlComponent * component |
|
public mutable QQmlContext * context |
|
public VisualLogEntry (const QString & tag,quint8 level,const QString & prefix,const QString & location,const QString & data) |
Constructor for string-type log entries |
public VisualLogEntry (const QString & tag,quint8 level,const QString & prefix,const QString & location,QVariant * objectData,QQmlComponent * component) |
Constructor for objects and/or image log entries |
Members
public QString
prefix
public QString
tag
public quint8
level
public QString
location
public QString
data
public QVariant *
objectData
public mutable QQmlComponent *
component
public mutable QQmlContext *
context
public
VisualLogEntry
(const QString & tag,quint8 level,const QString & prefix,const QString & location,const QString & data)
Constructor for string-type log entries
public
VisualLogEntry
(const QString & tag,quint8 level,const QString & prefix,const QString & location,QVariant * objectData,QQmlComponent * component)
Constructor for objects and/or image log entries
class lv::VisualLogBaseModel
class lv::VisualLogBaseModel
: public QAbstractListModel
Abstract model of a set of visual log entries, to be extended for concrete usage by the VisualLogModel and VisualLogFilter.
Summary
Members | Descriptions |
---|---|
public explicit VisualLogBaseModel (QObject * parent) |
Default constructor |
public virtual ~VisualLogBaseModel () |
Default destructor |
public QVariant data (const QModelIndex & index,int role) const |
Returns the data at the given index with a given role |
public int rowCount (const QModelIndex & parent) const |
Returns the row count of the model |
public virtual QHash< int, QByteArray > roleNames () const |
Returns the role names |
public int totalEntries () const |
Total number of entries. |
public QVariant entryDataAt (int index) const |
All data from the entry at the index |
public QString entryPrefixAt (int index) const |
Prefix from the entry at the given index |
public const VisualLogEntry & entryAt (int index) const |
Log entry at the given index |
enum Roles |
Role names |
Members
public explicit
VisualLogBaseModel
(QObject * parent)
Default constructor
public virtual
~VisualLogBaseModel
()
Default destructor
public QVariant
data
(const QModelIndex & index,int role) const
Returns the data at the given index with a given role
public int
rowCount
(const QModelIndex & parent) const
Returns the row count of the model
public virtual QHash< int, QByteArray >
roleNames
() const
Returns the role names
public int
totalEntries
() const
Total number of entries. See also: VisualLogBaseModel::rowCount
public QVariant
entryDataAt
(int index) const
All data from the entry at the index
public QString
entryPrefixAt
(int index) const
Prefix from the entry at the given index
public const VisualLogEntry &
entryAt
(int index) const
Log entry at the given index
enum
Roles
Values | Descriptions |
---|---|
Msg | |
Location | |
Prefix |
Role names
class lv::VisualLogFilter
class lv::VisualLogFilter
: public lv::VisualLogBaseModel
: public QQmlParserStatus
An implementation of the VisualLogBaseModel to represent a filtered set of log entries.
The filter can be applied via tag, prefix or a regular search string
Summary
Members | Descriptions |
---|---|
public explicit VisualLogFilter (QObject * parent) |
Default constructor |
public ~VisualLogFilter () |
Blank destructor |
public inline lv::VisualLogBaseModel * source () const |
Base model which is the model we're applying the filter too. |
public inline QString tag () const |
The tag we're filtering by |
public QJSValue search () const |
Returns the search string/regexp |
public inline bool isIndexing () const |
Indicator if the object is currently performing indexing in the background, asynchronously |
public void setSource ( lv::VisualLogBaseModel * source) |
Sets the model data source |
public inline void setTag (QString tag) |
Tag setter |
public void setSearch (QJSValue search) |
Sets the actual search string |
public inline void classBegin () |
Implementation of the respective QQmlParserStatus function |
public void componentComplete () |
Implementation of the respective QQmlParserStatus function |
public virtual QVariant data (const QModelIndex & index,int role) const |
Implementation of the respective lv::VisualLogBaseModel/QAbstractListModel function |
public virtual int rowCount (const QModelIndex & parent) const |
Implementation of the respective lv::VisualLogBaseModel/QAbstractListModel function |
public inline virtual int totalEntries () const |
Total number of entries |
public virtual QVariant entryDataAt (int index) const |
Implementation of the respective lv::VisualLogBaseModel function |
public virtual QString entryPrefixAt (int index) const |
Implementation of the respective lv::VisualLogBaseModel function |
public virtual const VisualLogEntry & entryAt (int index) const |
Implementation of the respective lv::VisualLogBaseModel function |
public void setPrefix (QJSValue prefix) |
Sets the prefix |
public void setIsIndexing (bool isIndexing) |
Sets the indexing indicator |
public QJSValue prefix () const |
The prefix we're filtering by |
{signal} public void sourceChanged () |
Source has changed |
{signal} public void tagChanged () |
Tag has changed |
{signal} public void prefixChanged () |
Prefix has changed |
{signal} public void searchChanged () |
Search string has changed |
{signal} public void isIndexingChanged () |
Indexing indicator has changed |
{slot} public void refilterReady () |
Slot that listens for the ending of indexing in the background. |
{slot} public void sourceDestroyed () |
Source is destroyed slot |
{slot} public void sourceModelReset () |
Reacts to changes in the source model |
{slot} public void sourceModelAboutToReset () |
Before a reset, we ignore the results of the worker because they're not valid anymore |
{slot} public void sourceRowsAboutToBeRemoved (const QModelIndex &,int from,int to) |
When source model is having rows removed, we ignore the worker results and rebuild |
{slot} public void sourceRowsInserted (const QModelIndex &,int from,int to) |
When source model is having rows added, we ignore the worker results and rebuild |
Members
public explicit
VisualLogFilter
(QObject * parent)
Default constructor
public
~VisualLogFilter
()
Blank destructor
public inline
lv::VisualLogBaseModel
*
source
() const
Base model which is the model we're applying the filter too.
Interestingly, it can be both the main model, or even another filter model! We could, in theory, have an array or filter models where each one is filtering on the previous one.
public inline QString
tag
() const
The tag we're filtering by
public QJSValue
search
() const
Returns the search string/regexp
public inline bool
isIndexing
() const
Indicator if the object is currently performing indexing in the background, asynchronously
public void
setSource
(
lv::VisualLogBaseModel
* source)
Sets the model data source
public inline void
setTag
(QString tag)
Tag setter
public void
setSearch
(QJSValue search)
Sets the actual search string
public inline void
classBegin
()
Implementation of the respective QQmlParserStatus function
public void
componentComplete
()
Implementation of the respective QQmlParserStatus function
public virtual QVariant
data
(const QModelIndex & index,int role) const
Implementation of the respective lv::VisualLogBaseModel/QAbstractListModel function
public virtual int
rowCount
(const QModelIndex & parent) const
Implementation of the respective lv::VisualLogBaseModel/QAbstractListModel function
public inline virtual int
totalEntries
() const
Total number of entries
public virtual QVariant
entryDataAt
(int index) const
Implementation of the respective lv::VisualLogBaseModel function
public virtual QString
entryPrefixAt
(int index) const
Implementation of the respective lv::VisualLogBaseModel function
public virtual const VisualLogEntry &
entryAt
(int index) const
Implementation of the respective lv::VisualLogBaseModel function
public void
setPrefix
(QJSValue prefix)
Sets the prefix
public void
setIsIndexing
(bool isIndexing)
Sets the indexing indicator
public QJSValue
prefix
() const
The prefix we're filtering by
{signal} public void
sourceChanged
()
Source has changed
{signal} public void
tagChanged
()
Tag has changed
{signal} public void
prefixChanged
()
Prefix has changed
{signal} public void
searchChanged
()
Search string has changed
{signal} public void
isIndexingChanged
()
Indexing indicator has changed
{slot} public void
refilterReady
()
Slot that listens for the ending of indexing in the background.
This slot gets called after the worker finishes, but also gets called only after control is returned to the event loop. Any changes in between will be lost, therefore we handle the changes separately, using the m_workerIgnoreResult variable.
{slot} public void
sourceDestroyed
()
Source is destroyed slot
{slot} public void
sourceModelReset
()
Reacts to changes in the source model
{slot} public void
sourceModelAboutToReset
()
Before a reset, we ignore the results of the worker because they're not valid anymore
{slot} public void
sourceRowsAboutToBeRemoved
(const QModelIndex &,int from,int to)
When source model is having rows removed, we ignore the worker results and rebuild
{slot} public void
sourceRowsInserted
(const QModelIndex &,int from,int to)
When source model is having rows added, we ignore the worker results and rebuild
class lv::VisualLogModel
class lv::VisualLogModel
: public lv::VisualLogBaseModel
: public lv::VisualLog::ViewTransport
Main model used in visualizing log entries within LiveKeys when the log window is opened.
Receives any type message, whether if it's a string (or a string-displayable object) or an image.
Summary
Members | Descriptions |
---|---|
public VisualLogModel (QQmlEngine * engine) |
Default constructor |
public ~VisualLogModel () |
Blank destructor |
public virtual QVariant data (const QModelIndex & index,int role) const |
Implementation of the respective QAbstractListModel function |
public inline virtual int rowCount (const QModelIndex & parent) const |
Implementation of the respective QAbstractListModel function |
public virtual void onMessage (const VisualLog::Configuration * configuration,const VisualLog::MessageInfo & messageInfo,const std::string & message) |
Implementation of the respective function from VisualLog::ViewTransport. |
public virtual void onView (const VisualLog::Configuration * configuration,const VisualLog::MessageInfo & messageInfo,const std::string & viewName,const QVariant & value) |
Implementation of the respective function from VisualLog::ViewTransport. |
public inline int width () const |
Returns the width |
public inline virtual int totalEntries () const |
Implementation of the respective VisualLogBaseModel function |
public virtual QVariant entryDataAt (int index) const |
Implementation of the respective VisualLogBaseModel function |
public virtual QString entryPrefixAt (int index) const |
Implementation of the respective VisualLogBaseModel function |
public virtual const VisualLogEntry & entryAt (int index) const |
Implementation of the respective VisualLogBaseModel function |
public inline QList< VisualLogEntry >::Iterator begin () |
Begin-iterator of the log entries |
public inline QList< VisualLogEntry >::Iterator end () |
End-iterator of the log entries |
public inline QList< VisualLogEntry >::ConstIterator begin () const |
Const begin-iterator of the log entries |
public inline QList< VisualLogEntry >::ConstIterator end () const |
Const end-iterator of the log entries |
public QJSValue style () const |
Returns the style of this log model |
{signal} public void widthChanged (int width) |
Width has changed |
{signal} public void entryAdded () |
Entry was added |
{signal} public void styleChanged () |
Style changed |
{slot} public QString messageAt (int index) const |
|
{slot} public QString locationAt (int index) const |
|
{slot} public inline void setWidth (int width) |
Sets the width |
{slot} public void clearValues () |
Erases all log entries from the model |
{slot} public void setStyle (QJSValue style) |
Sets the style of this log model |
Members
public
VisualLogModel
(QQmlEngine * engine)
Default constructor
public
~VisualLogModel
()
Blank destructor
public virtual QVariant
data
(const QModelIndex & index,int role) const
Implementation of the respective QAbstractListModel function
public inline virtual int
rowCount
(const QModelIndex & parent) const
Implementation of the respective QAbstractListModel function
public virtual void
onMessage
(const VisualLog::Configuration * configuration,const
VisualLog::MessageInfo
& messageInfo,const std::string & message)
Implementation of the respective function from VisualLog::ViewTransport.
Appends the given string message to the list of log entries.
public virtual void
onView
(const VisualLog::Configuration * configuration,const
VisualLog::MessageInfo
& messageInfo,const std::string & viewName,const QVariant & value)
Implementation of the respective function from VisualLog::ViewTransport.
Appends the log view given via name to the entries
public inline int
width
() const
Returns the width
public inline virtual int
totalEntries
() const
Implementation of the respective VisualLogBaseModel function
public virtual QVariant
entryDataAt
(int index) const
Implementation of the respective VisualLogBaseModel function
public virtual QString
entryPrefixAt
(int index) const
Implementation of the respective VisualLogBaseModel function
public virtual const VisualLogEntry &
entryAt
(int index) const
Implementation of the respective VisualLogBaseModel function
public inline QList< VisualLogEntry >::Iterator
begin
()
Begin-iterator of the log entries
public inline QList< VisualLogEntry >::Iterator
end
()
End-iterator of the log entries
public inline QList< VisualLogEntry >::ConstIterator
begin
() const
Const begin-iterator of the log entries
public inline QList< VisualLogEntry >::ConstIterator
end
() const
Const end-iterator of the log entries
public QJSValue
style
() const
Returns the style of this log model
{signal} public void
widthChanged
(int width)
Width has changed
{signal} public void
entryAdded
()
Entry was added
{signal} public void
styleChanged
()
Style changed
{slot} public QString
messageAt
(int index) const
{slot} public QString
locationAt
(int index) const
{slot} public inline void
setWidth
(int width)
Sets the width
{slot} public void
clearValues
()
Erases all log entries from the model
{slot} public void
setStyle
(QJSValue style)
Sets the style of this log model
class lv::VisualLogNetworkSender
class lv::VisualLogNetworkSender
: public QObject
: public lv::VisualLog::Transport
Implementation of VisualLog::Transport used for sending log messages over a network.
Summary
Members | Descriptions |
---|---|
public explicit VisualLogNetworkSender (const QString & ip,int port,QObject * parent) |
Default constructor, initialized with an IP address and an appropriate port |
public ~VisualLogNetworkSender () |
Default destructor |
public void sendMessage (const QString & message) |
QString variant of the sendMessage function |
public void sendMessage (const QByteArray & message) |
Main, byte-array based function for sending messages over the network |
public void sendMessage (const std::string & message) |
Standard string variant of the sendMessage function |
public void connectToHost (int maxRetries) |
Function that tries to connect to host a limited ammount of times |
public virtual void onMessage (const VisualLog::Configuration * configuration,const VisualLog::MessageInfo & messageInfo,const std::string & message) |
Sends a string-based log message over the network |
public virtual void onObject (const VisualLog::Configuration * configuration,const VisualLog::MessageInfo & messageInfo,const std::string & type,const MLNode & node) |
Sends an object-based log entry over the network by converting it into JSON |
{slot} public void socketConnected () |
When socket is connected, we send all the queued messages through |
{slot} public void socketDisconnected () |
When socket is disconnected. we notify the user of a failed connecting attempt, or finally notify that we gave up |
{slot} public void socketError (QAbstractSocket::SocketError) |
In case of socket error, we notify the user and try again if we have any attempts left |
{slot} public void reconnect () |
Function that attempts to connect to host if we haven't exceeded the maximum number of attempts |
Members
public explicit
VisualLogNetworkSender
(const QString & ip,int port,QObject * parent)
Default constructor, initialized with an IP address and an appropriate port
public
~VisualLogNetworkSender
()
Default destructor
public void
sendMessage
(const QString & message)
QString variant of the sendMessage function
public void
sendMessage
(const QByteArray & message)
Main, byte-array based function for sending messages over the network
public void
sendMessage
(const std::string & message)
Standard string variant of the sendMessage function
public void
connectToHost
(int maxRetries)
Function that tries to connect to host a limited ammount of times
public virtual void
onMessage
(const VisualLog::Configuration * configuration,const
VisualLog::MessageInfo
& messageInfo,const std::string & message)
Sends a string-based log message over the network
public virtual void
onObject
(const VisualLog::Configuration * configuration,const
VisualLog::MessageInfo
& messageInfo,const std::string & type,const
MLNode
& node)
Sends an object-based log entry over the network by converting it into JSON
{slot} public void
socketConnected
()
When socket is connected, we send all the queued messages through
{slot} public void
socketDisconnected
()
When socket is disconnected. we notify the user of a failed connecting attempt, or finally notify that we gave up
{slot} public void
socketError
(QAbstractSocket::SocketError)
In case of socket error, we notify the user and try again if we have any attempts left
{slot} public void
reconnect
()
Function that attempts to connect to host if we haven't exceeded the maximum number of attempts
class lv::VisualLogQmlObject
class lv::VisualLogQmlObject
: public QObject
Contains methods to present a Qml output for the visual log.
Summary
Members | Descriptions |
---|---|
public VisualLogQmlObject (QObject * parent) |
Default constructor |
public ~VisualLogQmlObject () |
Default destructor |
{slot} public void f (const QJSValue & messageOrCategory,const QJSValue & message) |
Fatal messages |
{slot} public void e (const QJSValue & messageOrCategory,const QJSValue & message) |
Error messages |
{slot} public void w (const QJSValue & messageOrCategory,const QJSValue & message) |
Warning messages |
{slot} public void i (const QJSValue & messageOrCategory,const QJSValue & message) |
Info messages |
{slot} public void d (const QJSValue & messageOrCategory,const QJSValue & message) |
Debug messages |
{slot} public void v (const QJSValue & messageOrCategory,const QJSValue & message) |
Verbose messages |
{slot} public void configure (const QString & name,const QJSValue & options) |
Configures global vlog object from a given QJSValue object |
Members
public
VisualLogQmlObject
(QObject * parent)
Default constructor
public
~VisualLogQmlObject
()
Default destructor
{slot} public void
f
(const QJSValue & messageOrCategory,const QJSValue & message)
Fatal messages
{slot} public void
e
(const QJSValue & messageOrCategory,const QJSValue & message)
Error messages
{slot} public void
w
(const QJSValue & messageOrCategory,const QJSValue & message)
Warning messages
{slot} public void
i
(const QJSValue & messageOrCategory,const QJSValue & message)
Info messages
{slot} public void
d
(const QJSValue & messageOrCategory,const QJSValue & message)
Debug messages
{slot} public void
v
(const QJSValue & messageOrCategory,const QJSValue & message)
Verbose messages
{slot} public void
configure
(const QString & name,const QJSValue & options)
Configures global vlog object from a given QJSValue object