[][src]Struct qt_qml::QQmlFileSelector

#[repr(C)]pub struct QQmlFileSelector { /* fields omitted */ }

QQmlFileSelector will automatically apply a QFileSelector to qml file and asset paths.

C++ class: QQmlFileSelector.

C++ documentation:

QQmlFileSelector will automatically apply a QFileSelector to qml file and asset paths.

It is used as follows:

QQmlEngine engine; QQmlFileSelector* selector = new QQmlFileSelector(&engine);

Then you can swap out files like so:

main.qml Component.qml asset.png +unix/Component.qml +mac/asset.png

In this example, main.qml will normally use Component.qml for the Component type. However on a unix platform, the unix selector will be present and the +unix/Component.qml version will be used instead. Note that this acts like swapping out Component.qml with +unix/Component.qml, so when using Component.qml you should not need to alter any paths based on which version was selected.

For example, to pass the "asset.png" file path around you would refer to it just as "asset.png" in all of main.qml, Component.qml, and +linux/Component.qml. It will be replaced with +mac/asset.png on Mac platforms in all cases.

For a list of available selectors, see QFileSelector.

Your platform may also provide additional selectors for you to use. As specified by QFileSelector, directories used for selection must start with a '+' character, so you will not accidentally trigger this feature unless you have directories with such names inside your project.

If a new QQmlFileSelector is set on the engine, the old one will be replaced. Use QQmlFileSelector::get() to query or use the existing instance.

Methods

impl QQmlFileSelector[src]

pub unsafe fn get(
    arg1: impl CastInto<Ptr<QQmlEngine>>
) -> QPtr<QQmlFileSelector>
[src]

Gets the QQmlFileSelector currently active on the target engine.

Calls C++ function: static QQmlFileSelector* QQmlFileSelector::get(QQmlEngine* arg1).

C++ documentation:

Gets the QQmlFileSelector currently active on the target engine.

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QQmlFileSelector::metaObject() const.

pub unsafe fn new_2a(
    engine: impl CastInto<Ptr<QQmlEngine>>,
    parent: impl CastInto<Ptr<QObject>>
) -> QBox<QQmlFileSelector>
[src]

Creates a new QQmlFileSelector with parent object parent, which includes its own QFileSelector. engine is the QQmlEngine you wish to apply file selectors to. It will also take ownership of the QQmlFileSelector.

Calls C++ function: [constructor] void QQmlFileSelector::QQmlFileSelector(QQmlEngine* engine, QObject* parent = …).

C++ documentation:

Creates a new QQmlFileSelector with parent object parent, which includes its own QFileSelector. engine is the QQmlEngine you wish to apply file selectors to. It will also take ownership of the QQmlFileSelector.

pub unsafe fn new_1a(
    engine: impl CastInto<Ptr<QQmlEngine>>
) -> QBox<QQmlFileSelector>
[src]

Creates a new QQmlFileSelector with parent object parent, which includes its own QFileSelector. engine is the QQmlEngine you wish to apply file selectors to. It will also take ownership of the QQmlFileSelector.

Calls C++ function: [constructor] void QQmlFileSelector::QQmlFileSelector(QQmlEngine* engine).

C++ documentation:

Creates a new QQmlFileSelector with parent object parent, which includes its own QFileSelector. engine is the QQmlEngine you wish to apply file selectors to. It will also take ownership of the QQmlFileSelector.

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QQmlFileSelector::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QQmlFileSelector::qt_metacast(const char* arg1).

pub unsafe fn selector(&self) -> QPtr<QFileSelector>[src]

Returns the QFileSelector instance used by the QQmlFileSelector.

Calls C++ function: QFileSelector* QQmlFileSelector::selector() const.

C++ documentation:

Returns the QFileSelector instance used by the QQmlFileSelector.

This function was introduced in Qt 5.7.

See also setSelector().

pub unsafe fn set_extra_selectors_q_string_list(
    &self,
    strings: impl CastInto<Ref<QStringList>>
)
[src]

Adds extra selectors contained in strings to the current QFileSelector being used. Use this when extra selectors are all you need to avoid having to create your own QFileSelector instance.

Calls C++ function: void QQmlFileSelector::setExtraSelectors(QStringList& strings).

C++ documentation:

Adds extra selectors contained in strings to the current QFileSelector being used. Use this when extra selectors are all you need to avoid having to create your own QFileSelector instance.

pub unsafe fn set_extra_selectors_q_string_list2(
    &self,
    strings: impl CastInto<Ref<QStringList>>
)
[src]

Adds extra selectors contained in strings to the current QFileSelector being used. Use this when extra selectors are all you need to avoid having to create your own QFileSelector instance.

Calls C++ function: void QQmlFileSelector::setExtraSelectors(const QStringList& strings).

C++ documentation:

Adds extra selectors contained in strings to the current QFileSelector being used. Use this when extra selectors are all you need to avoid having to create your own QFileSelector instance.

pub unsafe fn set_selector(&self, selector: impl CastInto<Ptr<QFileSelector>>)[src]

Sets the QFileSelector instance for use by the QQmlFileSelector to selector. QQmlFileSelector does not take ownership of the new QFileSelector. To reset QQmlFileSelector to use its internal QFileSelector instance, call setSelector(0).

Calls C++ function: void QQmlFileSelector::setSelector(QFileSelector* selector).

C++ documentation:

Sets the QFileSelector instance for use by the QQmlFileSelector to selector. QQmlFileSelector does not take ownership of the new QFileSelector. To reset QQmlFileSelector to use its internal QFileSelector instance, call setSelector(0).

See also selector().

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn tr(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QQmlFileSelector::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QQmlFileSelector::trUtf8(const char* s, const char* c, int n).

Trait Implementations

impl CppDeletable for QQmlFileSelector[src]

unsafe fn delete(&self)[src]

Destroys the QQmlFileSelector object.

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

C++ documentation:

Destroys the QQmlFileSelector object.

impl Deref for QQmlFileSelector[src]

type Target = QObject

The resulting type after dereferencing.

fn deref(&self) -> &QObject[src]

Calls C++ function: QObject* static_cast<QObject*>(QQmlFileSelector* ptr).

impl DynamicCast<QQmlFileSelector> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QQmlFileSelector>[src]

Calls C++ function: QQmlFileSelector* dynamic_cast<QQmlFileSelector*>(QObject* ptr).

impl StaticDowncast<QQmlFileSelector> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QQmlFileSelector>[src]

Calls C++ function: QQmlFileSelector* static_cast<QQmlFileSelector*>(QObject* ptr).

impl StaticUpcast<QObject> for QQmlFileSelector[src]

unsafe fn static_upcast(ptr: Ptr<QQmlFileSelector>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QQmlFileSelector* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.