Commit Graph

63 Commits

Author SHA1 Message Date
Pascal de Bruijn
5ac886fa0e Add proper PDF creator metadata 2025-02-03 12:05:16 -05:00
xtemp09
64b4382462 [Spreadsheet] Enable zoom in Spreadsheet (#16130)
* [Spreadsheet] Enable zoom in Spreadsheet

Closes #6094. This commit also fixes page tab order of Spreadsheet
settings in Preferences.

* Spreadsheet: apply clang-format

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-12-13 10:52:51 -06:00
Ladislav Michl
e62b91ada4 Base: Drop QString-std::string conversion functions from Tools
Convenience helpers function Tools::toStdString and Tools::fromStdString
were implemented for Qt4 or older to perform utf8 aware conversion as
QString::toStdString/QString::fromStdString were using toAscii/fromAscii
internally (see https://dreamswork.github.io/qt4/classQString.html).

Since Qt5 QString uses toUtf8/fromUTf8, which makes the helper functions
obsolete (see https://doc.qt.io/qt-5/qstring.html#fromStdString).
2024-12-02 23:30:53 -05:00
Kacper Donat
082b5edf29 Gui: Do not show overlay panels in Start 2024-08-26 11:24:19 -05:00
pre-commit-ci[bot]
e92ed45df9 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-09-12 13:02:35 -04:00
wmayer
b5d363baf1 Sheet: Apply clang format 2023-09-10 16:01:37 +02:00
wmayer
8027aed557 Sheet: modernize C++: use equals default 2023-08-22 12:45:58 +02:00
Jonas Bähr
dee56c32d4 Spreadsheet: fix build on macOS
The recent migration from boost::bind to std::bind [1] broke the build
on Mac (Apple clang version 13.0.0 (clang-1300.0.29.30) on macOS-11.7.8).

In all other cases the `boost::bind` was replaced by `std::bind` (among
with the place holders) but in these two spread sheet files
  src/Mod/Spreadsheet/Gui/SheetModel.cpp
  src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp
the original code only referenced `bind`, which used to get resolved to
`boost::bind` but now raises this error:
> /Users/jonas/src/FreeCAD/FreeCAD-git/src/Mod/Spreadsheet/Gui/SheetModel.cpp:50:36: error: use of undeclared identifier 'bind'; did you mean 'boost::bind'?
>         sheet->cellUpdated.connect(bind(&SheetModel::cellUpdated, this, sp::_1));
>                                    ^~~~
>                                    boost::bind

This commit changes this to `std::bind` expicitly, just like it's done in
the other files. This works on my system/compiler.

[1]: 4ffe0c3218
2023-08-11 06:15:51 -07:00
wmayer
948cbfccd9 modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
2023-08-08 21:10:16 +02:00
wmayer
52e1c7c33b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
Tobias Falk
529f9401f7 added PDF/A-1b compliancy to all PDF export functions
for more details about this look at: https://www.kdab.com/creating-pdfa-documents-qt/
2023-08-05 14:46:11 -06:00
Robbe De Greef
4d34b3324d fix: Spreadsheet applies content/alias even when focus lost (#9836)
* fix: Spreadsheet applies alias even when focus lost

The original stylesheet behavior was that the alias or content fields
could be edited, but only after enter was pressed the field would
actually update. This change makes the field apply when focus is lost
on top of when enter is pressed. This makes it easier to enter the
alias of a lot of fields at once.
2023-07-19 09:15:54 -05:00
wmayer
e0076161c9 Spreadsheet: move to new style connect() 2023-01-13 20:02:46 +01:00
flachyjoe
b06cd1c421 [Spreadsheet] Fix alias setting for empty cells
Fix #7841
2022-11-27 18:54:56 -06:00
Uwe
2dd9f90f57 [Spread] Gui: remove unused includes
- also sort includes
2022-10-10 01:04:07 +02:00
berniev
53ba98d636 Mod: use empty 2022-08-06 19:30:13 +02:00
wmayer
526228c89e Spreadsheet: fix several memory leaks 2022-07-27 07:37:23 +02:00
wmayer
e2f1452cb8 Spreadsheet: [skip ci] Fix several clazy issues:
* Mixing iterators with const_iterators [-Wclazy-strict-iterators]
* Q_PROPERTY should have either NOTIFY or CONSTANT [-Wclazy-qproperty-without-notify]
* Missing reference in range-for with non trivial type [-Wclazy-range-loop-reference]
* Missing emit keyword on signal call SpreadsheetGui::SheetViewHeader::resizeFinished [-Wclazy-incorrect-emit]
* Missing emit keyword on signal call QAbstractItemModel::dataChanged [-Wclazy-incorrect-emit]
* c++11 range-loop might detach Qt container (QStringList) [-Wclazy-range-loop-detach]
2022-07-25 11:23:27 +02:00
mosfet80
c48a569696 Boost version <=1.60 is never used in freecad 0.20 (#7038)
* Boost version 1.60 is never used in freecad 0.20
2022-06-24 02:20:26 +02:00
0penBrain
9eca8454ca Sheet: enable Split action only if only one merged cell is selected
Both main menu and context menu
 Partially fixes #6744
2022-04-15 12:14:55 -05:00
Chris Hennes
42e0cf0c8a [Spreadsheet] Use stylesheet for alias color
When setting the text color for an invalid alias, use the Qt stylesheeet
mechanism rather than QPalette, so that it works correctly with
an applied QSS stylesheeet. Also attempt to detect a darkmode stylesheet
and use lighter shade of red so that the alias is more legible. Finally,
instead of explicitly setting the text color to black when it's valid,
reset to the original stylesheet (usually an empty string). This ensures
that in a dark stylesheet the text color is legible.

Fixes #0004803.
2021-12-29 21:49:00 -06:00
Mateusz Skowroński
699d2fb197 Fix Qt deprecation warning. QPrinter::setOrientation() is obsolete. 2021-12-11 18:46:29 +01:00
wmayer
45de32c4e1 Spreadsheet: fix format of table cells when used for printing, by default use landscape orientation 2021-12-05 12:16:54 +01:00
wmayer
1d3822822d Spreadsheet: issue 0002957: spreadsheet direct printing 2021-12-04 23:36:11 +01:00
wmayer
049a34645b Mod: change error text of Python wrapper when trying to access deleted view 2021-11-21 19:57:21 +01:00
wmayer
25afe523c4 Spreadsheet: [skip ci] return Py::None() instead of Py::Object() 2021-11-20 14:40:12 +01:00
Chris Hennes
0da3bc7332 Spreadsheet: Implement Python SheetView functions
Add the following functions to the Python interface of SheetView:
* selectedRanges()
* selectedCells()
* select(cell, flags)
* select(upperLeft, lowerRight, flags)
* currentIndex()
* setCurrentIndex(cell)
2021-11-20 14:40:12 +01:00
wmayer
67cc5c9047 Gui: add MDIViewPy.cast_to_base and implement in Python wrappers for sub-classes of MDIView 2021-11-19 15:44:23 +01:00
wmayer
d398ee7f50 Spreadsheet: implement SheetViewPy that acts as sub-class of MDIViewPy 2021-11-13 20:40:32 +01:00
Chris Hennes
48f4277477 Spreadsheet: Expose currentIndex to Python 2021-11-12 22:54:24 -06:00
Chris Hennes
170e515f15 Spreadsheet: Add programmatic selection of cells
Implement modifying the current selection programmatically via the
ViewProvider object in both C++ and Python. This enables unit testing of
GUI tasks that require a selection, and improves scriptability of
Spreadsheet.
2021-11-12 17:33:39 -06:00
Chris Hennes
34fdcd1a61 Spreadsheet: Remove double-set of value on enter 2021-11-02 23:12:31 -05:00
Chris Hennes
1d8a9a86a4 Spreadsheet: Fix bug in content and alias lineedits
The two line edit widgets above the spreadsheet, one for exiting the
cell contents and one for editing the alias, were set to use the same
editing widget as the individual spreadsheet cells. Once that widget was
refactored to handle tab/enter behavior it was no longer the correct
widget for those elements. This commit changes them to
Gui::ExpressionLineEdit widgets instead, so that the Enter key works
correctly for them again.
2021-11-02 10:15:19 -05:00
Chris Hennes
82e3bc5844 [Spreadsheet] Clean up compilation warnings 2021-10-12 11:53:48 -05:00
Chris Hennes
8aa22d1a68 [Spreadsheet] Refactor keyboard handling
LineEdit no longer actually handles motion, it simply indicates which
action was taken to cause it to lose focus (e.g. which key was pressed).
It's up to the client code to determine what this means. This allows
significant consolidation of keyboard-handling logic, and the
implementation of more extensive keyboard navigation features.

New keyboard shortcuts include a tab counter to implement auto-return,
plus Ctrl->Arrow, End, Home, Ctrl-End, and Ctrl-Home, matching the
behavior of OpenOffice, LibreOffice, etc.

Block selection via keyboard has also been added by holding down the
shift key during navigation with the arrow keys (this also works in
combination with the Ctrl modifier for region navigation).
2021-10-08 14:55:39 -05:00
0penBrain
07db7dd262 [Spreadsheet] Expose SpreadsheetView::getSheet to Python 2021-06-07 21:18:26 +02:00
Benjamin Nauck
6eb89fe038 Spreadsheet: Fix coverity warning
There are no reason to check the return values for these functions
as the string passed as an argument will be set to an empty string
if it false. An empty string is a valid option in these instances.

Coverity warnings fixed:

CID 316520 (1 of 1): Unchecked return value (CHECKED_RETURN)
3. check_return: Calling getAlias without checking return value (as is done elsewhere 8 out of 10 times).

CID 316557 (1 of 1): Unchecked return value (CHECKED_RETURN)
8. check_return: Calling getAlias without checking return value (as is done elsewhere 8 out of 10 times).
2021-02-19 15:47:27 +01:00
luz paz
786d84d288 Spreadsheet: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the Spreadsheet Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
wmayer
0a6929a122 Coverity: Dereference after null check 2020-07-20 17:34:25 +02:00
donovaly
37c4c90ab0 [Spreadsheet] add visible alias check
as discussed in https://forum.freecadweb.org/viewtopic.php?p=408992#p408981
visible feedback is missing for the Alias field. This PR add it and also adapts the UI label style.
2020-06-19 12:17:04 +02:00
wmayer
d6169d6478 boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
730154a684 boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
mwganson
4643e3b170 [Spreadsheet] [skip ci] fix bug where aliases renamed in the spreadsheet were not getting renamed in sketcher constraints 2020-03-22 15:20:53 +01:00
mwganson
e2e0018df6 [Spreadsheet] fix minor bug where failure to set alias message appears erroneously. Fixes #4287 2020-03-13 15:40:30 +01:00
mwganson
2609ec5441 [Spreadsheet] fix bug where duplicate / bad aliases were being allowed. 2020-03-12 15:47:54 +01:00
mwganson
54549d0931 [Spreadsheet] add alias line edit next to contents line edit -- add back in some inadvertently removed code 2020-03-12 15:47:54 +01:00
mwganson
77114fa942 [Spreadsheet] add alias line edit next to contents line edit 2020-03-12 15:47:54 +01:00
wmayer
5390266ac7 fixes #0004125: MDIViews not accessible correctly 2019-09-15 18:15:44 +02:00
Zheng, Lei
11321bb996 Spreadsheet changes
Various changes to support in-place editing, and more.
2019-08-17 15:15:47 +02:00
wmayer
c26ac76083 fixes 0003515: Changing Name of Spreadsheet in History Tree Does Not Trigger Name Update in Tab at Bottom of 3D Window 2019-01-14 00:21:56 +01:00