TechDraw to Master

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

Re: TechDraw to Master

Post by wandererfan »

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
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw to Master

Post by wandererfan »

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
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: TechDraw to Master

Post by wmayer »

* 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
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw to Master

Post by wandererfan »

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
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TechDraw to Master

Post by triplus »

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
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw to Master

Post by wandererfan »

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
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: TechDraw to Master

Post by wmayer »

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
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TechDraw to Master

Post by triplus »

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
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TechDraw to Master

Post by triplus »

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

Re: TechDraw to Master

Post by wandererfan »

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.
Post Reply