Model print and compare user customisable style (#5866)

* New feature: Model print and compare customisable style

* Layout cosmetics.

* File handling tweak
Message cosmetics
This commit is contained in:
Neil Horne
2018-05-21 10:07:49 +02:00
committed by Bertrand Songis
parent 25049d041d
commit 2f91eba85d
16 changed files with 624 additions and 77 deletions
+39 -1
View File
@@ -21,8 +21,11 @@
#ifndef _HELPERS_HTML_H_
#define _HELPERS_HTML_H_
#include <QObject>
#include <QString>
#include <QStringList>
#define THEMES_DEFAULT_PATH ":/themes/default/"
#define MODEL_PRINT_CSS "modelprt.css"
QString tdAlign(const QString & s, const QString & align, const QString & color, bool bold);
QString doTC(const QString & s, const QString & color = "", bool bold = false);
@@ -33,4 +36,39 @@ QString doTableCell(const QString & s, const unsigned int width = 0, const QStri
QString doTableRow(const QStringList & strl, const unsigned int width = 0, const QString & align = "", const QString & color = "", bool bold = false);
QString doTableBlankRow();
class Stylesheet: public QObject
{
Q_OBJECT
public:
enum StyleType {
STYLE_TYPE_NONE,
STYLE_TYPE_DEFAULT,
STYLE_TYPE_CUSTOM,
STYLE_TYPE_EFFECTIVE
};
Stylesheet(const QString & name);
Stylesheet(const QString & name, const StyleType styleType);
~Stylesheet();
bool load(const StyleType styleType);
bool update();
bool deleteCustom();
QString name();
QString text();
QString errormsg();
void setText(const QString & text);
private:
bool mResult;
QString mErrormsg;
QString mName;
QString mText;
QString mCustomFile;
QString mCustomPath;
QString mDefaultFile;
void init();
bool read(const QString & filepath);
};
#endif // _HELPERS_HTML_H_