mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
graphics table properties editor : minor
Add label to inform users that the number of row is less than the number of information to display.
This commit is contained in:
@@ -52,6 +52,8 @@ GraphicsTablePropertiesEditor::GraphicsTablePropertiesEditor(QetGraphicsTableIte
|
||||
if (table) {
|
||||
setTable(table);
|
||||
}
|
||||
|
||||
ui->m_info_label->setStyleSheet("QLabel {color : red; }");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -281,6 +283,8 @@ void GraphicsTablePropertiesEditor::updateUi()
|
||||
}
|
||||
}
|
||||
|
||||
updateInfoLabel();
|
||||
|
||||
auto margin = QETUtils::marginsFromString(m_table_item->model()->headerData(0, Qt::Horizontal, Qt::UserRole+1).toString());
|
||||
ui->m_header_top_margin ->setValue(margin.top());
|
||||
ui->m_header_left_margin ->setValue(margin.left());
|
||||
@@ -306,6 +310,38 @@ void GraphicsTablePropertiesEditor::updateUi()
|
||||
setUpEditConnection();
|
||||
}
|
||||
|
||||
void GraphicsTablePropertiesEditor::updateInfoLabel()
|
||||
{
|
||||
auto table_ = m_table_item;
|
||||
while (table_->previousTable()) { table_ = table_->previousTable();}
|
||||
|
||||
int count_ = 0;
|
||||
bool infinite = false;
|
||||
if (table_->displayNRow() <= 0) {
|
||||
infinite = true;
|
||||
} else {
|
||||
count_ = table_->displayNRow();
|
||||
}
|
||||
|
||||
while (table_->nextTable())
|
||||
{
|
||||
table_ = table_->nextTable();
|
||||
if (table_->displayNRow() <= 0) {
|
||||
infinite = true;
|
||||
} else {
|
||||
count_ += table_->displayNRow();
|
||||
}
|
||||
}
|
||||
|
||||
auto value = m_table_item->model()->rowCount() - count_;
|
||||
if (value > 0 && !infinite) {
|
||||
ui->m_info_label->setText(tr("<center>ATTENTION :</center>\n il manque %1 lignes afin d'afficher l'intégralité des informations").arg(value));
|
||||
ui->m_info_label->show();
|
||||
} else {
|
||||
ui->m_info_label->hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief GraphicsTablePropertiesEditor::setUpEditConnection
|
||||
*/
|
||||
@@ -338,6 +374,7 @@ void GraphicsTablePropertiesEditor::setUpEditConnection()
|
||||
m_edit_connection << connect(m_header_button_group, QOverload<int>::of(&QButtonGroup::idClicked), this, &GraphicsTablePropertiesEditor::apply);
|
||||
#endif
|
||||
m_edit_connection << connect(ui->m_display_n_row_sb, QOverload<int>::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply);
|
||||
m_edit_connection << connect(ui->m_display_n_row_sb, QOverload<int>::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::updateInfoLabel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ class GraphicsTablePropertiesEditor : public PropertiesEditorWidget
|
||||
void on_m_header_font_pb_clicked();
|
||||
void on_m_table_font_pb_clicked();
|
||||
virtual void updateUi() override;
|
||||
void updateInfoLabel();
|
||||
void on_m_table_name_le_textEdited(const QString &arg1);
|
||||
void on_m_previous_table_cb_activated(int index);
|
||||
void on_m_previous_pb_clicked();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>524</width>
|
||||
<height>600</height>
|
||||
<height>623</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -40,40 +40,17 @@
|
||||
<string>Géometrie et lignes</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0,0,0,0,0,0,0">
|
||||
<item row="0" column="6">
|
||||
<widget class="QPushButton" name="m_apply_geometry_to_linked_table_pb">
|
||||
<property name="toolTip">
|
||||
<string>Appliquer la géometrie à tous les tableaux liée à celui-ci</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../qelectrotech.qrc">
|
||||
<normaloff>:/ico/22x22/all_pages.png</normaloff>:/ico/22x22/all_pages.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QSpinBox" name="m_y_pos">
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QComboBox" name="m_previous_table_cb">
|
||||
<property name="insertPolicy">
|
||||
<enum>QComboBox::InsertAtBottom</enum>
|
||||
<widget class="QSpinBox" name="m_display_n_row_sb">
|
||||
<property name="specialValueText">
|
||||
<string>Toutes</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Aucun</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<item row="2" column="6">
|
||||
<widget class="QPushButton" name="m_next_pb">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@@ -93,14 +70,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QSpinBox" name="m_x_pos">
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
<item row="2" column="4">
|
||||
<widget class="QComboBox" name="m_previous_table_cb">
|
||||
<property name="insertPolicy">
|
||||
<enum>QComboBox::InsertAtBottom</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Aucun</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -113,20 +95,7 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="7">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<item row="1" column="5">
|
||||
<widget class="QPushButton" name="m_auto_geometry_pb">
|
||||
<property name="toolTip">
|
||||
<string>Ajuster le tableau au folio</string>
|
||||
@@ -140,7 +109,47 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="6">
|
||||
<item row="2" column="7">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Y :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>X :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QSpinBox" name="m_x_pos">
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="6">
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="leftMargin">
|
||||
@@ -158,47 +167,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Lignes à afficher :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>X :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QSpinBox" name="m_display_n_row_sb">
|
||||
<property name="specialValueText">
|
||||
<string>Toutes</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Tableau précédent :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<item row="2" column="5">
|
||||
<widget class="QPushButton" name="m_previous_pb">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@@ -218,16 +187,60 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<item row="2" column="2">
|
||||
<widget class="QSpinBox" name="m_y_pos">
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QPushButton" name="m_apply_geometry_to_linked_table_pb">
|
||||
<property name="toolTip">
|
||||
<string>Appliquer la géometrie à tous les tableaux liée à celui-ci</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Y :</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../qelectrotech.qrc">
|
||||
<normaloff>:/ico/22x22/all_pages.png</normaloff>:/ico/22x22/all_pages.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Tableau précédent :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Lignes à afficher :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="6">
|
||||
<widget class="QLabel" name="m_info_label">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user