17#ifndef __gui_mrview_tool_base_h__
18#define __gui_mrview_tool_base_h__
25#define LAYOUT_SPACING 3
28#define __STR(x) __STR__(x)
64 class Dock :
public QDockWidget
69 Window::main->addDockWidget (Qt::RightDockWidgetArea,
this);
70 setFloating (floating);
97 window().tool_has_focus =
this;
101 if (
window().tool_has_focus ==
this) {
102 window().tool_has_focus =
nullptr;
165 event->acceptProposedAction();
168 event->acceptProposedAction();
187 class __Action__ :
public QAction
190 __Action__ (QActionGroup* parent,
191 const char*
const name,
192 const char*
const description,
194 QAction (
name, parent),
197 setShortcut (tr (std::string (
"Ctrl+F" +
str (
index)).c_str()));
198 setStatusTip (tr (description));
201 virtual ~__Action__ () {
delete dock; }
203 virtual Dock*
create (
bool floating) = 0;
212 Dock* dock =
new Dock (text, floating);
213 dock->
tool =
new T (dock);
214 dock->setWidget (dock->
tool);
225 const char*
const name,
226 const char*
const description,
228 __Action__ (parent,
name, description,
index) { }
231 dock = Tool::create<T> (this->text(), floating);
a class to hold the list of option groups
object storing information about option parsed from command-line
int main(int cmdline_argc, char **cmdline_argv)
const App::OptionGroup Options
std::string str(const T &value, int precision=0)