Skip to content
Snippets Groups Projects
Commit 83fa0241 authored by Tobias Schmidt's avatar Tobias Schmidt
Browse files

add documentation for ToolOptions, removed debug stuff

parent 0af3b281
Branches
Tags
No related merge requests found
......@@ -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
......@@ -68,9 +68,4 @@ ToolOptionButton::ToolOptionButton(const String& key,
}
void ToolOptionButton::RunMe()
{
std::cout << "TOOL RUN ME RUN ME" << std::endl;
}
}}
......@@ -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_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment