40 #ifndef __OPENFLUID_UICOMMON_UIHELPERS_HPP__ 41 #define __OPENFLUID_UICOMMON_UIHELPERS_HPP__ 50 namespace openfluid {
namespace ui {
namespace common {
55 return QColor(qrand() % 256,qrand() % 256,qrand() % 256);
63 inline void fixLineEdit(QLineEdit* LineEdit,QRegExp SearchRegExp = QRegExp(
"[^\\w]"),QString NewStr =
"_")
65 int CPos = LineEdit->cursorPosition();
66 LineEdit->setText(LineEdit->text().replace(SearchRegExp,NewStr));
67 LineEdit->setCursorPosition(CPos);
75 inline QIcon
getIcon(
const QString& IconName,
const QString& ResourcePath,
bool IsLight =
false)
77 QString IconSuffix =
"dark";
81 QIcon TmpIcon(QString(
":%1/icons/%2_%3.png").arg(ResourcePath).arg(IconName).arg(IconSuffix));
84 TmpIcon.addPixmap(QPixmap(QString(
":%1/icons/%2_grayed.png").arg(ResourcePath).arg(IconName)),QIcon::Disabled);
QColor getRandomColor()
Definition: UIHelpers.hpp:53
QIcon getIcon(const QString &IconName, const QString &ResourcePath, bool IsLight=false)
Definition: UIHelpers.hpp:75
void fixLineEdit(QLineEdit *LineEdit, QRegExp SearchRegExp=QRegExp("[^\]"), QString NewStr="_")
Definition: UIHelpers.hpp:63
Definition: ApplicationException.hpp:47