forked from qt-creator/qt-creator
Utils: Introduce a FilePathAspect
A shallow wrapper around a StringAspect with a suitable operator(). Change-Id: I0a5e121565d03573faa5c3f4085d72db2b9c3774 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1325,6 +1325,28 @@ void StringAspect::makeCheckable(CheckBoxPlacement checkBoxPlacement,
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class Utils::FilePathAspect
|
||||||
|
\inmodule QtCreator
|
||||||
|
|
||||||
|
\brief A file path aspect is shallow wrapper around a Utils::StringAspect that
|
||||||
|
represents a file in the file system.
|
||||||
|
|
||||||
|
It is displayed by default using Utils::PathChooser.
|
||||||
|
|
||||||
|
The visual representation often contains a label in front of the display
|
||||||
|
of the actual value.
|
||||||
|
|
||||||
|
\sa Utils::StringAspect
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
FilePathAspect::FilePathAspect()
|
||||||
|
{
|
||||||
|
setDisplayStyle(PathChooserDisplay);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class Utils::ColorAspect
|
\class Utils::ColorAspect
|
||||||
\inmodule QtCreator
|
\inmodule QtCreator
|
||||||
|
|||||||
@@ -439,6 +439,14 @@ protected:
|
|||||||
std::unique_ptr<Internal::StringAspectPrivate> d;
|
std::unique_ptr<Internal::StringAspectPrivate> d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class QTCREATOR_UTILS_EXPORT FilePathAspect : public StringAspect
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FilePathAspect();
|
||||||
|
|
||||||
|
FilePath operator()() const { return filePath(); }
|
||||||
|
};
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT IntegerAspect : public BaseAspect
|
class QTCREATOR_UTILS_EXPORT IntegerAspect : public BaseAspect
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
Reference in New Issue
Block a user