mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-09 15:19:58 +01:00
implement variable point-size of grid
This commit is contained in:
@@ -227,6 +227,8 @@ void Diagram::drawBackground(QPainter *p, const QRectF &r) {
|
||||
points << QPoint(gx, gy);
|
||||
}
|
||||
}
|
||||
pen.setWidth(settings.value(QStringLiteral("diagrameditor/grid_pointsize"), 1).toInt());
|
||||
p -> setPen(pen);
|
||||
p -> drawPoints(points);
|
||||
}
|
||||
|
||||
|
||||
@@ -550,6 +550,8 @@ void ElementView::drawBackground(QPainter *p, const QRectF &r) {
|
||||
// draw the dot of the grid
|
||||
QPen pen(Qt::black);
|
||||
pen.setCosmetic(true);
|
||||
QSettings settings;
|
||||
pen.setWidth(settings.value(QStringLiteral("diagrameditor/grid_pointsize"), 1).toInt());
|
||||
p -> setPen(pen);
|
||||
p -> setBrush(Qt::NoBrush);
|
||||
qreal limite_x = r.x() + r.width();
|
||||
@@ -564,8 +566,8 @@ void ElementView::drawBackground(QPainter *p, const QRectF &r) {
|
||||
for (int gy = g_y ; gy < limite_y ; gy += drawn_y_grid) {
|
||||
if (draw_cross) {
|
||||
if (!(gx % 10) && !(gy % 10)) {
|
||||
p -> drawLine(QLineF(gx - 0.25, gy, gx + 0.25, gy));
|
||||
p -> drawLine(QLineF(gx, gy - 0.25, gx, gy + 0.25));
|
||||
p -> drawLine(QLineF(gx - (pen.width()/4.0), gy, gx + (pen.width()/4.0), gy));
|
||||
p -> drawLine(QLineF(gx, gy - (pen.width()/4.0), gx, gy + (pen.width()/4.0)));
|
||||
} else {
|
||||
p -> drawPoint(gx, gy);
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
|
||||
ui->DiagramEditor_yKeyGrid_sb->setValue(settings.value("diagrameditor/key_Ygrid", 10).toInt());
|
||||
ui->DiagramEditor_xKeyGridFine_sb->setValue(settings.value("diagrameditor/key_fine_Xgrid", 1).toInt());
|
||||
ui->DiagramEditor_yKeyGridFine_sb->setValue(settings.value("diagrameditor/key_fine_Ygrid", 1).toInt());
|
||||
ui->DiagramEditor_Grid_PointSize_sb->setValue(settings.value("diagrameditor/grid_pointsize", 1).toInt());
|
||||
ui->m_use_system_color_cb->setChecked(settings.value("usesystemcolors", "true").toBool());
|
||||
bool tabbed = settings.value("diagrameditor/viewmode", "tabbed") == "tabbed";
|
||||
if(tabbed)
|
||||
@@ -237,6 +238,7 @@ void GeneralConfigurationPage::applyConf()
|
||||
settings.setValue("diagrameditor/key_Ygrid", ui->DiagramEditor_yKeyGrid_sb->value());
|
||||
settings.setValue("diagrameditor/key_fine_Xgrid", ui->DiagramEditor_xKeyGridFine_sb->value());
|
||||
settings.setValue("diagrameditor/key_fine_Ygrid", ui->DiagramEditor_yKeyGridFine_sb->value());
|
||||
settings.setValue("diagrameditor/grid_pointsize", ui->DiagramEditor_Grid_PointSize_sb->value());
|
||||
//Dynamic text item
|
||||
settings.setValue("diagrameditor/dynamic_text_rotation", ui->m_dyn_text_rotation_sb->value());
|
||||
settings.setValue("diagrameditor/dynamic_text_width", ui->m_dyn_text_width_sb->value());
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>872</width>
|
||||
<height>411</height>
|
||||
<height>471</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -17,7 +17,7 @@
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
@@ -868,6 +868,51 @@ Vous pouvez spécifier ici la valeur par défaut de ce champ pour les éléments
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_8">
|
||||
<property name="title">
|
||||
<string>Affichage Grille</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>555</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QSpinBox" name="DiagramEditor_Grid_PointSize_sb">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="Label_Diagram_Grid_PointSize">
|
||||
<property name="text">
|
||||
<string>Taille du point Grille : 1 - 5</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_5">
|
||||
<property name="orientation">
|
||||
|
||||
Reference in New Issue
Block a user