Loading...
Searching...
No Matches
score::DocumentBuilder Class Reference

Methods to set-up documents. More...

Detailed Description

Methods to set-up documents.

Facility to construct a Document according to different cases :

  • Creating a blank, new document.
  • Loading a document.
  • Restoring a document after a crash.

Public Member Functions

 DocumentBuilder (QObject *parentPresenter, QWidget *parentView)
 
Document * newDocument (const score::GUIApplicationContext &ctx, const Id< DocumentModel > &id, score::DocumentDelegateFactory &doctype)
 
Document * newDocumentFromTemplate (const score::GUIApplicationContext &ctx, const Id< DocumentModel > &id, const QString &templatePath, score::DocumentDelegateFactory &doctype)
 Creates a new, untitled document from an existing .score file.
 
Document * loadDocument (const score::GUIApplicationContext &ctx, QString filename, score::DocumentDelegateFactory &doctype)
 
Document * loadDocument (const score::GUIApplicationContext &ctx, QString filename, QByteArray data, SerializationIdentifier format, score::DocumentDelegateFactory &doctype)
 
Document * restoreDocument (const score::GUIApplicationContext &ctx, const score::RestorableDocument &doc, score::DocumentDelegateFactory &doctype)
 

Member Function Documentation

◆ newDocumentFromTemplate()

Document * score::DocumentBuilder::newDocumentFromTemplate ( const score::GUIApplicationContext &  ctx,
const Id< DocumentModel > &  id,
const QString &  templatePath,
score::DocumentDelegateFactory &  doctype 
)

Creates a new, untitled document from an existing .score file.

The file is loaded like any document, then detached from its path so that saving never overwrites the template. Returns nullptr on failure.


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