pub fn add_file<S: SizeTrait<'a>>(
        &self,
        file_name: &str,
        size: &S,
        mode: Mode,
        state: State,
    ) -> &Self {
        let str_in_file_name_1 = CString::new(file_name).unwrap();
        let (obj_size_2, _funcs) = size.get_size_obj_funcs();
        let enum_mode_3 = mode as u32;
        let enum_state_4 = state as u32;

        let (obj_data, funcs) = self.get_icon_obj_funcs();
        unsafe {
            ((*funcs).add_file)(
                obj_data,
                str_in_file_name_1.as_ptr(),
                obj_size_2,
                enum_mode_3,
                enum_state_4,
            );
        }
        self
    }
/// Adds an image from the file with the given *fileName* to the
/// icon, as a specialization for *size,* *mode* and *state.* The
/// file will be loaded on demand. Note: custom icon engines are free
/// to ignore additionally added pixmaps.
///
/// If *fileName* contains a relative path (e.g. the filename only)
/// the relevant file must be found relative to the runtime working
/// directory.
///
/// The file name can refer to an actual file on disk or to
/// one of the application's embedded resources. See the
/// [Resource System](resources.html)
/// overview for details on how to
/// embed images and other resource files in the application's
/// executable.
///
/// Use the QImageReader::supportedImageFormats() and
/// QImageWriter::supportedImageFormats() functions to retrieve a
/// complete list of the supported file formats.
///
/// If a high resolution version of the image exists (identified by
/// the suffix `@2x` on the base name), it is automatically loaded
/// and added with the *device pixel ratio* set to a value of 2.
/// This can be disabled by setting the environment variable
/// `QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING` (see QImageReader).
///
/// **Note**: When you add a non-empty filename to a QIcon, the icon becomes
/// non-null, even if the file doesn't exist or points to a corrupt file.
///
/// **See also:** [`add_pixmap()`]
/// [`Pixmap::device_pixel_ratio`]


If *fileName* contains a relative path
the relevant file must be found relative to the runtime working
directory.

The file name can refer to an actual file on disk or to
one of the application's embedded resources. See the
[Resource System](resources.html)
overview for details on how to
embed images and other resource files in the application's
executable.

Use the QImageReader::supportedImageFormats() and
QImageWriter::supportedImageFormats() functions to retrieve a
complete list of the supported file formats.

If a high resolution version of the image exists (identified by
the suffix `@2x` on the base name), it is automatically loaded
and added with the *device pixel ratio* set to a value of 2.
This can be disabled by setting the environment variable
`QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING` .

Note**: When you add a non-empty filename to a QIcon, the icon becomes
non-null, even if the file doesn't exist or points to a corrupt file.


If * fileName * contains a relative path the relevant file must be found relative to the runtime working directory . The file name can refer to an actual file on disk or to one of the application ' s embedded resources . See the [ Resource System ] ( resources . html ) overview for details on how to embed images and other resource files in the application ' s executable . Use the QImageReader :: supportedImageFormats () and QImageWriter :: supportedImageFormats () functions to retrieve a complete list of the supported file formats . If a high resolution version of the image exists ( identified by the suffix ` @2x ` on the base name ) it is automatically loaded and added with the * device pixel ratio * set to a value of 2 . This can be disabled by setting the environment variable ` QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING ` . Note ** : When you add a non - empty filename to a QIcon the icon becomes non - null even if the file doesn ' t exist or points to a corrupt file .
pub fn add_file<S: SizeTrait<'a>>(
        &self,
        file_name: &str,
        size: &S,
        mode: Mode,
        state: State,
    ) -> &Self {
        let str_in_file_name_1 = CString::new(file_name).unwrap();
        let (obj_size_2, _funcs) = size.get_size_obj_funcs();
        let enum_mode_3 = mode as u32;
        let enum_state_4 = state as u32;
        let (obj_data, funcs) = self.get_icon_obj_funcs();
        unsafe {
            ((*funcs).add_file)(
                obj_data,
                str_in_file_name_1.as_ptr(),
                obj_size_2,
                enum_mode_3,
                enum_state_4,
            );
        }
        self
    }
pub fn add_file < S : SizeTrait < ' a > > ( & self , file_name : & str , size : & S , mode : Mode , state : State , ) -> & Self { let str_in_file_name_1 = CString :: new ( file_name ) . unwrap ( ) ; let ( obj_size_2 , _funcs ) = size . get_size_obj_funcs ( ) ; let enum_mode_3 = mode as u32 ; let enum_state_4 = state as u32 ; let ( obj_data , funcs ) = self . get_icon_obj_funcs ( ) ; unsafe { ( ( * funcs ) . add_file ) ( obj_data , str_in_file_name_1 . as_ptr ( ) , obj_size_2 , enum_mode_3 , enum_state_4 , ) ; } self }
Adds an image from the file with the given *fileName* to the
icon, as a specialization for *size,* *mode* and *state.
Adds an image from the file with the given * fileName * to the icon as a specialization for * size * * mode * and * state .
&self
file_name
&str
size
&S
mode
Mode
state
State
&self
file_name
&str
size
&S
mode
Mode
state
State