Commit Graph

803 Commits

Author SHA1 Message Date
Max Wilfinger
70f4221993 Fix missed strings for UI consistency
Fix ellipsis rendering
2025-08-08 06:37:59 -05:00
Frank David Martínez M
1b3851c502 [Core] Add Boolean Functions to expressions (AND, OR, NOT) (#22506)
* [Core] Add Boolean Functions to expressions (AND, OR, BOOL, NOT)

* [Core] Add `if` function to expressions to overcome ternary operator limitations

* [Core] Update expressions grammar to recognize relational operations as arguments

* [Core] The `if` function has been removed as no consensus was reached regarding its convenience or necessity. Its inclusion was considered potentially confusing or redundant.

* [Core] Make boolean cast based on Confusion threshold.
2025-08-05 03:50:13 +00:00
xtemp09
5aae85f48d [Spreadsheet] Add icons to the context menu (#22773)
* [Spreadsheet] Add icons to the context menu

This commit adds the following icons:
- edit-cut
- edit-copy
- edit-paste
- edit-delete
- merge-cells
- split-cell
- view-refresh

* [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-08-02 14:57:53 +02:00
Ian Abreu
bb2ee82990 Core: Generation of Spreadsheet interface bindings (#22624)
* Initial commit of spreadsheet

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-07-22 18:34:42 -05:00
Max Wilfinger
3cce6ffa3c Update src/Mod/Spreadsheet/Gui/Workbench.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
e7161fedd4 Update src/Mod/Spreadsheet/Gui/Workbench.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
f38d0028a1 Update src/Mod/Spreadsheet/Gui/Workbench.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
a732648fe9 Update src/Mod/Spreadsheet/Gui/Workbench.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
50173a4e1b Update src/Mod/Spreadsheet/Gui/Workbench.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
d3e6c1fd63 Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
a3f2e8cf6b Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
cbef684d63 Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
a31f2d3a1c Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
4151dfd18c Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
7fdf2ec460 Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
5ae0d2f6a9 Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
6ffe3ee81b Update src/Mod/Spreadsheet/Gui/Command.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
f078e51dab Update src/Mod/Spreadsheet/Gui/Workbench.cpp
Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 10:35:16 -05:00
Max Wilfinger
751626202d Spreadsheet: Update UI strings for consistency 2025-06-30 10:35:16 -05:00
Kacper Donat
96b006a2dd Spreadsheet Fix '=' regression in spreadsheets (#22146)
* Tools: Add ExpressionLineEdit to QtDesigner plugin

* Spreadsheet: Only use validator when when prefix is not '='

---------

Co-authored-by: wmayer <wmayer@freecad.org>
2025-06-23 22:20:25 +02:00
Benjamin Nauck
4fcb871b5b Spreadsheet: Only use validator when when prefix is not '=' 2025-06-23 16:14:35 +02:00
xtemp09
eb8d8b68f0 [Spreadsheet] Replace override cursor with QGraphicsItem::setCursor (#22097)
* [Spreadsheet] Replace the risky use of override cursor with
QGraphicsItem::setCursor

* [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-06-21 12:57:07 +02:00
Ladislav Michl
4d1d6f4e78 Revert "Sheet: Disable zooming"
This reverts 0c4fb60 ("Sheet: Disable zooming") as it breaks some
users workflow.
2025-06-11 06:54:59 +02:00
Kacper Donat
109e11e6b2 Spreadsheet: Fix cursor being stuck resize state when scaled 2025-06-11 06:54:59 +02:00
wmayer
b38c8867d0 Sheet: Further cleanup in Sheet class
With PR 21445 an unused function has been removed. But the underlying
class member isn't used anywhere else and can be removed as well.
2025-06-05 10:15:58 +02:00
wmayer
513260d29d Sheet: Improve handling of unsupported formulas
With the example file of issue 20299 the parser stops with an exception
and reads in the formulas only partially. This PR doesn't fix the issue
but avoids to raise an exception so that as much as possible will be
read in. For unsupported formulas a suitable message is printed with
the content of the cell.
2025-06-05 10:15:28 +02:00
wmayer
a46f79aa68 Sheet: Fix crash in Cell::setContent
This fixes issue 14697
2025-06-05 10:15:24 +02:00
wmayer
c215bd7be9 Sheet: Fix reading xlsx files
for the specs of the XLSX file format see:
https://jkp-ads.com/articles/excel2007fileformat00.aspx or
https://www.data2type.de/xml-xslt-xslfo/spreadsheetml/xlsx-format

In order to find the correct sheet file one has to first read-in
xl/_rels/workbook.xml.rels and save the relations of Id and Target.
The file xl/workbook.xml contains a list of sheet elements where for
each element the attribute 'r:id' is set. This attribute can be used
to look up for the actual data file.

This fixes issue 19757
2025-06-05 10:14:42 +02:00
wmayer
0c4fb60225 Sheet: Disable zooming
With PR 16130 the zooming capability was added to spreadsheet view.

The SheetTableView is added to a QGraphicsScene of a QGraphicsView
that provides the method scale(). However, this causes some problems
with header of the table view and makes resizing columns or rows
very unintuitive.

A correctly working table view is probably more important than the
possibility to zoom in or out and that's why the latter will be
disabled.

This fixes issue 19863
2025-06-05 10:14:03 +02:00
Gonzalo
bcfda35b42 Avoid error importing spreadsheet with deleted sheet (#19757)
This fix was proposed by pageeddie on https://github.com/FreeCAD/FreeCAD/issues/19757
2025-06-04 21:54:31 -05:00
Ladislav Michl
f8d2789a43 Base: Units: introduce unit one
Dimensionless quantities have all exponents equal to zero.
Such quantities are simply numbers. The associated unit is
the unit one, symbol 1, although this is rarely explicitly
written.

See chapter 2.3.3 Dimensions of quantities, The International
System of Units, 9th edition.
2025-06-03 09:31:38 +02:00
pre-commit-ci[bot]
5dc203630b [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-06-02 09:53:47 +00:00
Yorik van Havre
94144ecd99 Translations: Merged crowdin translations 2025-06-02 11:48:26 +02:00
Yorik van Havre
bba4a7b990 Translations: updated ts files 2025-06-02 11:07:28 +02:00
Pieter Hijma
5bdfba3a1a Core: Update expressions on property rename
This includes both expressions in generic containers and in
spreadsheets.
2025-05-26 18:11:27 +02:00
mosfet80
41c750be47 Sketcher: Remove unused variables (#21504)
removed unused variables
2025-05-25 00:19:46 +02:00
Andrea
6cd828d986 SpreadSheet: remove function
Observer is no longer required as PropertySheet is now derived from  PropertyLinkBase and will handle all the link related behavior
2025-05-19 18:27:01 +02:00
Chris Hennes
f5806841b6 Merge pull request #19907 from benj5378/getAttribute
Base: make getAttribute template
2025-05-12 10:39:55 -05:00
Benjamin Bræstrup Sayoc
6786af6ef9 Everywhere: clean up getAttribute conversions 2025-05-09 15:54:57 +02:00
Benjamin Bræstrup Sayoc
492b8312b3 Base: make getAttribute template 2025-05-09 15:54:57 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Ladislav Michl
c293d74566 Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Benjamin Nauck
c70b649dff Spreadsheet: use isEmpty() instead of count() where possible 2025-05-03 22:22:10 +02:00
tetektoza
b138276a15 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
119dc079c1 Spreadsheet: Replace dynamic_cast with qobject_cast 2025-04-26 14:23:25 +02:00
Kacper Donat
f2c3b19198 Spreadsheet: Use freecad_cast whenever possible 2025-04-26 14:23:25 +02:00
xtemp09
23e4fe2d8e [Spreadsheet] Add usage of override cursor in SheetViewHeader (#20786)
* [Spreadsheet] Add usage of override cursor in SheetViewHeader

Closes #19863

* Update src/Mod/Spreadsheet/Gui/SheetTableView.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

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

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

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-16 20:42:24 +02:00
Chris Hennes
7ac21c5eff Merge pull request #20649 from pieterhijma/viewprovider-toggle-visibility
[Core] Allow setting visibility toggling in the ViewProvider
2025-04-14 10:45:14 -05:00
Kacper Donat
b300c80b90 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
Kacper Donat
35a9673a75 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