Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit b61870a

Browse files
committed
added more quick qml doc, excluded internal types
1 parent a3f19ba commit b61870a

File tree

5 files changed

+257
-89
lines changed

5 files changed

+257
-89
lines changed

doc/Doxyfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ ALIASES = "accessors{1}=<table><tr><th colspan= 2>Accessors</th><
250250
storedAc{1}=<tr><td><b>STORED</b></td><td>\1</td></tr> \
251251
userAc{1}=<tr><td><b>USER</b></td><td>\1</td></tr> \
252252
"constantAc=<tr><td colspan= 2><b>CONSTANT</b></td></tr>" \
253+
"readonlyAc=<tr><td colspan= 2><b>READ ONLY</b></td></tr>" \
253254
"finalAc=<tr><td colspan= 2><b>FINAL</b></td></tr>" \
254255
"default{1}=<b>Default:</b> \1 <br>" \
255256
"readAcFn{1}=READ accessor for \1" \
@@ -896,7 +897,16 @@ RECURSIVE = YES
896897
# run.
897898

898899
EXCLUDE = ../src/3rdparty \
899-
../src/plugins
900+
../src/plugins \
901+
../src/imports/mvvmquick/settingsuibuilder.h \
902+
../src/imports/mvvmquick/TintIcon.qml \
903+
../src/imports/mvvmquick/MsgBoxBase.qml \
904+
../src/imports/mvvmquick/MsgBox.qml \
905+
../src/imports/mvvmquick/InputDialog.qml \
906+
../src/imports/mvvmquick/ListSection.qml \
907+
../src/imports/mvvmquick/OverviewListView.qml \
908+
../src/imports/mvvmquick/AndroidFileDialog.qml \
909+
../src/imports/mvvmquick/AndroidFolderDialog.qml
900910

901911
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
902912
# directories that are symbolic links (a Unix file system feature) are excluded
@@ -919,7 +929,8 @@ EXCLUDE_PATTERNS = moc_* \
919929
*_p.* \
920930
*.cpp \
921931
*/src/mvvmquick/*.qml \
922-
*/src/mvvmdatasyncquick/*.qml
932+
*/src/mvvmdatasyncquick/*.qml \
933+
*/imports/mvvmquick/*model.h
923934

924935
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
925936
# (namespaces, classes, functions, etc.) that should be excluded from the
@@ -935,6 +946,9 @@ EXCLUDE_SYMBOLS = QtMvvm::__helpertypes \
935946
QtMvvmQuickDeclarativeModule \
936947
QtMvvmDataSyncCoreDeclarativeModule \
937948
QtMvvmDataSyncQuickDeclarativeModule \
949+
QtMvvm::MultiFilterProxyModel \
950+
QtMvvm::SettingsEntryModel \
951+
QtMvvm::SettingsSectionModel \
938952
\
939953
QAbstractAspect \
940954
QAndroidActivityResultReceiver \
@@ -956,7 +970,6 @@ EXCLUDE_SYMBOLS = QtMvvm::__helpertypes \
956970
ApplicationWindow \
957971
Dialog \
958972
Drawer \
959-
FileChooser \
960973
Item \
961974
Label \
962975
ListView \

doc/qtmvvm.dox

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,26 @@ The following list shows which classes belong to which Qt module, in alphabetica
6666

6767
<b>Current Version</b><br/>
6868
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.0
69+
70+
<b>Available Types</b>
71+
- @ref QtMvvm::InputViewFactory "InputViewFactory" (uncreatable)
72+
- QuickPresenter (singleton)
73+
- FileChooser
74+
- AlertDialog
75+
- ContrastToolBar
76+
- ToolBarLabel
77+
- ActionButton
78+
- RoundActionButton
79+
- MenuButton
80+
- FileDialog
81+
- FolderDialog
82+
- PresenterProgress
83+
- PresentingStackView
84+
- PopupPresenter
85+
- DialogPresenter
86+
- PresentingDrawer
87+
- SettingsView
88+
- QtMvvmApp
6989
*/
7090

7191
/*!

src/imports/mvvmquick/androidfilechooser.cpp

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,6 @@ AndroidFileChooser::AndroidFileChooser(QObject *parent) :
1616

1717
AndroidFileChooser::~AndroidFileChooser() {}
1818

19-
QString AndroidFileChooser::title() const
20-
{
21-
return _title;
22-
}
23-
24-
QUrl AndroidFileChooser::folderUrl() const
25-
{
26-
return _folderUrl;
27-
}
28-
29-
AndroidFileChooser::ChooserType AndroidFileChooser::type() const
30-
{
31-
return _type;
32-
}
33-
34-
QStringList AndroidFileChooser::mimeTypes() const
35-
{
36-
return _mimeTypes;
37-
}
38-
3919
AndroidFileChooser::ChooserFlags AndroidFileChooser::chooserFlags() const
4020
{
4121
return _flags;
@@ -83,42 +63,6 @@ void AndroidFileChooser::open()
8363
this);
8464
}
8565

86-
void AndroidFileChooser::setTitle(const QString &title)
87-
{
88-
if (_title == title)
89-
return;
90-
91-
_title = title;
92-
emit titleChanged(title);
93-
}
94-
95-
void AndroidFileChooser::setFolderUrl(const QUrl &contentUrl)
96-
{
97-
if (_folderUrl == contentUrl)
98-
return;
99-
100-
_folderUrl = contentUrl;
101-
emit folderUrlChanged(contentUrl);
102-
}
103-
104-
void AndroidFileChooser::setType(AndroidFileChooser::ChooserType type)
105-
{
106-
if (_type == type)
107-
return;
108-
109-
_type = type;
110-
emit typeChanged(type);
111-
}
112-
113-
void AndroidFileChooser::setMimeTypes(const QStringList &mimeType)
114-
{
115-
if (_mimeTypes == mimeType)
116-
return;
117-
118-
_mimeTypes = mimeType;
119-
emit mimeTypesChanged(mimeType);
120-
}
121-
12266
void AndroidFileChooser::setChooserFlags(ChooserFlags chooserFlags)
12367
{
12468
if (_flags == chooserFlags)

src/imports/mvvmquick/androidfilechooser.h

Lines changed: 117 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,73 +8,166 @@
88
#include <QtAndroidExtras/QAndroidActivityResultReceiver>
99
#include <QtAndroidExtras/QAndroidJniObject>
1010

11+
#ifdef DOXYGEN_RUN
12+
namespace de::skycoder42::QtMvvm::Quick {
13+
14+
/*! @brief A QML class access the native file chooser on android
15+
*
16+
* @since 1.0
17+
*
18+
* @warning Available on android only!
19+
*
20+
* A C++ wrapper around the android java API to access the native file chooser. It can only
21+
* be used on Android, and serves as the base for the android implementation of the file and
22+
* folder dialogs.
23+
*
24+
* @sa FileDialog, FolderDialog
25+
*/
26+
class FileChooser : public QtObject
27+
#else
1128
namespace QtMvvm {
1229

1330
class AndroidFileChooser : public QObject, public QAndroidActivityResultReceiver
31+
#endif
1432
{
1533
Q_OBJECT
1634

17-
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
18-
19-
Q_PROPERTY(QUrl folderUrl READ folderUrl WRITE setFolderUrl NOTIFY folderUrlChanged)
20-
Q_PROPERTY(ChooserType type READ type WRITE setType NOTIFY typeChanged)
21-
Q_PROPERTY(QStringList mimeTypes READ mimeTypes WRITE setMimeTypes NOTIFY mimeTypesChanged)
35+
/*! @brief The activity title/description of the file chooser
36+
*
37+
* @default{<i>Empty</i>}
38+
*
39+
* @accessors{
40+
* @memberAc{title}
41+
* @notifyAc{titleChanged()}
42+
* }
43+
*/
44+
Q_PROPERTY(QString title MEMBER _title NOTIFY titleChanged)
45+
46+
/*! @brief The URL of the place to show the dialog from
47+
*
48+
* @default{<i>Empty</i>}
49+
*
50+
* @accessors{
51+
* @memberAc{folderUrl}
52+
* @notifyAc{folderUrlChanged()}
53+
* }
54+
*/
55+
Q_PROPERTY(QUrl folderUrl MEMBER _folderUrl NOTIFY folderUrlChanged)
56+
/*! @brief The type of URL to get
57+
*
58+
* @default{`FileChooser::OpenDocument`}
59+
*
60+
* Basically the open mode to get a fitting URL for.
61+
*
62+
* @accessors{
63+
* @memberAc{type}
64+
* @notifyAc{typeChanged()}
65+
* }
66+
*
67+
* @sa FileChooser::ChooserType
68+
*/
69+
Q_PROPERTY(ChooserType type MEMBER _type NOTIFY typeChanged)
70+
/*! @brief A list of acceptable mimetypes. Can contain wildcards
71+
*
72+
* @default{`["*@/*"]` (with just 1 slash instead of `@/`)}
73+
*
74+
* @accessors{
75+
* @memberAc{mimeTypes}
76+
* @notifyAc{mimeTypesChanged()}
77+
* }
78+
*/
79+
Q_PROPERTY(QStringList mimeTypes MEMBER _mimeTypes NOTIFY mimeTypesChanged)
80+
/*! @brief Additional flags to configure the chooser
81+
*
82+
* @default{`FileChooser::OpenableFlag | FileChooser::AlwaysGrantWriteFlag`}
83+
*
84+
* @accessors{
85+
* @memberAc{chooserFlags}
86+
* @notifyAc{chooserFlagsChanged()}
87+
* }
88+
*
89+
* @sa FileChooser::ChooserFlag
90+
*/
2291
Q_PROPERTY(ChooserFlags chooserFlags READ chooserFlags WRITE setChooserFlags NOTIFY chooserFlagsChanged)
2392

93+
/*! @brief The chooser result url(s) the user selected
94+
*
95+
* @default{<i>Invalid</i>}
96+
*
97+
* Can either be a single QUrl or a QList<QUrl>. The list is only returned when
98+
* FileChooser::OpenMultipleDocuments is used as FileChooser::type. For all other cases
99+
* a single QUrl is returned.
100+
*
101+
* @accessors{
102+
* @memberAc{folderUrl}
103+
* @notifyAc{folderUrlChanged()}
104+
* @readonlyAc
105+
* }
106+
*/
24107
Q_PROPERTY(QVariant result READ result NOTIFY resultChanged)
25108

26109
public:
110+
//! The different modes the chooser can return urls for
27111
enum ChooserType {
28-
GetContent = 0,
29-
OpenDocument = 1,
30-
OpenMultipleDocuments = 2,
31-
CreateDocument = 3,
32-
OpenDocumentTree = 4
112+
GetContent = 0, //!< Get a non-permanent, read only content url
113+
OpenDocument = 1, //!< Get a permanent content url
114+
OpenMultipleDocuments = 2, //!< Get a list of permanent content urls
115+
CreateDocument = 3, //!< Create a new permanent content url
116+
OpenDocumentTree = 4 //!< Get a URL to content folder
33117
};
34118
Q_ENUM(ChooserType)
35119

120+
//! Extra flags to configure how to open the URLs
36121
enum ChooserFlag {
37-
OpenableFlag = 0x01,
38-
LocalOnlyFlag = 0x02,
39-
AlwaysGrantWriteFlag = 0x04,
40-
PersistPermissionsFlag = 0x08
122+
OpenableFlag = 0x01, //!< The returned URL must be openable (for reading)
123+
LocalOnlyFlag = 0x02, //!< Only local files are allowed
124+
AlwaysGrantWriteFlag = 0x04, //!< Always allow writing, not only for FileChooser::CreateDocument
125+
PersistPermissionsFlag = 0x08 //!< Persist the permission to access the content across reboots
41126
};
42127
Q_DECLARE_FLAGS(ChooserFlags, ChooserFlag)
43128
Q_FLAG(ChooserFlags)
44129

130+
//! @private
45131
explicit AndroidFileChooser(QObject *parent = nullptr);
46132
~AndroidFileChooser();
47133

48-
QString title() const;
49-
QUrl folderUrl() const;
50-
ChooserType type() const;
51-
QStringList mimeTypes() const;
134+
//! @private
52135
ChooserFlags chooserFlags() const;
53-
136+
//! @private
54137
QVariant result() const;
55138

139+
#ifdef DOXYGEN_RUN
140+
public:
141+
#else
56142
public Q_SLOTS:
143+
#endif
144+
//! Opens the file chooser by sending the show intent
57145
void open();
58146

59-
void setTitle(const QString &title);
60-
void setFolderUrl(const QUrl &folderUrl);
61-
void setType(ChooserType type);
62-
void setMimeTypes(const QStringList &mimeTypes);
147+
//! @private
63148
void setChooserFlags(ChooserFlags chooserFlags);
64149

65150
Q_SIGNALS:
151+
//! Emitted when the user select a url (or multiple)
66152
void accepted();
153+
//! Emitted when the user cancels without selecting a url
67154
void rejected();
68155

156+
//! @notifyAcFn{FileChooser::title}
69157
void titleChanged(const QString &title);
158+
//! @notifyAcFn{FileChooser::folderUrl}
70159
void folderUrlChanged(const QUrl &folderUrl);
160+
//! @notifyAcFn{FileChooser::type}
71161
void typeChanged(ChooserType type);
162+
//! @notifyAcFn{FileChooser::mimeTypes}
72163
void mimeTypesChanged(const QStringList &mimeTypes);
164+
//! @notifyAcFn{FileChooser::chooserFlags}
73165
void chooserFlagsChanged(ChooserFlags chooserFlags);
74-
166+
//! @notifyAcFn{FileChooser::result}
75167
void resultChanged(QVariant result);
76168

77169
protected:
170+
//! @private
78171
void handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject &data) override;
79172

80173
private:

0 commit comments

Comments
 (0)