Mercurial > octave-nkf
diff libgui/graphics/QtHandlesUtils.cc @ 20002:3cc0734283dc
style fixes in Qt graphics code
* Backend.cc, BaseControl.cc, ButtonControl.cc, Canvas.cc,
CheckBoxControl.cc, Container.cc, ContextMenu.cc, EditControl.cc,
Figure.cc, FigureWindow.cc, GLCanvas.cc, KeyMap.cc, ListBoxControl.cc,
Logger.cc, Menu.cc, MouseModeActionGroup.cc, Object.cc,
ObjectFactory.cc, ObjectProxy.cc, Panel.cc, PopupMenuControl.cc,
PushButtonControl.cc, PushTool.cc, QtHandlesUtils.cc,
RadioButtonControl.cc, SliderControl.cc, TextControl.cc, TextEdit.cc,
ToggleButtonControl.cc, ToggleTool.cc, ToolBar.cc, ToolBarButton.cc,
__init_qt__.cc: Follow a few more Octave coding conventions.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 19 Mar 2015 12:27:54 -0400 |
parents | 2f4406e9dad6 |
children | f0e61a67ad9f |
line wrap: on
line diff
--- a/libgui/graphics/QtHandlesUtils.cc Thu Mar 19 12:25:28 2015 -0400 +++ b/libgui/graphics/QtHandlesUtils.cc Thu Mar 19 12:27:54 2015 -0400 @@ -45,17 +45,20 @@ namespace Utils { -QString fromStdString (const std::string& s) +QString +fromStdString (const std::string& s) { return QString::fromLocal8Bit (s.c_str ()); } -std::string toStdString (const QString& s) +std::string +toStdString (const QString& s) { return std::string (s.toLocal8Bit ().data ()); } -QStringList fromStringVector (const string_vector& v) +QStringList +fromStringVector (const string_vector& v) { QStringList l; octave_idx_type n = v.length (); @@ -66,7 +69,8 @@ return l; } -string_vector toStringVector (const QStringList& l) +string_vector +toStringVector (const QStringList& l) { string_vector v (l.length ()); int i = 0; @@ -78,7 +82,8 @@ } template <class T> -QFont computeFont (const typename T::properties& props, int height) +QFont +computeFont (const typename T::properties& props, int height) { QFont f (fromStdString (props.get_fontname ())); @@ -109,10 +114,12 @@ template QFont computeFont<uicontrol> (const uicontrol::properties& props, int height); + template QFont computeFont<uipanel> (const uipanel::properties& props, int height); -QColor fromRgb (const Matrix& rgb) +QColor +fromRgb (const Matrix& rgb) { QColor c; @@ -122,7 +129,8 @@ return c; } -Matrix toRgb (const QColor& c) +Matrix +toRgb (const QColor& c) { Matrix rgb (1, 3); double* rgbData = rgb.fortran_vec (); @@ -132,7 +140,8 @@ return rgb; } -std::string figureSelectionType (QMouseEvent* event, bool isDoubleClick) +std::string +figureSelectionType (QMouseEvent* event, bool isDoubleClick) { if (isDoubleClick) return std::string ("open"); @@ -167,7 +176,8 @@ return std::string ("normal"); } -Matrix figureCurrentPoint (const graphics_object& fig, QMouseEvent* event) +Matrix +figureCurrentPoint (const graphics_object& fig, QMouseEvent* event) { Object* tkFig = Backend::toolkitObject (fig); @@ -188,8 +198,8 @@ return Matrix (1, 2, 0.0); } -Qt::Alignment fromHVAlign (const caseless_str& halign, - const caseless_str& valign) +Qt::Alignment +fromHVAlign (const caseless_str& halign, const caseless_str& valign) { Qt::Alignment flags; @@ -214,7 +224,8 @@ return flags; } -QImage makeImageFromCData (const octave_value& v, int width, int height) +QImage +makeImageFromCData (const octave_value& v, int width, int height) { dim_vector dv (v.dims ()); @@ -289,7 +300,8 @@ return QImage (); } -octave_scalar_map makeKeyEventStruct (QKeyEvent* event) +octave_scalar_map +makeKeyEventStruct (QKeyEvent* event) { octave_scalar_map retval;