mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-05 20:20:52 +01:00
add class ElementProvider and build small ui for the properties of folio report element
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2672 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
34
sources/ui/folioreportproperties.cpp
Normal file
34
sources/ui/folioreportproperties.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "folioreportproperties.h"
|
||||
#include "ui_folioreportproperties.h"
|
||||
|
||||
#include <diagramposition.h>
|
||||
#include <elementprovider.h>
|
||||
|
||||
FolioReportProperties::FolioReportProperties(Element *elmt, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
element_(elmt),
|
||||
ui(new Ui::FolioReportProperties)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ElementProvider ep(element_->diagram()->project(), element_->diagram());
|
||||
QList <Element *> elmt_list = ep.FreeElement(Element::report);
|
||||
|
||||
foreach (Element *elmt, elmt_list) {
|
||||
if (elmt != element_) {
|
||||
QString button_text;
|
||||
button_text += elmt->name();
|
||||
button_text += QString(tr(" Folio\240: %1, ")).arg(elmt->diagram()->folioIndex() + 1);
|
||||
button_text += QString(tr("Position\240: %1")).arg(elmt->diagram() -> convertPosition(elmt -> scenePos()).toString());
|
||||
|
||||
QRadioButton *rb = new QRadioButton(button_text , this);
|
||||
ui->available_report_layout->addWidget(rb);
|
||||
}
|
||||
}
|
||||
ui->available_report_layout->addStretch();
|
||||
}
|
||||
|
||||
FolioReportProperties::~FolioReportProperties()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
Reference in New Issue
Block a user