TechDraw to Master

Merged, abandoned or rejected pull requests are moved here to clear the main Pull Requests forum.
User avatar
wandererfan
Posts: 3636
Joined: Tue Nov 06, 2012 5:42 pm

Re: TechDraw to Master

Postby wandererfan » Mon Jul 04, 2016 3:10 am

wmayer wrote:I have found a few more issues:
New improved version on github.

* When you click on one of the green fields a dialog comes up to enter arbitrary text. However, this dialog doesn't have a layout applied.
>>> Don't really understand this one, but I changed the look of the dialog.

* The drawing doesn't support unicode. When entering text with non-ASCII characters (e.g. Umlauts) then the text in the drawing is broken afterwards.
>>> assume this is for EditableTexts (green dots) as Utf8 is supported in Annotation View & View labels
>>> EditableTexts now supports Latin-1 (thanks to Fredrik J). rest of Utf8 has to wait for Qt5 QString.toHtmlEscaped() I think. 4.8 Qt::escape() uses Latin-1 internally.

* When you create a standard cube and add a length dimension of the diagonal (which has the length 10*sqrt(2) ~ 14.142135623730951) it displays the text 14.14210 (precision is set to 5). This means the last digit is wrong and should be 14.14213. When increasing the digits e.g. to 10 then the text becomes 14.1421000000
>>>> Base::Quantity::getUserString is only returning 4 decimal places. Don't know why.
>>>> changed to use just the UoM from UserString

* On systems where the decimal separator is a comma it should also display a comma
>>>> done using system locale.

* I got a (not yet reproducible) crash when closing a techdraw.
>>>> still thinking about this one.

Thanks for testing.

wf
User avatar
wandererfan
Posts: 3636
Joined: Tue Nov 06, 2012 5:42 pm

Re: TechDraw to Master

Postby wandererfan » Mon Jul 04, 2016 3:22 am

yorik wrote:I have something very strange, I cannot build the TechDraw branch, although I can build master:
snip
Any idea?
`MPI::Comm::Comm()' looks like it might be from HDF5. Maybe Cmake finds different libraries?
wmayer
Site Admin
Posts: 15471
Joined: Thu Feb 19, 2009 10:32 am

Re: TechDraw to Master

Postby wmayer » Mon Jul 04, 2016 9:10 am

* When you click on one of the green fields a dialog comes up to enter arbitrary text. However, this dialog doesn't have a layout applied.
>>> Don't really understand this one, but I changed the look of the dialog.
This doesn't fix it. When a dialog has no layout then you can manually resize to have zero width or height so that all widgets inside are invisible. Also it can happen that with the default size the dialog is cropped on certain system. If a layout (e.g. a grid layout) is properly set these two issues cannot occur.

Another issues I noticed:
When you add a dimension and change its precision and trigger the recompute the text doesn't update. You have to change the dimension again and trigger the recompute or you have to de-select the item.

When you add a shape to a drawing plus adding a dimension then perform undo until the shape disappears from the drawing. When adding again the shape to the drawing a crash happens inside:

Code: Select all

TechDraw::DrawPage* ViewProviderPage::getPageObject() const
{
    return dynamic_cast<TechDraw::DrawPage*>(pcObject);
}
In this case 'pcObject' is a dangling pointer. I guess that "this" is already invalid because many other member variables are invalid, too.

The callstack is:
1 _CxxFrameHandler2 MSVCR120D 0x7feeb20d0d7
2 _RTDynamicCast MSVCR120D 0x7feeb20dad2
3 TechDrawGui::ViewProviderPage::getPageObject ViewProviderPage.cpp 341 0x7fed8d54f77
4 TechDrawGui::QGVPage::getDrawPage QGVPage.h 88 0x7fed8cdb18f
5 _findPage Command.cpp 87 0x7fed8cce3a4
6 CmdTechDrawNewView::activated Command.cpp 293 0x7fed8ccfa63
7 Gui::Command::invoke Command.cpp 289 0x7feec19abee
8 Gui::Action::onActivated Action.cpp 95 0x7feec186e5e
User avatar
wandererfan
Posts: 3636
Joined: Tue Nov 06, 2012 5:42 pm

Re: TechDraw to Master

Postby wandererfan » Tue Jul 05, 2016 12:45 am

wmayer wrote:This doesn't fix it. When a dialog has no layout then you can manually resize to have zero width or height so that all widgets inside are invisible.
Aha! I get it now. Fixed.
wmayer wrote:When you add a dimension and change its precision and trigger the recompute the text doesn't update. You have to change the dimension again and trigger the recompute or you have to de-select the item.
Fixed.
wmayer wrote:When you add a shape to a drawing plus adding a dimension then perform undo until the shape disappears from the drawing. When adding again the shape to the drawing a crash happens inside:
If "adding again" is "redo-ing" then this is fixed.

I was thinking of rebasing TechDraw tomorrow. Is that a problem for anyone?

wf
triplus
Posts: 9277
Joined: Mon Dec 12, 2011 4:45 pm

Re: TechDraw to Master

Postby triplus » Tue Jul 05, 2016 11:26 pm

I just noticed selecting drawing geometry works just like in the rest of FreeCAD therefore i guess context sensitivity will be possible! I did notice one thing that i decided to report.

Hovering over edge and selecting it and after hovering over selected edge works as expected.

Hovering over point/vertex and selecting it and after hovering over selected point/vertex doesn't work as expected as it looks like hovered state isn't cleared and returned back to selected state. It looks like selection is cleared just by hovering over selected point/vertex.

And additional question should point/vertex geometry be hidden when view frames option is set to off?
User avatar
wandererfan
Posts: 3636
Joined: Tue Nov 06, 2012 5:42 pm

Re: TechDraw to Master

Postby wandererfan » Thu Jul 07, 2016 1:06 am

triplus wrote:Hovering over point/vertex and selecting it and after hovering over selected point/vertex doesn't work as expected as it looks like hovered state isn't cleared and returned back to selected state. It looks like selection is cleared just by hovering over selected point/vertex.

And additional question should point/vertex geometry be hidden when view frames option is set to off?
Vertex hover issue fixed.

Right now the same code turns view frames off and prepares drawing for printing (where you probably don't want to see Vertices). Could be split so the Vertices stay visible on screen but not on print/export. Is that a change request?

wf
wmayer
Site Admin
Posts: 15471
Joined: Thu Feb 19, 2009 10:32 am

Re: TechDraw to Master

Postby wmayer » Thu Jul 07, 2016 11:26 am

Aha! I get it now. Fixed.
Still a few minor issues: for the dialog widget you should pass a parent pointer other than NULL to make sure the dialog isn't handled as a top-level widget. And maybe the dialog button box should be aligned to the right side to make it consistent with other dialogs.

If you click several times on a green field you get several dialogs. There shouldn't be more opened dialogs than one at a time.
triplus
Posts: 9277
Joined: Mon Dec 12, 2011 4:45 pm

Re: TechDraw to Master

Postby triplus » Thu Jul 07, 2016 11:42 am

wandererfan wrote:Vertex hover issue fixed.
Great. Will test over the weekend.
Right now the same code turns view frames off and prepares drawing for printing (where you probably don't want to see Vertices). Could be split so the Vertices stay visible on screen but not on print/export. Is that a change request?

wf
Good question and i am not sure. When printing vertices should be set to off. Therefore i guess setting view frames option to off should probably turn them off. But setting view frames option to on just to be able to select vertices i guess isn't ideal solution.

P.S. What i like about vertices is they are represented as circles instead of rectangles like in the rest of FreeCAD.
triplus
Posts: 9277
Joined: Mon Dec 12, 2011 4:45 pm

Re: TechDraw to Master

Postby triplus » Sat Jul 09, 2016 2:54 pm

triplus wrote:
wandererfan wrote:Vertex hover issue fixed.
Great. Will test over the weekend.
Test confirms the issue is resolved!
User avatar
wandererfan
Posts: 3636
Joined: Tue Nov 06, 2012 5:42 pm

Re: TechDraw to Master

Postby wandererfan » Sun Jul 10, 2016 2:10 pm

wmayer wrote:Still a few minor issues: for the dialog widget you should pass a parent pointer other than NULL to make sure the dialog isn't handled as a top-level widget.
fixed. dialog is now parented to QGraphicsView widget.
wmayer wrote:And maybe the dialog button box should be aligned to the right side to make it consistent with other dialogs.
done.
wmayer wrote:If you click several times on a green field you get several dialogs. There shouldn't be more opened dialogs than one at a time.
done. mouse press only creates dialog if it doesn't already exist.