Open-Typer
Open source typewriting tutor program
Loading...
Searching...
No Matches
QmlFileDialog Class Reference

The QmlFileDialog class provides a file dialog for QML. This file dialog supports file uploads on WebAssembly. More...

#include "framework/uicomponents/internal/QmlFileDialog.h"

Inheritance diagram for QmlFileDialog:
Collaboration diagram for QmlFileDialog:

Signals

void nameFiltersChanged (QStringList filters)
 
void showAllFilesChanged (bool value)
 
void fileNameChanged (QString name)
 
void shortFileNameChanged (QString name)
 
void fileContentReady (QString content)
 
void defaultSuffixChanged ()
 

Public Member Functions

QStringList nameFilters (void)
 
void setNameFilters (QStringList filters)
 
bool showAllFiles (void)
 
void setShowAllFiles (bool value)
 
QString fileName (void)
 
QString shortFileName (void)
 
const QString & defaultSuffix () const
 
void setDefaultSuffix (const QString &newDefaultSuffix)
 
Q_INVOKABLE void getOpenFileContent (void)
 
Q_INVOKABLE QString getSaveFileName ()
 

Properties

QStringList nameFilters
 
bool showAllFiles
 
QString fileName
 
QString shortFileName
 
QString defaultSuffix
 

Private Member Functions

QString getFilters ()
 

Private Attributes

QStringList m_nameFilters
 
bool m_showAllFiles = true
 
QString m_fileName
 
QString m_defaultSuffix
 

Detailed Description

The QmlFileDialog class provides a file dialog for QML. This file dialog supports file uploads on WebAssembly.

Member Function Documentation

◆ defaultSuffix()

const QString & QmlFileDialog::defaultSuffix ( ) const

Use this to set a file extension for saving.

Since
Open-Typer 5.2.0

◆ getOpenFileContent()

void QmlFileDialog::getOpenFileContent ( void  )

Shows a file dialog and emits fileContentReady() after a file is selected.

◆ getSaveFileName()

QString QmlFileDialog::getSaveFileName ( )

Shows a file dialog and returns a file name selected by the user.

Since
Open-Typer 5.2.0

Property Documentation

◆ fileName

QString QmlFileDialog::fileName
read

The file name of the selected file (after running getOpenFileContent()).

◆ nameFilters

QStringList QmlFileDialog::nameFilters
readwrite

List of name filters, for example: [ "Image files (*.jpg *.png)", "Text files (*.txt)" ]
"All files" will be included by default. To disable it, set showAllFiles to false.

◆ shortFileName

QString QmlFileDialog::shortFileName
read

The short file name of the selected file (use this after running getOpenFileContent()).
A short file name doesn't contain parent directories.

◆ showAllFiles

bool QmlFileDialog::showAllFiles
readwrite

Set this to true to enable the "All files" name filter.


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