From a6bf60c9b4e302782ab672c2e9ab56cd02928257 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Tue, 28 Feb 2023 15:49:42 +0100 Subject: [PATCH] upgraded to uncrustify 0.76.0 - still not happy with the C++ beautifier situation, that requires way too much manual post processing --- .uncrustify | 563 ++++++++++++------ examples/boxes/Box.cpp | 2 +- examples/boxes/main.cpp | 14 +- examples/iotdashboard/BoxWithButtons.cpp | 7 +- examples/iotdashboard/BoxWithButtons.h | 7 +- examples/iotdashboard/Diagram.h | 6 +- examples/iotdashboard/DiagramSkinlet.cpp | 27 +- examples/iotdashboard/LightDisplay.cpp | 5 +- examples/iotdashboard/LightDisplay.h | 2 +- examples/iotdashboard/LightDisplaySkinlet.cpp | 19 +- examples/iotdashboard/MainItem.cpp | 34 +- examples/iotdashboard/MainItem.h | 102 ++-- examples/iotdashboard/RoomsPage.cpp | 3 +- examples/iotdashboard/RoundedIcon.h | 3 +- examples/iotdashboard/Skin.cpp | 6 +- examples/iotdashboard/StorageBar.h | 10 +- examples/iotdashboard/UsageDiagram.cpp | 3 +- examples/tabview/main.cpp | 4 +- playground/dials/main.cpp | 2 +- playground/grids/GridQuick.cpp | 3 +- playground/shadows/main.cpp | 2 +- qmlexport/QskMainQml.h | 4 +- qmlexport/QskShortcutQml.cpp | 3 +- skins/material3/QskMaterial3Skin.cpp | 34 +- skins/squiek/QskSquiekSkin.cpp | 12 +- src/common/QskBoxBorderMetrics.h | 2 +- src/common/QskBoxShapeMetrics.h | 2 +- src/common/QskGradient.cpp | 4 +- src/common/QskGradientDirection.cpp | 2 +- src/common/QskGradientDirection.h | 2 +- src/common/QskGradientStop.cpp | 2 +- src/common/QskTextColors.cpp | 7 +- src/controls/QskAbstractButton.cpp | 2 +- src/controls/QskComboBox.cpp | 7 +- src/controls/QskControl.cpp | 3 +- src/controls/QskEvent.h | 10 +- src/controls/QskProgressBarSkinlet.cpp | 2 +- src/controls/QskPushButton.h | 2 +- src/controls/QskPushButtonSkinlet.cpp | 2 +- src/controls/QskRadioBox.cpp | 4 +- src/controls/QskSegmentedBarSkinlet.cpp | 24 +- src/controls/QskSkinHintTableEditor.cpp | 2 +- src/controls/QskSpinBox.cpp | 2 +- src/controls/QskSpinBox.h | 4 +- src/controls/QskSpinBoxSkinlet.cpp | 6 +- src/controls/QskSpinBoxSkinlet.h | 2 +- src/graphic/QskStandardSymbol.cpp | 4 +- src/layouts/QskStackBoxAnimator.cpp | 2 +- src/layouts/QskSubcontrolLayoutEngine.cpp | 63 +- support/SkinnyNamespace.cpp | 18 +- support/SkinnyShapeFactory.cpp | 4 +- 51 files changed, 657 insertions(+), 404 deletions(-) diff --git a/.uncrustify b/.uncrustify index c20650e8..76be0ba3 100644 --- a/.uncrustify +++ b/.uncrustify @@ -1,3 +1,5 @@ +# Uncrustify-0.76.0_f + # # General options # @@ -28,7 +30,7 @@ string_escape_char2 = 0 # unsigned number # Replace tab characters found in string literals with the escape sequence \t # instead. -string_replace_tab_chars = true # true/false +string_replace_tab_chars = true # true/false # Allow interpreting '>=' and '>>=' as part of a template in code like # 'void f(list>=val);'. If true, 'assert(x<0 && y>=3)' will be broken. @@ -74,20 +76,20 @@ utf8_force = false # true/false # Add or remove space around non-assignment symbolic operators ('+', '/', '%', # '<<', and so forth). -sp_arith = force # ignore/add/remove/force/not_defined +sp_arith = force # ignore/add/remove/force/not_defined # Add or remove space around arithmetic operators '+' and '-'. # # Overrides sp_arith. -sp_arith_additive = force # ignore/add/remove/force/not_defined +sp_arith_additive = force # ignore/add/remove/force/not_defined # Add or remove space around assignment operator '=', '+=', etc. -sp_assign = force # ignore/add/remove/force/not_defined +sp_assign = force # ignore/add/remove/force/not_defined # Add or remove space around '=' in C++11 lambda capture specifications. # # Overrides sp_assign. -sp_cpp_lambda_assign = force # ignore/add/remove/force/not_defined +sp_cpp_lambda_assign = force # ignore/add/remove/force/not_defined # Add or remove space after the capture specification of a C++11 lambda when # an argument list is present, as in '[] (int x){ ... }'. @@ -95,16 +97,16 @@ sp_cpp_lambda_square_paren = remove # ignore/add/remove/force/not_defined # Add or remove space after the capture specification of a C++11 lambda with # no argument list is present, as in '[] { ... }'. -sp_cpp_lambda_square_brace = force # ignore/add/remove/force/not_defined +sp_cpp_lambda_square_brace = force # ignore/add/remove/force/not_defined # Add or remove space after the opening parenthesis and before the closing # parenthesis of a argument list of a C++11 lambda, as in # '[]( int x ){ ... }'. -sp_cpp_lambda_argument_list = force # ignore/add/remove/force/not_defined +sp_cpp_lambda_argument_list = ignore # ignore/add/remove/force/not_defined # Add or remove space after the argument list of a C++11 lambda, as in # '[](int x) { ... }'. -sp_cpp_lambda_paren_brace = force # ignore/add/remove/force/not_defined +sp_cpp_lambda_paren_brace = force # ignore/add/remove/force/not_defined # Add or remove space between a lambda body and its call operator of an # immediately invoked lambda, as in '[]( ... ){ ... } ( ... )'. @@ -113,7 +115,7 @@ sp_cpp_lambda_fparen = ignore # ignore/add/remove/force/not_defined # Add or remove space around assignment operator '=' in a prototype. # # If set to ignore, use sp_assign. -sp_assign_default = force # ignore/add/remove/force/not_defined +sp_assign_default = force # ignore/add/remove/force/not_defined # Add or remove space before assignment operator '=', '+=', etc. # @@ -125,6 +127,11 @@ sp_before_assign = ignore # ignore/add/remove/force/not_defined # Overrides sp_assign. sp_after_assign = ignore # ignore/add/remove/force/not_defined +# Add or remove space in 'enum {'. +# +# Default: add +sp_enum_brace = add # ignore/add/remove/force/not_defined + # Add or remove space in 'NS_ENUM ('. sp_enum_paren = ignore # ignore/add/remove/force/not_defined @@ -142,12 +149,12 @@ sp_enum_before_assign = ignore # ignore/add/remove/force/not_defined sp_enum_after_assign = ignore # ignore/add/remove/force/not_defined # Add or remove space around assignment ':' in enum. -sp_enum_colon = force # ignore/add/remove/force/not_defined +sp_enum_colon = force # ignore/add/remove/force/not_defined # Add or remove space around preprocessor '##' concatenation operator. # # Default: add -sp_pp_concat = force # ignore/add/remove/force/not_defined +sp_pp_concat = force # ignore/add/remove/force/not_defined # Add or remove space after preprocessor '#' stringify operator. # Also affects the '#@' charizing operator. @@ -158,16 +165,16 @@ sp_pp_stringify = ignore # ignore/add/remove/force/not_defined sp_before_pp_stringify = ignore # ignore/add/remove/force/not_defined # Add or remove space around boolean operators '&&' and '||'. -sp_bool = force # ignore/add/remove/force/not_defined +sp_bool = force # ignore/add/remove/force/not_defined # Add or remove space around compare operator '<', '>', '==', etc. -sp_compare = force # ignore/add/remove/force/not_defined +sp_compare = force # ignore/add/remove/force/not_defined # Add or remove space inside '(' and ')'. -sp_inside_paren = force # ignore/add/remove/force/not_defined +sp_inside_paren = force # ignore/add/remove/force/not_defined # Add or remove space between nested parentheses, i.e. '((' vs. ') )'. -sp_paren_paren = force # ignore/add/remove/force/not_defined +sp_paren_paren = force # ignore/add/remove/force/not_defined # Add or remove space between back-to-back parentheses, i.e. ')(' vs. ') ('. sp_cparen_oparen = ignore # ignore/add/remove/force/not_defined @@ -176,10 +183,10 @@ sp_cparen_oparen = ignore # ignore/add/remove/force/not_defined sp_balance_nested_parens = false # true/false # Add or remove space between ')' and '{'. -sp_paren_brace = force # ignore/add/remove/force/not_defined +sp_paren_brace = force # ignore/add/remove/force/not_defined # Add or remove space between nested braces, i.e. '{{' vs. '{ {'. -sp_brace_brace = force # ignore/add/remove/force/not_defined +sp_brace_brace = force # ignore/add/remove/force/not_defined # Add or remove space before pointer star '*'. sp_before_ptr_star = remove # ignore/add/remove/force/not_defined @@ -194,13 +201,13 @@ sp_between_ptr_star = remove # ignore/add/remove/force/not_defined # Add or remove space after pointer star '*', if followed by a word. # # Overrides sp_type_func. -sp_after_ptr_star = force # ignore/add/remove/force/not_defined +sp_after_ptr_star = force # ignore/add/remove/force/not_defined # Add or remove space after pointer caret '^', if followed by a word. sp_after_ptr_block_caret = remove # ignore/add/remove/force/not_defined # Add or remove space after pointer star '*', if followed by a qualifier. -sp_after_ptr_star_qualifier = force # ignore/add/remove/force/not_defined +sp_after_ptr_star_qualifier = force # ignore/add/remove/force/not_defined # Add or remove space after a pointer star '*', if followed by a function # prototype or function definition. @@ -216,9 +223,13 @@ sp_after_ptr_star_trailing = ignore # ignore/add/remove/force/not_defined # in a function pointer definition. sp_ptr_star_func_var = ignore # ignore/add/remove/force/not_defined +# Add or remove space between the pointer star '*' and the name of the type +# in a function pointer type definition. +sp_ptr_star_func_type = force # ignore/add/remove/force/not_defined + # Add or remove space after a pointer star '*', if followed by an open # parenthesis, as in 'void* (*)()'. -sp_ptr_star_paren = force # ignore/add/remove/force/not_defined +sp_ptr_star_paren = force # ignore/add/remove/force/not_defined # Add or remove space before a pointer star '*', if followed by a function # prototype or function definition. @@ -238,18 +249,22 @@ sp_before_unnamed_byref = remove # ignore/add/remove/force/not_defined # Add or remove space after reference sign '&', if followed by a word. # # Overrides sp_type_func. -sp_after_byref = force # ignore/add/remove/force/not_defined +sp_after_byref = force # ignore/add/remove/force/not_defined # Add or remove space after a reference sign '&', if followed by a function # prototype or function definition. # # Overrides sp_after_byref and sp_type_func. -sp_after_byref_func = force # ignore/add/remove/force/not_defined +sp_after_byref_func = force # ignore/add/remove/force/not_defined # Add or remove space before a reference sign '&', if followed by a function # prototype or function definition. sp_before_byref_func = remove # ignore/add/remove/force/not_defined +# Add or remove space after a reference sign '&', if followed by an open +# parenthesis, as in 'char& (*)()'. +sp_byref_paren = force # ignore/add/remove/force/not_defined + # Add or remove space between type and word. In cases where total removal of # whitespace would be a syntax error, a value of 'remove' is treated the same # as 'force'. @@ -279,7 +294,7 @@ sp_template_angle = remove # ignore/add/remove/force/not_defined sp_before_angle = ignore # ignore/add/remove/force/not_defined # Add or remove space inside '<' and '>'. -sp_inside_angle = force # ignore/add/remove/force/not_defined +sp_inside_angle = force # ignore/add/remove/force/not_defined # Add or remove space inside '<>'. sp_inside_angle_empty = ignore # ignore/add/remove/force/not_defined @@ -432,15 +447,15 @@ sp_after_comma = ignore # ignore/add/remove/force/not_defined # Default: remove sp_before_comma = remove # ignore/add/remove/force/not_defined -# (C#) Add or remove space between ',' and ']' in multidimensional array type +# (C#, Vala) Add or remove space between ',' and ']' in multidimensional array type # like 'int[,,]'. sp_after_mdatype_commas = ignore # ignore/add/remove/force/not_defined -# (C#) Add or remove space between '[' and ',' in multidimensional array type +# (C#, Vala) Add or remove space between '[' and ',' in multidimensional array type # like 'int[,,]'. sp_before_mdatype_commas = ignore # ignore/add/remove/force/not_defined -# (C#) Add or remove space between ',' in multidimensional array type +# (C#, Vala) Add or remove space between ',' in multidimensional array type # like 'int[,,]'. sp_between_mdatype_commas = ignore # ignore/add/remove/force/not_defined @@ -450,42 +465,42 @@ sp_between_mdatype_commas = ignore # ignore/add/remove/force/not_defined # Default: force sp_paren_comma = force # ignore/add/remove/force/not_defined +# Add or remove space between a type and ':'. +sp_type_colon = force # ignore/add/remove/force/not_defined + # Add or remove space after the variadic '...' when preceded by a # non-punctuator. -# The value REMOVE will be overriden with FORCE -sp_after_ellipsis = add # ignore/add/remove/force/not_defined +# The value REMOVE will be overridden with FORCE +sp_after_ellipsis = add # ignore/add/remove/force/not_defined # Add or remove space before the variadic '...' when preceded by a # non-punctuator. -# The value REMOVE will be overriden with FORCE -sp_before_ellipsis = add # ignore/add/remove/force/not_defined +# The value REMOVE will be overridden with FORCE +sp_before_ellipsis = add # ignore/add/remove/force/not_defined # Add or remove space between a type and '...'. -sp_type_ellipsis = add # ignore/add/remove/force/not_defined +sp_type_ellipsis = add # ignore/add/remove/force/not_defined # Add or remove space between a '*' and '...'. sp_ptr_type_ellipsis = ignore # ignore/add/remove/force/not_defined -# (D) Add or remove space between a type and '?'. -sp_type_question = ignore # ignore/add/remove/force/not_defined - # Add or remove space between ')' and '...'. -sp_paren_ellipsis = add # ignore/add/remove/force/not_defined +sp_paren_ellipsis = add # ignore/add/remove/force/not_defined # Add or remove space between '&&' and '...'. sp_byref_ellipsis = ignore # ignore/add/remove/force/not_defined # Add or remove space between ')' and a qualifier such as 'const'. -sp_paren_qualifier = add # ignore/add/remove/force/not_defined +sp_paren_qualifier = add # ignore/add/remove/force/not_defined # Add or remove space between ')' and 'noexcept'. -sp_paren_noexcept = add # ignore/add/remove/force/not_defined +sp_paren_noexcept = add # ignore/add/remove/force/not_defined # Add or remove space after class ':'. -sp_after_class_colon = add # ignore/add/remove/force/not_defined +sp_after_class_colon = add # ignore/add/remove/force/not_defined # Add or remove space before class ':'. -sp_before_class_colon = add # ignore/add/remove/force/not_defined +sp_before_class_colon = add # ignore/add/remove/force/not_defined # Add or remove space after class constructor ':'. # @@ -495,7 +510,7 @@ sp_after_constr_colon = add # ignore/add/remove/force/not_defined # Add or remove space before class constructor ':'. # # Default: add -sp_before_constr_colon = remove # ignore/add/remove/force/not_defined +sp_before_constr_colon = remove # ignore/add/remove/force/not_defined # Add or remove space before case ':'. # @@ -528,7 +543,7 @@ sp_cpp_cast_paren = remove # ignore/add/remove/force/not_defined sp_sizeof_paren = remove # ignore/add/remove/force/not_defined # Add or remove space between 'sizeof' and '...'. -sp_sizeof_ellipsis = force # ignore/add/remove/force/not_defined +sp_sizeof_ellipsis = force # ignore/add/remove/force/not_defined # Add or remove space between 'sizeof...' and '('. sp_sizeof_ellipsis_paren = ignore # ignore/add/remove/force/not_defined @@ -587,7 +602,7 @@ sp_type_func = ignore # ignore/add/remove/force/not_defined # Add or remove space between type and open brace of an unnamed temporary # direct-list-initialization. -sp_type_brace_init_lst = force # ignore/add/remove/force/not_defined +sp_type_brace_init_lst = force # ignore/add/remove/force/not_defined # Add or remove space between function name and '(' on function declaration. sp_func_proto_paren = ignore # ignore/add/remove/force/not_defined @@ -673,7 +688,7 @@ sp_return = force # ignore/add/remove/force/not_defined sp_return_paren = ignore # ignore/add/remove/force/not_defined # Add or remove space between 'return' and '{'. -sp_return_brace = force # ignore/add/remove/force/not_defined +sp_return_brace = force # ignore/add/remove/force/not_defined # Add or remove space between '__attribute__' and '('. sp_attribute_paren = ignore # ignore/add/remove/force/not_defined @@ -767,7 +782,7 @@ sp_getset_brace = ignore # ignore/add/remove/force/not_defined # Add or remove space between a variable and '{' for C++ uniform # initialization. -sp_word_brace_init_lst = add # ignore/add/remove/force/not_defined +sp_word_brace_init_lst = add # ignore/add/remove/force/not_defined # Add or remove space between a variable and '{' for a namespace. # @@ -788,6 +803,10 @@ sp_d_array_colon = ignore # ignore/add/remove/force/not_defined # Default: remove sp_not = remove # ignore/add/remove/force/not_defined +# Add or remove space between two '!' (not) unary operators. +# If set to ignore, sp_not will be used. +sp_not_not = ignore # ignore/add/remove/force/not_defined + # Add or remove space after the '~' (invert) unary operator. # # Default: remove @@ -896,7 +915,7 @@ sp_after_oc_property = ignore # ignore/add/remove/force/not_defined sp_after_oc_synchronized = ignore # ignore/add/remove/force/not_defined # Add or remove space around the ':' in 'b ? t : f'. -sp_cond_colon = force # ignore/add/remove/force/not_defined +sp_cond_colon = force # ignore/add/remove/force/not_defined # Add or remove space before the ':' in 'b ? t : f'. # @@ -909,7 +928,7 @@ sp_cond_colon_before = ignore # ignore/add/remove/force/not_defined sp_cond_colon_after = ignore # ignore/add/remove/force/not_defined # Add or remove space around the '?' in 'b ? t : f'. -sp_cond_question = force # ignore/add/remove/force/not_defined +sp_cond_question = force # ignore/add/remove/force/not_defined # Add or remove space before the '?' in 'b ? t : f'. # @@ -936,11 +955,11 @@ sp_range = ignore # ignore/add/remove/force/not_defined # Add or remove space after ':' in a Java/C++11 range-based 'for', # as in 'for (Type var : expr)'. -sp_after_for_colon = force # ignore/add/remove/force/not_defined +sp_after_for_colon = force # ignore/add/remove/force/not_defined # Add or remove space before ':' in a Java/C++11 range-based 'for', # as in 'for (Type var : expr)'. -sp_before_for_colon = force # ignore/add/remove/force/not_defined +sp_before_for_colon = force # ignore/add/remove/force/not_defined # (D) Add or remove space between 'extern' and '(' as in 'extern (C)'. sp_extern_paren = ignore # ignore/add/remove/force/not_defined @@ -974,23 +993,23 @@ sp_after_new = ignore # ignore/add/remove/force/not_defined sp_between_new_paren = ignore # ignore/add/remove/force/not_defined # Add or remove space between ')' and type in 'new(foo) BAR'. -sp_after_newop_paren = force # ignore/add/remove/force/not_defined +sp_after_newop_paren = force # ignore/add/remove/force/not_defined -# Add or remove space inside parenthesis of the new operator +# Add or remove space inside parentheses of the new operator # as in 'new(foo) BAR'. -sp_inside_newop_paren = force # ignore/add/remove/force/not_defined +sp_inside_newop_paren = force # ignore/add/remove/force/not_defined # Add or remove space after the open parenthesis of the new operator, # as in 'new(foo) BAR'. # # Overrides sp_inside_newop_paren. -sp_inside_newop_paren_open = force # ignore/add/remove/force/not_defined +sp_inside_newop_paren_open = force # ignore/add/remove/force/not_defined # Add or remove space before the close parenthesis of the new operator, # as in 'new(foo) BAR'. # # Overrides sp_inside_newop_paren. -sp_inside_newop_paren_close = force # ignore/add/remove/force/not_defined +sp_inside_newop_paren_close = force # ignore/add/remove/force/not_defined # Add or remove space before a trailing comment. sp_before_tr_cmt = ignore # ignore/add/remove/force/not_defined @@ -1025,7 +1044,7 @@ sp_annotation_paren = ignore # ignore/add/remove/force/not_defined sp_skip_vbrace_tokens = false # true/false # Add or remove space after 'noexcept'. -sp_after_noexcept = force # ignore/add/remove/force/not_defined +sp_after_noexcept = force # ignore/add/remove/force/not_defined # Add or remove space after '_'. sp_vala_after_translation = ignore # ignore/add/remove/force/not_defined @@ -1042,15 +1061,21 @@ force_tab_after_define = false # true/false # Default: 8 indent_columns = 4 # unsigned number +# Whether to ignore indent for the first continuation line. Subsequent +# continuation lines will still be indented to match the first. +indent_ignore_first_continue = false # true/false + # The continuation indent. If non-zero, this overrides the indent of '(', '[' # and '=' continuation indents. Negative values are OK; negative value is # absolute and not increased for each '(' or '[' level. # # For FreeBSD, this is set to 4. -indent_continue = 4 # number +# Requires indent_ignore_first_continue=false. +indent_continue = 0 # number # The continuation indent, only for class header line(s). If non-zero, this # overrides the indent of 'class' continuation indents. +# Requires indent_ignore_first_continue=false. indent_continue_class_head = 0 # unsigned number # Whether to indent empty lines (i.e. lines which contain only spaces before @@ -1059,7 +1084,7 @@ indent_single_newlines = false # true/false # The continuation indent for func_*_param if they are true. If non-zero, this # overrides the indent. -indent_param = 4 # unsigned number +indent_param = 0 # unsigned number # How to use tabs when indenting code. # @@ -1068,7 +1093,7 @@ indent_param = 4 # unsigned number # 2: Indent and align with tabs, using spaces when not on a tabstop # # Default: 1 -indent_with_tabs = 0 # unsigned number +indent_with_tabs = 0 # unsigned number # Whether to indent comments that are not at a brace level with tabs on a # tabstop. Requires indent_with_tabs=2. If false, will use spaces. @@ -1112,7 +1137,7 @@ indent_cs_delegate_brace = false # true/false indent_cs_delegate_body = false # true/false # Whether to indent the body of a 'namespace'. -indent_namespace = true # true/false +indent_namespace = true # true/false # Whether to indent only the first namespace, and not any nested namespaces. # Requires indent_namespace=true. @@ -1126,16 +1151,23 @@ indent_namespace_level = 0 # unsigned number # indented. Requires indent_namespace=true. 0 means no limit. indent_namespace_limit = 0 # unsigned number +# Whether to indent only in inner namespaces (nested in other namespaces). +# Requires indent_namespace=true. +indent_namespace_inner_only = false # true/false + # Whether the 'extern "C"' body is indented. -indent_extern = true # true/false +indent_extern = true # true/false # Whether the 'class' body is indented. -indent_class = true # true/false +indent_class = true # true/false + +# Whether to ignore indent for the leading base class colon. +indent_ignore_before_class_colon = false # true/false # Additional indent before the leading base class colon. # Negative values decrease indent down to the first column. -# Requires a newline break before colon (see pos_class_colon -# and nl_class_colon) +# Requires indent_ignore_before_class_colon=false and a newline break before +# the colon (see pos_class_colon and nl_class_colon) indent_before_class_colon = 0 # number # Whether to indent the stuff after a leading base class colon. @@ -1145,6 +1177,9 @@ indent_class_colon = false # true/false # colon. Requires indent_class_colon=true. indent_class_on_colon = false # true/false +# Whether to ignore indent for a leading class initializer colon. +indent_ignore_before_constr_colon = false # true/false + # Whether to indent the stuff after a leading class initializer colon. indent_constr_colon = false # true/false @@ -1173,44 +1208,47 @@ indent_else_if = false # true/false indent_var_def_blk = 0 # number # Whether to indent continued variable declarations instead of aligning. -indent_var_def_cont = true # true/false +indent_var_def_cont = true # true/false -# Whether to indent continued shift expressions ('<<' and '>>') instead of -# aligning. Set align_left_shift=false when enabling this. -indent_shift = true # true/false +# How to indent continued shift expressions ('<<' and '>>'). +# Set align_left_shift=false when using this. +# 0: Align shift operators instead of indenting them (default) +# 1: Indent by one level +# -1: Preserve original indentation +indent_shift = 0 # number # Whether to force indentation of function definitions to start in column 1. indent_func_def_force_col1 = false # true/false # Whether to indent continued function call parameters one indent level, # rather than aligning parameters under the open parenthesis. -indent_func_call_param = true # true/false +indent_func_call_param = true # true/false # Whether to indent continued function definition parameters one indent level, # rather than aligning parameters under the open parenthesis. -indent_func_def_param = true # true/false +indent_func_def_param = true # true/false # for function definitions, only if indent_func_def_param is false # Allows to align params when appropriate and indent them when not # behave as if it was true if paren position is more than this value # if paren position is more than the option value -indent_func_def_param_paren_pos_threshold = 0 # unsigned number +indent_func_def_param_paren_pos_threshold = 4 # unsigned number # Whether to indent continued function call prototype one indent level, # rather than aligning parameters under the open parenthesis. -indent_func_proto_param = true # true/false +indent_func_proto_param = true # true/false # Whether to indent continued function call declaration one indent level, # rather than aligning parameters under the open parenthesis. -indent_func_class_param = true # true/false +indent_func_class_param = true # true/false # Whether to indent continued class variable constructors one indent level, # rather than aligning parameters under the open parenthesis. -indent_func_ctor_var_param = true # true/false +indent_func_ctor_var_param = true # true/false # Whether to indent continued template parameter list one indent level, # rather than aligning parameters under the open parenthesis. -indent_template_param = true # true/false +indent_template_param = true # true/false # Double the indent for indent_func_xxx_param options. # Use both values of the options indent_columns and indent_param. @@ -1240,7 +1278,7 @@ indent_member = 4 # unsigned number # Whether lines broken at '.' or '->' should be indented by a single indent. # The indent_member option will not be effective if this is set to true. -indent_member_single = true # true/false +indent_member_single = false # true/false # Spaces to indent single line ('//') comments on lines before code. indent_single_line_comments_before = 0 # unsigned number @@ -1264,6 +1302,9 @@ indent_switch_case = 4 # unsigned number # Usually the same as indent_columns or indent_switch_case. indent_switch_body = 0 # unsigned number +# Whether to ignore indent for '{' following 'case'. +indent_ignore_case_brace = true # true/false + # Spaces to indent '{' from 'case'. By default, the brace will appear under # the 'c' in case. Usually set to 0 or indent_columns. Negative values are OK. # It might be wise to choose the same value for the option indent_switch_case. @@ -1320,7 +1361,7 @@ indent_label = 1 # number # <=0: Subtract from brace indent # # Default: 1 -indent_access_spec = -2 # number +indent_access_spec = -2 # number # Whether to indent the code after an access specifier by one level. # If true, this option forces 'indent_access_spec=0'. @@ -1332,10 +1373,11 @@ indent_paren_nl = false # true/false # How to indent a close parenthesis after a newline. # -# 0: Indent to body level (default) -# 1: Align under the open parenthesis -# 2: Indent to the brace level -indent_paren_close = 0 # unsigned number +# 0: Indent to body level (default) +# 1: Align under the open parenthesis +# 2: Indent to the brace level +# -1: Preserve original indentation +indent_paren_close = 0 # number # Whether to indent the open parenthesis of a function definition, # if the parenthesis is on its own line. @@ -1349,24 +1391,41 @@ indent_paren_after_func_decl = false # true/false # if the parenthesis is on its own line. indent_paren_after_func_call = false # true/false -# Whether to indent a comma when inside a brace. -# If true, aligns under the open brace. -indent_comma_brace = false # true/false +# How to indent a comma when inside braces. +# 0: Indent by one level (default) +# 1: Align under the open brace +# -1: Preserve original indentation +indent_comma_brace = 0 # number -# Whether to indent a comma when inside a parenthesis. -# If true, aligns under the open parenthesis. -indent_comma_paren = false # true/false +# How to indent a comma when inside parentheses. +# 0: Indent by one level (default) +# 1: Align under the open parenthesis +# -1: Preserve original indentation +indent_comma_paren = 0 # number -# Whether to indent a Boolean operator when inside a parenthesis. -# If true, aligns under the open parenthesis. -indent_bool_paren = false # true/false +# How to indent a Boolean operator when inside parentheses. +# 0: Indent by one level (default) +# 1: Align under the open parenthesis +# -1: Preserve original indentation +indent_bool_paren = 0 # number + +# Whether to ignore the indentation of a Boolean operator when outside +# parentheses. +indent_ignore_bool = false # true/false + +# Whether to ignore the indentation of an arithmetic operator. +indent_ignore_arith = false # true/false # Whether to indent a semicolon when inside a for parenthesis. # If true, aligns under the open for parenthesis. indent_semicolon_for_paren = false # true/false +# Whether to ignore the indentation of a semicolon outside of a 'for' +# statement. +indent_ignore_semicolon = false # true/false + # Whether to align the first expression to following ones -# if indent_bool_paren=true. +# if indent_bool_paren=1. indent_first_bool_expr = false # true/false # Whether to align the first expression to following ones @@ -1380,11 +1439,14 @@ indent_square_nl = false # true/false # (ESQL/C) Whether to preserve the relative indent of 'EXEC SQL' bodies. indent_preserve_sql = false # true/false +# Whether to ignore the indentation of an assignment operator. +indent_ignore_assign = false # true/false + # Whether to align continued statements at the '='. If false or if the '=' is # followed by a newline, the next line is indent one tab. # # Default: true -indent_align_assign = false # true/false +indent_align_assign = false # true/false # If true, the indentation of the chunks after a '=' sequence will be set at # LHS token indentation column before '='. @@ -1475,7 +1537,7 @@ indent_using_block = true # true/false # How to indent the continuation of ternary operator. # # 0: Off (default) -# 1: When the `if_false` is a continuation, indent it under `if_false` +# 1: When the `if_false` is a continuation, indent it under the `if_true` branch # 2: When the `:` is a continuation, indent it under `?` indent_ternary_operator = 0 # unsigned number @@ -1503,31 +1565,36 @@ donot_indent_func_def_close_paren = false # true/false # Newline adding and removing options # -# Whether to collapse empty blocks between '{' and '}'. -# If true, overrides nl_inside_empty_func +# Whether to collapse empty blocks between '{' and '}' except for functions. +# Use nl_collapse_empty_body_functions to specify how empty function braces +# should be formatted. nl_collapse_empty_body = false # true/false +# Whether to collapse empty blocks between '{' and '}' for functions only. +# If true, overrides nl_inside_empty_func. +nl_collapse_empty_body_functions = false # true/false + # Don't split one-line braced assignments, as in 'foo_t f = { 1, 2 };'. -nl_assign_leave_one_liners = true # true/false +nl_assign_leave_one_liners = true # true/false # Don't split one-line braced statements inside a 'class xx { }' body. nl_class_leave_one_liners = false # true/false # Don't split one-line enums, as in 'enum foo { BAR = 15 };' -nl_enum_leave_one_liners = true # true/false +nl_enum_leave_one_liners = true # true/false # Don't split one-line get or set functions. -nl_getset_leave_one_liners = true # true/false +nl_getset_leave_one_liners = true # true/false # (C#) Don't split one-line property get or set functions. -nl_cs_property_leave_one_liners = true # true/false +nl_cs_property_leave_one_liners = true # true/false # Don't split one-line function definitions, as in 'int foo() { return 0; }'. # might modify nl_func_type_name -nl_func_leave_one_liners = true # true/false +nl_func_leave_one_liners = true # true/false # Don't split one-line C++11 lambdas, as in '[]() { return 0; }'. -nl_cpp_lambda_leave_one_liners = true # true/false +nl_cpp_lambda_leave_one_liners = true # true/false # Don't split one-line if/else statements, as in 'if(...) b++;'. nl_if_leave_one_liners = false # true/false @@ -1536,10 +1603,10 @@ nl_if_leave_one_liners = false # true/false nl_while_leave_one_liners = false # true/false # Don't split one-line do statements, as in 'do { b++; } while(...);'. -nl_do_leave_one_liners = true # true/false +nl_do_leave_one_liners = true # true/false # Don't split one-line for statements, as in 'for(...) b++;'. -nl_for_leave_one_liners = true # true/false +nl_for_leave_one_liners = true # true/false # (OC) Don't split one-line Objective-C messages. nl_oc_msg_leave_one_liner = false # true/false @@ -1586,7 +1653,7 @@ nl_assign_brace = ignore # ignore/add/remove/force/not_defined nl_assign_square = ignore # ignore/add/remove/force/not_defined # Add or remove newline between '[]' and '{'. -nl_tsquare_brace = force # ignore/add/remove/force/not_defined +nl_tsquare_brace = force # ignore/add/remove/force/not_defined # (D) Add or remove newline after '= ['. Will also affect the newline before # the ']'. @@ -1597,7 +1664,7 @@ nl_after_square_assign = ignore # ignore/add/remove/force/not_defined nl_fcall_brace = ignore # ignore/add/remove/force/not_defined # Add or remove newline between 'enum' and '{'. -nl_enum_brace = add # ignore/add/remove/force/not_defined +nl_enum_brace = add # ignore/add/remove/force/not_defined # Add or remove newline between 'enum' and 'class'. nl_enum_class = remove # ignore/add/remove/force/not_defined @@ -1612,62 +1679,62 @@ nl_enum_identifier_colon = remove # ignore/add/remove/force/not_defined nl_enum_colon_type = remove # ignore/add/remove/force/not_defined # Add or remove newline between 'struct and '{'. -nl_struct_brace = add # ignore/add/remove/force/not_defined +nl_struct_brace = add # ignore/add/remove/force/not_defined # Add or remove newline between 'union' and '{'. -nl_union_brace = add # ignore/add/remove/force/not_defined +nl_union_brace = add # ignore/add/remove/force/not_defined # Add or remove newline between 'if' and '{'. -nl_if_brace = add # ignore/add/remove/force/not_defined +nl_if_brace = add # ignore/add/remove/force/not_defined # Add or remove newline between '}' and 'else'. -nl_brace_else = add # ignore/add/remove/force/not_defined +nl_brace_else = add # ignore/add/remove/force/not_defined # Add or remove newline between 'else if' and '{'. If set to ignore, # nl_if_brace is used instead. -nl_elseif_brace = add # ignore/add/remove/force/not_defined +nl_elseif_brace = add # ignore/add/remove/force/not_defined # Add or remove newline between 'else' and '{'. -nl_else_brace = add # ignore/add/remove/force/not_defined +nl_else_brace = add # ignore/add/remove/force/not_defined # Add or remove newline between 'else' and 'if'. nl_else_if = ignore # ignore/add/remove/force/not_defined # Add or remove newline before '{' opening brace -nl_before_opening_brace_func_class_def = add # ignore/add/remove/force/not_defined +nl_before_opening_brace_func_class_def = add # ignore/add/remove/force/not_defined # Add or remove newline before 'if'/'else if' closing parenthesis. nl_before_if_closing_paren = ignore # ignore/add/remove/force/not_defined # Add or remove newline between '}' and 'finally'. -nl_brace_finally = add # ignore/add/remove/force/not_defined +nl_brace_finally = add # ignore/add/remove/force/not_defined # Add or remove newline between 'finally' and '{'. -nl_finally_brace = add # ignore/add/remove/force/not_defined +nl_finally_brace = add # ignore/add/remove/force/not_defined # Add or remove newline between 'try' and '{'. -nl_try_brace = add # ignore/add/remove/force/not_defined +nl_try_brace = add # ignore/add/remove/force/not_defined # Add or remove newline between get/set and '{'. -nl_getset_brace = add # ignore/add/remove/force/not_defined +nl_getset_brace = add # ignore/add/remove/force/not_defined # Add or remove newline between 'for' and '{'. -nl_for_brace = add # ignore/add/remove/force/not_defined +nl_for_brace = add # ignore/add/remove/force/not_defined # Add or remove newline before the '{' of a 'catch' statement, as in # 'catch (decl) {'. -nl_catch_brace = add # ignore/add/remove/force/not_defined +nl_catch_brace = add # ignore/add/remove/force/not_defined # (OC) Add or remove newline before the '{' of a '@catch' statement, as in # '@catch (decl) {'. If set to ignore, nl_catch_brace is used. -nl_oc_catch_brace = add # ignore/add/remove/force/not_defined +nl_oc_catch_brace = add # ignore/add/remove/force/not_defined # Add or remove newline between '}' and 'catch'. -nl_brace_catch = add # ignore/add/remove/force/not_defined +nl_brace_catch = add # ignore/add/remove/force/not_defined # (OC) Add or remove newline between '}' and '@catch'. If set to ignore, # nl_brace_catch is used. -nl_oc_brace_catch = add # ignore/add/remove/force/not_defined +nl_oc_brace_catch = add # ignore/add/remove/force/not_defined # Add or remove newline between '}' and ']'. nl_brace_square = ignore # ignore/add/remove/force/not_defined @@ -1679,7 +1746,7 @@ nl_brace_fparen = ignore # ignore/add/remove/force/not_defined nl_while_brace = ignore # ignore/add/remove/force/not_defined # (D) Add or remove newline between 'scope (x)' and '{'. -nl_scope_brace = add # ignore/add/remove/force/not_defined +nl_scope_brace = add # ignore/add/remove/force/not_defined # (D) Add or remove newline between 'unittest' and '{'. nl_unittest_brace = ignore # ignore/add/remove/force/not_defined @@ -1740,7 +1807,7 @@ nl_case_colon_brace = ignore # ignore/add/remove/force/not_defined nl_before_throw = ignore # ignore/add/remove/force/not_defined # Add or remove newline between 'namespace' and '{'. -nl_namespace_brace = ignore # ignore/add/remove/force/not_defined +nl_namespace_brace = force # ignore/add/remove/force/not_defined # Add or remove newline after 'template<...>' of a template class. nl_template_class = ignore # ignore/add/remove/force/not_defined @@ -1809,7 +1876,7 @@ nl_class_init_args = ignore # ignore/add/remove/force/not_defined # Add or remove newline after each ',' in the constructor member # initialization. Related to nl_constr_colon, pos_constr_colon and # pos_constr_comma. -nl_constr_init_args = force # ignore/add/remove/force/not_defined +nl_constr_init_args = force # ignore/add/remove/force/not_defined # Add or remove newline before first element, after comma, and after last # element, in 'enum'. @@ -1959,6 +2026,12 @@ nl_template_end = false # true/false # See nl_oc_msg_leave_one_liner. nl_oc_msg_args = false # true/false +# (OC) Minimum number of Objective-C message parameters before applying nl_oc_msg_args. +nl_oc_msg_args_min_params = 0 # unsigned number + +# (OC) Max code width of Objective-C message before applying nl_oc_msg_args. +nl_oc_msg_args_max_code_width = 0 # unsigned number + # Add or remove newline between function signature and '{'. nl_fdef_brace = ignore # ignore/add/remove/force/not_defined @@ -1972,6 +2045,9 @@ nl_cpp_ldef_brace = ignore # ignore/add/remove/force/not_defined # Add or remove newline between 'return' and the return expression. nl_return_expr = ignore # ignore/add/remove/force/not_defined +# Add or remove newline between 'throw' and the throw expression. +nl_throw_expr = ignore # ignore/add/remove/force/not_defined + # Whether to add a newline after semicolons, except in 'for' statements. nl_after_semicolon = false # true/false @@ -1980,7 +2056,8 @@ nl_after_semicolon = false # true/false nl_paren_dbrace_open = ignore # ignore/add/remove/force/not_defined # Whether to add a newline after the type in an unnamed temporary -# direct-list-initialization. +# direct-list-initialization, better: +# before a direct-list-initialization. nl_type_brace_init_lst = ignore # ignore/add/remove/force/not_defined # Whether to add a newline after the open brace in an unnamed temporary @@ -2164,7 +2241,7 @@ nl_max_blank_in_func = 0 # unsigned number # The number of newlines inside an empty function body. # This option overrides eat_blanks_after_open_brace and # eat_blanks_before_close_brace, but is ignored when -# nl_collapse_empty_body=true +# nl_collapse_empty_body_functions=true nl_inside_empty_func = 0 # unsigned number # The number of newlines before a function prototype. @@ -2216,12 +2293,6 @@ nl_after_func_body_class = 0 # unsigned number # Overrides nl_after_func_body and nl_after_func_body_class. nl_after_func_body_one_liner = 0 # unsigned number -# The number of blank lines after a block of variable definitions at the top -# of a function body. -# -# 0: No change (default). -nl_func_var_def_blk = 0 # unsigned number - # The number of newlines before a block of typedefs. If nl_after_access_spec # is non-zero, that option takes precedence. # @@ -2238,15 +2309,27 @@ nl_typedef_blk_end = 0 # unsigned number # 0: No change (default). nl_typedef_blk_in = 0 # unsigned number -# The number of newlines before a block of variable definitions not at the top -# of a function body. If nl_after_access_spec is non-zero, that option takes -# precedence. +# The minimum number of blank lines after a block of variable definitions +# at the top of a function body. If any preprocessor directives appear +# between the opening brace of the function and the variable block, then +# it is considered as not at the top of the function.Newlines are added +# before trailing preprocessor directives, if any exist. +# +# 0: No change (default). +nl_var_def_blk_end_func_top = 0 # unsigned number + +# The minimum number of empty newlines before a block of variable definitions +# not at the top of a function body. If nl_after_access_spec is non-zero, +# that option takes precedence. Newlines are not added at the top of the +# file or just after an opening brace. Newlines are added above any +# preprocessor directives before the block. # # 0: No change (default). nl_var_def_blk_start = 0 # unsigned number -# The number of newlines after a block of variable definitions not at the top -# of a function body. +# The minimum number of empty newlines after a block of variable definitions +# not at the top of a function body. Newlines are not added if the block +# is at the bottom of the file or just before a preprocessor directive. # # 0: No change (default). nl_var_def_blk_end = 0 # unsigned number @@ -2435,7 +2518,7 @@ pos_shift = ignore # ignore/break/force/lead/trail/join/ # # Try to limit code width to N columns. -code_width = 100 # unsigned number +code_width = 100 # unsigned number # Whether to fully split long 'for' statements at semi-colons. ls_for_split_full = false # true/false @@ -2573,6 +2656,22 @@ align_assign_func_proto_span = 0 # unsigned number # 0: No limit (default). align_assign_thresh = 0 # number +# Whether to align on the left most assignment when multiple +# definitions are found on the same line. +# Depends on 'align_assign_span' and 'align_assign_thresh' settings. +align_assign_on_multi_var_defs = false # true/false + +# The span for aligning on '{' in braced init list. +# +# 0: Don't align (default). +align_braced_init_list_span = 0 # unsigned number + +# The threshold for aligning on '{' in braced init list. +# Use a negative number for absolute thresholds. +# +# 0: No limit (default). +align_braced_init_list_thresh = 0 # number + # How to apply align_assign_span to function declaration "assignments", i.e. # 'virtual void foo() = 0' or '~foo() = {default|delete}'. # @@ -2778,7 +2877,7 @@ align_oc_decl_colon = false # true/false # (OC) Whether to not align parameters in an Objectve-C message call if first # colon is not on next line of the message call (the same way Xcode does -# aligment) +# alignment) align_oc_msg_colon_xcode_like = false # true/false # @@ -2832,7 +2931,7 @@ cmt_reflow_indent_to_paragraph_start = false # true/false # Whether to convert all tabs to spaces in comments. If false, tabs in # comments are left alone, unless used for indenting. -cmt_convert_tab_to_spaces = true # true/false +cmt_convert_tab_to_spaces = true # true/false # Whether to apply changes to multi-line comments, including cmt_width, # keyword substitution and leading chars. @@ -2978,12 +3077,17 @@ mod_full_brace_function = ignore # ignore/add/remove/force/not_defined mod_full_brace_if = ignore # ignore/add/remove/force/not_defined # Whether to enforce that all blocks of an 'if'/'else if'/'else' chain either -# have, or do not have, braces. If true, braces will be added if any block -# needs braces, and will only be removed if they can be removed from all -# blocks. +# have, or do not have, braces. Overrides mod_full_brace_if. # -# Overrides mod_full_brace_if. -mod_full_brace_if_chain = false # true/false +# 0: Don't override mod_full_brace_if +# 1: Add braces to all blocks if any block needs braces and remove braces if +# they can be removed from all blocks +# 2: Add braces to all blocks if any block already has braces, regardless of +# whether it needs them +# 3: Add braces to all blocks if any block needs braces and remove braces if +# they can be removed from all blocks, except if all blocks have braces +# despite none needing them +mod_full_brace_if_chain = 0 # unsigned number # Whether to add braces to all blocks of an 'if'/'else if'/'else' chain. # If true, mod_full_brace_if_chain will only remove braces from an 'if' that @@ -3015,9 +3119,12 @@ mod_full_brace_nl = 0 # unsigned number # mod_full_brace_function mod_full_brace_nl_block_rem_mlcond = false # true/false -# Add or remove unnecessary parenthesis on 'return' statement. +# Add or remove unnecessary parentheses on 'return' statement. mod_paren_on_return = ignore # ignore/add/remove/force/not_defined +# Add or remove unnecessary parentheses on 'throw' statement. +mod_paren_on_throw = ignore # ignore/add/remove/force/not_defined + # (Pawn) Whether to change optional semicolons to real semicolons. mod_pawn_semicolon = false # true/false @@ -3025,11 +3132,19 @@ mod_pawn_semicolon = false # true/false # statement, as in 'if (a && b > c)' => 'if (a && (b > c))'. mod_full_paren_if_bool = false # true/false +# Whether to fully parenthesize Boolean expressions after '=' +# statement, as in 'x = a && b > c;' => 'x = (a && (b > c));'. +mod_full_paren_assign_bool = false # true/false + +# Whether to fully parenthesize Boolean expressions after '=' +# statement, as in 'return a && b > c;' => 'return (a && (b > c));'. +mod_full_paren_return_bool = false # true/false + # Whether to remove superfluous semicolons. mod_remove_extra_semicolon = false # true/false # Whether to remove duplicate include. -mod_remove_duplicate_include = true # true/false +mod_remove_duplicate_include = true # true/false # If a function body exceeds the specified number of newlines and doesn't have # a comment after the close brace, a comment will be added. @@ -3092,6 +3207,10 @@ mod_sort_incl_import_grouping_enabled = false # true/false # the close brace, as in 'case X: { ... } break;' => 'case X: { ... break; }'. mod_move_case_break = false # true/false +# Whether to move a 'return' that appears after a fully braced 'case' before +# the close brace, as in 'case X: { ... } return;' => 'case X: { ... return; }'. +mod_move_case_return = false # true/false + # Add or remove braces around a fully braced case statement. Will only remove # braces if there are no variable declarations in the block. mod_case_brace = ignore # ignore/add/remove/force/not_defined @@ -3103,6 +3222,49 @@ mod_remove_empty_return = false # true/false # Add or remove the comma after the last value of an enumeration. mod_enum_last_comma = ignore # ignore/add/remove/force/not_defined +# Syntax to use for infinite loops. +# +# 0: Leave syntax alone (default) +# 1: Rewrite as `for(;;)` +# 2: Rewrite as `while(true)` +# 3: Rewrite as `do`...`while(true);` +# 4: Rewrite as `while(1)` +# 5: Rewrite as `do`...`while(1);` +# +# Infinite loops that do not already match one of these syntaxes are ignored. +# Other options that affect loop formatting will be applied after transforming +# the syntax. +mod_infinite_loop = 0 # unsigned number + +# Add or remove the 'int' keyword in 'int short'. +mod_int_short = ignore # ignore/add/remove/force/not_defined + +# Add or remove the 'int' keyword in 'short int'. +mod_short_int = ignore # ignore/add/remove/force/not_defined + +# Add or remove the 'int' keyword in 'int long'. +mod_int_long = ignore # ignore/add/remove/force/not_defined + +# Add or remove the 'int' keyword in 'long int'. +mod_long_int = ignore # ignore/add/remove/force/not_defined + +# Add or remove the 'int' keyword in 'int signed'. +mod_int_signed = ignore # ignore/add/remove/force/not_defined + +# Add or remove the 'int' keyword in 'signed int'. +mod_signed_int = ignore # ignore/add/remove/force/not_defined + +# Add or remove the 'int' keyword in 'int unsigned'. +mod_int_unsigned = ignore # ignore/add/remove/force/not_defined + +# Add or remove the 'int' keyword in 'unsigned int'. +mod_unsigned_int = ignore # ignore/add/remove/force/not_defined + +# If there is a situation where mod_int_* and mod_*_int would result in +# multiple int keywords, whether to keep the rightmost int (the default) or the +# leftmost int. +mod_int_prefer_int_on_left = false # true/false + # (OC) Whether to organize the properties. If true, properties will be # rearranged according to the mod_sort_oc_property_*_weight factors. mod_sort_oc_properties = false # true/false @@ -3134,6 +3296,16 @@ mod_sort_oc_property_nullability_weight = 0 # number # Preprocessor options # +# How to use tabs when indenting preprocessor code. +# +# -1: Use 'indent_with_tabs' setting (default) +# 0: Spaces only +# 1: Indent with tabs to brace level, align with spaces +# 2: Indent and align with tabs, using spaces when not on a tabstop +# +# Default: -1 +pp_indent_with_tabs = -1 # number + # Add or remove indentation of preprocessor directives inside #if blocks # at brace level 0 (file-level). pp_indent = ignore # ignore/add/remove/force/not_defined @@ -3142,6 +3314,10 @@ pp_indent = ignore # ignore/add/remove/force/not_defined # indented from column 1. pp_indent_at_level = false # true/false +# Whether to indent #if/#else/#endif at the parenthesis level if the brace +# level is 0. If false, these are indented from column 1. +pp_indent_at_level0 = false # true/false + # Specifies the number of columns to indent preprocessors per level # at brace level 0 (file-level). If pp_indent_at_level=false, also specifies # the number of columns to indent preprocessors per level @@ -3150,10 +3326,10 @@ pp_indent_at_level = false # true/false # Default: 1 pp_indent_count = 1 # unsigned number -# Add or remove space after # based on pp_level of #if blocks. -pp_space = ignore # ignore/add/remove/force/not_defined +# Add or remove space after # based on pp level of #if blocks. +pp_space_after = ignore # ignore/add/remove/force/not_defined -# Sets the number of spaces per level added with pp_space. +# Sets the number of spaces per level added with pp_space_after. pp_space_count = 0 # unsigned number # The indent for '#region' and '#endregion' in C# and '#pragma region' in @@ -3186,33 +3362,70 @@ pp_include_at_level = false # true/false # Whether to ignore the '#define' body while formatting. pp_ignore_define_body = false # true/false +# An offset value that controls the indentation of the body of a multiline #define. +# 'body' refers to all the lines of a multiline #define except the first line. +# Requires 'pp_ignore_define_body = false'. +# +# <0: Absolute column: the body indentation starts off at the specified column +# (ex. -3 ==> the body is indented starting from column 3) +# >=0: Relative to the column of the '#' of '#define' +# (ex. 3 ==> the body is indented starting 3 columns at the right of '#') +# +# Default: 8 +pp_multiline_define_body_indent = 8 # number + # Whether to indent case statements between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the case statements +# Only applies to the indent of the preprocessor that the case statements # directly inside of. # # Default: true pp_indent_case = true # true/false # Whether to indent whole function definitions between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the function definition +# Only applies to the indent of the preprocessor that the function definition # is directly inside of. # # Default: true pp_indent_func_def = true # true/false # Whether to indent extern C blocks between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the extern block is +# Only applies to the indent of the preprocessor that the extern block is # directly inside of. # # Default: true pp_indent_extern = true # true/false -# Whether to indent braces directly inside #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the braces are directly -# inside of. +# How to indent braces directly inside #if, #else, and #endif. +# Requires pp_if_indent_code=true and only applies to the indent of the +# preprocessor that the braces are directly inside of. +# 0: No extra indent +# 1: Indent by one level +# -1: Preserve original indentation # -# Default: true -pp_indent_brace = true # true/false +# Default: 1 +pp_indent_brace = 1 # number + +# Whether to print warning messages for unbalanced #if and #else blocks. +# This will print a message in the following cases: +# - if an #ifdef block ends on a different indent level than +# where it started from. Example: +# +# #ifdef TEST +# int i; +# { +# int j; +# #endif +# +# - an #elif/#else block ends on a different indent level than +# the corresponding #ifdef block. Example: +# +# #ifdef TEST +# int i; +# #else +# } +# int j; +# #endif +pp_warn_unbalanced_if = false # true/false # # Sort includes options @@ -3251,17 +3464,16 @@ use_indent_func_call_param = true # true/false # # true: indent_continue will be used only once # false: indent_continue will be used every time (default) +# +# Requires indent_ignore_first_continue=false. use_indent_continue_only_once = false # true/false -# The value might be used twice: -# - at the assignment -# - at the opening brace +# The indentation can be: +# - after the assignment, at the '[' character +# - at the beginning of the lambda body # -# To prevent the double use of the indentation value, use this option with the -# value 'true'. -# -# true: indentation will be used only once -# false: indentation will be used every time (default) +# true: indentation will be at the beginning of the lambda body +# false: indentation will be after the assignment (default) indent_cpp_lambda_only_once = false # true/false # Whether sp_after_angle takes precedence over sp_inside_fparen. This was the @@ -3313,6 +3525,18 @@ debug_timeout = 0 # number # 0: do not truncate. debug_truncate = 0 # unsigned number +# sort (or not) the tracking info. +# +# Default: true +debug_sort_the_tracks = true # true/false + +# decode (or not) the flags as a new line. +# only if the -p option is set. +debug_decode_the_flags = false # true/false + +# insert the number of the line at the beginning of each line +set_numbering_for_html_output = false # true/false + # Meaning of the settings: # Ignore - do not do any changes # Add - makes sure there is 1 or more space/brace/newline/etc @@ -3365,8 +3589,11 @@ debug_truncate = 0 # unsigned number # `macro-close END_MESSAGE_MAP` # # -# option(s) with 'not default' value: 0 -# -type QWindow -type QQuickItem +#type QQuickItem +#type QWindow +#type QObject +type int QT_VERSION_CHECK + +# option(s) with 'not default' value: 116 +# diff --git a/examples/boxes/Box.cpp b/examples/boxes/Box.cpp index bac88653..f5e3891f 100644 --- a/examples/boxes/Box.cpp +++ b/examples/boxes/Box.cpp @@ -218,7 +218,7 @@ void Box::setGradient( FillType fillType, QskGradientStops stops; stops += QskGradientStop( 0.0, color1 ); stops += QskGradientStop( 1.0, color2 ); - + setGradient( fillType, stops ); } diff --git a/examples/boxes/main.cpp b/examples/boxes/main.cpp index ae68f825..d1186fc7 100644 --- a/examples/boxes/main.cpp +++ b/examples/boxes/main.cpp @@ -25,7 +25,7 @@ namespace { // Some leftover definitions from M(aterial)2. TODO ... - + constexpr const QRgb Grey400 = 0xffbdbdbd; constexpr const QRgb Grey500 = 0xff9e9e9e; @@ -418,7 +418,8 @@ static void addColoredBorderRectangles1( QskLinearBox* parent, box->setShape( 30, Qt::AbsoluteSize ); } -static void addColoredBorderRectangles2( QskLinearBox* parent, bool rounded, Box::FillType fillType ) +static void addColoredBorderRectangles2( QskLinearBox* parent, + bool rounded, Box::FillType fillType ) { Box* box = new Box( parent ); box->setBorderWidth( 20 ); @@ -431,7 +432,8 @@ static void addColoredBorderRectangles2( QskLinearBox* parent, bool rounded, Box box->setShape( 30, Qt::AbsoluteSize ); } -static void addColoredBorderRectangles3( QskLinearBox* parent, bool rounded, Box::FillType fillType ) +static void addColoredBorderRectangles3( QskLinearBox* parent, + bool rounded, Box::FillType fillType ) { Box* box = new Box( parent ); box->setBorderWidth( 20 ); @@ -471,7 +473,8 @@ static void addColoredBorderRectangles3( QskLinearBox* parent, bool rounded, Box box->setShape( 30, Qt::AbsoluteSize ); } -static void addColoredBorderRectangles4( QskLinearBox* parent, bool rounded, Box::FillType fillType ) +static void addColoredBorderRectangles4( QskLinearBox* parent, + bool rounded, Box::FillType fillType ) { Box* box = new Box( parent ); box->setBorderWidth( 20 ); @@ -485,7 +488,8 @@ static void addColoredBorderRectangles4( QskLinearBox* parent, bool rounded, Box box->setShape( 30, Qt::AbsoluteSize ); } -static void addColoredBorderRectangles5( QskLinearBox* parent, bool rounded, Box::FillType fillType ) +static void addColoredBorderRectangles5( QskLinearBox* parent, + bool rounded, Box::FillType fillType ) { Box* box = new Box( parent ); box->setBorderWidth( 20 ); diff --git a/examples/iotdashboard/BoxWithButtons.cpp b/examples/iotdashboard/BoxWithButtons.cpp index c9eb01bb..eac4f89a 100644 --- a/examples/iotdashboard/BoxWithButtons.cpp +++ b/examples/iotdashboard/BoxWithButtons.cpp @@ -41,9 +41,10 @@ namespace }; } -BoxWithButtons::BoxWithButtons( const QString& title, const QString &prefix, - const int initialValue, const QString &suffix, - bool isBright, QQuickItem* parent ) +BoxWithButtons::BoxWithButtons( + const QString& title, const QString& prefix, + const int initialValue, const QString& suffix, + bool isBright, QQuickItem* parent ) : Box( QString(), parent ) , m_prefix( prefix ) , m_suffix( suffix ) diff --git a/examples/iotdashboard/BoxWithButtons.h b/examples/iotdashboard/BoxWithButtons.h index 247be00f..55dd539b 100644 --- a/examples/iotdashboard/BoxWithButtons.h +++ b/examples/iotdashboard/BoxWithButtons.h @@ -14,9 +14,10 @@ class BoxWithButtons : public Box public: QSK_SUBCONTROLS( Panel, ValuePanel, ValueText ) - BoxWithButtons( const QString& title, const QString& prefix, - const int initialValue, const QString& suffix, - bool isBright, QQuickItem* parent = nullptr ); + BoxWithButtons( + const QString& title, const QString& prefix, + const int initialValue, const QString& suffix, + bool isBright, QQuickItem* parent = nullptr ); private: void setValue( const int value ); diff --git a/examples/iotdashboard/Diagram.h b/examples/iotdashboard/Diagram.h index 9b0074a4..942f90f6 100644 --- a/examples/iotdashboard/Diagram.h +++ b/examples/iotdashboard/Diagram.h @@ -15,9 +15,9 @@ class Diagram : public QskControl public: QSK_SUBCONTROLS( Chart, Segments, - ChartLine1, ChartArea1, ChartLine2, - ChartArea2, ChartLine3, ChartArea3, - ChartBar1, ChartBar2, ChartBar3 ) + ChartLine1, ChartArea1, ChartLine2, + ChartArea2, ChartLine3, ChartArea3, + ChartBar1, ChartBar2, ChartBar3 ) enum Type { diff --git a/examples/iotdashboard/DiagramSkinlet.cpp b/examples/iotdashboard/DiagramSkinlet.cpp index 82d5cffb..a5505d30 100644 --- a/examples/iotdashboard/DiagramSkinlet.cpp +++ b/examples/iotdashboard/DiagramSkinlet.cpp @@ -26,17 +26,17 @@ namespace switch( type ) { - case Diagram::Line: - row = 0; - break; + case Diagram::Line: + row = 0; + break; - case Diagram::Area: - row = 1; - break; + case Diagram::Area: + row = 1; + break; - case Diagram::Bar: - row = 2; - break; + case Diagram::Bar: + row = 2; + break; } return subcontrols[ row * 3 + i ]; @@ -146,7 +146,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node if( barsNode->childCount() > k ) { - barNode = static_cast< QskBoxRectangleNode* >( barsNode->childAtIndex( k ) ); + barNode = static_cast< QskBoxRectangleNode* >( + barsNode->childAtIndex( k ) ); } else { @@ -181,7 +182,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node if( chartNode->childCount() > nodeIndex ) { - dataPointNode = static_cast< DiagramDataNode* >( chartNode->childAtIndex( nodeIndex ) ); + dataPointNode = static_cast< DiagramDataNode* >( + chartNode->childAtIndex( nodeIndex ) ); } else { @@ -202,7 +204,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node color = diagram->color( areaSubcontrol ); } - dataPointNode->update( rect, nodeType, color, dataPoints, yMax, false, lineWidth ); + dataPointNode->update( rect, nodeType, color, + dataPoints, yMax, false, lineWidth ); } nodeIndex++; } diff --git a/examples/iotdashboard/LightDisplay.cpp b/examples/iotdashboard/LightDisplay.cpp index 42dd8713..079b68d8 100644 --- a/examples/iotdashboard/LightDisplay.cpp +++ b/examples/iotdashboard/LightDisplay.cpp @@ -22,7 +22,8 @@ QSK_SUBCONTROL( LightDisplay, Knob ) QSK_STATE( LightDisplay, Pressed, ( QskAspect::FirstUserState << 1 ) ) -namespace { +namespace +{ bool angleInRange( const QskArcMetrics& metrics, qreal angle ) { return angle >= metrics.startAngle() && angle <= metrics.endAngle(); @@ -123,7 +124,7 @@ void LightDisplay::mouseReleaseEvent( QMouseEvent* /*event*/ ) qreal LightDisplay::angleFromPoint( const QRectF& rect, const QPointF& point ) const { QPointF circlePos( point.x() - rect.center().x(), - rect.center().y() - point.y() ); + rect.center().y() - point.y() ); const qreal atan = qAtan2( circlePos.y(), circlePos.x() ); const qreal angle = qRadiansToDegrees( atan ); diff --git a/examples/iotdashboard/LightDisplay.h b/examples/iotdashboard/LightDisplay.h index 9049a5b3..5d6074fb 100644 --- a/examples/iotdashboard/LightDisplay.h +++ b/examples/iotdashboard/LightDisplay.h @@ -15,7 +15,7 @@ class LightDisplay : public QskBoundedValueInput public: QSK_SUBCONTROLS( Panel, Groove, ColdAndWarmArc, Tickmarks, ValueText, - LeftLabel, RightLabel, Knob ) // ### rename knob to handle? + LeftLabel, RightLabel, Knob ) // ### rename knob to handle? QSK_STATES( Pressed ) LightDisplay( QQuickItem* parent = nullptr ); diff --git a/examples/iotdashboard/LightDisplaySkinlet.cpp b/examples/iotdashboard/LightDisplaySkinlet.cpp index 6c6308bc..ecb17879 100644 --- a/examples/iotdashboard/LightDisplaySkinlet.cpp +++ b/examples/iotdashboard/LightDisplaySkinlet.cpp @@ -39,7 +39,8 @@ QRectF LightDisplaySkinlet::subControlRect( const QskSkinnable* skinnable, { const auto textSize = textLabelsSize( display ); const auto arcMetrics = display->arcMetricsHint( LightDisplay::ColdAndWarmArc ); - const qreal ticksWidth = display->arcMetricsHint( LightDisplay::Tickmarks ).width() + ticksSpacing; + const qreal ticksWidth = display->arcMetricsHint( + LightDisplay::Tickmarks ).width() + ticksSpacing; const qreal x = textSize.width() + arcMetrics.width() + ticksWidth; const qreal w = contentsRect.width() - @@ -104,7 +105,8 @@ QRectF LightDisplaySkinlet::subControlRect( const QskSkinnable* skinnable, } else if( subControl == LightDisplay::Knob ) { - const auto arcRect = subControlRect( skinnable, contentsRect, LightDisplay::ColdAndWarmArc ); + const auto arcRect = subControlRect( skinnable, + contentsRect, LightDisplay::ColdAndWarmArc ); const auto arcMetrics = display->arcMetricsHint( LightDisplay::ColdAndWarmArc ); const auto knobSize = display->strutSizeHint( LightDisplay::Knob ); @@ -165,19 +167,18 @@ QSGNode* LightDisplaySkinlet::updateSubNode( case ValueTextRole: { const QString valueText = QString::number( display->value(), 'f', 0 ) - + QStringLiteral( " %" ); - return updateTextNode( skinnable, node, valueText, - LightDisplay::ValueText ); + + QStringLiteral( " %" ); + return updateTextNode( skinnable, node, valueText, LightDisplay::ValueText ); } case LeftLabelRole: { - return updateTextNode( skinnable, node, QStringLiteral( "0 " ), - LightDisplay::LeftLabel ); + return updateTextNode( skinnable, node, + QStringLiteral( "0 " ), LightDisplay::LeftLabel ); } case RightLabelRole: { - return updateTextNode( skinnable, node, QStringLiteral( " 100" ), - LightDisplay::RightLabel ); + return updateTextNode( skinnable, node, + QStringLiteral( " 100" ), LightDisplay::RightLabel ); } case KnobRole: { diff --git a/examples/iotdashboard/MainItem.cpp b/examples/iotdashboard/MainItem.cpp index 225fa16c..36a17243 100644 --- a/examples/iotdashboard/MainItem.cpp +++ b/examples/iotdashboard/MainItem.cpp @@ -199,20 +199,24 @@ void Cube::keyPressEvent( QKeyEvent* event ) switch( event->key() ) { - case Qt::Key_Up: - direction = Qsk::TopToBottom; - break; - case Qt::Key_Down: - direction = Qsk::BottomToTop; - break; - case Qt::Key_Left: - direction = Qsk::LeftToRight; - break; - case Qt::Key_Right: - direction = Qsk::RightToLeft; - break; - default: - return; + case Qt::Key_Up: + direction = Qsk::TopToBottom; + break; + + case Qt::Key_Down: + direction = Qsk::BottomToTop; + break; + + case Qt::Key_Left: + direction = Qsk::LeftToRight; + break; + + case Qt::Key_Right: + direction = Qsk::RightToLeft; + break; + + default: + return; } switchPosition( direction ); @@ -307,7 +311,7 @@ MainItem::MainItem( QQuickItem* parent ) void MainItem::gestureEvent( QskGestureEvent* event ) { if( event->gesture()->state() == QskGesture::Finished - && event->gesture()->type() == QskGesture::Pan ) + && event->gesture()->type() == QskGesture::Pan ) { const auto* panGesture = static_cast< const QskPanGesture* >( event->gesture().get() ); diff --git a/examples/iotdashboard/MainItem.h b/examples/iotdashboard/MainItem.h index 0bde2792..9d7ef47d 100644 --- a/examples/iotdashboard/MainItem.h +++ b/examples/iotdashboard/MainItem.h @@ -14,70 +14,72 @@ class Cube : public QskStackBox { Q_OBJECT - public: - enum Edge { - LeftEdge = Qsk::LeftToRight, - RightEdge = Qsk::RightToLeft, - TopEdge = Qsk::TopToBottom, - BottomEdge = Qsk::BottomToTop, - NumEdges - }; - Q_ENUM( Edge ) + public: + enum Edge + { + LeftEdge = Qsk::LeftToRight, + RightEdge = Qsk::RightToLeft, + TopEdge = Qsk::TopToBottom, + BottomEdge = Qsk::BottomToTop, + NumEdges + }; + Q_ENUM( Edge ) - enum Position { - LeftPos = LeftEdge, - RightPos = RightEdge, - TopPos = TopEdge, - BottomPos = BottomEdge, - FrontPos, - BackPos, - NumPositions - }; - Q_ENUM( Position ) + enum Position + { + LeftPos = LeftEdge, + RightPos = RightEdge, + TopPos = TopEdge, + BottomPos = BottomEdge, + FrontPos, + BackPos, + NumPositions + }; + Q_ENUM( Position ) - explicit Cube( QQuickItem* parent = nullptr ); + explicit Cube( QQuickItem* parent = nullptr ); - public Q_SLOTS: - void switchPosition( const Qsk::Direction direction ); - void switchToPosition( const Cube::Position position ); + public Q_SLOTS: + void switchPosition( const Qsk::Direction direction ); + void switchToPosition( const Cube::Position position ); - Q_SIGNALS: - // might be different from indexChanged: - void cubeIndexChanged( const int index ); + Q_SIGNALS: + // might be different from indexChanged: + void cubeIndexChanged( const int index ); - protected: - void keyPressEvent( QKeyEvent* event ) override; + protected: + void keyPressEvent( QKeyEvent* event ) override; - private: - Position currentPosition() const; - Position neighbor( const Position position, const Qsk::Direction direction ) const; - Qsk::Direction direction( const Position from, const Position to ) const; - void updateEdge( Qsk::Direction direction, Position position ); - void doSwitch( Qsk::Direction direction, Position position ); + private: + Position currentPosition() const; + Position neighbor( const Position position, const Qsk::Direction direction ) const; + Qsk::Direction direction( const Position from, const Position to ) const; + void updateEdge( Qsk::Direction direction, Position position ); + void doSwitch( Qsk::Direction direction, Position position ); - Position m_destination; - Edge m_currentEdge; - bool m_isIntermediateHop; + Position m_destination; + Edge m_currentEdge; + bool m_isIntermediateHop; - static QPair< Position, Edge > s_neighbors[ NumPositions ][ NumEdges ]; - static Edge s_edgeTransformations[ NumEdges ][ NumEdges ]; + static QPair< Position, Edge > s_neighbors[ NumPositions ][ NumEdges ]; + static Edge s_edgeTransformations[ NumEdges ][ NumEdges ]; }; class MainItem : public QskControl { Q_OBJECT - public: - MainItem( QQuickItem* parent = nullptr ); + public: + MainItem( QQuickItem* parent = nullptr ); - protected: - bool eventFilter(QObject *obj, QEvent *event) override final; - bool gestureFilter( QQuickItem*, QEvent* ) override final; - void gestureEvent( QskGestureEvent* ) override final; + protected: + bool eventFilter(QObject* obj, QEvent* event) override final; + bool gestureFilter( QQuickItem*, QEvent* ) override final; + void gestureEvent( QskGestureEvent* ) override final; - private: - QskLinearBox* m_mainLayout; - MenuBar* m_menuBar; - Cube* m_cube; - QskPanGestureRecognizer m_panRecognizer; + private: + QskLinearBox* m_mainLayout; + MenuBar* m_menuBar; + Cube* m_cube; + QskPanGestureRecognizer m_panRecognizer; }; diff --git a/examples/iotdashboard/RoomsPage.cpp b/examples/iotdashboard/RoomsPage.cpp index cdfb8c81..595cc2be 100644 --- a/examples/iotdashboard/RoomsPage.cpp +++ b/examples/iotdashboard/RoomsPage.cpp @@ -73,7 +73,8 @@ RoomsPage::RoomsPage( QQuickItem* parent ) const QVector< qreal > livingRoomWater = { 5, 8, 13, 2, 3, 9, 11 }; const QVector< qreal > livingRoomElectricity = { 1, 8, 7, 4, 12, 6, 5 }; const QVector< qreal > livingRoomGas = { 10, 11, 5, 8, 3, 1, 7 }; - auto livingRoomDiagram = new RoomsDiagram( livingRoomWater, livingRoomElectricity, livingRoomGas ); + auto livingRoomDiagram = new RoomsDiagram( + livingRoomWater, livingRoomElectricity, livingRoomGas ); gridBox->addItem( new UsageDiagramBox( "Living Room", livingRoomDiagram ), 0, 0 ); const QVector< qreal > bedroomWater = { 8, 6, 11, 2, 5, 4, 9 }; diff --git a/examples/iotdashboard/RoundedIcon.h b/examples/iotdashboard/RoundedIcon.h index b448c42c..916a5f53 100644 --- a/examples/iotdashboard/RoundedIcon.h +++ b/examples/iotdashboard/RoundedIcon.h @@ -15,7 +15,8 @@ class RoundedIcon : public QskPushButton QSK_SUBCONTROLS( Panel, PalePanel, Graphic ) QSK_STATES( Bright ) // to differentiate between orange and purple - enum { + enum + { NormalRole, CheckedRole, } GraphicRole; diff --git a/examples/iotdashboard/Skin.cpp b/examples/iotdashboard/Skin.cpp index 66efb80a..71a085ab 100644 --- a/examples/iotdashboard/Skin.cpp +++ b/examples/iotdashboard/Skin.cpp @@ -288,9 +288,9 @@ void Skin::initHints( const Palette& palette ) // storage bar { - const auto make_gradient = []( const QColor color ) -> QskGradient { - return { color.lighter(), color }; - }; + const auto make_gradient = []( const QColor color ) -> QskGradient + { return { color.lighter(), color }; }; + ed.setGradient( StorageBar::Pictures, make_gradient( "#FFBE0B" ) ); ed.setGradient( StorageBar::Music, make_gradient( "#FB5607" ) ); ed.setGradient( StorageBar::Videos, make_gradient( "#FF006E" ) ); diff --git a/examples/iotdashboard/StorageBar.h b/examples/iotdashboard/StorageBar.h index 6d6dddf0..6f28b5cf 100644 --- a/examples/iotdashboard/StorageBar.h +++ b/examples/iotdashboard/StorageBar.h @@ -43,9 +43,9 @@ class StorageBar final : public QskControl void othersChanged( qreal value ); private: - qreal m_pictures{ 0.0 }; - qreal m_music{ 0.0 }; - qreal m_videos{ 0.0 }; - qreal m_documents{ 0.0 }; - qreal m_others{ 0.0 }; + qreal m_pictures = 0.0; + qreal m_music = 0.0; + qreal m_videos = 0.0; + qreal m_documents = 0.0; + qreal m_others = 0.0; }; diff --git a/examples/iotdashboard/UsageDiagram.cpp b/examples/iotdashboard/UsageDiagram.cpp index ca20b110..52f3cd72 100644 --- a/examples/iotdashboard/UsageDiagram.cpp +++ b/examples/iotdashboard/UsageDiagram.cpp @@ -140,7 +140,8 @@ void UsageDiagram::addCurve( const qreal values[], const size_t count ) addDataPoints( points, Diagram::Area ); } -UsageDiagramBox::UsageDiagramBox(const QString &title, Diagram *diagram, QQuickItem* parent ) +UsageDiagramBox::UsageDiagramBox( + const QString& title, Diagram* diagram, QQuickItem* parent ) : Box( title, parent ) { diagram->setParent( this ); diff --git a/examples/tabview/main.cpp b/examples/tabview/main.cpp index 7bc0cc53..f228661a 100644 --- a/examples/tabview/main.cpp +++ b/examples/tabview/main.cpp @@ -48,11 +48,11 @@ class SliderBox : public QskLinearBox { auto slider = new OtherSlider( this ); - + slider->setMinimum( 0 ); slider->setMaximum( 10 ); slider->setStepSize( 1 ); - } + } { auto slider = new CustomSlider( this ); diff --git a/playground/dials/main.cpp b/playground/dials/main.cpp index 760b958b..3ce909a2 100644 --- a/playground/dials/main.cpp +++ b/playground/dials/main.cpp @@ -24,7 +24,7 @@ namespace { public: Window() - { + { setAutoLayoutChildren( true ); const QImage image( QStringLiteral( ":/images/background.jpg" ) ); diff --git a/playground/grids/GridQuick.cpp b/playground/grids/GridQuick.cpp index 03cb2983..c8e1d0b5 100644 --- a/playground/grids/GridQuick.cpp +++ b/playground/grids/GridQuick.cpp @@ -75,7 +75,8 @@ void GridQuick::insert( const QByteArray& colorName, We need to create a temporary layout in QML, so that the object for the attachedProperties is created early */ - auto layout = createQml( "import QtQuick 2.0\nimport QtQuick.Layouts 1.15\nGridLayout { Rectangle {} }" ); + auto layout = createQml( + "import QtQuick 2.0\nimport QtQuick.Layouts 1.15\nGridLayout { Rectangle {} }" ); auto rectangle = layout->childItems().constFirst(); rectangle->setParent( nullptr ); diff --git a/playground/shadows/main.cpp b/playground/shadows/main.cpp index e57c4d83..a6f2fb85 100644 --- a/playground/shadows/main.cpp +++ b/playground/shadows/main.cpp @@ -122,7 +122,7 @@ class GridBox : public QskGridBox addItem( label, row, 2 ); connect( slider, &QskSlider::valueChanged, - label, [label]( qreal value ) { label->setText( QString::number( value ) ); } ); + label, [label]( qreal value ) { label->setText( QString::number( value ) ); } ); } }; diff --git a/qmlexport/QskMainQml.h b/qmlexport/QskMainQml.h index 581ec723..ea356fdd 100644 --- a/qmlexport/QskMainQml.h +++ b/qmlexport/QskMainQml.h @@ -18,9 +18,9 @@ class QskSetupFlagsQml : public QskQuickItem::UpdateFlags Q_GADGET public: - template< typename... Args > + template< typename ... Args > QskSetupFlagsQml( Args&&... args ) - : QskQuickItem::UpdateFlags( std::forward< Args >( args )... ) + : QskQuickItem::UpdateFlags( std::forward< Args >( args ) ... ) { } diff --git a/qmlexport/QskShortcutQml.cpp b/qmlexport/QskShortcutQml.cpp index 6347967c..822223b2 100644 --- a/qmlexport/QskShortcutQml.cpp +++ b/qmlexport/QskShortcutQml.cpp @@ -130,8 +130,7 @@ Qt::ShortcutContext QskShortcutQml::context() const void QskShortcutQml::setContext( Qt::ShortcutContext context ) { - if ( context == Qt::ApplicationShortcut || - context == Qt::WindowShortcut ) + if ( context == Qt::ApplicationShortcut || context == Qt::WindowShortcut ) { const bool isWindowContext = ( context == Qt::WindowShortcut ); diff --git a/skins/material3/QskMaterial3Skin.cpp b/skins/material3/QskMaterial3Skin.cpp index 7e3b5db2..b6524ac2 100644 --- a/skins/material3/QskMaterial3Skin.cpp +++ b/skins/material3/QskMaterial3Skin.cpp @@ -474,18 +474,18 @@ void Editor::setupRadioBox() using A = QskAspect; setAnimation( Q::Ripple | A::Metric | A::Position, qskDuration ); - + setSpacing( Q::Panel, 10_dp ); - + setStrutSize( Q::Button, { 20_dp, 20_dp } ); setStrutSize( Q::Symbol, { 10_dp, 10_dp } ); setStrutSize( Q::Ripple, { 40_dp, 40_dp } ); setAlignment( Q::Symbol, Qt::AlignCenter ); setAlignment( Q::Text, Qt::AlignBottom ); - + setMargin( Q::Text, QskMargins( 10_dp, 0, 10_dp, 0 ) ); - + setBoxShape( Q::Button, 20_dp ); setBoxShape( Q::Ripple, 40_dp ); setBoxBorderMetrics( Q::Button, 2_dp ); @@ -496,7 +496,7 @@ void Editor::setupRadioBox() // Selected setColor( Q::Ripple | Q::Selected, - stateLayerColor( m_pal.primary, m_pal.focusOpacity ) ); + stateLayerColor( m_pal.primary, m_pal.focusOpacity ) ); setBoxBorderColors( Q::Button | Q::Selected, m_pal.primary ); // Disabled @@ -680,13 +680,16 @@ void Editor::setupPushButton() setGradient( Q::Panel | M3::Elevated | Q::Disabled, m_pal.onSurface12 ); setShadowMetrics( Q::Panel | M3::Elevated | Q::Disabled, m_pal.elevation0 ); setColor( Q::Text | M3::Elevated | Q::Disabled, m_pal.onSurface38 ); - setGraphicRole( Q::Graphic | M3::Elevated | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 ); + setGraphicRole( Q::Graphic | M3::Elevated | Q::Disabled, + QskMaterial3Skin::GraphicRoleOnSurface38 ); - const auto elevatedHoverColor = flattenedColor( m_pal.primary, m_pal.surface, m_pal.hoverOpacity ); + const auto elevatedHoverColor = + flattenedColor( m_pal.primary, m_pal.surface, m_pal.hoverOpacity ); setGradient( Q::Panel | M3::Elevated | Q::Hovered, elevatedHoverColor ); setShadowMetrics( Q::Panel | M3::Elevated | Q::Hovered, m_pal.elevation2 ); - const auto elevatedPressedColor = flattenedColor( m_pal.primary, m_pal.surface, m_pal.pressedOpacity ); + const auto elevatedPressedColor = + flattenedColor( m_pal.primary, m_pal.surface, m_pal.pressedOpacity ); setGradient( Q::Panel | M3::Elevated | Q::Focused, elevatedPressedColor ); setShadowMetrics( Q::Panel | M3::Elevated | Q::Focused, m_pal.elevation1 ); @@ -724,17 +727,21 @@ void Editor::setupPushButton() setShadowMetrics( Q::Panel | M3::Tonal, m_pal.elevation0 ); setColor( Q::Text | M3::Tonal, m_pal.onSecondaryContainer ); setGraphicRole( Q::Graphic | M3::Tonal, QskMaterial3Skin::GraphicRoleOnSecondaryContainer ); - setGradient( Q::Ripple | M3::Tonal, stateLayerColor( m_pal.onSecondaryContainer, m_pal.pressedOpacity ) ); + setGradient( Q::Ripple | M3::Tonal, + stateLayerColor( m_pal.onSecondaryContainer, m_pal.pressedOpacity ) ); setGradient( Q::Panel | M3::Tonal | Q::Disabled, m_pal.onSurface12 ); setColor( Q::Text | M3::Tonal | Q::Disabled, m_pal.onSurface38 ); - setGraphicRole( Q::Graphic | M3::Tonal | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 ); + setGraphicRole( Q::Graphic | M3::Tonal | Q::Disabled, + QskMaterial3Skin::GraphicRoleOnSurface38 ); - const auto tonalHoverColor = flattenedColor( m_pal.onSecondaryContainer, m_pal.secondaryContainer, m_pal.hoverOpacity ); + const auto tonalHoverColor = flattenedColor( m_pal.onSecondaryContainer, + m_pal.secondaryContainer, m_pal.hoverOpacity ); setGradient( Q::Panel | M3::Tonal | Q::Hovered, tonalHoverColor ); setShadowMetrics( Q::Panel | M3::Tonal | Q::Hovered, m_pal.elevation1 ); - const auto tonalPressedColor = flattenedColor( m_pal.onSecondaryContainer, m_pal.secondaryContainer, m_pal.pressedOpacity ); + const auto tonalPressedColor = flattenedColor( m_pal.onSecondaryContainer, + m_pal.secondaryContainer, m_pal.pressedOpacity ); setGradient( Q::Panel | M3::Tonal | Q::Focused, tonalPressedColor ); setShadowMetrics( Q::Panel | M3::Tonal | Q::Focused, m_pal.elevation0 ); @@ -754,7 +761,8 @@ void Editor::setupPushButton() setBoxBorderColors( Q::Panel | M3::Outlined | Q::Disabled, m_pal.onSurface12 ); setColor( Q::Text | M3::Outlined | Q::Disabled, m_pal.onSurface38 ); - setGraphicRole( Q::Graphic | M3::Outlined | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 ); + setGraphicRole( Q::Graphic | M3::Outlined | Q::Disabled, + QskMaterial3Skin::GraphicRoleOnSurface38 ); setBoxBorderColors( Q::Panel | M3::Outlined | Q::Hovered, m_pal.outline ); setGradient( Q::Panel | M3::Outlined | Q::Hovered, m_pal.primary8 ); diff --git a/skins/squiek/QskSquiekSkin.cpp b/skins/squiek/QskSquiekSkin.cpp index f5bae580..13ddaa20 100644 --- a/skins/squiek/QskSquiekSkin.cpp +++ b/skins/squiek/QskSquiekSkin.cpp @@ -621,10 +621,10 @@ void Editor::setupRadioBox() using Q = QskRadioBox; setSpacing(Q::Panel, qskDpiScaled( 10 ) ); - + setStrutSize( Q::Button, { qskDpiScaled( 20 ), qskDpiScaled( 20 ) } ); - setStrutSize( Q::Symbol, { qskDpiScaled( 9 ), qskDpiScaled( 9 ) }) ; - + setStrutSize( Q::Symbol, { qskDpiScaled( 9 ), qskDpiScaled( 9 ) }); + setBoxShape( Q::Button, qskDpiScaled( 20 ) ); setBoxShape( Q::Ripple, qskDpiScaled( 40 ) ); setBoxBorderMetrics( Q::Button, qskDpiScaled( 1 ) ); @@ -638,12 +638,12 @@ void Editor::setupRadioBox() setColor( Q::Panel | Q::Disabled, m_pal.lighter125 ); setColor( Q::Button | Q::Disabled, m_pal.lighter110 ); - + setColor( Q::Text | Q::Disabled, m_pal.darker200 ); setColor( Q::Symbol | Q::Disabled, m_pal.darker200 ); - setMargin( Q::Text, QskMargins( qskDpiScaled( 10 ), 0, qskDpiScaled( 10 ), 0 )); + setMargin( Q::Text, QskMargins( qskDpiScaled( 10 ), 0, qskDpiScaled( 10 ), 0 ) ); setAlignment( Q::Symbol, Qt::AlignCenter ); setAlignment( Q::Text, Qt::AlignBottom ); @@ -1046,7 +1046,7 @@ void Editor::setupSpinBox() setBoxShape( subControl, 0 ); const auto downState = ( subControl == Q::UpPanel ) - ? Q::Increasing : Q::Decreasing; + ? Q::Increasing : Q::Decreasing; setButton( subControl | downState, Sunken, 1.0 ); diff --git a/src/common/QskBoxBorderMetrics.h b/src/common/QskBoxBorderMetrics.h index 8d6d277b..11e8733d 100644 --- a/src/common/QskBoxBorderMetrics.h +++ b/src/common/QskBoxBorderMetrics.h @@ -77,7 +77,7 @@ class QSK_EXPORT QskBoxBorderMetrics constexpr bool isEquidistant() const noexcept; - QRectF adjustedRect( const QRectF& )const ; + QRectF adjustedRect( const QRectF& ) const; private: QskMargins m_widths; diff --git a/src/common/QskBoxShapeMetrics.h b/src/common/QskBoxShapeMetrics.h index 727900a4..b87263d5 100644 --- a/src/common/QskBoxShapeMetrics.h +++ b/src/common/QskBoxShapeMetrics.h @@ -38,7 +38,7 @@ class QSK_EXPORT QskBoxShapeMetrics Symmetric or Proportional shrink the larger radius, while SymmetricByMaximum expands the smaller radius to achieve the desired aspect ratio. - The effect of the scaling on the implemented box rendering is: + The effect of the scaling on the implemented box rendering is: - SymmetricByMaximum in combination with a relative radius of 100 results in an ellipse. diff --git a/src/common/QskGradient.cpp b/src/common/QskGradient.cpp index 6619f66c..ff0d9b2e 100644 --- a/src/common/QskGradient.cpp +++ b/src/common/QskGradient.cpp @@ -65,7 +65,7 @@ static inline QTransform qskTransformForRect( int, const QRectF& rect ) return QTransform( w, 0, 0, h, x, y ); } - + QskGradient::QskGradient( const QColor& color ) : QskGradient() { @@ -751,7 +751,7 @@ QGradient QskGradient::toQGradient() const } } - g.setCoordinateMode( m_stretchMode == NoStretch + g.setCoordinateMode( m_stretchMode == NoStretch ? QGradient::LogicalMode : QGradient::ObjectMode ); g.setSpread( static_cast< QGradient::Spread >( m_spreadMode ) ); diff --git a/src/common/QskGradientDirection.cpp b/src/common/QskGradientDirection.cpp index b387283a..56813476 100644 --- a/src/common/QskGradientDirection.cpp +++ b/src/common/QskGradientDirection.cpp @@ -131,7 +131,7 @@ void QskLinearDirection::setInterval( Qt::Orientation orientation, qreal from, q void QskLinearDirection::precalculate() const noexcept { m_dx = m_x2 - m_x1; - m_dy = m_y2 - m_y1; + m_dy = m_y2 - m_y1; m_dot = m_dx * m_dx + m_dy * m_dy; } diff --git a/src/common/QskGradientDirection.h b/src/common/QskGradientDirection.h index 239890fe..b0d8037b 100644 --- a/src/common/QskGradientDirection.h +++ b/src/common/QskGradientDirection.h @@ -74,7 +74,7 @@ class QSK_EXPORT QskLinearDirection /* In direction of the gradient vector, where 0.0 corresponds to points on the perpendicular at the start and 1.0 to points on - the perpendicular of the end point. + the perpendicular of the end point. Also corresponds to the positions of the color stops and can be used to calculate the color at a specific position. diff --git a/src/common/QskGradientStop.cpp b/src/common/QskGradientStop.cpp index 4455d5c8..94854c68 100644 --- a/src/common/QskGradientStop.cpp +++ b/src/common/QskGradientStop.cpp @@ -403,7 +403,7 @@ QGradientStops qskToQGradientStops( const QskGradientStops& stops ) for ( const auto& stop : stops ) { - QPair qStop = { stop.position(), stop.color() }; + QPair< qreal, QColor > qStop = { stop.position(), stop.color() }; if ( !qStops.isEmpty() && qStops.last().first == qStop.first ) { diff --git a/src/common/QskTextColors.cpp b/src/common/QskTextColors.cpp index 787aa258..ca32862f 100644 --- a/src/common/QskTextColors.cpp +++ b/src/common/QskTextColors.cpp @@ -38,11 +38,8 @@ QVariant QskTextColors::interpolate( static inline void qskDebugColor( QDebug debug, const QColor& c ) { - debug << '(' - << c.red() << ',' - << c.green() << ',' - << c.blue() << ',' - << c.alpha() << ')'; + debug << '(' << c.red() << ',' << c.green() << ',' + << c.blue() << ',' << c.alpha() << ')'; } QDebug operator<<( QDebug debug, const QskTextColors& colors ) diff --git a/src/controls/QskAbstractButton.cpp b/src/controls/QskAbstractButton.cpp index f286f881..ee9e94f8 100644 --- a/src/controls/QskAbstractButton.cpp +++ b/src/controls/QskAbstractButton.cpp @@ -13,7 +13,7 @@ QSK_SYSTEM_STATE( QskAbstractButton, Checked, QskAspect::LastSystemState >> 3 ) QSK_SYSTEM_STATE( QskAbstractButton, Pressed, QskAspect::LastSystemState >> 2 ) -static QskAbstractButton* qskCheckedSibling( const QskAbstractButton* button ) +static QskAbstractButton* qskCheckedSibling( const QskAbstractButton * button ) { const auto parentItem = button->parentItem(); if ( parentItem == nullptr ) diff --git a/src/controls/QskComboBox.cpp b/src/controls/QskComboBox.cpp index 855cddcd..ea8eca36 100644 --- a/src/controls/QskComboBox.cpp +++ b/src/controls/QskComboBox.cpp @@ -55,11 +55,8 @@ QskComboBox::QskComboBox( QQuickItem* parent ) connect( this, &QskComboBox::currentIndexChanged, this, &QskControl::focusIndicatorRectChanged ); - connect( m_data->menu, &QskMenu::closed, this, [ this ]() - { - setPopupOpen( false ); - setFocus( true ); - } ); + connect( m_data->menu, &QskMenu::closed, this, + [ this ]() { setPopupOpen( false ); setFocus( true ); } ); connect( this, &QskComboBox::pressed, this, &QskComboBox::togglePopup ); } diff --git a/src/controls/QskControl.cpp b/src/controls/QskControl.cpp index f2be97bc..d1111dc0 100644 --- a/src/controls/QskControl.cpp +++ b/src/controls/QskControl.cpp @@ -52,7 +52,8 @@ QskControl::~QskControl() if( this == w->mouseGrabberItem() ) { // to catch suicide situations as a result of mouse clicks - qWarning() << "QskControl::~QskControl: probably suicide situation detected, control is the mouse grabber item" << this; + qWarning() << "QskControl::~QskControl: probably suicide situation detected, " + "control is the mouse grabber item" << this; } } diff --git a/src/controls/QskEvent.h b/src/controls/QskEvent.h index 4a0180c4..355614e8 100644 --- a/src/controls/QskEvent.h +++ b/src/controls/QskEvent.h @@ -23,11 +23,11 @@ class QWheelEvent; class QHoverEvent; class QKeyEvent; -#define QSK_EVENT_DISABLE_COPY(Class) \ - Class(const Class &) = default; \ - Class(Class &&) = delete; \ - Class &operator=(const Class &other) = default; \ - Class &operator=(Class &&) = delete; +#define QSK_EVENT_DISABLE_COPY( Class ) \ + Class( const Class& ) = default; \ + Class( Class && ) = delete; \ + Class& operator=( const Class & ) = default; \ + Class& operator=( Class && ) = delete; class QSK_EXPORT QskEvent : public QEvent { diff --git a/src/controls/QskProgressBarSkinlet.cpp b/src/controls/QskProgressBarSkinlet.cpp index cad4d197..c860d316 100644 --- a/src/controls/QskProgressBarSkinlet.cpp +++ b/src/controls/QskProgressBarSkinlet.cpp @@ -134,7 +134,7 @@ QSGNode* QskProgressBarSkinlet::updateBarNode( definition for the 100% situation and have to adjust the stops for smaller bars. - For this situation it would be more convenient to + For this situation it would be more convenient to adjust the start/stop positions, but the box renderer is not supporting this yet. TODO ... */ diff --git a/src/controls/QskPushButton.h b/src/controls/QskPushButton.h index 4ff74366..b59fc231 100644 --- a/src/controls/QskPushButton.h +++ b/src/controls/QskPushButton.h @@ -48,7 +48,7 @@ class QSK_EXPORT QskPushButton : public QskAbstractButton QSK_SUBCONTROLS( Panel, Ripple, Text, Graphic ) enum Emphasis - { + { VeryLowEmphasis = -2, LowEmphasis = -1, NoEmphasis = 0, diff --git a/src/controls/QskPushButtonSkinlet.cpp b/src/controls/QskPushButtonSkinlet.cpp index 9c8f231f..d97da955 100644 --- a/src/controls/QskPushButtonSkinlet.cpp +++ b/src/controls/QskPushButtonSkinlet.cpp @@ -42,7 +42,7 @@ namespace const auto textOptions = button->textOptions(); if ( ( textOptions.elideMode() == Qt::ElideNone ) - && ( textOptions.wrapMode() == QskTextOptions::NoWrap ) ) + && ( textOptions.wrapMode() == QskTextOptions::NoWrap ) ) { const auto alignment = button->alignmentHint( QskPushButton::Panel, Qt::AlignCenter ); diff --git a/src/controls/QskRadioBox.cpp b/src/controls/QskRadioBox.cpp index e87835fa..2ff6a8ad 100644 --- a/src/controls/QskRadioBox.cpp +++ b/src/controls/QskRadioBox.cpp @@ -37,9 +37,7 @@ QskRadioBox::QskRadioBox( QQuickItem* parent ) connect(this, &QskRadioBox::itemsChanged, this, [this]( const QStringList& items ) - { - setFocusPolicy( items.count() > 0 ? Qt::StrongFocus : Qt::NoFocus ); - } + { setFocusPolicy( items.count() > 0 ? Qt::StrongFocus : Qt::NoFocus ); } ); setFocusedIndex( -1 ); diff --git a/src/controls/QskSegmentedBarSkinlet.cpp b/src/controls/QskSegmentedBarSkinlet.cpp index 91dab9c1..9d1f8c06 100644 --- a/src/controls/QskSegmentedBarSkinlet.cpp +++ b/src/controls/QskSegmentedBarSkinlet.cpp @@ -59,16 +59,18 @@ namespace LayoutEngine( const QskSegmentedBar* bar, int index ) : QskSubcontrolLayoutEngine( bar->orientation() ) { - setSpacing( bar->spacingHint( QskSegmentedBar::Panel ) ); + using Q = QskSegmentedBar; + + setSpacing( bar->spacingHint( Q::Panel ) ); setGraphicTextElements( bar, - QskSegmentedBar::Text, qskValueAt< QString >( bar, index ), - QskSegmentedBar::Graphic, graphicAt( bar, index ).defaultSize() ); + Q::Text, qskValueAt< QString >( bar, index ), + Q::Graphic, graphicAt( bar, index ).defaultSize() ); if( bar->orientation() == Qt::Horizontal ) { - const auto alignment = bar->alignmentHint( QskSegmentedBar::Panel, Qt::AlignCenter ); - setFixedContent( QskSegmentedBar::Text, Qt::Horizontal, alignment ); + const auto alignment = bar->alignmentHint( Q::Panel, Qt::AlignCenter ); + setFixedContent( Q::Text, Qt::Horizontal, alignment ); } } }; @@ -151,7 +153,7 @@ QRectF QskSegmentedBarSkinlet::segmentRect( { const qreal h = rect.height() / count; - rect.setTop( index * h ); + rect.setTop( index * h ); rect.setHeight( h ); } @@ -218,7 +220,8 @@ QSGNode* QskSegmentedBarSkinlet::updateSubNode( return nullptr; } -QSizeF QskSegmentedBarSkinlet::segmentSizeHint( const QskSegmentedBar* bar, Qt::SizeHint which ) const +QSizeF QskSegmentedBarSkinlet::segmentSizeHint( + const QskSegmentedBar* bar, Qt::SizeHint which ) const { using Q = QskSegmentedBar; @@ -228,13 +231,14 @@ QSizeF QskSegmentedBarSkinlet::segmentSizeHint( const QskSegmentedBar* bar, Qt:: { LayoutEngine layoutEngine( bar, i ); - const auto graphic = bar->effectiveSkin()->symbol( QskStandardSymbol::SegmentedBarCheckMark ); + const auto graphic = bar->effectiveSkin()->symbol( + QskStandardSymbol::SegmentedBarCheckMark ); // We want to know how big the element can grow when it is selected, // i.e. when it has the checkmark symbol: layoutEngine.setGraphicTextElements( bar, - QskSegmentedBar::Text, qskValueAt< QString >( bar, i ), - QskSegmentedBar::Graphic, graphic.defaultSize() ); + Q::Text, qskValueAt< QString >( bar, i ), + Q::Graphic, graphic.defaultSize() ); const auto size = layoutEngine.sizeHint( which, QSizeF() ); diff --git a/src/controls/QskSkinHintTableEditor.cpp b/src/controls/QskSkinHintTableEditor.cpp index 8e736d26..cba5b56a 100644 --- a/src/controls/QskSkinHintTableEditor.cpp +++ b/src/controls/QskSkinHintTableEditor.cpp @@ -245,7 +245,7 @@ void QskSkinHintTableEditor::setGradient( QskStateCombination combination ) { const QskGradient gradient( color1, color2 ); - setColorHint( aspect, gradient , combination ); + setColorHint( aspect, gradient, combination ); } void QskSkinHintTableEditor::setGradient( diff --git a/src/controls/QskSpinBox.cpp b/src/controls/QskSpinBox.cpp index 3001f666..710a1664 100644 --- a/src/controls/QskSpinBox.cpp +++ b/src/controls/QskSpinBox.cpp @@ -193,7 +193,7 @@ void QskSpinBox::setWrapping( bool on ) { if ( on != m_data->wrapping ) { - m_data->wrapping = on; + m_data->wrapping = on; Q_EMIT wrappingChanged( on ); } } diff --git a/src/controls/QskSpinBox.h b/src/controls/QskSpinBox.h index 0a1435cf..84998180 100644 --- a/src/controls/QskSpinBox.h +++ b/src/controls/QskSpinBox.h @@ -49,8 +49,8 @@ class QSK_EXPORT QskSpinBox : public QskBoundedValueInput Q_ENUM( Decoration ) QskSpinBox( QQuickItem* parent = nullptr ); - QskSpinBox( qreal min, qreal max, qreal stepSize, - QQuickItem* parent = nullptr ); + QskSpinBox( qreal min, qreal max, + qreal stepSize, QQuickItem* parent = nullptr ); ~QskSpinBox() override; diff --git a/src/controls/QskSpinBoxSkinlet.cpp b/src/controls/QskSpinBoxSkinlet.cpp index 150eab2f..00dfcb84 100644 --- a/src/controls/QskSpinBoxSkinlet.cpp +++ b/src/controls/QskSpinBoxSkinlet.cpp @@ -186,7 +186,7 @@ QSizeF QskSpinBoxSkinlet::sizeHint( const QskSkinnable* skinnable, hint.setWidth( std::max( w1, w2 ) ); hint.setHeight( fm.height() ); - + hint = hint.grownBy( spinBox->paddingHint( Q::TextPanel ) ); hint = hint.expandedTo( spinBox->strutSizeHint( Q::TextPanel ) ); } @@ -215,10 +215,10 @@ QSizeF QskSpinBoxSkinlet::sizeHint( const QskSkinnable* skinnable, } else { - if ( hintDown.width() > 0.0 ) + if ( hintDown.width() > 0.0 ) hint.rwidth() += hintDown.width() + spacing; - if ( hintUp.width() > 0.0 ) + if ( hintUp.width() > 0.0 ) hint.rwidth() += hintUp.width() + spacing; const auto h = std::max( hintUp.height(), hintDown.height() ); diff --git a/src/controls/QskSpinBoxSkinlet.h b/src/controls/QskSpinBoxSkinlet.h index 2c26bda4..da6ef27f 100644 --- a/src/controls/QskSpinBoxSkinlet.h +++ b/src/controls/QskSpinBoxSkinlet.h @@ -21,7 +21,7 @@ class QSK_EXPORT QskSpinBoxSkinlet : public QskSkinlet TextPanel, Text, - UpPanel, + UpPanel, UpIndicator, DownPanel, diff --git a/src/graphic/QskStandardSymbol.cpp b/src/graphic/QskStandardSymbol.cpp index 0299dee1..9464ddc7 100644 --- a/src/graphic/QskStandardSymbol.cpp +++ b/src/graphic/QskStandardSymbol.cpp @@ -269,8 +269,8 @@ QskGraphic QskStandardSymbol::graphic( Type symbolType ) case QskStandardSymbol::SegmentedBarCheckMark: { qskCheckMarkGraphic( &painter ); - break; - } + break; + } case QskStandardSymbol::Bullet: { qskBulletGraphic( &painter ); diff --git a/src/layouts/QskStackBoxAnimator.cpp b/src/layouts/QskStackBoxAnimator.cpp index 0eb43d79..f12d0603 100644 --- a/src/layouts/QskStackBoxAnimator.cpp +++ b/src/layouts/QskStackBoxAnimator.cpp @@ -619,7 +619,7 @@ QTransform QskStackBoxAnimator4::transformation( transform.translate( dx, dy ); transform.rotateRadians( radians - M_PI_2, Qt::YAxis ); transform.translate( 0.0, -dy ); - } + } } else { diff --git a/src/layouts/QskSubcontrolLayoutEngine.cpp b/src/layouts/QskSubcontrolLayoutEngine.cpp index d7227df7..6a28e571 100644 --- a/src/layouts/QskSubcontrolLayoutEngine.cpp +++ b/src/layouts/QskSubcontrolLayoutEngine.cpp @@ -408,7 +408,8 @@ void QskSubcontrolLayoutEngine::setGraphicTextElements( const QskSkinnable* skin } } -void QskSubcontrolLayoutEngine::setFixedContent( QskAspect::Subcontrol subcontrol, Qt::Orientation orientation, Qt::Alignment alignment ) +void QskSubcontrolLayoutEngine::setFixedContent( + QskAspect::Subcontrol subcontrol, Qt::Orientation orientation, Qt::Alignment alignment ) { if( auto* e = element( subcontrol ) ) { @@ -419,38 +420,38 @@ void QskSubcontrolLayoutEngine::setFixedContent( QskAspect::Subcontrol subcontro switch( orientation ) { - case Qt::Horizontal: - extraSpacing |= ( extraSpacingAt() & ( Qt::TopEdge | Qt::BottomEdge ) ); + case Qt::Horizontal: + extraSpacing |= ( extraSpacingAt() & ( Qt::TopEdge | Qt::BottomEdge ) ); - if( alignment & Qt::AlignLeft ) - { - extraSpacing |= Qt::RightEdge; - } - else if( alignment & Qt::AlignRight ) - { - extraSpacing |= Qt::LeftEdge; - } - else if( alignment & Qt::AlignHCenter ) - { - extraSpacing |= Qt::LeftEdge | Qt::RightEdge; - } - break; - case Qt::Vertical: - extraSpacing |= ( extraSpacingAt() & ( Qt::LeftEdge | Qt::RightEdge ) ); + if( alignment & Qt::AlignLeft ) + { + extraSpacing |= Qt::RightEdge; + } + else if( alignment & Qt::AlignRight ) + { + extraSpacing |= Qt::LeftEdge; + } + else if( alignment & Qt::AlignHCenter ) + { + extraSpacing |= Qt::LeftEdge | Qt::RightEdge; + } + break; + case Qt::Vertical: + extraSpacing |= ( extraSpacingAt() & ( Qt::LeftEdge | Qt::RightEdge ) ); - if( alignment & Qt::AlignTop ) - { - extraSpacing |= Qt::BottomEdge; - } - else if( alignment & Qt::AlignBottom ) - { - extraSpacing |= Qt::TopEdge; - } - else if( alignment & Qt::AlignVCenter ) - { - extraSpacing |= Qt::TopEdge | Qt::BottomEdge; - } - break; + if( alignment & Qt::AlignTop ) + { + extraSpacing |= Qt::BottomEdge; + } + else if( alignment & Qt::AlignBottom ) + { + extraSpacing |= Qt::TopEdge; + } + else if( alignment & Qt::AlignVCenter ) + { + extraSpacing |= Qt::TopEdge | Qt::BottomEdge; + } + break; } setExtraSpacingAt( extraSpacing ); diff --git a/support/SkinnyNamespace.cpp b/support/SkinnyNamespace.cpp index 310414fd..63db79ed 100644 --- a/support/SkinnyNamespace.cpp +++ b/support/SkinnyNamespace.cpp @@ -153,32 +153,32 @@ void Skinny::changeSkin( QskAnimationHint hint ) } void Skinny::changeFonts( int increment ) -{ +{ auto skin = qskSetup->skin(); - + const auto fonts = skin->fonts(); - + for ( auto it = fonts.begin(); it != fonts.end(); ++it ) - { + { auto role = it->first; auto font = it->second; - + if ( font.pixelSize() > 0 ) - { + { const auto newSize = font.pixelSize() + increment; if ( newSize > 0 ) font.setPixelSize( newSize ); } else - { + { const auto newSize = font.pointSizeF() + increment; if ( newSize > 0 ) font.setPointSizeF( font.pointSizeF() + increment ); } - + skin->setFont( role, font ); } - + Q_EMIT qskSetup->skinChanged( skin ); } diff --git a/support/SkinnyShapeFactory.cpp b/support/SkinnyShapeFactory.cpp index 2ce61f4f..922165d1 100644 --- a/support/SkinnyShapeFactory.cpp +++ b/support/SkinnyShapeFactory.cpp @@ -154,7 +154,7 @@ QPainterPath SkinnyShapeFactory::shapePath( Shape shape, const QSizeF& size ) { path.arcMoveTo( rect, -60 ); path.arcTo( rect, -60, 300 ); - + const double w = 0.25 * rect.width(); const auto r = rect.adjusted( w, w, -w, -w ); @@ -164,7 +164,7 @@ QPainterPath SkinnyShapeFactory::shapePath( Shape shape, const QSizeF& size ) innerPath.arcTo( r, 240, -300 ); path.connectPath( innerPath ); - + break; }