13 #ifndef __PLUGIN_API_UTIL_H__ 14 #define __PLUGIN_API_UTIL_H__ 62 explicit
FileIO(QObject *parent = 0);
69 Q_INVOKABLE QString
read();
78 Q_INVOKABLE
bool write(const QString& data);
82 Q_INVOKABLE QString
homePath() {QDir dir;
return dir.homePath();}
84 Q_INVOKABLE QString
tempPath() {QDir dir;
return dir.tempPath();}
101 void error(
const QString& msg);
124 Q_INVOKABLE
void start(
const QString& program) { QProcess::start(program); }
126 Q_INVOKABLE
bool waitForFinished(
int msecs = 30000) {
return QProcess::waitForFinished(msecs); }
139 Q_PROPERTY(QColor color READ color WRITE setColor)
141 Q_PROPERTY(qreal scale READ scale WRITE setScale)
148 QRectF _boundingRect;
150 QNetworkAccessManager* networkManager;
152 virtual
void setScore(
Ms::
Score*) override;
154 virtual
void dataChanged(const QRectF&)
override { update(); }
157 virtual void paint(QPainter*)
override;
166 Q_INVOKABLE
void setCurrentPage(
int n);
168 Q_INVOKABLE
void nextPage();
170 Q_INVOKABLE
void prevPage();
176 QColor
color()
const {
return _color; }
180 virtual const QRect
geometry()
const override {
return QRect(QQuickPaintedItem::x(), y(), width(), height()); }
void setColor(const QColor &c)
Definition: util.h:177
This is an GUI element to show a score.
Definition: util.h:136
Q_INVOKABLE bool remove()
Removes the file.
Definition: util.cpp:102
Q_INVOKABLE bool write(const QString &data)
Writes a string to the file.
Definition: util.cpp:83
MsProcess(QObject *parent=0)
Definition: util.h:120
void error(const QString &msg)
Emitted on file operations errors.
Q_INVOKABLE void start(const QString &program)
Definition: util.h:124
Definition of Score class.
virtual const QRect geometry() const override
Definition: util.h:180
void setScale(qreal v)
Definition: util.h:179
Q_INVOKABLE QByteArray readAllStandardOutput()
Definition: util.h:128
Q_INVOKABLE int modifiedTime()
Returns the file's last modification time.
Definition: util.cpp:117
QString mSource
Definition: util.h:104
virtual QRectF boundingRect() const override
Definition: util.h:159
Q_INVOKABLE bool waitForFinished(int msecs=30000)
Definition: util.h:126
virtual ~ScoreView()
Definition: util.h:175
Provides a simple API to perform file reading and writing operations.
Definition: util.h:52
QColor color() const
Definition: util.h:176
virtual void drawBackground(QPainter *, const QRectF &) const override
Definition: util.h:160
Q_INVOKABLE QString read()
Reads file contents and returns a string.
Definition: util.cpp:54
Definition: aeolus.cpp:26
Q_INVOKABLE QString tempPath()
Returns a path suitable for a temporary file.
Definition: util.h:84
Start an external program. Available in QML as QProcess.
Definition: util.h:116
qreal scale() const
Definition: util.h:178
QString source()
Definition: util.h:89
Q_INVOKABLE bool exists()
Returns true if the file exists.
Definition: util.cpp:111
Q_INVOKABLE QString homePath()
Returns user's home directory.
Definition: util.h:82
void setSource(const QString &source)
Definition: util.h:92
Definition: mscoreview.h:32
virtual void updateAll() override
Definition: util.h:155