pub unsafe fn copy_selection_as_lua_table(&self) {

        // Get the selection sorted visually.
        let indexes = self.table_view_primary.selection_model().selection().indexes();
        let mut indexes_sorted = (0..indexes.count_0a()).map(|x| indexes.at(x)).collect::<Vec<Ref<QModelIndex>>>();
        sort_indexes_visually(&mut indexes_sorted, &self.get_mut_ptr_table_view_primary());
        let indexes_sorted = get_real_indexes(&indexes_sorted, &self.get_mut_ptr_table_view_filter());

        // Split the indexes in two groups: those who have a key column selected and those who haven't.
        // Keep in mind this doesn't check what key column we have selected.
        //
        // TODO: Improve this.
        let (intexed_keys, indexes_no_keys): (Vec<Ref<QModelIndex>>, Vec<Ref<QModelIndex>>) = indexes_sorted.iter()
            .filter_map(|x| if x.column() != -1 { Some(x.as_ref()) } else { None })
            .partition(|x|
                indexes_sorted.iter()
                    .filter(|y| y.row() == x.row())
                    .any(|z| self.get_ref_table_definition().get_fields_processed()[z.column() as usize].get_is_key())
            );

        let mut lua_table = self.get_indexes_as_lua_table(&intexed_keys, true);
        lua_table.push('\n');
        lua_table.push_str(&self.get_indexes_as_lua_table(&indexes_no_keys, false));

        // Put the baby into the oven.
        QGuiApplication::clipboard().set_text_1a(&QString::from_std_str(lua_table));
    }
/// This function copies the selected cells into the clipboard as a LUA Table, so you can use it in LUA scripts.
This function copies the selected cells into the clipboard as a LUA Table, so you can use it in LUA scripts.
This function copies the selected cells into the clipboard as a LUA Table so you can use it in LUA scripts .
pub unsafe fn copy_selection_as_lua_table(&self) {
        // Get the selection sorted visually.
        let indexes = self.table_view_primary.selection_model().selection().indexes();
        let mut indexes_sorted = (0..indexes.count_0a()).map(|x| indexes.at(x)).collect::<Vec<Ref<QModelIndex>>>();
        sort_indexes_visually(&mut indexes_sorted, &self.get_mut_ptr_table_view_primary());
        let indexes_sorted = get_real_indexes(&indexes_sorted, &self.get_mut_ptr_table_view_filter());
        // Split the indexes in two groups: those who have a key column selected and those who haven't.
        // Keep in mind this doesn't check what key column we have selected.
        //
        // TODO: Improve this.
        let (intexed_keys, indexes_no_keys): (Vec<Ref<QModelIndex>>, Vec<Ref<QModelIndex>>) = indexes_sorted.iter()
            .filter_map(|x| if x.column() != -1 { Some(x.as_ref()) } else { None })
            .partition(|x|
                indexes_sorted.iter()
                    .filter(|y| y.row() == x.row())
                    .any(|z| self.get_ref_table_definition().get_fields_processed()[z.column() as usize].get_is_key())
            );
        let mut lua_table = self.get_indexes_as_lua_table(&intexed_keys, true);
        lua_table.push('\n');
        lua_table.push_str(&self.get_indexes_as_lua_table(&indexes_no_keys, false));
        // Put the baby into the oven.
        QGuiApplication::clipboard().set_text_1a(&QString::from_std_str(lua_table));
    }
pub unsafe fn copy_selection_as_lua_table ( & self ) { // Get the selection sorted visually. let indexes = self . table_view_primary . selection_model ( ) . selection ( ) . indexes ( ) ; let mut indexes_sorted = ( 0 .. indexes . count_0a ( ) ) . map ( | x | indexes . at ( x ) ) . collect :: < Vec < Ref < QModelIndex > > > ( ) ; sort_indexes_visually ( & mut indexes_sorted , & self . get_mut_ptr_table_view_primary ( ) ) ; let indexes_sorted = get_real_indexes ( & indexes_sorted , & self . get_mut_ptr_table_view_filter ( ) ) ; // Split the indexes in two groups: those who have a key column selected and those who haven't. // Keep in mind this doesn't check what key column we have selected. // // TODO: Improve this. let ( intexed_keys , indexes_no_keys ) : ( Vec < Ref < QModelIndex > > , Vec < Ref < QModelIndex > > ) = indexes_sorted . iter ( ) . filter_map ( | x | if x . column ( ) != - 1 { Some ( x . as_ref ( ) ) } else { None } ) . partition ( | x | indexes_sorted . iter ( ) . filter ( | y | y . row ( ) == x . row ( ) ) . any ( | z | self . get_ref_table_definition ( ) . get_fields_processed ( ) [ z . column ( ) as usize ] . get_is_key ( ) ) ) ; let mut lua_table = self . get_indexes_as_lua_table ( & intexed_keys , true ) ; lua_table . push ( '\n' ) ; lua_table . push_str ( & self . get_indexes_as_lua_table ( & indexes_no_keys , false ) ) ; // Put the baby into the oven. QGuiApplication :: clipboard ( ) . set_text_1a ( & QString :: from_std_str ( lua_table ) ) ; }
This function copies the selected cells into the clipboard as a LUA Table, so you can use it in LUA scripts.
This function copies the selected cells into the clipboard as a LUA Table so you can use it in LUA scripts .
&self
&self