Commit Graph

3117 Commits

Author SHA1 Message Date
tetektoza
8fda3b4bd1 Core: Introduce PDF Import-Export dialog (#20860)
* Core: Introduce PDF Import-Export dialog

Currently, we only have hardcoded exporting to one pdf version, which
leads to (as in one of the below issues) to problems, such as
non-transparent layers, which are by default not supported in PDF/A-1b.

So, this patch adds an option to the user to select their preferred PDF
version by introducing new dialog under Import-Export in Preferences,
and allowing to update that version before exporting.

* Core: Add informational messages regarding selected PDF format

* Gui: Handle Qt < 6.8 unsupported PDF format

* Gui: Switch PDF export prefs dialog to use tr()

* Gui: Remove center alignment of PDF version description

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-04-27 19:31:34 -05:00
Kacper Donat
ed6e953c90 TechDraw: Replace dynamic_cast with qobject_cast 2025-04-26 14:23:25 +02:00
Kacper Donat
b999ce0336 TechDraw: Use freecad_cast whenever possible 2025-04-26 14:23:25 +02:00
Furgo
e25c43537a TechDraw: Add BIM view with the page's scale (#20934)
* TechDraw: Add BIM view with the page's scale

* Fix if one-liner syntax
2025-04-23 19:31:57 +02:00
tetektoza
354cef7463 TechDraw: Use static_cast when casting scene's child to TextField 2025-04-23 16:32:31 +02:00
tetektoza
bbcdb77003 TechDraw: Return text fields directly as childs of QGISVGTemplate
As the title says. I've noticed during reproducing of #18921, that
after in `PagePrinter::renderPage` we call `setTemplateMarkers`
twice, which results in deleting `childItems` allocated memory
(in `setTemplateMarkers`->`setMarkers`->`updateView`->`clearClickHandles`),
and then we are calling `setTemplateMarkers` (also in `PagePrinter::renderPage`) second time,
accessing `textFields` in `setMarkers` method, which still contain hanging pointers
from the previous deallocation. This results in segfaults as we iterate through `textFields`.

So, instead of keeping sychronization between childs of QGISVGTemplate
and textFields vector - this patch removes this variable at all and uses
childs directly to return text fields.
2025-04-23 16:32:31 +02:00
Chris Hennes
f1ef2159ee Merge pull request #20835 from oursland/python-binding-generator-const
python: Make const methods declared const in C++.
2025-04-21 10:58:21 -05:00
Florian Foinant-Willig
ef0ca1cff3 Core: Part::PartFeature should be Part::Feature 2025-04-21 10:51:15 -05:00
Jacob Oursland
0b29aa596a python: use const_cast<> to new() python types. 2025-04-16 20:32:04 -07:00
Jacob Oursland
5c251e73ac python: apply const method annotations to impls. 2025-04-16 20:32:04 -07:00
Benjamin Nauck
66a664ae55 TechDraw: Potential fix for snap builds, specify type.. again (#20831)
* TechDraw: Potential fix for snap builds, specify type

* Techdraw: Fix more toDegrees-issues
2025-04-17 00:19:26 +02:00
Benjamin Nauck
04db3175f3 TechDraw: Potential fix for snap builds, specify type 2025-04-16 17:28:11 +02:00
Benjamin Nauck
f22f3705db Use Base::toDegrees() instead of manually converting 2025-04-15 07:16:39 +02:00
Benjamin Nauck
21fbf8e539 Use Base::toRadians() instead of manually converting 2025-04-15 07:16:36 +02:00
Benjamin Bræstrup Sayoc
8e7d3325b3 TechDraw: refactor click handles for editable fields
Fixes #19387
2025-04-14 10:46:09 -05:00
Kacper Donat
77e40b9747 Base: Use explicit pointer syntax for freecad_cast (#20694)
* Base: Use explicit pointer syntax for freecad_cast

This aligns our custom cast with other casts

* All: Use explicit pointer syntax for freecad_cast
2025-04-11 14:11:33 +00:00
Pieter Hijma
5ba9037885 [Doc] Fix unassociated doc strings
Before this commit, these doc strings were unassociated, which means
that the can appear at random places.  They are now associated with
their namespace an class.
2025-04-11 00:47:54 +02:00
Andrea
30b76b5eda MOD: TECHDRAW (Removed unused functions)
Unused functions removed.
2025-04-07 11:19:02 -05:00
Kacper Donat
9d97d1c895 Base: Rename Base::freecad_dynamic_cast into freecad_cast
This is to make it shorter and easier to use. QT does the same thing
with their qobject_cast.
2025-04-07 10:32:28 -05:00
Benjamin Bræstrup Sayoc
5287008dff TechDraw: fix wrong color on edges
Fixes #20561
2025-04-07 12:05:53 +02:00
jonzirk76
35bae9a3ff Moved DrawUtil.cpp member functions to DrawViewPart.cpp
Updated ownership of member functions & updated headers

Removed redundant ownership lines

Removed reference to removed ownership line

Removed owner from function head

static reference removed from header file, function heads updated

attempt to fix CosmeticExtension.cpp

attempt to fix CosmeticExtension.cpp #2

attempt to fix CosmeticExtension.cpp #3

CosmeticExtension.cpp refactored based on DrawUtil member functions move
2025-04-07 11:07:52 +02:00
luzpaz
e526547885 Fix various typos (#20651)
* Fix various typos
Found via `codespell -q 3 -L aci,addmin,ake,aline,alle,alledges,alocation,als,ang,anid,anormal,anull,aply,apoints,ba,beginn,behaviour,bloaded,bottome,brushin,bu,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,documentin,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,findn,fle,freez,graphin,groupe,hist,iff,incrementin,indexin,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,itsel,kilometre,leadin,localy,lod,mantatory,matc,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,recurrance,renderin,re-use,re-used,re-using,rin,ro,rougly,sectionin,seperator,sergent,serie,shs,sinc,siz,som,stpo,strack,substraction,te,technic,thist,thru,tread,tru,ue,uint,unter,uupper,uptodate,vas,vertexes,vew,wallthickness,whitespaces -S "./.git,*.po,*.ts,*.pdf,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./src/Base/StackWalker.cpp,./build/doc/SourceDoc,./tools/build/WindowsInstaller/lang,./src/Mod/TechDraw/Templates/locale"`

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-05 22:58:20 -05:00
captain0xff
d8f673aead techdraw: remove QGVPage::getDevicePixelRatio() in favor of getMaximumDPR 2025-04-03 19:55:27 +05:30
captain0xff
887cbd0e1a remove some code setting pixel density ratio for pixmaps
update
2025-04-03 19:55:27 +05:30
Kacper Donat
5658274bb8 Merge pull request #20559 from hyarion/refactor/add-limits
Add `#include <limits>` in all files where it is used
2025-04-01 17:11:50 +02:00
Benjamin Nauck
738bc95fa2 TechDraw: Add #include <limits> where used 2025-03-31 23:53:03 +02:00
Luz Paz
97e172334b Fix typos
Found via `codespell -q 3 -L aci,addmin,ake,aline,alle,alledges,alocation,als,ang,anid,anormal,aply,apoints,ba,beginn,behaviour,bloaded,bottome,brushin,bu,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,documentin,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,findn,fle,freez,graphin,hist,iff,incrementin,indexin,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,itsel,kilometre,leadin,localy,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,recurrance,renderin,rin,ro,rougly,sectionin,seperator,serie,shs,sinc,siz,som,strack,substraction,te,technic,thist,thru,tread,tru,ue,uint,unter,uptodate,vas,vertexes,vew,wallthickness,whitespaces -S "./.git,*.po,*.ts,*.pdf,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./src/Base/StackWalker.cpp,./build/doc/SourceDoc,./tools/build/WindowsInstaller/lang,./src/Mod/TechDraw/Templates/locale"`
2025-03-31 23:00:32 +02:00
Andrea
ce10f30aa6 [mod] clean
code clean
2025-03-31 11:01:39 -05:00
jonzirk76
9ac7e6d17c TechDraw: remove double type checking
Fixes #20131
2025-03-30 10:42:08 -05:00
Benjamin Nauck
cf94011294 Techdraw: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:39 +01:00
PaddleStroke
fc9c5a7521 TechDraw: Section task: Fix spinbox (#20413)
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-03-26 21:41:17 +01:00
Benjamin Bræstrup Sayoc
56020bfb75 TechDraw: arc dimensions should not have fill
Fixes #20418. Regression by commit 998f713c97
2025-03-26 11:02:57 +01:00
mosfet80
b7f588c1e8 Clean QGTracker.cpp
Clean code
2025-03-24 19:02:34 +01:00
j-hap
edf8a4daf5 TechDraw: Replace annotation edit dialog with QPlainTextEdit (#20092)
* TechDraw: Replace annotation edit dialog with QPlainTextEdit

* Remove useless include introduced in previous commit

* Remove trailing _ for members to conform with rest of the codebase

* Add const & to string vectors that don't need copying

* Fix IWYU linter warnings

* Forward all annotation double clicks to the StringList property editor

* Remove unused dialog

* Fix Qt 5 build error

* Fix missing exports with MSVC
2025-03-24 13:27:55 -04:00
Chris Hennes
af4850e442 Merge pull request #20369 from WandererFan/SplineAsCircleYetAgain20347
[TD] Spline as circle yet again  (fix 20347)
2025-03-24 12:05:59 -05:00
Chris Hennes
2ddd96e315 Merge pull request #20110 from WandererFan/HeadlessViewCreation20024
[TD]Headless view creation (fix #20024)
2025-03-22 12:20:58 -05:00
WandererFan
43f5e134e9 [TD]fix view loses dimensions (fix #19968) (#20122)
* [TD]fix view loses dimensions (fix #19968)

* [TD]Apply review comment
2025-03-22 11:12:42 -05:00
Chris Hennes
04602f96c2 TD: Ensure WalkerEdge is fully initialized
Coverity thinks that the edge_t is not getting fully initialized, so add a constructor to WalkerEdge that ensures the two components in question are set to zero (resulting in an invalid edge).
2025-03-22 07:15:15 +01:00
wandererfan
7d511b2bd9 [TD]use Ptolemy's Theorem for bspline to circle conversion 2025-03-21 11:10:17 -04:00
wandererfan
dc04f68732 [TD]fix reversed condition prevents 3d dimension 2025-03-21 11:01:20 -04:00
wandererfan
2cea9600ef [TD]clean annoying lint messages 2025-03-21 11:01:15 -04:00
wandererfan
a10e93befe [TD]apply review comments 2025-03-21 09:49:14 -04:00
Chris Hennes
21c07cabc5 FreeCAD: Compiler warning fixes 2025-03-19 10:13:34 +01:00
Chris Hennes
5e6a37a1fa Merge pull request #19899 from tritao/cmake-cleanup-targets
CMake: Cleanup targets with transitive dependencies
2025-03-17 13:15:37 -05:00
Captain
65236b9e69 TechDraw: changed CosmeticVertex point picker dashed circle to filled dot. (#20095)
* techdraw: changed the cosmetic vertex shape

* add back the call to prepareGeometryChange

* add getVertexSize and getLineWidth methods to QGIViewPart

* use doubles for sizes

* update setRadius in QGMarker to use double instead of float
2025-03-17 12:05:29 -05:00
Chris Hennes
e04b8b05b2 Merge pull request #20177 from captain0xff/flickering-cursor
TechDraw: Fix flickering cursor issue
2025-03-17 11:15:40 -05:00
tritao
cdab9c7837 CMake: Cleanup targets with transitive dependencies 2025-03-17 12:12:06 +00:00
Chris Hennes
9a77120e82 Merge pull request #20142 from bofdahof/ranges
Apply C++20 std::ranges (mainly to std::find)
2025-03-17 03:08:27 -05:00
Chris Hennes
0924f159a1 Merge pull request #20160 from karliss/popup-parent
Add missing parent for messagbox and other popups.
2025-03-17 00:16:49 -05:00
Chris Hennes
92a99ac71a Merge pull request #19788 from benj5378/state2
TechDraw: remove unneeded state, part 1
2025-03-17 00:02:20 -05:00