mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 02:10:52 +01:00
make user text for folio report none editable
Add signal mapper for radiobutton in the folio report dialog git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2679 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -3,19 +3,45 @@
|
||||
|
||||
#include <diagramposition.h>
|
||||
#include <elementprovider.h>
|
||||
#include <qetgraphicsitem/elementtextitem.h>
|
||||
|
||||
/**
|
||||
* @brief FolioReportProperties::FolioReportProperties : Construcor
|
||||
* @param elmt : The edited element
|
||||
* @param parent : Parent widget
|
||||
*/
|
||||
FolioReportProperties::FolioReportProperties(Element *elmt, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
element_(elmt),
|
||||
element_to_link(0),
|
||||
ui(new Ui::FolioReportProperties)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
sm_ = new QSignalMapper(this);
|
||||
connect(sm_, SIGNAL(mapped(int)) , this, SLOT(linkToElement(int)));
|
||||
|
||||
BuildRadioList();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioReportProperties::~FolioReportProperties : Destructor
|
||||
*/
|
||||
FolioReportProperties::~FolioReportProperties()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioReportProperties::BuildRadioList : build the radio list for each available folio report
|
||||
*/
|
||||
void FolioReportProperties::BuildRadioList() {
|
||||
ElementProvider ep(element_->diagram()->project(), element_->diagram());
|
||||
QList <Element *> elmt_list = ep.FreeElement(REPORT);
|
||||
|
||||
foreach (Element *elmt, elmt_list) {
|
||||
if (elmt != element_) {
|
||||
//label for the button
|
||||
QString button_text;
|
||||
QString title = elmt->diagram()->title();
|
||||
if (title.isEmpty()) title = tr("Sans titre");
|
||||
@@ -23,14 +49,22 @@ FolioReportProperties::FolioReportProperties(Element *elmt, QWidget *parent) :
|
||||
.arg(title)
|
||||
.arg(elmt->diagram() -> convertPosition(elmt -> scenePos()).toString());
|
||||
|
||||
//button himself
|
||||
QRadioButton *rb = new QRadioButton(button_text , this);
|
||||
ui->available_report_layout->addWidget(rb);
|
||||
element_list << elmt;
|
||||
//map the radio button signal
|
||||
connect(rb, SIGNAL(clicked()), sm_, SLOT(map()));
|
||||
sm_ -> setMapping(rb, element_list.size()-1);
|
||||
}
|
||||
}
|
||||
ui->available_report_layout->addStretch();
|
||||
}
|
||||
|
||||
FolioReportProperties::~FolioReportProperties()
|
||||
{
|
||||
delete ui;
|
||||
/**
|
||||
* @brief FolioReportProperties::Apply
|
||||
* Apply the new properties for this folio report
|
||||
*/
|
||||
void FolioReportProperties::Apply() {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user