mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-06-14 00:43:14 +02:00
Compare commits
5 Commits
78de585504
...
d493c24ecf
| Author | SHA1 | Date | |
|---|---|---|---|
| d493c24ecf | |||
| 3438ba9ab3 | |||
| 1078496bb1 | |||
| 711353bb58 | |||
| dd7955e50e |
+14
-8
@@ -821,19 +821,25 @@ void DiagramView::scrollOnMovement(QKeyEvent *e)
|
||||
{
|
||||
if (qgraphicsitem_cast<Conductor *>(qgi))
|
||||
continue;
|
||||
if(qgi->parentItem() && qgi->parentItem()->isSelected())
|
||||
if (qgi->parentItem() && qgi->parentItem()->isSelected())
|
||||
continue;
|
||||
|
||||
qreal x = qgi->pos().x();
|
||||
qreal y = qgi->pos().y();
|
||||
qreal bottom = viewed_scene.bottom();
|
||||
qreal top = viewed_scene.top();
|
||||
qreal left = viewed_scene.left();
|
||||
qreal right = viewed_scene.right();
|
||||
qreal elmt_top = y + qgi->boundingRect().top();
|
||||
qreal top = viewed_scene.top();
|
||||
qreal left = viewed_scene.left();
|
||||
qreal right = viewed_scene.right();
|
||||
qreal elmt_top = y + qgi->boundingRect().top();
|
||||
qreal elmt_bottom = y + qgi->boundingRect().bottom();
|
||||
qreal elmt_right = x + qgi->boundingRect().right();
|
||||
qreal elmt_left = x + qgi->boundingRect().left();
|
||||
qreal elmt_right = x + qgi->boundingRect().right();
|
||||
qreal elmt_left = x + qgi->boundingRect().left();
|
||||
if (qgi->parentItem()) {
|
||||
elmt_top += qgi->parentItem()->y();
|
||||
elmt_bottom += qgi->parentItem()->y();
|
||||
elmt_right += qgi->parentItem()->x();
|
||||
elmt_left += qgi->parentItem()->x();
|
||||
}
|
||||
|
||||
bool elmt_right_of_left_margin = elmt_left>=left;
|
||||
bool elmt_left_of_right_margin = elmt_right<=right;
|
||||
@@ -841,7 +847,7 @@ void DiagramView::scrollOnMovement(QKeyEvent *e)
|
||||
bool elmt_above_bottom_margin = elmt_bottom<=bottom;
|
||||
|
||||
if (!(elmt_right_of_left_margin && elmt_left_of_right_margin) ||
|
||||
!(elmt_below_top_margin && elmt_above_bottom_margin ) )
|
||||
!(elmt_below_top_margin && elmt_above_bottom_margin ) )
|
||||
{
|
||||
QScrollBar *h = horizontalScrollBar();
|
||||
QScrollBar *v = verticalScrollBar();
|
||||
|
||||
@@ -364,7 +364,12 @@ void DynamicTextFieldEditor::on_m_text_from_cb_activated(int index) {
|
||||
|
||||
void DynamicTextFieldEditor::on_m_composite_text_pb_clicked()
|
||||
{
|
||||
CompositeTextEditDialog ctd(m_text_field.data() -> compositeText(), this);
|
||||
bool isReport = false;
|
||||
if (elementEditor()->elementScene()->elementData().m_type & ElementData::AllReport) {
|
||||
isReport = true;
|
||||
}
|
||||
|
||||
CompositeTextEditDialog ctd(m_text_field.data() -> compositeText(), isReport, this);
|
||||
if(ctd.exec()) {
|
||||
QString ct = ctd.plainText();
|
||||
for (int i = 0; i < m_parts.length(); i++) {
|
||||
|
||||
@@ -18,10 +18,15 @@ CompositeTextEditDialog::CompositeTextEditDialog(DynamicElementTextItem *text, Q
|
||||
m_default_text = m_text->compositeText();
|
||||
ui->m_plain_text_edit->setPlainText(m_default_text);
|
||||
ui->m_plain_text_edit->setPlaceholderText(tr("Entrée votre texte composé ici, en vous aidant des variables disponible"));
|
||||
setUpComboBox();
|
||||
bool report = false;
|
||||
if ((m_text) &&(m_text->parentElement()->linkType()) & (Element::AllReport))
|
||||
{
|
||||
report = true;
|
||||
}
|
||||
setUpComboBox(report);
|
||||
}
|
||||
|
||||
CompositeTextEditDialog::CompositeTextEditDialog(QString text, QWidget *parent) :
|
||||
CompositeTextEditDialog::CompositeTextEditDialog(QString text, bool report, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::CompositeTextEditDialog)
|
||||
{
|
||||
@@ -29,7 +34,7 @@ CompositeTextEditDialog::CompositeTextEditDialog(QString text, QWidget *parent)
|
||||
m_default_text = std::move(text);
|
||||
ui->m_plain_text_edit->setPlainText(m_default_text);
|
||||
ui->m_plain_text_edit->setPlaceholderText(tr("Entrée votre texte composé ici, en vous aidant des variables disponible"));
|
||||
setUpComboBox();
|
||||
setUpComboBox(report);
|
||||
}
|
||||
|
||||
CompositeTextEditDialog::~CompositeTextEditDialog()
|
||||
@@ -50,13 +55,9 @@ QString CompositeTextEditDialog::plainText() const
|
||||
@brief CompositeTextEditDialog::setUpComboBox
|
||||
Add the available element information in the combo box
|
||||
*/
|
||||
void CompositeTextEditDialog::setUpComboBox()
|
||||
void CompositeTextEditDialog::setUpComboBox(bool is_report)
|
||||
{
|
||||
QStringList qstrl;
|
||||
bool is_report = false;
|
||||
if (m_text && m_text->parentElement()->linkType() & Element::AllReport) {
|
||||
is_report = true;
|
||||
}
|
||||
|
||||
if(is_report) //Special treatment for text owned by a folio report
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ class CompositeTextEditDialog : public QDialog
|
||||
|
||||
public:
|
||||
explicit CompositeTextEditDialog(DynamicElementTextItem *text, QWidget *parent = nullptr);
|
||||
explicit CompositeTextEditDialog(QString text, QWidget *parent = nullptr);
|
||||
explicit CompositeTextEditDialog(QString text, bool report, QWidget *parent = nullptr);
|
||||
~CompositeTextEditDialog() override;
|
||||
|
||||
QString plainText() const;
|
||||
@@ -34,7 +34,7 @@ class CompositeTextEditDialog : public QDialog
|
||||
void focusInEvent(QFocusEvent *event) override;
|
||||
|
||||
private :
|
||||
void setUpComboBox();
|
||||
void setUpComboBox(bool is_report);
|
||||
QString infoToVar(const QString& info) const;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user