Plasma Engine  2.0
Loading...
Searching...
No Matches
plQtUiServices Class Reference
Inheritance diagram for plQtUiServices:

Classes

struct  Event
 
struct  TickEvent
 

Public Member Functions

void ShowColorDialog (const plColor &color, bool bAlpha, bool bHDR, QWidget *pParent, const char *szSlotCurColChanged, const char *szSlotAccept, const char *szSlotReject)
 Shows a non-modal color dialog. The Qt slots are called when the selected color is changed or when the dialog is closed and the result accepted or rejected.
 
void LoadState ()
 Loads some global state used by plQtUiServices from the registry. E.g. the last position of the color dialog.
 
void SaveState ()
 Saves some global state used by plQtUiServices to the registry.
 
void Init ()
 

Static Public Member Functions

static bool IsHeadless ()
 True if the application doesn't show any window and only works in the background.
 
static void SetHeadless (bool bHeadless)
 Set to true if the application doesn't show any window and only works in the background.
 
static void MessageBoxStatus (const plStatus &s, const char *szFailureMsg, const char *szSuccessMsg="", bool bOnlySuccessMsgIfDetails=true)
 Might show a message box depending on the given status. If the status is 'failure' the szFailureMsg is shown, including the message in plStatus. If the status is success a message box with text szSuccessMsg is shown, but only if the status message is not empty or if bOnlySuccessMsgIfDetails is false.
 
static void MessageBoxInformation (const plFormatString &msg)
 Shows an information message box.
 
static void MessageBoxWarning (const plFormatString &msg)
 Shows an warning message box.
 
static QMessageBox::StandardButton MessageBoxQuestion (const plFormatString &msg, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
 Shows a question message box and returns which button the user pressed.
 
static void ShowAllDocumentsTemporaryStatusBarMessage (const plFormatString &msg, plTime timeOut)
 Use this if you need to display a status bar message in any/all documents. Go directly through the document, if you only want to show a message in a single document window.
 
static void ShowAllDocumentsPermanentStatusBarMessage (const plFormatString &msg, Event::TextType type)
 
static void ShowGlobalStatusBarMessage (const plFormatString &msg)
 Shows a 'critical' message in all container windows (in red), which does not disappear, until it is replaced with another (empty) string.
 
static bool OpenFileInDefaultProgram (const char *szPath)
 Opens the given file in the program that is registered in the OS to handle that file type.
 
static void OpenInExplorer (const char *szPath, bool bIsFile)
 Opens the given file or folder in the Explorer.
 
static plStatus OpenInClion (const QStringList &arguments)
 
static plStatus OpenInRider (const char *szPath)
 
static plStatus OpenIn10X (const char *szPath)
 
static plStatus OpenInVisualStudio (const char *szPath)
 
static plStatus OpenInVsCode (const QStringList &arguments)
 Attempts to launch Visual Studio Code with the given command line.
 
static const QIcon & GetCachedIconResource (plStringView sIdentifier, plColor svgTintColor=plColor::MakeZero())
 Returns a cached QIcon that was created from an internal Qt resource (e.g. 'QIcon(":QtNamespace/MyIcon.png")' ). Prevents creating the object over and over.
 
static const QImage & GetCachedImageResource (const char *szIdentifier)
 Returns a cached QImage that was created from an internal Qt resource (e.g. 'QImage(":QtNamespace/MyIcon.png")' ). Prevents creating the object over and over.
 
static const QPixmap & GetCachedPixmapResource (const char *szIdentifier)
 Returns a cached QPixmap that was created from an internal Qt resource (e.g. 'QPixmap(":QtNamespace/MyIcon.png")' ). Prevents creating the object over and over.
 
static plResult AddToGitIgnore (const char *szGitIgnoreFile, const char *szPattern)
 Adds the pattern to the gitignore file.
 
static void CheckForUpdates ()
 Raises the 'CheckForUpdates' event.
 

Static Public Attributes

static plEvent< const plQtUiServices::Event & > s_Events
 
static plEvent< const plQtUiServices::TickEvent & > s_TickEvent
 

Member Function Documentation

◆ AddToGitIgnore()

plResult plQtUiServices::AddToGitIgnore ( const char * szGitIgnoreFile,
const char * szPattern )
static

Adds the pattern to the gitignore file.

If the gitignore file does not exist, it is created. If the pattern is already present in the file, it is not added again.

◆ GetCachedIconResource()

const QIcon & plQtUiServices::GetCachedIconResource ( plStringView sIdentifier,
plColor svgTintColor = plColor::MakeZero() )
static

Returns a cached QIcon that was created from an internal Qt resource (e.g. 'QIcon(":QtNamespace/MyIcon.png")' ). Prevents creating the object over and over.

If svgTintColor is a non-zero color, and sIdentifier points to an .SVG file, then the first time the icon is requested with that color, a copy is made, and the SVG content is modified such that white ("#FFFFFF") gets replaced by the requested color. Thus multiple tints of the same icon can be created for different use cases. Usually this is used to get different shades of the same icon, such that it looks good on the target background.


The documentation for this class was generated from the following files: