mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-02 18:00:53 +01:00
folio report properties widget: add two buttons:
first see the edited report, second see the linked report (if the edited report is already linked) git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2742 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -20,7 +20,10 @@ FolioReportProperties::FolioReportProperties(Element *elmt, QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
unlink = false;
|
unlink = false;
|
||||||
if(element_->isFree()) buildRadioList();
|
if(element_->isFree()) {
|
||||||
|
buildRadioList();
|
||||||
|
ui->button_linked->setDisabled(true);
|
||||||
|
}
|
||||||
else buildUnlinkButton();
|
else buildUnlinkButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +42,7 @@ void FolioReportProperties::buildRadioList() {
|
|||||||
sm_ = new QSignalMapper(this);
|
sm_ = new QSignalMapper(this);
|
||||||
connect(sm_, SIGNAL(mapped(int)), this, SLOT(linkToElement(int)));
|
connect(sm_, SIGNAL(mapped(int)), this, SLOT(linkToElement(int)));
|
||||||
sm_show_ = new QSignalMapper(this);
|
sm_show_ = new QSignalMapper(this);
|
||||||
connect(sm_show_, SIGNAL(mapped(int)), this, SLOT(showDiagram(int)));
|
connect(sm_show_, SIGNAL(mapped(int)), this, SLOT(showElementFromList(int)));
|
||||||
|
|
||||||
//Research the invert report of @element_
|
//Research the invert report of @element_
|
||||||
int rep = element_->linkType() == Element::NextReport? Element::PreviousReport : Element::NextReport;
|
int rep = element_->linkType() == Element::NextReport? Element::PreviousReport : Element::NextReport;
|
||||||
@@ -118,13 +121,39 @@ void FolioReportProperties::unlinkClicked() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief FolioReportProperties::showDiagram
|
* @brief FolioReportProperties::showElement
|
||||||
* Show the wanted report element
|
* Show the required element
|
||||||
* @param i position of wanted element in element_list
|
* @param elmt: element to be displayed
|
||||||
*/
|
*/
|
||||||
void FolioReportProperties::showDiagram(const int i) {
|
void FolioReportProperties::showElement(Element *elmt) {
|
||||||
Element *elmt = element_list.at(i);
|
|
||||||
elmt->diagram()->showMe();
|
elmt->diagram()->showMe();
|
||||||
foreach (QGraphicsItem *qgi, elmt->diagram()->selectedItems()) qgi->setSelected(false);
|
foreach (QGraphicsItem *qgi, elmt->diagram()->selectedItems()) qgi->setSelected(false);
|
||||||
elmt->setSelected(true);
|
elmt->setSelected(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief FolioReportProperties::showElementFromList
|
||||||
|
* Show element at the position @i from @element_list
|
||||||
|
* @param i position of element to be displayed
|
||||||
|
*/
|
||||||
|
void FolioReportProperties::showElementFromList(const int i) {
|
||||||
|
if (element_list.size() > i)
|
||||||
|
showElement(element_list.at(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief FolioReportProperties::on_button_this_clicked
|
||||||
|
* Action when push button "this report" is clicked
|
||||||
|
*/
|
||||||
|
void FolioReportProperties::on_button_this_clicked() {
|
||||||
|
showElement(element_);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief FolioReportProperties::on_button_linked_clicked
|
||||||
|
* Action when push button "linked report" is clicked
|
||||||
|
*/
|
||||||
|
void FolioReportProperties::on_button_linked_clicked() {
|
||||||
|
if (element_->isFree()) return;
|
||||||
|
showElement(element_->linkedElements().first());
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,16 +15,20 @@ class FolioReportProperties : public QWidget
|
|||||||
public:
|
public:
|
||||||
explicit FolioReportProperties(Element *elmt, QWidget *parent = 0);
|
explicit FolioReportProperties(Element *elmt, QWidget *parent = 0);
|
||||||
~FolioReportProperties();
|
~FolioReportProperties();
|
||||||
void buildRadioList();
|
|
||||||
void buildUnlinkButton();
|
|
||||||
void Apply();
|
void Apply();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void linkToElement(const int i) {element_to_link = element_list.at(i);}
|
void linkToElement(const int i) {element_to_link = element_list.at(i);}
|
||||||
void unlinkClicked();
|
void unlinkClicked();
|
||||||
void showDiagram(const int i);
|
void showElement(Element *elmt);
|
||||||
|
void showElementFromList (const int i);
|
||||||
|
void on_button_this_clicked();
|
||||||
|
void on_button_linked_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void buildRadioList();
|
||||||
|
void buildUnlinkButton();
|
||||||
|
|
||||||
Element *element_, *element_to_link;
|
Element *element_, *element_to_link;
|
||||||
QList <Element *> element_list;
|
QList <Element *> element_list;
|
||||||
Ui::FolioReportProperties *ui;
|
Ui::FolioReportProperties *ui;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>370</width>
|
<width>370</width>
|
||||||
<height>258</height>
|
<height>224</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="available_report_layout">
|
<layout class="QVBoxLayout" name="available_report_layout">
|
||||||
@@ -74,6 +74,24 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="button_this">
|
||||||
|
<property name="text">
|
||||||
|
<string>Voir ce report</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="button_linked">
|
||||||
|
<property name="text">
|
||||||
|
<string>Voir le report lié</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
Reference in New Issue
Block a user