28 #ifndef EXPORTABLETABLEVIEW_H 29 #define EXPORTABLETABLEVIEW_H 32 #include <QApplication> 35 #include <QFileDialog> 39 #include <QStandardPaths> 149 #endif // EXPORTABLETABLEVIEW_H static QString getDefaultHtmlStyle()
Get the default style sheet used for HTML export.
void save()
Saves currently selected cell(s) to a file of the user's choice and format.
QString toHtml(const QModelIndexList &indexList) const
Saves data from the passed model indices to an HTML-formatted string.
The ExportableTableView class provides a regular QTableView but with features to export the data as p...
void setHtmlStyle(const QString &value)
Set the style sheet for HTML export.
void onCustomContextMenuRequested(const QPoint &pos)
bool saveToFile(const QModelIndexList &indexList, const QString &fileName=QString())
Saves data from the passed model indices to a file in text or HTML format.
void copyText(const QString &delim=QString("\t"))
Copies currently selected cell(s) to the clipboard as plain text.
static QString getDefaultHtmlTemplate()
Get the default overall template used for HTML export.
void copy()
Designed for QAction connections, it calls copyText() or copyHtml() based on delimiter specified in s...
ExportableTableView(QWidget *parent=Q_NULLPTR)
ExportableTableView.
QString toPlainText(const QModelIndexList &indexList, const QString &delim="\t") const
Saves data from the passed model indices to a text string.
QModelIndexList getSelectedOrAll()
Return a list of selected cells.
QSize sizeHint() const override
QObject * parent() const const
void setHtmlTemplate(const QString &value)
Set the overall template for HTML export.
void copyHtml()
Copies currently selected cell(s) to the clipboard as HTML (with MIME content-type "text/html").