diff libgui/graphics/ToggleTool.cc @ 22411:c69805d1fa64

maint: Style check C++ code in libgui/ * Backend.cc, Backend.h, BaseControl.cc, BaseControl.h, ButtonControl.cc, ButtonControl.h, ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h, CheckBoxControl.cc, CheckBoxControl.h, Container.cc, Container.h, ContextMenu.cc, ContextMenu.h, EditControl.cc, EditControl.h, Figure.cc, Figure.h, FigureWindow.cc, FigureWindow.h, GLCanvas.cc, GLCanvas.h, GenericEventNotify.h, KeyMap.cc, KeyMap.h, ListBoxControl.cc, ListBoxControl.h, Logger.cc, Logger.h, Menu.cc, Menu.h, MenuContainer.h, MouseModeActionGroup.cc, MouseModeActionGroup.h, Object.cc, Object.h, ObjectFactory.cc, ObjectFactory.h, ObjectProxy.cc, ObjectProxy.h, Panel.cc, Panel.h, PopupMenuControl.cc, PopupMenuControl.h, PushButtonControl.cc, PushButtonControl.h, PushTool.cc, PushTool.h, QtHandlesUtils.cc, QtHandlesUtils.h, RadioButtonControl.cc, RadioButtonControl.h, SliderControl.cc, SliderControl.h, TextControl.cc, TextControl.h, TextEdit.cc, TextEdit.h, ToggleButtonControl.cc, ToggleButtonControl.h, ToggleTool.cc, ToggleTool.h, ToolBar.cc, ToolBar.h, ToolBarButton.cc, ToolBarButton.h, __init_qt__.cc, __init_qt__.h, annotation-dialog.cc, annotation-dialog.h, gl-select.cc, gl-select.h, color-picker.cc, color-picker.h, dialog.h, documentation-dock-widget.cc, documentation-dock-widget.h, files-dock-widget.cc, files-dock-widget.h, find-files-dialog.h, find-files-model.cc, find-files-model.h, history-dock-widget.cc, history-dock-widget.h, liboctgui-build-info.h, liboctgui-build-info.in.cc, file-editor-interface.h, file-editor-tab.cc, file-editor-tab.h, file-editor.cc, file-editor.h, find-dialog.cc, find-dialog.h, marker.cc, marker.h, octave-qscintilla.cc, octave-qscintilla.h, octave-txt-lexer.cc, octave-txt-lexer.h, main-window.cc, main-window.h, octave-cmd.cc, octave-cmd.h, octave-dock-widget.cc, octave-dock-widget.h, octave-gui.cc, octave-gui.h, octave-interpreter.cc, octave-interpreter.h, octave-qt-link.cc, octave-qt-link.h, parser.cc, parser.h, webinfo.cc, webinfo.h, resource-manager.cc, resource-manager.h, settings-dialog.cc, settings-dialog.h, shortcut-manager.cc, shortcut-manager.h, terminal-dock-widget.h, thread-manager.cc, thread-manager.h, welcome-wizard.cc, welcome-wizard.h, workspace-model.cc, workspace-model.h, workspace-view.cc, workspace-view.h: Style check C++ code in libgui/
author Rik <rik@octave.org>
date Wed, 31 Aug 2016 12:20:46 -0700
parents bac0d6f07a3e
children 48c00363dc74
line wrap: on
line diff
--- a/libgui/graphics/ToggleTool.cc	Wed Aug 31 14:37:33 2016 -0400
+++ b/libgui/graphics/ToggleTool.cc	Wed Aug 31 12:20:46 2016 -0700
@@ -31,65 +31,66 @@
 namespace QtHandles
 {
 
-ToggleTool*
-ToggleTool::create (const graphics_object& go)
-{
-  Object* parent = Object::parentObject (go);
+  ToggleTool*
+  ToggleTool::create (const graphics_object& go)
+  {
+    Object* parent = Object::parentObject (go);
 
-  if (parent)
-    {
-      QWidget* parentWidget = parent->qWidget<QWidget> ();
+    if (parent)
+      {
+        QWidget* parentWidget = parent->qWidget<QWidget> ();
 
-      if (parentWidget)
-        return new ToggleTool (go, new QAction (parentWidget));
-    }
+        if (parentWidget)
+          return new ToggleTool (go, new QAction (parentWidget));
+      }
 
-  return 0;
-}
+    return 0;
+  }
 
-ToggleTool::ToggleTool (const graphics_object& go, QAction* action)
-  : ToolBarButton<uitoggletool> (go, action)
-{
-  uitoggletool::properties& tp = properties<uitoggletool> ();
+  ToggleTool::ToggleTool (const graphics_object& go, QAction* action)
+    : ToolBarButton<uitoggletool> (go, action)
+  {
+    uitoggletool::properties& tp = properties<uitoggletool> ();
 
-  action->setCheckable (true);
-  action->setChecked (tp.is_state ());
+    action->setCheckable (true);
+    action->setChecked (tp.is_state ());
 
-  connect (action, SIGNAL (toggled (bool)),
-           this, SLOT (triggered (bool)));
-}
+    connect (action, SIGNAL (toggled (bool)),
+             this, SLOT (triggered (bool)));
+  }
 
-ToggleTool::~ToggleTool (void)
-{
-}
+  ToggleTool::~ToggleTool (void)
+  {
+  }
 
-void
-ToggleTool::update (int pId)
-{
-  uitoggletool::properties& tp = properties<uitoggletool> ();
-  QAction* action = qWidget<QAction> ();
+  void
+  ToggleTool::update (int pId)
+  {
+    uitoggletool::properties& tp = properties<uitoggletool> ();
+    QAction* action = qWidget<QAction> ();
 
-  switch (pId)
-    {
-    case uitoggletool::properties::ID_STATE:
-      action->setChecked (tp.is_state ());
-      break;
+    switch (pId)
+      {
+      case uitoggletool::properties::ID_STATE:
+        action->setChecked (tp.is_state ());
+        break;
 
-    default:
-      ToolBarButton<uitoggletool>::update (pId);
-      break;
-    }
-}
+      default:
+        ToolBarButton<uitoggletool>::update (pId);
+        break;
+      }
+  }
 
-void
-ToggleTool::triggered (bool checked)
-{
-  gh_manager::post_set (m_handle, "state", checked, false);
-  gh_manager::post_callback (m_handle,
-                             checked
-                             ? "oncallback"
-                             : "offcallback");
-  gh_manager::post_callback (m_handle, "clickedcallback");
-}
+  void
+  ToggleTool::triggered (bool checked)
+  {
+    gh_manager::post_set (m_handle, "state", checked, false);
+    gh_manager::post_callback (m_handle,
+                               checked
+                               ? "oncallback"
+                               : "offcallback");
+    gh_manager::post_callback (m_handle, "clickedcallback");
+  }
 
 };
+