Tooltip for tools.
--HG-- branch : develop
This commit is contained in:
parent
296a9e5e93
commit
8a7ace463c
|
@ -61,8 +61,7 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, Draw::Draws mode, QWidg
|
||||||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogAlongLine::FormulaChanged);
|
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogAlongLine::FormulaChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogAlongLine::~DialogAlongLine()
|
DialogAlongLine::~DialogAlongLine(){
|
||||||
{
|
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,6 +89,7 @@ void DialogAlongLine::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxFirstPoint->setCurrentIndex(index);
|
ui->comboBoxFirstPoint->setCurrentIndex(index);
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select second point of line"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,6 +98,7 @@ void DialogAlongLine::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxSecondPoint->setCurrentIndex(index);
|
ui->comboBoxSecondPoint->setCurrentIndex(index);
|
||||||
number = 0;
|
number = 0;
|
||||||
|
emit ToolTip("");
|
||||||
}
|
}
|
||||||
if(!isInitialized){
|
if(!isInitialized){
|
||||||
this->show();
|
this->show();
|
||||||
|
|
|
@ -134,6 +134,7 @@ void DialogArc::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetModelingPoint(id);
|
||||||
}
|
}
|
||||||
ChangeCurrentText(ui->comboBoxBasePoint, point.name());
|
ChangeCurrentText(ui->comboBoxBasePoint, point.name());
|
||||||
|
emit ToolTip("");
|
||||||
this->show();
|
this->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,7 @@ void DialogBisector::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxFirstPoint->setCurrentIndex(index);
|
ui->comboBoxFirstPoint->setCurrentIndex(index);
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select second point of angle"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,6 +99,7 @@ void DialogBisector::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxSecondPoint->setCurrentIndex(index);
|
ui->comboBoxSecondPoint->setCurrentIndex(index);
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select third point of angle"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,6 +108,7 @@ void DialogBisector::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxThirdPoint->setCurrentIndex(index);
|
ui->comboBoxThirdPoint->setCurrentIndex(index);
|
||||||
number = 0;
|
number = 0;
|
||||||
|
emit ToolTip("");
|
||||||
}
|
}
|
||||||
if(!isInitialized){
|
if(!isInitialized){
|
||||||
this->show();
|
this->show();
|
||||||
|
|
|
@ -74,6 +74,7 @@ void DialogDetail::DialogAccepted(){
|
||||||
}
|
}
|
||||||
details.setName(ui.lineEditNameDetail->text());
|
details.setName(ui.lineEditNameDetail->text());
|
||||||
emit DialogClosed(QDialog::Accepted);
|
emit DialogClosed(QDialog::Accepted);
|
||||||
|
emit ToolTip("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogDetail::NewItem(qint64 id, Tool::Tools typeTool, Draw::Draws mode, NodeDetail::NodeDetails typeNode){
|
void DialogDetail::NewItem(qint64 id, Tool::Tools typeTool, Draw::Draws mode, NodeDetail::NodeDetails typeNode){
|
||||||
|
|
|
@ -101,6 +101,7 @@ void DialogEndLine::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
point = data->GetModelingPoint(id);
|
point = data->GetModelingPoint(id);
|
||||||
}
|
}
|
||||||
ChangeCurrentText(ui->comboBoxBasePoint, point.name());
|
ChangeCurrentText(ui->comboBoxBasePoint, point.name());
|
||||||
|
emit ToolTip("");
|
||||||
this->show();
|
this->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,6 +99,7 @@ void DialogLine::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxFirstPoint->setCurrentIndex(index);
|
ui->comboBoxFirstPoint->setCurrentIndex(index);
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select second point"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,6 +108,7 @@ void DialogLine::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxSecondPoint->setCurrentIndex(index);
|
ui->comboBoxSecondPoint->setCurrentIndex(index);
|
||||||
number = 0;
|
number = 0;
|
||||||
|
emit ToolTip("");
|
||||||
}
|
}
|
||||||
if(!isInitialized){
|
if(!isInitialized){
|
||||||
this->show();
|
this->show();
|
||||||
|
|
|
@ -71,6 +71,7 @@ void DialogLineIntersect::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
ui->comboBoxP1Line1->setCurrentIndex(index);
|
ui->comboBoxP1Line1->setCurrentIndex(index);
|
||||||
p1Line1 = id;
|
p1Line1 = id;
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select second point of first line"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,6 +81,7 @@ void DialogLineIntersect::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
ui->comboBoxP2Line1->setCurrentIndex(index);
|
ui->comboBoxP2Line1->setCurrentIndex(index);
|
||||||
p2Line1 = id;
|
p2Line1 = id;
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select first point of second line"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,6 +91,7 @@ void DialogLineIntersect::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
ui->comboBoxP1Line2->setCurrentIndex(index);
|
ui->comboBoxP1Line2->setCurrentIndex(index);
|
||||||
p1Line2 = id;
|
p1Line2 = id;
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select second point of second line"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,6 +101,7 @@ void DialogLineIntersect::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
ui->comboBoxP2Line2->setCurrentIndex(index);
|
ui->comboBoxP2Line2->setCurrentIndex(index);
|
||||||
p2Line2 = id;
|
p2Line2 = id;
|
||||||
number = 0;
|
number = 0;
|
||||||
|
emit ToolTip("");
|
||||||
}
|
}
|
||||||
if(!isInitialized){
|
if(!isInitialized){
|
||||||
flagPoint = CheckIntersecion();
|
flagPoint = CheckIntersecion();
|
||||||
|
|
|
@ -108,6 +108,7 @@ void DialogNormal::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxFirstPoint->setCurrentIndex(index);
|
ui->comboBoxFirstPoint->setCurrentIndex(index);
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select second point of line"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,6 +117,7 @@ void DialogNormal::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxSecondPoint->setCurrentIndex(index);
|
ui->comboBoxSecondPoint->setCurrentIndex(index);
|
||||||
number = 0;
|
number = 0;
|
||||||
|
emit ToolTip("");
|
||||||
}
|
}
|
||||||
if(!isInitialized){
|
if(!isInitialized){
|
||||||
this->show();
|
this->show();
|
||||||
|
|
|
@ -84,6 +84,7 @@ void DialogPointOfContact::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui.comboBoxFirstPoint->setCurrentIndex(index);
|
ui.comboBoxFirstPoint->setCurrentIndex(index);
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select second point of line"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,6 +93,7 @@ void DialogPointOfContact::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui.comboBoxSecondPoint->setCurrentIndex(index);
|
ui.comboBoxSecondPoint->setCurrentIndex(index);
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select point of center of arc"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,6 +102,7 @@ void DialogPointOfContact::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui.comboBoxCenter->setCurrentIndex(index);
|
ui.comboBoxCenter->setCurrentIndex(index);
|
||||||
number = 0;
|
number = 0;
|
||||||
|
emit ToolTip("");
|
||||||
}
|
}
|
||||||
if(!isInitialized){
|
if(!isInitialized){
|
||||||
this->show();
|
this->show();
|
||||||
|
|
|
@ -92,6 +92,7 @@ void DialogShoulderPoint::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxP1Line->setCurrentIndex(index);
|
ui->comboBoxP1Line->setCurrentIndex(index);
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select second point of line"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,6 +101,7 @@ void DialogShoulderPoint::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxP2Line->setCurrentIndex(index);
|
ui->comboBoxP2Line->setCurrentIndex(index);
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select point of shoulder"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,6 +110,7 @@ void DialogShoulderPoint::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxPShoulder->setCurrentIndex(index);
|
ui->comboBoxPShoulder->setCurrentIndex(index);
|
||||||
number = 0;
|
number = 0;
|
||||||
|
emit ToolTip("");
|
||||||
}
|
}
|
||||||
if(!isInitialized){
|
if(!isInitialized){
|
||||||
this->show();
|
this->show();
|
||||||
|
|
|
@ -67,6 +67,7 @@ void DialogSpline::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxP1->setCurrentIndex(index);
|
ui->comboBoxP1->setCurrentIndex(index);
|
||||||
number++;
|
number++;
|
||||||
|
emit ToolTip(tr("Select last point of curve"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,6 +76,7 @@ void DialogSpline::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
if ( index != -1 ) { // -1 for not found
|
if ( index != -1 ) { // -1 for not found
|
||||||
ui->comboBoxP4->setCurrentIndex(index);
|
ui->comboBoxP4->setCurrentIndex(index);
|
||||||
number = 0;
|
number = 0;
|
||||||
|
emit ToolTip("");
|
||||||
index = ui->comboBoxP1->currentIndex();
|
index = ui->comboBoxP1->currentIndex();
|
||||||
qint64 p1Id = qvariant_cast<qint64>(ui->comboBoxP1->itemData(index));
|
qint64 p1Id = qvariant_cast<qint64>(ui->comboBoxP1->itemData(index));
|
||||||
QPointF p1;
|
QPointF p1;
|
||||||
|
|
|
@ -82,6 +82,7 @@ void DialogSplinePath::ChoosedObject(qint64 id, Scene::Scenes type){
|
||||||
}
|
}
|
||||||
if(type == Scene::Point){
|
if(type == Scene::Point){
|
||||||
NewItem(id, 1, 0, 1);
|
NewItem(id, 1, 0, 1);
|
||||||
|
emit ToolTip(tr("Select point of curve path"));
|
||||||
this->show();
|
this->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,6 +94,7 @@ void DialogSplinePath::DialogAccepted(){
|
||||||
path.append( qvariant_cast<VSplinePoint>(item->data(Qt::UserRole)));
|
path.append( qvariant_cast<VSplinePoint>(item->data(Qt::UserRole)));
|
||||||
}
|
}
|
||||||
path.setKCurve(ui->doubleSpinBoxKcurve->value());
|
path.setKCurve(ui->doubleSpinBoxKcurve->value());
|
||||||
|
emit ToolTip("");
|
||||||
emit DialogClosed(QDialog::Accepted);
|
emit DialogClosed(QDialog::Accepted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ public:
|
||||||
void setIdDetail(const qint64 &value);
|
void setIdDetail(const qint64 &value);
|
||||||
signals:
|
signals:
|
||||||
void DialogClosed(int result);
|
void DialogClosed(int result);
|
||||||
|
void ToolTip(const QString &toolTip);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(qint64 id, Scene::Scenes type);
|
virtual void ChoosedObject(qint64 id, Scene::Scenes type);
|
||||||
void NamePointChanged();
|
void NamePointChanged();
|
||||||
|
|
|
@ -65,7 +65,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
policy.setHorizontalStretch(12);
|
policy.setHorizontalStretch(12);
|
||||||
view->setSizePolicy(policy);
|
view->setSizePolicy(policy);
|
||||||
helpLabel = new QLabel("Створіть новий файл для початку роботи.");
|
helpLabel = new QLabel(tr("Create new drawing for start working."));
|
||||||
ui->statusBar->addWidget(helpLabel);
|
ui->statusBar->addWidget(helpLabel);
|
||||||
|
|
||||||
connect(ui->actionArrowTool, &QAction::triggered, this, &MainWindow::ActionAroowTool);
|
connect(ui->actionArrowTool, &QAction::triggered, this, &MainWindow::ActionAroowTool);
|
||||||
|
@ -204,17 +204,19 @@ void MainWindow::OptionDraw(){
|
||||||
|
|
||||||
template <typename Dialog, typename Func>
|
template <typename Dialog, typename Func>
|
||||||
void MainWindow::SetToolButton(bool checked, Tool::Tools t, const QString &cursor,
|
void MainWindow::SetToolButton(bool checked, Tool::Tools t, const QString &cursor,
|
||||||
QSharedPointer<Dialog> &dialog, Func closeDialogSlot){
|
const QString &toolTip, QSharedPointer<Dialog> &dialog,
|
||||||
|
Func closeDialogSlot){
|
||||||
if(checked){
|
if(checked){
|
||||||
CanselTool();
|
CanselTool();
|
||||||
tool = t;
|
tool = t;
|
||||||
QPixmap pixmap(cursor);
|
QPixmap pixmap(cursor);
|
||||||
QCursor cur(pixmap, 2, 3);
|
QCursor cur(pixmap, 2, 3);
|
||||||
view->setCursor(cur);
|
view->setCursor(cur);
|
||||||
helpLabel->setText("Виберіть точки.");
|
helpLabel->setText(toolTip);
|
||||||
dialog = QSharedPointer<Dialog>(new Dialog(data, mode));
|
dialog = QSharedPointer<Dialog>(new Dialog(data, mode));
|
||||||
connect(currentScene, &VMainGraphicsScene::ChoosedObject, dialog.data(), &Dialog::ChoosedObject);
|
connect(currentScene, &VMainGraphicsScene::ChoosedObject, dialog.data(), &Dialog::ChoosedObject);
|
||||||
connect(dialog.data(), &Dialog::DialogClosed, this, closeDialogSlot);
|
connect(dialog.data(), &Dialog::DialogClosed, this, closeDialogSlot);
|
||||||
|
connect(dialog.data(), &Dialog::ToolTip, this, &MainWindow::ShowToolTip);
|
||||||
connect(doc, &VDomDocument::FullUpdateFromFile, dialog.data(), &Dialog::UpdateList);
|
connect(doc, &VDomDocument::FullUpdateFromFile, dialog.data(), &Dialog::UpdateList);
|
||||||
} else {
|
} else {
|
||||||
if(QToolButton *tButton = qobject_cast< QToolButton * >(this->sender())){
|
if(QToolButton *tButton = qobject_cast< QToolButton * >(this->sender())){
|
||||||
|
@ -233,8 +235,8 @@ void MainWindow::AddToolToDetail(T *tool, const qint64 &id, Tool::Tools typeTool
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ToolEndLine(bool checked){
|
void MainWindow::ToolEndLine(bool checked){
|
||||||
SetToolButton(checked, Tool::EndLineTool, ":/cursor/endline_cursor.png", dialogEndLine,
|
SetToolButton(checked, Tool::EndLineTool, ":/cursor/endline_cursor.png", tr("Select point"),
|
||||||
&MainWindow::ClosedDialogEndLine);
|
dialogEndLine, &MainWindow::ClosedDialogEndLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ClosedDialogEndLine(int result){
|
void MainWindow::ClosedDialogEndLine(int result){
|
||||||
|
@ -250,8 +252,8 @@ void MainWindow::ClosedDialogEndLine(int result){
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ToolLine(bool checked){
|
void MainWindow::ToolLine(bool checked){
|
||||||
SetToolButton(checked, Tool::LineTool, ":/cursor/line_cursor.png", dialogLine,
|
SetToolButton(checked, Tool::LineTool, ":/cursor/line_cursor.png", tr("Select first point"),
|
||||||
&MainWindow::ClosedDialogLine);
|
dialogLine, &MainWindow::ClosedDialogLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ClosedDialogLine(int result){
|
void MainWindow::ClosedDialogLine(int result){
|
||||||
|
@ -267,8 +269,8 @@ void MainWindow::ClosedDialogLine(int result){
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ToolAlongLine(bool checked){
|
void MainWindow::ToolAlongLine(bool checked){
|
||||||
SetToolButton(checked, Tool::AlongLineTool, ":/cursor/alongline_cursor.png", dialogAlongLine,
|
SetToolButton(checked, Tool::AlongLineTool, ":/cursor/alongline_cursor.png", tr("Select point"),
|
||||||
&MainWindow::ClosedDialogAlongLine);
|
dialogAlongLine, &MainWindow::ClosedDialogAlongLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ClosedDialogAlongLine(int result){
|
void MainWindow::ClosedDialogAlongLine(int result){
|
||||||
|
@ -284,7 +286,8 @@ void MainWindow::ClosedDialogAlongLine(int result){
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ToolShoulderPoint(bool checked){
|
void MainWindow::ToolShoulderPoint(bool checked){
|
||||||
SetToolButton(checked, Tool::ShoulderPointTool, ":/cursor/shoulder_cursor.png", dialogShoulderPoint,
|
SetToolButton(checked, Tool::ShoulderPointTool, ":/cursor/shoulder_cursor.png",
|
||||||
|
tr("Select first point of line"), dialogShoulderPoint,
|
||||||
&MainWindow::ClosedDialogShoulderPoint);
|
&MainWindow::ClosedDialogShoulderPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,8 +305,8 @@ void MainWindow::ClosedDialogShoulderPoint(int result){
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ToolNormal(bool checked){
|
void MainWindow::ToolNormal(bool checked){
|
||||||
SetToolButton(checked, Tool::NormalTool, ":/cursor/normal_cursor.png", dialogNormal,
|
SetToolButton(checked, Tool::NormalTool, ":/cursor/normal_cursor.png",
|
||||||
&MainWindow::ClosedDialogNormal);
|
tr("Select first point of line"), dialogNormal, &MainWindow::ClosedDialogNormal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ClosedDialogNormal(int result){
|
void MainWindow::ClosedDialogNormal(int result){
|
||||||
|
@ -319,8 +322,8 @@ void MainWindow::ClosedDialogNormal(int result){
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ToolBisector(bool checked){
|
void MainWindow::ToolBisector(bool checked){
|
||||||
SetToolButton(checked, Tool::BisectorTool, ":/cursor/bisector_cursor.png", dialogBisector,
|
SetToolButton(checked, Tool::BisectorTool, ":/cursor/bisector_cursor.png",
|
||||||
&MainWindow::ClosedDialogBisector);
|
tr("Select first point of angle"), dialogBisector, &MainWindow::ClosedDialogBisector);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ClosedDialogBisector(int result){
|
void MainWindow::ClosedDialogBisector(int result){
|
||||||
|
@ -336,7 +339,8 @@ void MainWindow::ClosedDialogBisector(int result){
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ToolLineIntersect(bool checked){
|
void MainWindow::ToolLineIntersect(bool checked){
|
||||||
SetToolButton(checked, Tool::LineIntersectTool, ":/cursor/intersect_cursor.png", dialogLineIntersect,
|
SetToolButton(checked, Tool::LineIntersectTool, ":/cursor/intersect_cursor.png",
|
||||||
|
tr("Select first point of first line"), dialogLineIntersect,
|
||||||
&MainWindow::ClosedDialogLineIntersect);
|
&MainWindow::ClosedDialogLineIntersect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,7 +349,8 @@ void MainWindow::ClosedDialogLineIntersect(int result){
|
||||||
if(mode == Draw::Calculation){
|
if(mode == Draw::Calculation){
|
||||||
VToolLineIntersect::Create(dialogLineIntersect, currentScene, doc, data);
|
VToolLineIntersect::Create(dialogLineIntersect, currentScene, doc, data);
|
||||||
} else {
|
} else {
|
||||||
VModelingLineIntersect *point = VModelingLineIntersect::Create(dialogLineIntersect, doc, data);
|
VModelingLineIntersect *point = VModelingLineIntersect::Create(dialogLineIntersect, doc,
|
||||||
|
data);
|
||||||
AddToolToDetail(point, point->getId(), Tool::LineIntersectTool,
|
AddToolToDetail(point, point->getId(), Tool::LineIntersectTool,
|
||||||
dialogLineIntersect->getIdDetail());
|
dialogLineIntersect->getIdDetail());
|
||||||
}
|
}
|
||||||
|
@ -354,8 +359,8 @@ void MainWindow::ClosedDialogLineIntersect(int result){
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ToolSpline(bool checked){
|
void MainWindow::ToolSpline(bool checked){
|
||||||
SetToolButton(checked, Tool::SplineTool, ":/cursor/spline_cursor.png", dialogSpline,
|
SetToolButton(checked, Tool::SplineTool, ":/cursor/spline_cursor.png",
|
||||||
&MainWindow::ClosedDialogSpline);
|
tr("Select first point curve"), dialogSpline, &MainWindow::ClosedDialogSpline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ClosedDialogSpline(int result){
|
void MainWindow::ClosedDialogSpline(int result){
|
||||||
|
@ -371,8 +376,8 @@ void MainWindow::ClosedDialogSpline(int result){
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ToolArc(bool checked){
|
void MainWindow::ToolArc(bool checked){
|
||||||
SetToolButton(checked, Tool::ArcTool, ":/cursor/arc_cursor.png", dialogArc,
|
SetToolButton(checked, Tool::ArcTool, ":/cursor/arc_cursor.png",
|
||||||
&MainWindow::ClosedDialogArc);
|
tr("Select point of center of arc"), dialogArc, &MainWindow::ClosedDialogArc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ClosedDialogArc(int result){
|
void MainWindow::ClosedDialogArc(int result){
|
||||||
|
@ -388,7 +393,8 @@ void MainWindow::ClosedDialogArc(int result){
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ToolSplinePath(bool checked){
|
void MainWindow::ToolSplinePath(bool checked){
|
||||||
SetToolButton(checked, Tool::SplinePathTool, ":/cursor/splinepath_cursor.png", dialogSplinePath,
|
SetToolButton(checked, Tool::SplinePathTool, ":/cursor/splinepath_cursor.png",
|
||||||
|
tr("Select point of curve path"), dialogSplinePath,
|
||||||
&MainWindow::ClosedDialogSplinePath);
|
&MainWindow::ClosedDialogSplinePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,7 +411,8 @@ void MainWindow::ClosedDialogSplinePath(int result){
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ToolPointOfContact(bool checked){
|
void MainWindow::ToolPointOfContact(bool checked){
|
||||||
SetToolButton(checked, Tool::PointOfContact, ":/cursor/pointcontact_cursor.png", dialogPointOfContact,
|
SetToolButton(checked, Tool::PointOfContact, ":/cursor/pointcontact_cursor.png",
|
||||||
|
tr("Select first point of line"), dialogPointOfContact,
|
||||||
&MainWindow::ClosedDialogPointOfContact);
|
&MainWindow::ClosedDialogPointOfContact);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -430,7 +437,7 @@ void MainWindow::ToolDetail(bool checked){
|
||||||
QPixmap pixmap("://cursor/new_detail_cursor.png");
|
QPixmap pixmap("://cursor/new_detail_cursor.png");
|
||||||
QCursor cur(pixmap, 2, 3);
|
QCursor cur(pixmap, 2, 3);
|
||||||
view->setCursor(cur);
|
view->setCursor(cur);
|
||||||
helpLabel->setText("Виберіть точки.");
|
helpLabel->setText(tr("Select points, arcs, curves and details clockwise."));
|
||||||
dialogDetail = QSharedPointer<DialogDetail>(new DialogDetail(data, mode));
|
dialogDetail = QSharedPointer<DialogDetail>(new DialogDetail(data, mode));
|
||||||
connect(currentScene, &VMainGraphicsScene::ChoosedObject, dialogDetail.data(),
|
connect(currentScene, &VMainGraphicsScene::ChoosedObject, dialogDetail.data(),
|
||||||
&DialogDetail::ChoosedObject);
|
&DialogDetail::ChoosedObject);
|
||||||
|
@ -458,6 +465,10 @@ void MainWindow::AboutQt(){
|
||||||
QMessageBox::aboutQt(this, tr("About Qt"));
|
QMessageBox::aboutQt(this, tr("About Qt"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::ShowToolTip(const QString &toolTip){
|
||||||
|
helpLabel->setText(toolTip);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::tableClosed(){
|
void MainWindow::tableClosed(){
|
||||||
show();
|
show();
|
||||||
MinimumScrollBar();
|
MinimumScrollBar();
|
||||||
|
@ -603,6 +614,7 @@ void MainWindow::CanselTool(){
|
||||||
{
|
{
|
||||||
case Tool::ArrowTool:
|
case Tool::ArrowTool:
|
||||||
ui->actionArrowTool->setChecked(false);
|
ui->actionArrowTool->setChecked(false);
|
||||||
|
helpLabel->setText("");
|
||||||
break;
|
break;
|
||||||
case Tool::SinglePointTool:
|
case Tool::SinglePointTool:
|
||||||
//Nothing to do here because we can't create this tool from main window.
|
//Nothing to do here because we can't create this tool from main window.
|
||||||
|
@ -1119,4 +1131,5 @@ void MainWindow::OpenPattern(const QString &fileName){
|
||||||
QString title(info.fileName());
|
QString title(info.fileName());
|
||||||
title.append("-Valentina");
|
title.append("-Valentina");
|
||||||
setWindowTitle(title);
|
setWindowTitle(title);
|
||||||
|
helpLabel->setText("");
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,7 @@ public slots:
|
||||||
void ClosedDialogDetail(int result);
|
void ClosedDialogDetail(int result);
|
||||||
void About();
|
void About();
|
||||||
void AboutQt();
|
void AboutQt();
|
||||||
|
void ShowToolTip(const QString &toolTip);
|
||||||
/**
|
/**
|
||||||
* @brief tableClosed Слот, що виконується при отриманні сигналу закриття вікна укладання
|
* @brief tableClosed Слот, що виконується при отриманні сигналу закриття вікна укладання
|
||||||
*деталей моделі.
|
*деталей моделі.
|
||||||
|
@ -149,8 +150,8 @@ private:
|
||||||
void SetEnableTool(bool enable);
|
void SetEnableTool(bool enable);
|
||||||
template <typename Dialog, typename Func>
|
template <typename Dialog, typename Func>
|
||||||
void SetToolButton(bool checked, Tool::Tools t, const QString &cursor,
|
void SetToolButton(bool checked, Tool::Tools t, const QString &cursor,
|
||||||
QSharedPointer<Dialog> &dialog,
|
const QString &toolTip,QSharedPointer<Dialog> &dialog,
|
||||||
Func closeDialogSlot);
|
Func closeDialogSlot);
|
||||||
void MinimumScrollBar();
|
void MinimumScrollBar();
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void AddToolToDetail(T *tool, const qint64 &id, Tool::Tools typeTool,
|
void AddToolToDetail(T *tool, const qint64 &id, Tool::Tools typeTool,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user