76

(38 replies, posted in Code)

Im günstigsten Fall hast Du einen github-Account, auf dem Du Sourcecode und Releases veröffentlichst.
Dann kann sich jeder den Quellcode anschauen, weiter verbessern, PullRequests erstellen, etc. pp.

@elevatormind:

elevatormind wrote:

It should definitely be the default font in QET as you say though, otherwise people will probably not use it.

Based on your “liberation-fonts” branch including osifont, I have implemented the setting of the default font to "Liberation Sans, 9, Regular"in QET.
As I believe this is inseparable from each other, I am providing the patch here for you to integrate it.

diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp
--- a/sources/qetapp.cpp    2025-03-13 22:43:33.000000000 +0100
+++ b/sources/qetapp.cpp    2025-03-14 16:41:05.253397571 +0100
@@ -1236,7 +1236,7 @@
 /**
     @brief QETApp::diagramTextsFont
     The font to use
-    By default the font is "sans Serif" and size 9.
+    By default the font is "Liberation Sans" and size 9.
     @param size : the size of font
     @return the font to use
 */
@@ -1246,7 +1246,7 @@
 
     //Font to use
     QString diagram_texts_family = settings.value("diagramfont",
-                              "Sans Serif").toString();
+                              "Liberation Sans").toString();
     qreal diagram_texts_size     = settings.value("diagramsize",
                               9.0).toDouble();
 
@@ -1272,14 +1272,14 @@
 
     //Font to use
     QString diagram_texts_item_family = settings.value("diagramitemfont",
-                               "Sans Serif").toString();
+                               "Liberation Sans").toString();
     qreal diagram_texts_item_size     = settings.value("diagramitemsize",
                                9.0).toDouble();
     auto diagram_texts_item_weight =
             static_cast<QFont::Weight>(
                 settings.value("diagramitemweight", QFont::Normal).toInt());
     QString diagram_texts_item_style  = settings.value("diagramitemstyle",
-                               "normal").toString();
+                               "Regular").toString();
 
     if (size != -1.0) {
         diagram_texts_item_size = size;
diff -r -u a/sources/ui/configpage/generalconfigurationpage.cpp b/sources/ui/configpage/generalconfigurationpage.cpp
--- a/sources/ui/configpage/generalconfigurationpage.cpp    2025-03-13 22:43:33.000000000 +0100
+++ b/sources/ui/configpage/generalconfigurationpage.cpp    2025-03-14 17:26:10.217643923 +0100
@@ -86,13 +86,11 @@
     ui->m_border_0->setChecked(settings.value("border-columns_0", false).toBool());
     ui->m_autosave_sb->setValue(settings.value("diagrameditor/autosave-interval", 0).toInt());
     
-    QString fontInfos = settings.value("diagramitemfont").toString() + " " +
-            settings.value("diagramitemsize").toString() + " (" +
-            settings.value("diagramitemstyle").toString() + ")";
+    QString fontInfos = settings.value("diagramitemfont", "Liberation Sans").toString() + " " +
+            settings.value("diagramitemsize", "9").toString() + " (" +
+            settings.value("diagramitemstyle", "Regular").toString() + ")";
     ui->m_font_pb->setText(fontInfos);
 
-    
-    
 
         //Dynamic element text item
     ui->m_dyn_text_rotation_sb->setValue(settings.value("diagrameditor/dynamic_text_rotation", 0).toInt());
@@ -106,7 +104,7 @@
                 QString::number(font.pointSize()) + " (" +
                 font.styleName() + ")";
         ui->m_dyn_text_font_pb->setText(fontInfos);
-    }
+    } else { ui->m_dyn_text_font_pb->setText("Liberation Sans 9 (Regular)"); }
 
         //Independent text item
     ui->m_indi_text_rotation_sb->setValue(settings.value("diagrameditor/independent_text_rotation",0).toInt());
@@ -119,7 +117,7 @@
                             QString::number(font.pointSize()) + " (" +
                             font.styleName() + ")";
         ui->m_indi_text_font_pb->setText(fontInfos);
-    }
+    } else { ui->m_indi_text_font_pb->setText("Liberation Sans 9 (Regular)"); }
     
     ui->m_highlight_integrated_elements->setChecked(settings.value("diagrameditor/highlight-integrated-elements", true).toBool());
     ui->m_default_elements_info->setPlainText(settings.value("elementeditor/default-informations", "").toString());
@@ -399,7 +397,9 @@
 {
     bool ok;
     QSettings settings;
-    QFont font = QFontDialog::getFont(&ok, QFont("Sans Serif", 9), this);
+    QString currentFont = settings.value("diagramitemfont", "Liberation Sans").toString();
+    int currentPointSize = settings.value("diagramitemsize", "9").toInt();
+    QFont font = QFontDialog::getFont(&ok, QFont(currentFont, currentPointSize), this);
     if (ok)
     {
         settings.setValue("diagramitemfont", font.family());
@@ -421,7 +421,9 @@
 {
     bool ok;
     QSettings settings;
-    QFont font = QFontDialog::getFont(&ok, QFont("Sans Serif", 9), this);
+    QFont curFont;
+    curFont.fromString(settings.value("diagrameditor/dynamic_text_font", "Liberation Sans,9,-1,5,50,0,0,0,0,0,Regular").toString());
+    QFont font = QFontDialog::getFont(&ok, QFont(curFont.family(), curFont.pointSize()), this);
     if (ok)
     {
         settings.setValue("diagrameditor/dynamic_text_font", font.toString());
@@ -510,7 +512,9 @@
 {
     bool ok;
     QSettings settings;
-    QFont font = QFontDialog::getFont(&ok, QFont("Sans Serif", 9), this);
+    QFont curFont;
+    curFont.fromString(settings.value("diagrameditor/independent_text_font", "Liberation Sans,9,-1,5,50,0,0,0,0,0,Regular").toString());
+    QFont font = QFontDialog::getFont(&ok, QFont(curFont.family(), curFont.pointSize()), this);
     if (ok)
     {
         settings.setValue("diagrameditor/independent_text_font", font.toString());

At the same time, this also corrects an unattractive feature: When setting the font, the font dialog did not scroll to the current font, but always displayed the default font.


EDIT:
About the licenses: Do you think it is possible to have only one "tab" for all licenses?
The QET-License should of course be the first to display, but I like the idea with the combobox to choose others to view.

EDIT again:
Already have a solution for only having one license tab in about-dialog.
Just waiting for your PR for including the fonts, elevatormind, nomicons/wink

78

(16 replies, posted in Scripts)

That's why i'm asking which system and what QET-version you have!
We support several systems here, where the files are located in different directories!

You have to help with information so that we can help you!

79

(16 replies, posted in Scripts)

search your system for "nomenclature.json" or "summary.json"

80

(16 replies, posted in Scripts)

How can I tell, if you have not yet provided any information about your system!
OS, QET-Version, ...

81

(38 replies, posted in Code)

All the best for your health, Laurent!

Ok, so you don't have any problem with different looking fonts on different systems, Achim?

I tried PDF-Export with osifont used as Element-Text. (You might recognize, Achim)
To me it looks like it works perfectly:
osifont is not installed on the system – just used from within QET.

83

(16 replies, posted in Scripts)

That is not yet implemented.

You can overwrite entries with empty strings or you can edit the corresponding json file directly with a text editor.
The json-files are located in configuration-dir.

84

(16 replies, posted in Scripts)

It does not help, posting the same question in more than one thread!
Deleted the other post!

elevatormind wrote:

In my "liberation-fonts" branch, the liberation fonts is directly usable in QET

That's what I mean! Top!

elevatormind wrote:

I haven't looked at it, but the font should be able to be embedded when you export to PDF for example.

That would of course be necessary! Especially, when we speak of using osi-font!

elevatormind wrote:

It should definitely be the default font in QET as you say though, otherwise people will probably not use it.

Fully agree!

@elevatormind:

elevatormind wrote:

I'll try to work on a replacement for KAutoSaveFile (...)

Just noticed this warning:

QMetaObject::connectSlotsByName: No matching signal for on_m_color_kpb_changed(QColor)

and when searching for the slot/signal it returns this file:

sources/editor/ui/dynamictextfieldeditor.cpp

with this function:

void DynamicTextFieldEditor::setupWidget()
{
    m_color_kpb = new ColorButton(this);
    m_color_kpb->setObjectName(QString::fromUtf8("m_color_kpb"));

    connect(m_color_kpb, &ColorButton::changed,
            this, &DynamicTextFieldEditor::on_m_color_kpb_changed);

    ui->m_main_grid_layout->addWidget(m_color_kpb, 6, 1, 1, 2);
}

@elevatormind
No matter which font(s) we decide for:
Simply supplying fonts is not enough!
Is the font then directly usable in QET or even default-font for QET on all systems, or does it have to be installed to the system first?
That would definitely be an additional hurdle for users, which we should spare them!
And the supporters here in the forum: Fonts and font-sizes are regularly cause of problem!

@Achim:
Is the need for an osi-font for electrical schematics a requirement from customers?
As far as I know it the mechanics do have more restrictive requirements on font-selection!
Looking at KiCad for example: They use a monospaced font for schematics and Sans Serif for Titleblock.

Do you have information, which fonts are really free to use and re-distributable by an Open-Source-Project, elevatormind?

As we do not speak of DTP or Text-Processing – we still speak of a schematic editor!
I would see a maximum (!) of three fonts: Sans Serif (as default), Monospace and Serif.

Just found these:
https://github.com/liberationfonts/liberation-fonts

Das große Thema "Klemmleisten-Manager", das Joshua in die nächste stabile Version 0.10 reinbringen möchte, ist ja auch im Menüeintrag noch als "DEV" gekennzeichnet und entsprechend nicht fertig! Die solltest Du in Deinen Projekten nicht verwendet haben! Die werden bestimmt nicht unterstützt von einer älteren Version!
Das Python-Klemmleisten-Plugin ist davon aber nicht betroffen. Das sollte gehen.

Du kannst aber sicher sein, daß an Versionen < 0.10 nicht mehr entwickelt wird!
Aussagekräftige Fehlermeldungen sind zwar immer schön zu haben, aber ...


Wie heißt es immer so schön bei Open-Source-Projekten: Keine Garantie in jedwede Richtung!

@RedBaron:
Depends on what you modify:
Read the linked thread!
Generally speaking: yes.
But be sure to have a backup!

tigerbeard wrote:

I sehe gerade ich habe die 0.8.0

Update auf 0.10-dev dringend empfohlen!

tigerbeard wrote:

Und im Forum habe ich gefunden das jemand M und F eingebaut hat.

Der "Jemand", der das in den Element-Editor eingebaut hat, antwortet Dir gerade!  nomicons/smile

tigerbeard wrote:

Hm. Den den Use Case innerhalb des Baumes hatte ich noch nicht. Ich wolle den Beispielstecker aus dem Zip als libary Element von der Platte importieren. Das war ein m.W. QET format.

Den Use-Case hast Du gerade selber geschrieben:
Wenn Du ein QET-Projekt öffnest, baut sich im Element-Baum eine weitere Sammlung "Importierte Elemente" auf.
Da sind die Elemente des Projekts aufgelistet. Die kannst Du auch in deine Firmen- oder Benutzer-Sammlung ziehen!

Im Element-Eitor gibt es die Menüpunkte "Aus Datei öffnen" und "speichern unter"...
Alternativ kopierst Du die *.elmt - Datei per Datei-Browser in Deine Benutzersammlung.

Spontan fällt mir keine Inkompatibilität ein...!
Ein Backup der Projekt-Datei hast Du doch, oder?!?  nomicons/wink

tigerbeard wrote:

Es gibt doch bestimmt einen Weg Elemente zu spieglen?

Spiegeln geht im Moment nur im Element-Editor mit dem Shortcut <M>
Du brauchst also mehrere Elemente.

English is not my native language, too, but French would be even worse!

Ich würde auch lieber auf Deutsch antworten, aber das verstehen hier auch nur wenige...

So we stick to English! (I guess, you know how to use online-translators?)

As I wrote in the first few words in first answer:

plc-user wrote:

It is not QElectroTech that is the problem,...

To be neutral:
It's the Operating-System!
The one you use, changes standard-fonts from version to version, from country to country, from...!

Install the same font you used on the other system and keep your fingers crossed, that this is the solution!

On the other hand, you can use a text-editor to change the font and font-size in the qet-file as the other user suggested in the thread I linked above.

Wenn Du gerade frisch mit QET angefangen bist, empfehle ich auf jeden Fall die 0.10-dev-Version!

Die 0.9 ist inzwischen ein wenig ...
In der 0.10-dev ist seit kurzem die Rotier-Funktion im Element-Editor so überarbeitet, dass alle Teil-Elemente um den Nullpunkt rotiert bzw. gespiegelt werden!
Also kein Kleinholz mehr beim Rotieren!
Ein Grund mehr, Elemente rund um den Nullpunkt zu konstruieren.
(Hilft auch später beim Platzieren im Schaltplan!)

Elemente kannst Du im Element-Baum per Drag-and-Drop zwischen den Sammlungen hin- und her-kopieren!
Die Elemente in der Firmen- oder Benutzer-Sammlung kannst Du per Doppelklick editieren.

Von wo willst Du Elemente importieren?
Ein Import aus anderen Formaten in den Element-Editor ist zur Zeit nur für DXF vorgesehen.

So in der Form nicht.
Du kannst aber auch im Schaltplaneditor Rechtecke in verschiedenen Farben und mit verschiedenen Füllmustern einfügen, um sowas zu kennzeichnen.

This must be the 0.10-dev - version in which we have introduced a new function so that dynamic texts of the elements are not accidentally moved when the element as a whole shall be moved.
Since then, the dynamic texts of the elements are only moved if the Shift key is pressed at the same time!


Remark:
You should also replace "your" language-file, for the case, that new texts are introduced for example in config-page.

Toll gefallen tut mir das nicht, mich als Anwender einer CAD-Software mit SQL-Abfragen auskennen zu müssen, um ein Inhaltsverzeichnis oder eine Stückliste zu generieren...
Habe im Moment nur keine Idee, wie das Nutzerfreundlicher in QET eingebaut werden kann.

99

(38 replies, posted in Code)

Auch, wenn Du den Text als Link markierst und den Text als Ziel-Adresse definieren kannst:
Das Ziel muss auch wissen, daß es Ziel ist, soweit ich PDFs richtig verstanden habe!

Bei HTML und LaTeX ist es jedenfalls auch so, daß es eine Stelle gibt, die den Link enthält und ein Sprungziel, wohin verlinkt ist.


Ergänzung:
Wenn ein Verweis auf eine andere Seite im Schaltplan geht, was meist die Regel ist, müsste das Dokument also (mindestens) zweimal komplett durch alle Seiten durchgegangen werden, um alle Verweise und Sprung-Ziele einzufügen.
Wie ich das sehe, ist diese Stelle beim Ausdruck im Ablauf zu spät, weil hier jede Seite nur einmal verarbeitet wird.
Es müßte also eine Vorverarbeitung mit zwei Durchgängen eingefügt werden, wenn PDF als Ausgabe gewählt wurde.

100

(38 replies, posted in Code)

Bevor Du Dir an den XRef-Texten einen Wolf suchst...

Schau' Dir mal eine qet-Datei im Texteditor an:
Die Verlinkungen hängen nicht am Text, sondern an separaten Tags "link_uuid" der Referenz der Referenz-Elemente.

Einen Ausschnitt gibt's im Anhang.