diff --git a/modules/gui/doc/tools.rst b/modules/gui/doc/tools.rst index 9c0da468bdeea30d310410c5607e223db3aa6877..1b652f2114c7ee83505861f6d6e4ffe7b50b0166 100644 --- a/modules/gui/doc/tools.rst +++ b/modules/gui/doc/tools.rst @@ -74,4 +74,98 @@ The example `Write a Tool in Python` demonstrates how to add a simple tool :rtype: :class:`ToolOptions` - + + +.. class:: ToolOption + + Currently, there are four different types of ToolOption which can be used to + build up your own tool. They will automatically generate the appropriate + QT widgets: + + * :class:`ToolOptionInt` generates a QLineEdit of integer type + * :class:`ToolOptionFloat` generates a QLineEdit of float type + * :class:`ToolOptionEnum` generates a QComboBox + * :class:`ToolOptionButton` generates a QPushButton + +.. class:: ToolOptionInt(key, verbose_name, default_value, min_value, max_value) + + :param key: Internal key name + :type name: str + :param verbose_name: Name used as label in the widget + :type name: str + :param default_value: Default value + :param min_value: Minimum allowed value + Defaults to minimum possible value + :param max_value: Maximum allowed value + Defaults to maximum possible value + + .. method:: GetDefault() + + .. method:: GetUpperLimit() + + .. method:: GetLowerLimit() + + .. method:: GetValue() + + .. method:: SetValue(value) + + +.. class:: ToolOptionFloat(key, verbose_name, default_value, min_value, max_value) + + :param key: Internal key name + :type name: str + :param verbose_name: Name used as label in the widget + :type name: str + :param default_value: Default value + :param min_value: Minimum allowed value + Defaults to minimum possible value + :param max_value: Maximum allowed value + Defaults to maximum possible value + + .. method:: GetDefault() + + .. method:: GetUpperLimit() + + .. method:: GetLowerLimit() + + .. method:: GetValue() + + .. method:: SetValue(value) + +.. class:: ToolOptionEnum(key, verbose_name) + + :param key: Internal key name + :type name: str + :param verbose_name: Name used as label in the widget + :type verbose_name: str + + .. method:: Add(text, tag) + + :param text: Text in dropdown menu + :type text: str + :param tag: Index in dropdown menu + :type tag: int + + .. method:: SetIndex(index) + + :type index: int + + .. method:: GetIndex() + .. method:: GetValue() + + .. method:: Begin() + .. method:: End() + .. method:: Size() + +.. class:: ToolOptionButton(key, verbose_name, QObject* receiver, + const char *slot_method) + + :param key: Internal key name + :type name: str + :param verbose_name: Name used as label in the widget + :type name: str + :param slot_method: Name of slot method that should be invoked upon releasing the buton + :type slot_method: const char * + :param receiver: QObject that implements the slot method + :type receiver: QObject * + \ No newline at end of file diff --git a/modules/gui/src/tools/tool_option.cc b/modules/gui/src/tools/tool_option.cc index 8f54a6c060d0390dab39f6d9c2c4a35230571d6b..542c99ccdd36adde5ffb5c762c9ff5c67b3056dd 100644 --- a/modules/gui/src/tools/tool_option.cc +++ b/modules/gui/src/tools/tool_option.cc @@ -68,9 +68,4 @@ ToolOptionButton::ToolOptionButton(const String& key, } -void ToolOptionButton::RunMe() -{ - std::cout << "TOOL RUN ME RUN ME" << std::endl; -} - }} diff --git a/modules/gui/src/tools/tool_option.hh b/modules/gui/src/tools/tool_option.hh index ac035559eabcdd6fe2b5c95ddb898b3e92c89348..7851000cdb97264a1a92ceddb352622e5079e058 100644 --- a/modules/gui/src/tools/tool_option.hh +++ b/modules/gui/src/tools/tool_option.hh @@ -124,7 +124,6 @@ private: }; class DLLEXPORT_OST_GUI ToolOptionButton : public ToolOption { - Q_OBJECT public: ToolOptionButton(const String& key, const String& verbose_name, @@ -132,8 +131,6 @@ public: const char *slot_method); const char* GetSlotMethod() const { return slot_method_; } QObject* GetReceiver() const { return receiver_; } -public slots: - void RunMe(); private: const char *slot_method_; QObject* receiver_;