Remove 'save' button from pipeline table
Quite unnecessary feature. Instead, added a more helpful tooltip for the copy operation.
MODIFY
src/pipelinetable.cpp
src/pipelinetable.cpp
@@ -9,6 +9,8 @@ PipelineTable::PipelineTable(QWidget* parent) : QDialog(parent), ui(new Ui::Pipe
ui->setupUi(this);
this->setModal(true);
ui->table->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
+
+ ui->description->setText(QString("<b>Note:</b> The pipeline table can be copied as tab separated,<br>suitable for pasting into a spreadsheet"));
}
void PipelineTable::setModel(QAbstractItemModel* model) {
@@ -20,23 +22,6 @@ PipelineTable::~PipelineTable() {
delete ui;
}
-void PipelineTable::on_save_clicked() {
- QFileDialog dialog;
- dialog.setNameFilter("*.png");
- dialog.setAcceptMode(QFileDialog::AcceptSave);
- dialog.setOption(QFileDialog::DontUseNativeDialog);
- if (dialog.exec()) {
- auto files = dialog.selectedFiles();
- if (files.length() == 1) {
- ui->table->resizeColumnsToContents();
- ui->table->resizeRowsToContents();
- QPixmap pixmap(ui->table->size());
- ui->table->render(&pixmap);
- pixmap.save(files[0]);
- }
- }
-}
-
void PipelineTable::on_copy_clicked() {
// Copy entire table to clipboard, including headers
Q_ASSERT(m_model != nullptr);

MODIFY
src/pipelinetable.h
src/pipelinetable.h
@@ -18,8 +18,6 @@ public:
void setModel(QAbstractItemModel* model);
private slots:
- void on_save_clicked();
-
void on_copy_clicked();
private:

MODIFY
src/pipelinetable.ui
src/pipelinetable.ui
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
- <widget class="QToolButton" name="save">
- <property name="toolTip">
- <string>Save image of currently viewable part of table</string>
- </property>
+ <widget class="QLabel" name="description">
<property name="text">
- <string>...</string>
- </property>
- <property name="icon">
- <iconset resource="../resources/images.qrc">
- <normaloff>:/icons/save.svg</normaloff>:/icons/save.svg</iconset>
+ <string>description...</string>
</property>
- <property name="iconSize">
- <size>
- <width>24</width>
- <height>24</height>
- </size>
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
</property>
</widget>
</item>

Remove 'save' button from pipeline table

Quite unnecessary feature. Instead, added a more helpful tooltip for the copy operation.