Struct QItemEditorFactory

Source
#[repr(C)]
pub struct QItemEditorFactory { /* private fields */ }
Expand description

The QItemEditorFactory class provides widgets for editing item data in views and delegates.

C++ class: QItemEditorFactory.

C++ documentation:

The QItemEditorFactory class provides widgets for editing item data in views and delegates.

When editing data in an item view, editors are created and displayed by a delegate. QItemDelegate, which is the delegate by default installed on Qt's item views, uses a QItemEditorFactory to create editors for it. A default unique instance provided by QItemEditorFactory is used by all item delegates. If you set a new default factory with setDefaultFactory(), the new factory will be used by existing and new delegates.

A factory keeps a collection of QItemEditorCreatorBase instances, which are specialized editors that produce editors for one particular QVariant data type (All Qt models store their data in QVariants).

Implementations§

Source§

impl QItemEditorFactory

Source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QItemEditorFactory>>, ) -> Ref<QItemEditorFactory>

The QItemEditorFactory class provides widgets for editing item data in views and delegates.

Calls C++ function: QItemEditorFactory& QItemEditorFactory::operator=(const QItemEditorFactory& other).

C++ documentation:

The QItemEditorFactory class provides widgets for editing item data in views and delegates.

When editing data in an item view, editors are created and displayed by a delegate. QItemDelegate, which is the delegate by default installed on Qt's item views, uses a QItemEditorFactory to create editors for it. A default unique instance provided by QItemEditorFactory is used by all item delegates. If you set a new default factory with setDefaultFactory(), the new factory will be used by existing and new delegates.

A factory keeps a collection of QItemEditorCreatorBase instances, which are specialized editors that produce editors for one particular QVariant data type (All Qt models store their data in QVariants).

Source

pub unsafe fn create_editor( &self, user_type: c_int, parent: impl CastInto<Ptr<QWidget>>, ) -> QPtr<QWidget>

Creates an editor widget with the given parent for the specified userType of data, and returns it as a QWidget.

Calls C++ function: virtual QWidget* QItemEditorFactory::createEditor(int userType, QWidget* parent) const.

C++ documentation:

Creates an editor widget with the given parent for the specified userType of data, and returns it as a QWidget.

See also registerEditor().

Source

pub unsafe fn default_factory() -> Ptr<QItemEditorFactory>

Returns the default item editor factory.

Calls C++ function: static const QItemEditorFactory* QItemEditorFactory::defaultFactory().

C++ documentation:

Returns the default item editor factory.

See also setDefaultFactory().

Source

pub unsafe fn new() -> CppBox<QItemEditorFactory>

Constructs a new item editor factory.

Calls C++ function: [constructor] void QItemEditorFactory::QItemEditorFactory().

C++ documentation:

Constructs a new item editor factory.

Source

pub unsafe fn new_copy( other: impl CastInto<Ref<QItemEditorFactory>>, ) -> CppBox<QItemEditorFactory>

The QItemEditorFactory class provides widgets for editing item data in views and delegates.

Calls C++ function: [constructor] void QItemEditorFactory::QItemEditorFactory(const QItemEditorFactory& other).

C++ documentation:

The QItemEditorFactory class provides widgets for editing item data in views and delegates.

When editing data in an item view, editors are created and displayed by a delegate. QItemDelegate, which is the delegate by default installed on Qt's item views, uses a QItemEditorFactory to create editors for it. A default unique instance provided by QItemEditorFactory is used by all item delegates. If you set a new default factory with setDefaultFactory(), the new factory will be used by existing and new delegates.

A factory keeps a collection of QItemEditorCreatorBase instances, which are specialized editors that produce editors for one particular QVariant data type (All Qt models store their data in QVariants).

Source

pub unsafe fn register_editor( &self, user_type: c_int, creator: impl CastInto<Ptr<QItemEditorCreatorBase>>, )

Registers an item editor creator specified by creator for the given userType of data.

Calls C++ function: void QItemEditorFactory::registerEditor(int userType, QItemEditorCreatorBase* creator).

C++ documentation:

Registers an item editor creator specified by creator for the given userType of data.

Note: The factory takes ownership of the item editor creator and will destroy it if a new creator for the same type is registered later.

See also createEditor().

Source

pub unsafe fn set_default_factory( factory: impl CastInto<Ptr<QItemEditorFactory>>, )

Sets the default item editor factory to the given factory. Both new and existing delegates will use the new factory.

Calls C++ function: static void QItemEditorFactory::setDefaultFactory(QItemEditorFactory* factory).

C++ documentation:

Sets the default item editor factory to the given factory. Both new and existing delegates will use the new factory.

See also defaultFactory().

Source

pub unsafe fn value_property_name(&self, user_type: c_int) -> CppBox<QByteArray>

Returns the property name used to access data for the given userType of data.

Calls C++ function: virtual QByteArray QItemEditorFactory::valuePropertyName(int userType) const.

C++ documentation:

Returns the property name used to access data for the given userType of data.

Trait Implementations§

Source§

impl CppDeletable for QItemEditorFactory

Source§

unsafe fn delete(&self)

Destroys the item editor factory.

Calls C++ function: virtual [destructor] void QItemEditorFactory::~QItemEditorFactory().

C++ documentation:

Destroys the item editor factory.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

Source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> StaticUpcast<T> for T

Source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.