Utils Namespace

The Utils namespace contains a collection of utility classes and functions for use by all plugins. More...

Header: #include <Utils>

Namespaces

namespace FileUtils
namespace Internal
namespace MathUtils
namespace SettingsDatabase

Classes

class Result
class TreeModel
class TypedAspect

Types

enum FindFlag { FindBackward, FindCaseSensitively, FindWholeWords, FindRegularExpression, FindPreserveCase, DontFindBinaryFiles }
enum class ProgressIndicatorSize { Small, Medium, Large }
enum ResultSpecialErrorCode { ResultAssert, ResultUnimplemented }

Variables

Utils::Q_DECL_IMPORT QString

Functions

class Utils::Q_DECL_IMPORT addToolTipsToMenu(QMenu *menu)
Utils::Q_DECL_IMPORT triggerShutdownGuard()

Detailed Description

Namespaces

namespace Utils::FileUtils

namespace Utils::Internal

namespace Utils::MathUtils

namespace Utils::SettingsDatabase

The settings database is SQLite based, and lazily retrieves data when it is asked for. It also does incremental updates of the database rather than rewriting the whole file each time one of the settings change.

The SettingsDatabase API mimics that of QSettings.

See also settings().

Classes

class Result

Result<T> is used for returning either a success value or an error string from a function. More...

class TreeModel

The TreeModel class is a convienience base class for models to use in a QTreeView. More...

class TypedAspect

The TypedAspect class is a helper class for implementing a simple aspect. More...

Type Documentation

enum Utils::FindFlag

This enum holds the find flags.

ConstantValueDescription
Utils::FindBackward0x01Searches backwards.
Utils::FindCaseSensitively0x02Considers case when searching.
Utils::FindWholeWords0x04Finds only whole words.
Utils::FindRegularExpression0x08Uses a regular epression as a search term.
Utils::FindPreserveCase0x10Preserves the case when replacing search terms.
Utils::DontFindBinaryFiles0x20Does not include binary files in search results.

enum class Utils::ProgressIndicatorSize

Size of a progress indicator.

ConstantValueDescription
Utils::ProgressIndicatorSize::Small0Small icon size. Useful for tool bars, status bars, rows in tree views, and so on.
Utils::ProgressIndicatorSize::Medium1Larger progress indicator useful for covering whole medium sized widgets.
Utils::ProgressIndicatorSize::Large2Very large progress indicator that can be used to cover large parts of a UI.

See also Utils::ProgressIndicator and Utils::ProgressIndicatorPainter.

enum Utils::ResultSpecialErrorCode

The ResultSpecialErrorCode enum is used with the Utils::ResultError class to provide a set of standardized error messages.

ConstantValueDescription
Utils::ResultAssert0An internal error that indicates that preconditions are violated.
Utils::ResultUnimplemented1A backend unexpectedly did not provide an implementation of this functionality.

See also Utils::ResultError.

Variable Documentation

Utils::Q_DECL_IMPORT Utils::QString

Returns a copy of string that has ch characters removed from the start and the end.

Function Documentation

class Utils::Q_DECL_IMPORT Utils::addToolTipsToMenu(QMenu *menu)

Adds tool tips to the menu that show the action's tool tip when hovering over an entry.

Utils::Q_DECL_IMPORT Utils::triggerShutdownGuard()

Destroys the shutdown guard object and consequently all objects guarded by it.

In a normal run of the application this function is called automatically at the appropriate time.