Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQmlPreviewFileEngineHandler Class Reference

#include <qqmlpreviewfileengine.h>

+ Inheritance diagram for QQmlPreviewFileEngineHandler:
+ Collaboration diagram for QQmlPreviewFileEngineHandler:

Public Member Functions

 QQmlPreviewFileEngineHandler (QQmlPreviewFileLoader *loader)
 
std::unique_ptr< QAbstractFileEnginecreate (const QString &fileName) const override
 If this file handler can handle fileName, this method creates a file engine and returns it wrapped in a std::unique_ptr; otherwise returns nullptr.
 
- Public Member Functions inherited from QAbstractFileEngineHandler
 QAbstractFileEngineHandler ()
 Constructs a file handler and registers it with Qt.
 
virtual ~QAbstractFileEngineHandler ()
 Destroys the file handler.
 

Detailed Description

Definition at line 91 of file qqmlpreviewfileengine.h.

Constructor & Destructor Documentation

◆ QQmlPreviewFileEngineHandler()

QQmlPreviewFileEngineHandler::QQmlPreviewFileEngineHandler ( QQmlPreviewFileLoader * loader)

Definition at line 386 of file qqmlpreviewfileengine.cpp.

Member Function Documentation

◆ create()

std::unique_ptr< QAbstractFileEngine > QQmlPreviewFileEngineHandler::create ( const QString & fileName) const
overridevirtual

If this file handler can handle fileName, this method creates a file engine and returns it wrapped in a std::unique_ptr; otherwise returns nullptr.

Example:

std::unique_ptr<QAbstractFileEngine> ZipEngineHandler::create(const QString &fileName) const
{
// ZipEngineHandler returns a ZipEngine for all .zip files
if (fileName.toLower().endsWith(".zip"_L1))
return std::make_unique<ZipEngine>(fileName);
else
return {};
}
See also
QAbstractFileEngine::create()

Implements QAbstractFileEngineHandler.

Definition at line 391 of file qqmlpreviewfileengine.cpp.

References absolutePath(), QString::chop(), QPointer< T >::data(), QString::endsWith(), fileName, QQmlPreviewFileLoader::isBlacklisted(), QString::isEmpty(), isRootPath(), and QString::startsWith().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: