pub unsafe fn load_unit_variants_colours(&self, data: &HashMap<String, String>) {
        data.iter()
            .sorted_by_key(|x| x.0)
            .filter(|x| x.0.starts_with("unit_variants_colours_key"))
            .for_each(|(_, value)| {

            let value = if value.is_empty() { "*" } else { value };
            let item = QStandardItem::from_q_string(&QString::from_std_str(&value)).into_ptr();
            let unit_variants_colours = data.iter()
                .filter(|x| x.0.ends_with(value) || x.0 == "unit_variants_colours_definition")
                .map(|x| {
                    if x.0.ends_with("_definition") {
                        (x.0.to_owned(), x.1.to_owned())
                    } else {
                        let mut clean_key = x.0.to_owned();
                        if let Some(index) = clean_key.find(value) {
                            clean_key = clean_key.split_at(index - 1).0.to_owned();
                        }
                        (clean_key, x.1.to_owned())
                    }
                })
                .collect::<HashMap<String, String>>();

            item.set_data_2a(&QVariant::from_q_string(&QString::from_std_str(&serde_json::to_string(&unit_variants_colours).unwrap())), UNIT_DATA);
            self.unit_variants_colours_list_model.append_row_q_standard_item(item);
        });
    }
/// This function loads the unit_variants_colours entries into a listview,
This function loads the unit_variants_colours entries into a listview.
This function loads the unit_variants_colours entries into a listview .
pub unsafe fn load_unit_variants_colours(&self, data: &HashMap<String, String>) {
        data.iter()
            .sorted_by_key(|x| x.0)
            .filter(|x| x.0.starts_with("unit_variants_colours_key"))
            .for_each(|(_, value)| {
            let value = if value.is_empty() { "*" } else { value };
            let item = QStandardItem::from_q_string(&QString::from_std_str(&value)).into_ptr();
            let unit_variants_colours = data.iter()
                .filter(|x| x.0.ends_with(value) || x.0 == "unit_variants_colours_definition")
                .map(|x| {
                    if x.0.ends_with("_definition") {
                        (x.0.to_owned(), x.1.to_owned())
                    } else {
                        let mut clean_key = x.0.to_owned();
                        if let Some(index) = clean_key.find(value) {
                            clean_key = clean_key.split_at(index - 1).0.to_owned();
                        }
                        (clean_key, x.1.to_owned())
                    }
                })
                .collect::<HashMap<String, String>>();
            item.set_data_2a(&QVariant::from_q_string(&QString::from_std_str(&serde_json::to_string(&unit_variants_colours).unwrap())), UNIT_DATA);
            self.unit_variants_colours_list_model.append_row_q_standard_item(item);
        });
    }
pub unsafe fn load_unit_variants_colours ( & self , data : & HashMap < String , String > ) { data . iter ( ) . sorted_by_key ( | x | x . 0 ) . filter ( | x | x . 0 . starts_with ( " " ) ) . for_each ( | ( _ , value ) | { let value = if value . is_empty ( ) { " " } else { value } ; let item = QStandardItem :: from_q_string ( & QString :: from_std_str ( & value ) ) . into_ptr ( ) ; let unit_variants_colours = data . iter ( ) . filter ( | x | x . 0 . ends_with ( value ) || x . 0 == " " ) . map ( | x | { if x . 0 . ends_with ( " " ) { ( x . 0 . to_owned ( ) , x . 1 . to_owned ( ) ) } else { let mut clean_key = x . 0 . to_owned ( ) ; if let Some ( index ) = clean_key . find ( value ) { clean_key = clean_key . split_at ( index - 1 ) . 0 . to_owned ( ) ; } ( clean_key , x . 1 . to_owned ( ) ) } } ) . collect :: < HashMap < String , String > > ( ) ; item . set_data_2a ( & QVariant :: from_q_string ( & QString :: from_std_str ( & serde_json :: to_string ( & unit_variants_colours ) . unwrap ( ) ) ) , UNIT_DATA ) ; self . unit_variants_colours_list_model . append_row_q_standard_item ( item ) ; } ) ; }
This function loads the unit_variants_colours entries into a listview,
This function loads the unit_variants_colours entries into a listview
&self
data
&HashMap<String, String>
&self
data
&HashMap<String, String>