Spreadsheet: add menu action 'Configuration table...'
To make it easy for user to create dynamically switchable configuration tables using spreadsheet.
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
#include "LineEdit.h"
|
||||
#include "PropertiesDialog.h"
|
||||
#include "DlgBindSheet.h"
|
||||
#include "DlgSheetConf.h"
|
||||
|
||||
using namespace SpreadsheetGui;
|
||||
using namespace Spreadsheet;
|
||||
@@ -183,6 +184,10 @@ SheetTableView::SheetTableView(QWidget *parent)
|
||||
connect(actionBind, SIGNAL(triggered()), this, SLOT(onBind()));
|
||||
contextMenu->addAction(actionBind);
|
||||
|
||||
QAction *actionConf = new QAction(tr("Configuration table..."),this);
|
||||
connect(actionConf, SIGNAL(triggered()), this, SLOT(onConfSetup()));
|
||||
contextMenu->addAction(actionConf);
|
||||
|
||||
horizontalHeader()->addAction(actionBind);
|
||||
verticalHeader()->addAction(actionBind);
|
||||
|
||||
@@ -222,6 +227,14 @@ void SheetTableView::onBind() {
|
||||
}
|
||||
}
|
||||
|
||||
void SheetTableView::onConfSetup() {
|
||||
auto ranges = selectedRanges();
|
||||
if(ranges.empty())
|
||||
return;
|
||||
DlgSheetConf dlg(sheet,ranges.back(),this);
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
void SheetTableView::cellProperties()
|
||||
{
|
||||
std::unique_ptr<PropertiesDialog> dialog(new PropertiesDialog(sheet, selectedRanges(), this));
|
||||
|
||||
Reference in New Issue
Block a user