graphic fixes
This commit is contained in:
@@ -4,7 +4,7 @@ cmake_policy(SET CMP0072 NEW) # FindOpenGL prefers GLVND by default
|
|||||||
project(QAD)
|
project(QAD)
|
||||||
set(QAD_MAJOR 2)
|
set(QAD_MAJOR 2)
|
||||||
set(QAD_MINOR 14)
|
set(QAD_MINOR 14)
|
||||||
set(QAD_REVISION 0)
|
set(QAD_REVISION 1)
|
||||||
set(QAD_SUFFIX )
|
set(QAD_SUFFIX )
|
||||||
set(QAD_COMPANY SHS)
|
set(QAD_COMPANY SHS)
|
||||||
set(QAD_DOMAIN org.SHS)
|
set(QAD_DOMAIN org.SHS)
|
||||||
|
|||||||
@@ -125,8 +125,7 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this),
|
|||||||
agroup->addAction(ui->graphic_actionGuidesTrace);
|
agroup->addAction(ui->graphic_actionGuidesTrace);
|
||||||
ui->graphic_actionGuidesFree->setProperty("_value", (int)Free);
|
ui->graphic_actionGuidesFree->setProperty("_value", (int)Free);
|
||||||
ui->graphic_actionGuidesTrace->setProperty("_value", (int)Trace);
|
ui->graphic_actionGuidesTrace->setProperty("_value", (int)Trace);
|
||||||
ui->graphic_actionGuidesFree->setChecked(true);
|
connect(agroup, &QActionGroup::triggered, this, &Graphic::actionGuidesTriggered);
|
||||||
connect(agroup, SIGNAL(triggered(QAction *)), this, SLOT(actionGuidesTriggered(QAction *)));
|
|
||||||
ui->graphic_checkGuides->addAction(ui->graphic_actionGuidesFree);
|
ui->graphic_checkGuides->addAction(ui->graphic_actionGuidesFree);
|
||||||
ui->graphic_checkGuides->addAction(ui->graphic_actionGuidesTrace);
|
ui->graphic_checkGuides->addAction(ui->graphic_actionGuidesTrace);
|
||||||
ui->graphic_buttonAutofit->addAction(ui->graphic_actionExpandX);
|
ui->graphic_buttonAutofit->addAction(ui->graphic_actionExpandX);
|
||||||
@@ -146,11 +145,11 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this),
|
|||||||
line_x_max.setClearButtonVisible(true);
|
line_x_max.setClearButtonVisible(true);
|
||||||
line_y_min.setClearButtonVisible(true);
|
line_y_min.setClearButtonVisible(true);
|
||||||
line_y_max.setClearButtonVisible(true);
|
line_y_max.setClearButtonVisible(true);
|
||||||
connect(&line_x_min, SIGNAL(valueChanged(double)), this, SLOT(lineXMinChanged(double)));
|
connect(&line_x_min, &EvalSpinBox::valueChanged, this, &Graphic::lineXMinChanged);
|
||||||
connect(&line_x_max, SIGNAL(valueChanged(double)), this, SLOT(lineXMaxChanged(double)));
|
connect(&line_x_max, &EvalSpinBox::valueChanged, this, &Graphic::lineXMaxChanged);
|
||||||
connect(&line_y_min, SIGNAL(valueChanged(double)), this, SLOT(lineYMinChanged(double)));
|
connect(&line_y_min, &EvalSpinBox::valueChanged, this, &Graphic::lineYMinChanged);
|
||||||
connect(&line_y_max, SIGNAL(valueChanged(double)), this, SLOT(lineYMaxChanged(double)));
|
connect(&line_y_max, &EvalSpinBox::valueChanged, this, &Graphic::lineYMaxChanged);
|
||||||
connect(ui->canvas_raster, SIGNAL(paintEvent(QPaintEvent *)), this, SLOT(canvasPaintEvent()));
|
connect(ui->canvas_raster, &UWidget::paintEvent, this, &Graphic::canvasPaintEvent);
|
||||||
prepareCanvas(ui->canvas_raster);
|
prepareCanvas(ui->canvas_raster);
|
||||||
icon_exp_x = QIcon(":/icons/expand_x.png");
|
icon_exp_x = QIcon(":/icons/expand_x.png");
|
||||||
icon_exp_y = QIcon(":/icons/expand_y.png");
|
icon_exp_y = QIcon(":/icons/expand_y.png");
|
||||||
@@ -203,7 +202,7 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this),
|
|||||||
updateLegend();
|
updateLegend();
|
||||||
setRectToLines();
|
setRectToLines();
|
||||||
conf = new GraphicConf(graphics, this);
|
conf = new GraphicConf(graphics, this);
|
||||||
connect(conf, SIGNAL(exportClicked()), this, SLOT(on_graphic_actionExportCSV_triggered()));
|
connect(conf, &GraphicConf::exportClicked, this, &Graphic::on_graphic_actionExportCSV_triggered);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -241,7 +240,7 @@ void Graphic::showEvent(QShowEvent *) {
|
|||||||
// qDebug() << "create GL on show";
|
// qDebug() << "create GL on show";
|
||||||
canvas_gl = new UGLWidget();
|
canvas_gl = new UGLWidget();
|
||||||
ui->layoutCanvas->addWidget(canvas_gl);
|
ui->layoutCanvas->addWidget(canvas_gl);
|
||||||
connect(canvas_gl, SIGNAL(paintSignal()), this, SLOT(canvasPaintEvent()));
|
connect(canvas_gl, &UGLWidget::paintSignal, this, &Graphic::canvasPaintEvent);
|
||||||
prepareCanvas(canvas_gl);
|
prepareCanvas(canvas_gl);
|
||||||
ui->canvas_raster->hide();
|
ui->canvas_raster->hide();
|
||||||
canvas_gl->show();
|
canvas_gl->show();
|
||||||
@@ -1209,7 +1208,7 @@ void Graphic::setOpenGL(bool on) {
|
|||||||
// qDebug() << "create GL on setter";
|
// qDebug() << "create GL on setter";
|
||||||
canvas_gl = new UGLWidget();
|
canvas_gl = new UGLWidget();
|
||||||
ui->layoutCanvas->addWidget(canvas_gl);
|
ui->layoutCanvas->addWidget(canvas_gl);
|
||||||
connect(canvas_gl, SIGNAL(paintSignal()), this, SLOT(canvasPaintEvent()));
|
connect(canvas_gl, &UGLWidget::paintSignal, this, &Graphic::canvasPaintEvent);
|
||||||
prepareCanvas(canvas_gl);
|
prepareCanvas(canvas_gl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2052,13 +2051,13 @@ QPolygonF Graphic::canvas2real(const QPolygonF & canvas_polygon) const {
|
|||||||
double Graphic::getScaleX() const {
|
double Graphic::getScaleX() const {
|
||||||
int gbx = gridborder.x() + margins_.left();
|
int gbx = gridborder.x() + margins_.left();
|
||||||
int wid = lastw - gbx - margins_.width();
|
int wid = lastw - gbx - margins_.width();
|
||||||
return selrect.width() / (double)wid;
|
return (double)wid / selrect.width();
|
||||||
}
|
}
|
||||||
|
|
||||||
double Graphic::getScaleY() const {
|
double Graphic::getScaleY() const {
|
||||||
int gby = gridborder.y() + margins_.top();
|
int gby = gridborder.y() + margins_.top();
|
||||||
int hei = lasth - gby - margins_.height();
|
int hei = lasth - gby - margins_.height();
|
||||||
return selrect.height() / (double)hei;
|
return (double)hei / selrect.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -440,6 +440,9 @@
|
|||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Snap trace</string>
|
<string>Snap trace</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user