@@ -969,16 +969,17 @@ def __init__(self, schema: Dict[str, Any], resolver: SchemaResolver, validator:
969
969
layout = QVBoxLayout (self )
970
970
971
971
# Add title/description if specified
972
- if "title" in schema :
973
- title_label = QLabel (schema ["title" ])
974
- title_label .setProperty ("class" , "title" )
975
- layout .addWidget (title_label )
976
-
977
- if "description" in schema :
978
- desc_label = QLabel (schema ["description" ])
979
- desc_label .setProperty ("class" , "description" )
980
- desc_label .setWordWrap (True )
981
- layout .addWidget (desc_label )
972
+ if path :
973
+ if "title" in schema :
974
+ title_label = QLabel (schema ["title" ])
975
+ title_label .setProperty ("class" , "title" )
976
+ layout .addWidget (title_label )
977
+
978
+ if "description" in schema :
979
+ desc_label = QLabel (schema ["description" ])
980
+ desc_label .setProperty ("class" , "description" )
981
+ desc_label .setWordWrap (True )
982
+ layout .addWidget (desc_label )
982
983
983
984
self .items_schema = schema .get ("items" , {})
984
985
self .min_items = schema .get ("minItems" , 0 )
@@ -1218,20 +1219,17 @@ def __init__(self, schema: Dict[str, Any], resolver: SchemaResolver, validator:
1218
1219
1219
1220
for prop_name , prop_schema in properties .items ():
1220
1221
prop_path = f"{ path } .{ prop_name } " if path else prop_name
1221
-
1222
- label_text = self ._get_property_label (prop_name , prop_schema , prop_name in required )
1223
- label = QLabel (label_text )
1224
-
1225
- if prop_name in required :
1226
- label .setProperty ("class" , "required" )
1227
-
1228
- if "description" in prop_schema :
1229
- desc_label = QLabel (prop_schema ["description" ])
1230
- desc_label .setStyleSheet ("color: gray; font-size: 10px; font-style: italic; margin-bottom: 5px;" )
1231
- desc_label .setWordWrap (True )
1232
- layout .addWidget (desc_label )
1233
-
1234
- layout .addWidget (label )
1222
+ if "title" in prop_schema or "description" in prop_schema :
1223
+ show_label = False
1224
+ else :
1225
+ show_label = True
1226
+
1227
+ if show_label :
1228
+ label_text = self ._get_property_label (prop_name , prop_schema , prop_name in required )
1229
+ label = QLabel (label_text )
1230
+ if prop_name in required :
1231
+ label .setProperty ("class" , "required" )
1232
+ layout .addWidget (label )
1235
1233
1236
1234
# Create widget for property with safe value provider
1237
1235
def make_value_provider ():
0 commit comments