qelectrotech / qelectrotech-source-mirror

Main QET repository, Bugtracker: https://qelectrotech.org/bugtracker/
https://qelectrotech.org
GNU General Public License v2.0
264 stars 81 forks source link

Saving centered text in table config file does not work #283

Open titanic-jb opened 3 months ago

titanic-jb commented 3 months ago

I was creating a Bill of Materials (bom for short) table via the menu in Project --> Add a Nomenclature.

I changed the alignment of the header text to be centered.

Than I saved the configuration by defining a file name (jb-bom) and clicking the floppy icon to save it.

In the next project, I clicked on the drop down list, selected the saved file jb-bom and most of the configuration was re-established, except the centered headings.

I found file graphics-table.json in ~/.qet. When opening the file in an editor, I found this text inside:

{
    "jb-bom": {
        "header": {
            "alignment": "AlignHCenter",
            "font": "Sans Serif,9,-1,5,50,0,0,0,0,0",
            "margins": "5;5;10;5"
        },
        "table": {
            "alignment": "AlignLeft",
            "font": "Sans Serif,9,-1,5,50,0,0,0,0,0",
            "margins": "5;5;10;5"
        }
    },
}

Changing the alignment line from "alignment": "AlignHCenter", to "alignment": "AlignCenter", and restarting QElectroTech did the trick to me.

I was working with version 0.9 on MacOS. I downloaded the lastet dev, with the same result. Saving the config also writes AlignHCenter to the json file.

QElectroTech V 0.100.0-dev Compilation : CLANG 14.0.0 (clang-1400.0.29.102) Built with Qt 5.15.12 - arm64 - Date : Mar 18 2024 : 09:36:28 Git Revision : a2beabd559831d8f28dd55a5cff4f1c307b39782

Besides that: great job everybody. I enjoyed drafting the last couple of days in QET very much! Thank you all.

scorpio810 commented 3 months ago

Strange? https://doc.qt.io/qt-6/qt.html#AlignmentFlag-enum

https://github.com/qelectrotech/qelectrotech-source-mirror/blob/master/sources/factory/ui/addtabledialog.cpp#L106