From 255def181c55db276c27f4b1f3ec0adab33bacf2 Mon Sep 17 00:00:00 2001 From: DaTweety <129504390+DaTweety@users.noreply.github.com> Date: Mon, 19 Oct 2026 13:54:19 +0200 Subject: [PATCH 1/2] Symbol texts: width and height, each fixed or not In a symbol text's properties, "Width (fixed)" and the new "Height (fixed)" each carry a tick box. Not ticked, the field follows the text and shows the size it has now, ready to be fixed; ticked, it keeps the size beside the box. A fixed height is new: the field keeps it whatever is written, and the lines that do not fit are cut off, neither drawn nor picked, to shorten a text where room is short. It is saved as text_height on the text, only when set, and changed through an undoable property command like the width. Translations for all languages. Co-Authored-By: Claude Opus 5.5 --- lang/qet_ar.ts | 25 ++++ lang/qet_ca.ts | 25 ++++ lang/qet_cs.ts | 25 ++++ lang/qet_da.ts | 25 ++++ lang/qet_de.ts | 25 ++++ lang/qet_el.ts | 25 ++++ lang/qet_en.ts | 25 ++++ lang/qet_es.ts | 25 ++++ lang/qet_fi.ts | 25 ++++ lang/qet_fr.ts | 25 ++++ lang/qet_hr.ts | 25 ++++ lang/qet_hu.ts | 25 ++++ lang/qet_it.ts | 25 ++++ lang/qet_ja.ts | 25 ++++ lang/qet_ko.ts | 25 ++++ lang/qet_mn.ts | 25 ++++ lang/qet_nb.ts | 25 ++++ lang/qet_nl.ts | 25 ++++ lang/qet_nl_BE.ts | 25 ++++ lang/qet_nl_NL.ts | 25 ++++ lang/qet_no.ts | 25 ++++ lang/qet_pl.ts | 25 ++++ lang/qet_pt.ts | 25 ++++ lang/qet_pt_BR.ts | 25 ++++ lang/qet_ro.ts | 25 ++++ lang/qet_rs.ts | 25 ++++ lang/qet_ru.ts | 25 ++++ lang/qet_sk.ts | 25 ++++ lang/qet_sl.ts | 25 ++++ lang/qet_sr.ts | 25 ++++ lang/qet_sv.ts | 25 ++++ lang/qet_tr.ts | 25 ++++ lang/qet_uk.ts | 25 ++++ lang/qet_zh.ts | 25 ++++ lang/qet_zh_TW.ts | 25 ++++ .../dynamicelementtextitem.cpp | 67 ++++++++- .../qetgraphicsitem/dynamicelementtextitem.h | 10 ++ sources/ui/dynamicelementtextmodel.cpp | 86 ++++++++++-- sources/ui/dynamicelementtextmodel.h | 1 + tests/qttest/CMakeLists.txt | 9 ++ tests/qttest/run_text_fixed_size_probe.py | 60 ++++++++ tests/qttest/text_fixed_size_probe.cpp | 129 ++++++++++++++++++ 42 files changed, 1222 insertions(+), 15 deletions(-) create mode 100755 tests/qttest/run_text_fixed_size_probe.py create mode 100644 tests/qttest/text_fixed_size_probe.cpp diff --git a/lang/qet_ar.ts b/lang/qet_ar.ts index 558ba8c2a..98d373eb1 100644 --- a/lang/qet_ar.ts +++ b/lang/qet_ar.ts @@ -3974,6 +3974,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + العرض (ثابت) + + + + Height (fixed) + الارتفاع (ثابت) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + عند التحديد يحتفظ حقل النص بهذا العرض ويلتف النص داخله. بدون تحديد يكون بعرض النص. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + عند التحديد يحتفظ حقل النص بهذا الارتفاع وتُقص الأسطر التي لا تتسع. بدون تحديد يكون بارتفاع النص. + + + + Change the height of an element text + تغيير ارتفاع نص العنصر + Property diff --git a/lang/qet_ca.ts b/lang/qet_ca.ts index 1ba3ea190..74ff049c0 100644 --- a/lang/qet_ca.ts +++ b/lang/qet_ca.ts @@ -3895,6 +3895,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Amplada (fixa) + + + + Height (fixed) + Alçada (fixa) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Marcat, el camp de text manté aquesta amplada i el text s'ajusta a dins. Sense marcar, és tan ample com el text. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Marcat, el camp de text manté aquesta alçada i les línies que no hi caben es tallen. Sense marcar, és tan alt com el text. + + + + Change the height of an element text + Canviar l'alçada d'un text d'element + Property diff --git a/lang/qet_cs.ts b/lang/qet_cs.ts index f37ca087d..71915aab4 100644 --- a/lang/qet_cs.ts +++ b/lang/qet_cs.ts @@ -3921,6 +3921,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Šířka (pevná) + + + + Height (fixed) + Výška (pevná) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Zaškrtnuto: textové pole si drží tuto šířku a text se v něm zalamuje. Nezaškrtnuto: je široké jako text. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Zaškrtnuto: textové pole si drží tuto výšku a řádky, které se nevejdou, se oříznou. Nezaškrtnuto: je vysoké jako text. + + + + Change the height of an element text + Změnit výšku textu prvku + Property diff --git a/lang/qet_da.ts b/lang/qet_da.ts index 38f41e744..0b3b53ad3 100644 --- a/lang/qet_da.ts +++ b/lang/qet_da.ts @@ -3875,6 +3875,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Bredde (fast) + + + + Height (fixed) + Højde (fast) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Markeret beholder tekstfeltet denne bredde, og teksten ombrydes i det. Ikke markeret er det lige så bredt som teksten. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Markeret beholder tekstfeltet denne højde, og linjer der ikke er plads til, skæres af. Ikke markeret er det lige så højt som teksten. + + + + Change the height of an element text + Ændr højden på en elementtekst + Property diff --git a/lang/qet_de.ts b/lang/qet_de.ts index 747912959..d03900b6c 100644 --- a/lang/qet_de.ts +++ b/lang/qet_de.ts @@ -3897,6 +3897,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Breite (fixiert) + + + + Height (fixed) + Höhe (fixiert) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Angehakt behält das Textfeld diese Breite, der Text bricht darin um. Nicht angehakt ist es so breit wie der Text. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Angehakt behält das Textfeld diese Höhe, Zeilen, die nicht hineinpassen, werden abgeschnitten. Nicht angehakt ist es so hoch wie der Text. + + + + Change the height of an element text + Höhe eines Elementtextes ändern + Property diff --git a/lang/qet_el.ts b/lang/qet_el.ts index 73f0aaf39..e4134e7d7 100644 --- a/lang/qet_el.ts +++ b/lang/qet_el.ts @@ -3894,6 +3894,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Πλάτος (σταθερό) + + + + Height (fixed) + Ύψος (σταθερό) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Επιλεγμένο: το πεδίο κειμένου κρατά αυτό το πλάτος και το κείμενο αναδιπλώνεται μέσα του. Μη επιλεγμένο: είναι όσο φαρδύ είναι το κείμενο. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Επιλεγμένο: το πεδίο κειμένου κρατά αυτό το ύψος και οι γραμμές που δεν χωρούν αποκόπτονται. Μη επιλεγμένο: είναι όσο ψηλό είναι το κείμενο. + + + + Change the height of an element text + Αλλαγή ύψους κειμένου στοιχείου + Property diff --git a/lang/qet_en.ts b/lang/qet_en.ts index 595e603c1..6f3095a1d 100644 --- a/lang/qet_en.ts +++ b/lang/qet_en.ts @@ -3894,6 +3894,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Width (fixed) + + + + Height (fixed) + Height (fixed) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + + + + Change the height of an element text + Change the height of an element text + Property diff --git a/lang/qet_es.ts b/lang/qet_es.ts index 123e65718..9a41606a1 100644 --- a/lang/qet_es.ts +++ b/lang/qet_es.ts @@ -3897,6 +3897,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Ancho (fijo) + + + + Height (fixed) + Alto (fijo) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Marcado, el campo de texto mantiene este ancho y el texto se ajusta dentro. Sin marcar, es tan ancho como el texto. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Marcado, el campo de texto mantiene este alto y las líneas que no caben se cortan. Sin marcar, es tan alto como el texto. + + + + Change the height of an element text + Cambiar el alto de un texto de elemento + Property diff --git a/lang/qet_fi.ts b/lang/qet_fi.ts index a3cbacc62..9e52ddf8d 100644 --- a/lang/qet_fi.ts +++ b/lang/qet_fi.ts @@ -3870,6 +3870,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Leveys (kiinteä) + + + + Height (fixed) + Korkeus (kiinteä) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Valittuna tekstikenttä pitää tämän leveyden ja teksti rivittyy sen sisään. Valitsematta se on tekstin levyinen. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Valittuna tekstikenttä pitää tämän korkeuden ja rivit, jotka eivät mahdu, katkaistaan. Valitsematta se on tekstin korkuinen. + + + + Change the height of an element text + Muuta elementtitekstin korkeutta + Property diff --git a/lang/qet_fr.ts b/lang/qet_fr.ts index 6c49e975d..4e8450740 100644 --- a/lang/qet_fr.ts +++ b/lang/qet_fr.ts @@ -3895,6 +3895,31 @@ Maintenir Maj et faire glisser pour déplacer ce texte seul DynamicElementTextModel + + + Width (fixed) + Largeur (fixe) + + + + Height (fixed) + Hauteur (fixe) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Cochée, le champ de texte garde cette largeur et le texte y passe à la ligne. Non cochée, il est aussi large que le texte. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Cochée, le champ de texte garde cette hauteur et les lignes qui ne tiennent pas sont coupées. Non cochée, il est aussi haut que le texte. + + + + Change the height of an element text + Modifier la hauteur d'un texte d'élément + Property diff --git a/lang/qet_hr.ts b/lang/qet_hr.ts index 8d36a9dbd..db5950425 100644 --- a/lang/qet_hr.ts +++ b/lang/qet_hr.ts @@ -3895,6 +3895,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Širina (fiksna) + + + + Height (fixed) + Visina (fiksna) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Označeno: tekstno polje zadržava ovu širinu i tekst se u njemu prelama. Neoznačeno: široko je koliko i tekst. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Označeno: tekstno polje zadržava ovu visinu, a redci koji ne stanu se odrežu. Neoznačeno: visoko je koliko i tekst. + + + + Change the height of an element text + Promijeni visinu teksta elementa + Property diff --git a/lang/qet_hu.ts b/lang/qet_hu.ts index ea6bca5ad..4c1b55db9 100644 --- a/lang/qet_hu.ts +++ b/lang/qet_hu.ts @@ -3874,6 +3874,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Szélesség (rögzített) + + + + Height (fixed) + Magasság (rögzített) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Bejelölve a szövegmező megtartja ezt a szélességet, és a szöveg benne tördelődik. Bejelöletlenül olyan széles, mint a szöveg. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Bejelölve a szövegmező megtartja ezt a magasságot, és a bele nem férő sorok levágódnak. Bejelöletlenül olyan magas, mint a szöveg. + + + + Change the height of an element text + Elemszöveg magasságának módosítása + Property diff --git a/lang/qet_it.ts b/lang/qet_it.ts index 64641487d..76ad9ad89 100644 --- a/lang/qet_it.ts +++ b/lang/qet_it.ts @@ -3894,6 +3894,31 @@ Tieni premuto Maiusc e trascina per spostare solo questo testo DynamicElementTextModel + + + Width (fixed) + Larghezza (fissa) + + + + Height (fixed) + Altezza (fissa) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Spuntato, il campo di testo mantiene questa larghezza e il testo va a capo al suo interno. Non spuntato, è largo quanto il testo. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Spuntato, il campo di testo mantiene questa altezza e le righe che non entrano vengono tagliate. Non spuntato, è alto quanto il testo. + + + + Change the height of an element text + Modifica l'altezza di un testo dell'elemento + diff --git a/lang/qet_ja.ts b/lang/qet_ja.ts index 99c819f1f..365bb52fe 100644 --- a/lang/qet_ja.ts +++ b/lang/qet_ja.ts @@ -3866,6 +3866,31 @@ Shift を押しながらドラッグすると、このテキストだけを移 DynamicElementTextModel + + + Width (fixed) + 幅(固定) + + + + Height (fixed) + 高さ(固定) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + チェックするとテキスト欄はこの幅を保ち、テキストはその中で折り返します。チェックしないとテキストの幅になります。 + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + チェックするとテキスト欄はこの高さを保ち、収まらない行は切り捨てられます。チェックしないとテキストの高さになります。 + + + + Change the height of an element text + 要素テキストの高さを変更 + Property diff --git a/lang/qet_ko.ts b/lang/qet_ko.ts index 8bd2c7497..653305b09 100644 --- a/lang/qet_ko.ts +++ b/lang/qet_ko.ts @@ -3866,6 +3866,31 @@ Shift를 누른 채 끌면 이 텍스트만 이동합니다 DynamicElementTextModel + + + Width (fixed) + 너비 (고정) + + + + Height (fixed) + 높이 (고정) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + 선택하면 텍스트 필드가 이 너비를 유지하고 텍스트가 그 안에서 줄 바꿈됩니다. 선택하지 않으면 텍스트 너비와 같습니다. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + 선택하면 텍스트 필드가 이 높이를 유지하고 들어가지 않는 줄은 잘립니다. 선택하지 않으면 텍스트 높이와 같습니다. + + + + Change the height of an element text + 요소 텍스트의 높이 변경 + Property diff --git a/lang/qet_mn.ts b/lang/qet_mn.ts index 576800b31..728f45804 100644 --- a/lang/qet_mn.ts +++ b/lang/qet_mn.ts @@ -3877,6 +3877,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Өргөн (тогтмол) + + + + Height (fixed) + Өндөр (тогтмол) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Тэмдэглэсэн үед текстийн талбар энэ өргөнийг хадгалж, текст дотор нь шилжинэ. Тэмдэглээгүй үед текстийн өргөнтэй тэнцүү. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Тэмдэглэсэн үед текстийн талбар энэ өндрийг хадгалж, багтахгүй мөрүүд таслагдана. Тэмдэглээгүй үед текстийн өндөртэй тэнцүү. + + + + Change the height of an element text + Элементийн текстийн өндрийг өөрчлөх + Property diff --git a/lang/qet_nb.ts b/lang/qet_nb.ts index 5c3d9fc6c..30ec04d72 100644 --- a/lang/qet_nb.ts +++ b/lang/qet_nb.ts @@ -3878,6 +3878,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Bredde (fast) + + + + Height (fixed) + Høyde (fast) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Avkrysset beholder tekstfeltet denne bredden, og teksten brytes inni det. Ikke avkrysset er det like bredt som teksten. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Avkrysset beholder tekstfeltet denne høyden, og linjer som ikke får plass, kuttes. Ikke avkrysset er det like høyt som teksten. + + + + Change the height of an element text + Endre høyden på en elementtekst + Property diff --git a/lang/qet_nl.ts b/lang/qet_nl.ts index 08c5e8d7d..0292f1981 100644 --- a/lang/qet_nl.ts +++ b/lang/qet_nl.ts @@ -3875,6 +3875,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Breedte (vast) + + + + Height (fixed) + Hoogte (vast) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Aangevinkt houdt het tekstveld deze breedte en loopt de tekst erin door. Niet aangevinkt is het zo breed als de tekst. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Aangevinkt houdt het tekstveld deze hoogte en worden regels die niet passen afgesneden. Niet aangevinkt is het zo hoog als de tekst. + + + + Change the height of an element text + De hoogte van een elementtekst wijzigen + Property diff --git a/lang/qet_nl_BE.ts b/lang/qet_nl_BE.ts index 5c96dced5..628f19689 100644 --- a/lang/qet_nl_BE.ts +++ b/lang/qet_nl_BE.ts @@ -3895,6 +3895,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Breedte (vast) + + + + Height (fixed) + Hoogte (vast) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Aangevinkt houdt het tekstveld deze breedte en loopt de tekst erin door. Niet aangevinkt is het zo breed als de tekst. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Aangevinkt houdt het tekstveld deze hoogte en worden regels die niet passen afgesneden. Niet aangevinkt is het zo hoog als de tekst. + + + + Change the height of an element text + De hoogte van een elementtekst wijzigen + Property diff --git a/lang/qet_nl_NL.ts b/lang/qet_nl_NL.ts index d44405c00..044bc2956 100644 --- a/lang/qet_nl_NL.ts +++ b/lang/qet_nl_NL.ts @@ -2697,6 +2697,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Breedte (vast) + + + + Height (fixed) + Hoogte (vast) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Aangevinkt houdt het tekstveld deze breedte en loopt de tekst erin door. Niet aangevinkt is het zo breed als de tekst. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Aangevinkt houdt het tekstveld deze hoogte en worden regels die niet passen afgesneden. Niet aangevinkt is het zo hoog als de tekst. + + + + Change the height of an element text + De hoogte van een elementtekst wijzigen + Property diff --git a/lang/qet_no.ts b/lang/qet_no.ts index 46cbdd84d..5606f5124 100644 --- a/lang/qet_no.ts +++ b/lang/qet_no.ts @@ -3870,6 +3870,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Bredde (fast) + + + + Height (fixed) + Høyde (fast) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Avkrysset beholder tekstfeltet denne bredden, og teksten brytes inni det. Ikke avkrysset er det like bredt som teksten. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Avkrysset beholder tekstfeltet denne høyden, og linjer som ikke får plass, kuttes. Ikke avkrysset er det like høyt som teksten. + + + + Change the height of an element text + Endre høyden på en elementtekst + Property diff --git a/lang/qet_pl.ts b/lang/qet_pl.ts index fdee219fe..5523a3721 100644 --- a/lang/qet_pl.ts +++ b/lang/qet_pl.ts @@ -3935,6 +3935,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Szerokość (stała) + + + + Height (fixed) + Wysokość (stała) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Zaznaczone: pole tekstowe zachowuje tę szerokość, a tekst jest w nim zawijany. Niezaznaczone: jest tak szerokie jak tekst. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Zaznaczone: pole tekstowe zachowuje tę wysokość, a wiersze, które się nie mieszczą, są obcinane. Niezaznaczone: jest tak wysokie jak tekst. + + + + Change the height of an element text + Zmień wysokość tekstu elementu + Property diff --git a/lang/qet_pt.ts b/lang/qet_pt.ts index 228fa076a..e27c4387b 100644 --- a/lang/qet_pt.ts +++ b/lang/qet_pt.ts @@ -3896,6 +3896,31 @@ Mantenha Shift premido e arraste para mover este texto sozinho DynamicElementTextModel + + + Width (fixed) + Largura (fixa) + + + + Height (fixed) + Altura (fixa) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Marcado, o campo de texto mantém esta largura e o texto quebra dentro dele. Desmarcado, é tão largo como o texto. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Marcado, o campo de texto mantém esta altura e as linhas que não cabem são cortadas. Desmarcado, é tão alto como o texto. + + + + Change the height of an element text + Alterar a altura de um texto de elemento + Property diff --git a/lang/qet_pt_BR.ts b/lang/qet_pt_BR.ts index a4b82f8e9..8e8cc1159 100644 --- a/lang/qet_pt_BR.ts +++ b/lang/qet_pt_BR.ts @@ -3895,6 +3895,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Largura (fixa) + + + + Height (fixed) + Altura (fixa) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Marcado, o campo de texto mantém esta largura e o texto quebra dentro dele. Desmarcado, é tão largo quanto o texto. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Marcado, o campo de texto mantém esta altura e as linhas que não cabem são cortadas. Desmarcado, é tão alto quanto o texto. + + + + Change the height of an element text + Alterar a altura de um texto de elemento + Property diff --git a/lang/qet_ro.ts b/lang/qet_ro.ts index 725f28f87..8544e0c1a 100644 --- a/lang/qet_ro.ts +++ b/lang/qet_ro.ts @@ -3894,6 +3894,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Lățime (fixă) + + + + Height (fixed) + Înălțime (fixă) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Bifat, câmpul de text păstrează această lățime și textul se încadrează în el. Nebifat, este cât textul de lat. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Bifat, câmpul de text păstrează această înălțime și rândurile care nu încap sunt tăiate. Nebifat, este cât textul de înalt. + + + + Change the height of an element text + Modifică înălțimea unui text de element + Property diff --git a/lang/qet_rs.ts b/lang/qet_rs.ts index f98b83674..504dc33e3 100644 --- a/lang/qet_rs.ts +++ b/lang/qet_rs.ts @@ -3894,6 +3894,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Širina (fiksna) + + + + Height (fixed) + Visina (fiksna) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Označeno: tekstualno polje zadržava ovu širinu i tekst se u njemu prelama. Neoznačeno: široko je koliko i tekst. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Označeno: tekstualno polje zadržava ovu visinu, a redovi koji ne stanu se odsecaju. Neoznačeno: visoko je koliko i tekst. + + + + Change the height of an element text + Promeni visinu teksta elementa + Property diff --git a/lang/qet_ru.ts b/lang/qet_ru.ts index 0376d4638..ec1809cb2 100644 --- a/lang/qet_ru.ts +++ b/lang/qet_ru.ts @@ -3932,6 +3932,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Ширина (фиксированная) + + + + Height (fixed) + Высота (фиксированная) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Если отмечено, текстовое поле сохраняет эту ширину, и текст переносится внутри него. Если не отмечено, поле по ширине текста. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Если отмечено, текстовое поле сохраняет эту высоту, а не поместившиеся строки обрезаются. Если не отмечено, поле по высоте текста. + + + + Change the height of an element text + Изменить высоту текста элемента + Property diff --git a/lang/qet_sk.ts b/lang/qet_sk.ts index 99b7650d1..cedf0c17b 100644 --- a/lang/qet_sk.ts +++ b/lang/qet_sk.ts @@ -3912,6 +3912,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Šírka (pevná) + + + + Height (fixed) + Výška (pevná) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Začiarknuté: textové pole si drží túto šírku a text sa v ňom zalamuje. Nezačiarknuté: je široké ako text. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Začiarknuté: textové pole si drží túto výšku a riadky, ktoré sa nezmestia, sa orežú. Nezačiarknuté: je vysoké ako text. + + + + Change the height of an element text + Zmeniť výšku textu prvku + Property diff --git a/lang/qet_sl.ts b/lang/qet_sl.ts index 349d867f7..6dd9137a3 100644 --- a/lang/qet_sl.ts +++ b/lang/qet_sl.ts @@ -3918,6 +3918,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Širina (fiksna) + + + + Height (fixed) + Višina (fiksna) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Označeno: besedilno polje ohrani to širino in besedilo se v njem prelamlja. Neoznačeno: je široko kot besedilo. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Označeno: besedilno polje ohrani to višino, vrstice, ki ne gredo vanj, se odrežejo. Neoznačeno: je visoko kot besedilo. + + + + Change the height of an element text + Spremeni višino besedila elementa + Property diff --git a/lang/qet_sr.ts b/lang/qet_sr.ts index 2c0703bd3..1e2dc808d 100644 --- a/lang/qet_sr.ts +++ b/lang/qet_sr.ts @@ -3894,6 +3894,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Ширина (фиксна) + + + + Height (fixed) + Висина (фиксна) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Означено: текстуално поље задржава ову ширину и текст се у њему прелама. Неозначено: широко је колико и текст. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Означено: текстуално поље задржава ову висину, а редови који не стану се одсецају. Неозначено: високо је колико и текст. + + + + Change the height of an element text + Промени висину текста елемента + Property diff --git a/lang/qet_sv.ts b/lang/qet_sv.ts index f2690c1d0..88f230f3e 100644 --- a/lang/qet_sv.ts +++ b/lang/qet_sv.ts @@ -3875,6 +3875,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Bredd (fast) + + + + Height (fixed) + Höjd (fast) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Markerat behåller textfältet denna bredd och texten radbryts i det. Omarkerat är det lika brett som texten. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Markerat behåller textfältet denna höjd och rader som inte får plats skärs av. Omarkerat är det lika högt som texten. + + + + Change the height of an element text + Ändra höjden på en elementtext + Property diff --git a/lang/qet_tr.ts b/lang/qet_tr.ts index a987082d2..aa6575cf6 100644 --- a/lang/qet_tr.ts +++ b/lang/qet_tr.ts @@ -3874,6 +3874,31 @@ Bu metni tek başına taşımak için Shift tuşunu basılı tutup sürükleyin< DynamicElementTextModel + + + Width (fixed) + Genişlik (sabit) + + + + Height (fixed) + Yükseklik (sabit) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + İşaretliyse metin alanı bu genişliği korur ve metin içinde kaydırılır. İşaretli değilse metin kadar geniştir. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + İşaretliyse metin alanı bu yüksekliği korur ve sığmayan satırlar kesilir. İşaretli değilse metin kadar yüksektir. + + + + Change the height of an element text + Bir öğe metninin yüksekliğini değiştir + Property diff --git a/lang/qet_uk.ts b/lang/qet_uk.ts index 7b5bdc34e..acddada94 100644 --- a/lang/qet_uk.ts +++ b/lang/qet_uk.ts @@ -3922,6 +3922,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + Ширина (фіксована) + + + + Height (fixed) + Висота (фіксована) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + Якщо позначено, текстове поле зберігає цю ширину, і текст переноситься всередині. Якщо ні, поле за шириною тексту. + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Якщо позначено, текстове поле зберігає цю висоту, а рядки, що не вміщуються, обрізаються. Якщо ні, поле за висотою тексту. + + + + Change the height of an element text + Змінити висоту тексту елемента + Property diff --git a/lang/qet_zh.ts b/lang/qet_zh.ts index d9420fc1e..5c9ce2d2c 100644 --- a/lang/qet_zh.ts +++ b/lang/qet_zh.ts @@ -3865,6 +3865,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + 宽度(固定) + + + + Height (fixed) + 高度(固定) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + 勾选后文本框保持此宽度,文本在其中换行。不勾选时与文本同宽。 + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + 勾选后文本框保持此高度,放不下的行被截断。不勾选时与文本同高。 + + + + Change the height of an element text + 更改元件文本的高度 + Property diff --git a/lang/qet_zh_TW.ts b/lang/qet_zh_TW.ts index 09e05c3e0..60297172e 100644 --- a/lang/qet_zh_TW.ts +++ b/lang/qet_zh_TW.ts @@ -3865,6 +3865,31 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel + + + Width (fixed) + 寬度(固定) + + + + Height (fixed) + 高度(固定) + + + + Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + 勾選後文字框保持此寬度,文字在其中換行。不勾選時與文字同寬。 + + + + Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + 勾選後文字框保持此高度,放不下的行會被截斷。不勾選時與文字同高。 + + + + Change the height of an element text + 變更元件文字的高度 + Property diff --git a/sources/qetgraphicsitem/dynamicelementtextitem.cpp b/sources/qetgraphicsitem/dynamicelementtextitem.cpp index 6e7ece16b..f016bdaa0 100644 --- a/sources/qetgraphicsitem/dynamicelementtextitem.cpp +++ b/sources/qetgraphicsitem/dynamicelementtextitem.cpp @@ -175,6 +175,8 @@ QDomElement DynamicElementTextItem::toXml(QDomDocument &dom_doc) const root_element.setAttribute("uuid", m_uuid.toString()); root_element.setAttribute("frame", m_frame? "true" : "false"); root_element.setAttribute("text_width", QString::number(m_text_width)); + if (m_text_height > 0) + root_element.setAttribute(QStringLiteral("text_height"), QString::number(m_text_height)); root_element.setAttribute("font", QETUtils::fontToString(font())); root_element.setAttribute("keep_visual_rotation", m_keep_visual_rotation ? "true" : "false"); root_element.setAttribute("rotation_point_center", m_rotation_point_center ? "true" : "false"); @@ -262,6 +264,7 @@ void DynamicElementTextItem::fromXml(const QDomElement &dom_elmt) m_uuid = QUuid(dom_elmt.attribute("uuid", QUuid::createUuid().toString())); setFrame(dom_elmt.attribute("frame", "false") == "true"? true : false); setTextWidth(dom_elmt.attribute("text_width", QString::number(-1)).toDouble()); + setTextHeight(dom_elmt.attribute(QStringLiteral("text_height"), QStringLiteral("-1")).toDouble()); //Text from QMetaEnum me = textFromMetaEnum(); @@ -867,7 +870,15 @@ void DynamicElementTextItem::paint(QPainter *painter, const QStyleOptionGraphics if (m_jump_highlight) painter->fillRect(boundingRect(), QColor(69, 137, 255, 90)); - DiagramTextItem::paint(painter, option, widget); + //A fixed height cuts off the lines that do not fit + if (m_text_height > 0) { + painter->save(); + painter->setClipRect(boundingRect(), Qt::IntersectClip); + DiagramTextItem::paint(painter, option, widget); + painter->restore(); + } else { + DiagramTextItem::paint(painter, option, widget); + } if (m_frame) { @@ -2069,6 +2080,60 @@ void DynamicElementTextItem::setTextWidth(qreal width) emit textWidthChanged(width); } +/** + @brief DynamicElementTextItem::setTextHeight + @param height : the height of the text field, -1 to follow the text. + With a height set, the field keeps it whatever is written: the lines + that do not fit are not drawn, to shorten a text where room is short. +*/ +void DynamicElementTextItem::setTextHeight(qreal height) +{ + if (height <= 0) + height = -1; + if (qFuzzyCompare(height + 2, m_text_height + 2)) + return; + prepareGeometryChange(); + m_text_height = height; + update(); + emit textHeightChanged(height); +} + +/** + @brief DynamicElementTextItem::boundingRect + @return the text's own box, cut to the height set by the user +*/ +QRectF DynamicElementTextItem::boundingRect() const +{ + QRectF rect = DiagramTextItem::boundingRect(); + if (m_text_height > 0) + rect.setHeight(m_text_height); + return rect; +} + +/** + @brief DynamicElementTextItem::shape + QGraphicsTextItem answers shape() and contains() from its own box, not + from boundingRect(): cut both to the height set by the user, so that + the lines cut off take no clicks either. +*/ +QPainterPath DynamicElementTextItem::shape() const +{ + QPainterPath path = DiagramTextItem::shape(); + if (m_text_height > 0) { + QPainterPath cut; + cut.addRect(boundingRect()); + path = path.intersected(cut); + } + return path; +} + +bool DynamicElementTextItem::contains(const QPointF &point) const +{ + if (m_text_height > 0 && !boundingRect().contains(point)) + return false; + return DiagramTextItem::contains(point); +} + /** @brief DynamicElementTextItem::fitAutoTextWidth With no width set by the user, a QTextDocument has no width to centre diff --git a/sources/qetgraphicsitem/dynamicelementtextitem.h b/sources/qetgraphicsitem/dynamicelementtextitem.h index e6fc2134f..02ec85f79 100644 --- a/sources/qetgraphicsitem/dynamicelementtextitem.h +++ b/sources/qetgraphicsitem/dynamicelementtextitem.h @@ -51,6 +51,7 @@ class DynamicElementTextItem : public DiagramTextItem Q_PROPERTY(QString compositeText READ compositeText WRITE setCompositeText NOTIFY compositeTextChanged) Q_PROPERTY(bool frame READ frame WRITE setFrame NOTIFY frameChanged) Q_PROPERTY(qreal textWidth READ textWidth WRITE setTextWidth NOTIFY textWidthChanged) + Q_PROPERTY(qreal textHeight READ textHeight WRITE setTextHeight NOTIFY textHeightChanged) Q_PROPERTY(bool keepVisualRotation READ keepVisualRotation WRITE setKeepVisualRotation NOTIFY keepVisualRotationChanged) Q_PROPERTY(bool rotationPointCenter READ rotationPointCenter WRITE setRotationPointCenter NOTIFY rotationPointCenterChanged) public: @@ -72,6 +73,7 @@ class DynamicElementTextItem : public DiagramTextItem void frameChanged(bool frame); void plainTextChanged(); void textWidthChanged(qreal width); + void textHeightChanged(qreal height); void keepVisualRotationChanged(bool keep); void rotationPointCenterChanged(bool center); @@ -122,6 +124,13 @@ class DynamicElementTextItem : public DiagramTextItem //centred or right-aligned, but the width is still "auto" (-1). qreal textWidth() const {return m_text_width;} void setTextWidth(qreal width); + //A height set by the user, -1 for "auto": lines that do not + //fit are cut off, as a text field of fixed size does + qreal textHeight() const {return m_text_height;} + void setTextHeight(qreal height); + QRectF boundingRect() const override; + QPainterPath shape() const override; + bool contains(const QPointF &point) const override; void setXref_item(Qt::AlignmentFlag m_exHrefPos, int slave_offset = 0); void setKeepVisualRotation(bool set); @@ -204,6 +213,7 @@ class DynamicElementTextItem : public DiagramTextItem QGraphicsTextItem *m_slave_Xref_item = nullptr; qreal m_text_width = -1; bool m_jump_highlight = false; + qreal m_text_height = -1; /// The text was emptied with its alignment kept (setPlainText()) bool m_emptied_aligned = false; QPointF m_initial_position; diff --git a/sources/ui/dynamicelementtextmodel.cpp b/sources/ui/dynamicelementtextmodel.cpp index ddfb58089..90e0f089f 100644 --- a/sources/ui/dynamicelementtextmodel.cpp +++ b/sources/ui/dynamicelementtextmodel.cpp @@ -48,11 +48,12 @@ static int font_txt_row = 5; static int color_txt_row = 6; static int frame_txt_row = 7; static int width_txt_row = 8; -static int x_txt_row = 9; -static int y_txt_row = 10; -static int rot_txt_row = 11; -static int keep_rot_row = 12; -static int align_txt_row = 13; +static int height_txt_row = 9; +static int x_txt_row = 10; +static int y_txt_row = 11; +static int rot_txt_row = 12; +static int keep_rot_row = 13; +static int align_txt_row = 14; static int align_grp_row = 0; static int x_grp_row = 1; @@ -96,6 +97,27 @@ DynamicElementTextModel::~DynamicElementTextModel() setConnection(group, false); } +/** + @brief setSizeItems + Show the width and the height of @a deti: ticked with the size set + when it is fixed, not ticked with the size the field has now when it + follows the text, so that ticking it fixes what one sees. +*/ +static void setSizeItems(QStandardItem *width, QStandardItem *height, DynamicElementTextItem *deti) +{ + const QRectF box = deti->boundingRect(); + if (width) { + const bool fixed = deti->textWidth() > 0; + width->setCheckState(fixed ? Qt::Checked : Qt::Unchecked); + width->setData(qRound(fixed ? deti->textWidth() : box.width()), Qt::EditRole); + } + if (height) { + const bool fixed = deti->textHeight() > 0; + height->setCheckState(fixed ? Qt::Checked : Qt::Unchecked); + height->setData(qRound(fixed ? deti->textHeight() : box.height()), Qt::EditRole); + } +} + /** @brief DynamicElementTextModel::indexIsInGroup @param index @@ -281,20 +303,41 @@ QList DynamicElementTextModel::itemsForText( qsi_list << frame << frame_a; qsi->appendRow(qsi_list); - //Width - QStandardItem *width = new QStandardItem(tr("Width")); + //Width and height: ticked, the field keeps the size given beside + //it; not ticked, it follows the text, and the size shown is the + //one it has now, ready to be fixed + QStandardItem *width = new QStandardItem(tr("Width (fixed)")); width->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + width->setToolTip(tr("Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text.")); QStandardItem *width_a = new QStandardItem; - width_a->setData(deti->textWidth(), Qt::EditRole); + width_a->setCheckable(true); width_a->setData(DynamicElementTextModel::textWidth, Qt::UserRole+1); width_a->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled - | Qt::ItemIsEditable); + | Qt::ItemIsEditable + | Qt::ItemIsUserCheckable); qsi_list.clear(); qsi_list << width << width_a; qsi->appendRow(qsi_list); + + QStandardItem *height = new QStandardItem(tr("Height (fixed)")); + height->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + height->setToolTip(tr("Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text.")); + + QStandardItem *height_a = new QStandardItem; + height_a->setCheckable(true); + height_a->setData(DynamicElementTextModel::textHeight, Qt::UserRole+1); + height_a->setFlags(Qt::ItemIsSelectable + | Qt::ItemIsEnabled + | Qt::ItemIsEditable + | Qt::ItemIsUserCheckable); + + qsi_list.clear(); + qsi_list << height << height_a; + qsi->appendRow(qsi_list); + setSizeItems(width_a, height_a, deti); if(deti->parentGroup() == nullptr) { @@ -587,13 +630,24 @@ QUndoCommand *DynamicElementTextModel::undoForEditedText( quc->setText(tr("Modify the frame of an element text")); } - qreal text_width = text_qsi->child(width_txt_row, 1)->data(Qt::EditRole).toDouble(); + QStandardItem *width_item = text_qsi->child(width_txt_row, 1); + qreal text_width = width_item->checkState() == Qt::Checked + ? width_item->data(Qt::EditRole).toDouble() : -1; if(text_width != deti->textWidth()) { QPropertyUndoCommand *quc = new QPropertyUndoCommand(deti, "textWidth", QVariant(deti->textWidth()), QVariant(text_width), undo); quc->setAnimated(true, false); quc->setText(tr("Change the width of an element text")); } + + QStandardItem *height_item = text_qsi->child(height_txt_row, 1); + qreal text_height = height_item->checkState() == Qt::Checked + ? height_item->data(Qt::EditRole).toDouble() : -1; + if(text_height != deti->textHeight()) + { + QPropertyUndoCommand *quc = new QPropertyUndoCommand(deti, "textHeight", QVariant(deti->textHeight()), QVariant(text_height), undo); + quc->setText(tr("Change the height of an element text")); + } //When text is in a group, they're isn't item for position of the text if(text_qsi->child(x_txt_row,1) && text_qsi->child(y_txt_row,1)) @@ -1388,6 +1442,7 @@ void DynamicElementTextModel::setConnection(DynamicElementTextItem *deti, bool s connection_list << connect(deti, &DynamicElementTextItem::frameChanged, [deti,this](){this->updateDataFromText(deti, frame);}); connection_list << connect(deti, &DynamicElementTextItem::rotationChanged, [deti,this](){this->updateDataFromText(deti, rotation);}); connection_list << connect(deti, &DynamicElementTextItem::textWidthChanged,[deti,this](){this->updateDataFromText(deti, textWidth);}); + connection_list << connect(deti, &DynamicElementTextItem::textHeightChanged,[deti,this](){this->updateDataFromText(deti, textHeight);}); connection_list << connect(deti, &DynamicElementTextItem::compositeTextChanged, [deti, this]() {this->updateDataFromText(deti, compositeText);}); m_hash_text_connect.insert(deti, connection_list); } @@ -1525,15 +1580,16 @@ void DynamicElementTextModel::updateDataFromText(DynamicElementTextItem *deti, break; } case textWidth: + case textHeight: { - qsi->child(width_txt_row,1)->setData(deti->textWidth(), Qt::EditRole); + setSizeItems(qsi->child(width_txt_row,1), qsi->child(height_txt_row,1), deti); break; } default:break; } //Rotating or resizing the text moves its anchor point (Position X/Y) - if ((type == rotation || type == textWidth) + if ((type == rotation || type == textWidth || type == textHeight) && qsi->child(x_txt_row,1) && qsi->child(y_txt_row,1)) { qsi->child(x_txt_row,1)->setData(deti->anchorPos().x(), Qt::EditRole); @@ -1761,10 +1817,12 @@ QWidget *DynamicTextItemDelegate::createEditor( return sb; } case DynamicElementTextModel::textWidth: + case DynamicElementTextModel::textHeight: { QSpinBox *sb = new QSpinBox(parent); - sb->setObjectName("width_spinbox"); - sb->setRange(-1, 500); + sb->setObjectName(index.data(Qt::UserRole+1).toInt() == DynamicElementTextModel::textWidth + ? "width_spinbox" : "height_spinbox"); + sb->setRange(1, 1000); sb->setFrame(false); sb->setSuffix(" px"); return sb; diff --git a/sources/ui/dynamicelementtextmodel.h b/sources/ui/dynamicelementtextmodel.h index 013d9318b..fb2c38029 100644 --- a/sources/ui/dynamicelementtextmodel.h +++ b/sources/ui/dynamicelementtextmodel.h @@ -53,6 +53,7 @@ class DynamicElementTextModel : public QStandardItemModel rotation, keepVisualRotation, textWidth, + textHeight, grpAlignment, grpPos, grpRotation, diff --git a/tests/qttest/CMakeLists.txt b/tests/qttest/CMakeLists.txt index 276982b83..cf2eca7e3 100644 --- a/tests/qttest/CMakeLists.txt +++ b/tests/qttest/CMakeLists.txt @@ -140,6 +140,15 @@ if(Python3_Interpreter_FOUND AND CMAKE_GENERATOR STREQUAL "Ninja") --fixture ${CMAKE_CURRENT_SOURCE_DIR}/fixtures/unlinked_contact_label.qet) set_tests_properties(tst_textoutlineintegration PROPERTIES TIMEOUT 300 RUN_SERIAL TRUE ENVIRONMENT "QT_QPA_PLATFORM=offscreen") + # Width and height of a symbol's text, each fixed or not: a fixed + # height cuts off the lines that do not fit; saved and undone. + add_test(NAME tst_textfixedsizeintegration + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/run_text_fixed_size_probe.py + --build ${CMAKE_BINARY_DIR} --binary $ + --source ${CMAKE_CURRENT_SOURCE_DIR}/text_fixed_size_probe.cpp + --fixture ${CMAKE_CURRENT_SOURCE_DIR}/fixtures/unlinked_contact_label.qet) + set_tests_properties(tst_textfixedsizeintegration PROPERTIES TIMEOUT 300 RUN_SERIAL TRUE + ENVIRONMENT "QT_QPA_PLATFORM=offscreen") endif() if(Python3_Interpreter_FOUND AND CMAKE_GENERATOR STREQUAL "Ninja") add_test(NAME tst_darkimageintegration diff --git a/tests/qttest/run_text_fixed_size_probe.py b/tests/qttest/run_text_fixed_size_probe.py new file mode 100755 index 000000000..adf498ee1 --- /dev/null +++ b/tests/qttest/run_text_fixed_size_probe.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +"""Link the text fixed size integration probe using an existing Ninja app build. + +Reuses app objects without duplicating the app or introducing a core-library +refactor. No application source or existing executable is replaced. The +generated manifest, probe binary, reports and export fixtures stay in build/. +""" +import argparse +import pathlib +import re +import shutil +import subprocess +import sys + +parser = argparse.ArgumentParser() +parser.add_argument('--build', required=True) +parser.add_argument('--binary', required=True) +parser.add_argument('--source', required=True) +parser.add_argument('--fixture', required=True) +args = parser.parse_args() +build = pathlib.Path(args.build).resolve() +binary = pathlib.Path(args.binary).resolve() +source = pathlib.Path(args.source).resolve() +fixture = pathlib.Path(args.fixture).resolve() +manifest = (build / 'build.ninja').read_text(encoding='utf-8') +match = re.search(r'^build (\S*?/sources/main\.cpp\.(?:obj|o)):', manifest, re.MULTILINE) +if not match: + sys.exit('Cannot find the application main object in the Ninja build.') +main_object = match.group(1) +probe_object = main_object.replace('main.cpp.', 'text_fixed_size_probe.cpp.') +probe_binary = binary.with_name('text_fixed_size_probe' + binary.suffix) +def escape(path): + return pathlib.Path(path).as_posix().replace('$', '$$').replace(':', '$:').replace(' ', '$ ') +main_source = source.parents[2] / 'sources' / 'main.cpp' +manifest = manifest.replace(main_object, probe_object) +manifest = manifest.replace(escape(main_source), escape(source)) +if binary.suffix: + manifest = manifest.replace(binary.name, probe_binary.name) +else: + old_target = escape(binary.name if binary.parent == build else binary) + new_target = escape(probe_binary.name if probe_binary.parent == build else probe_binary) + manifest = manifest.replace('build ' + old_target + ':', 'build ' + new_target + ':') + old_file = binary.name if binary.parent == build else binary.as_posix() + new_file = probe_binary.name if probe_binary.parent == build else probe_binary.as_posix() + manifest = re.sub(r'^ TARGET_FILE = ' + re.escape(old_file) + r'$', + ' TARGET_FILE = ' + new_file, manifest, flags=re.MULTILINE) +probe_manifest = build / 'text-fixed-size-probe.ninja' +probe_manifest.write_text(manifest, encoding='utf-8') +ninja = shutil.which('ninja') +if not ninja: + sys.exit('Ninja is required for the integration probe.') +target = probe_binary.name if probe_binary.parent == build else str(probe_binary) +subprocess.run([ninja, '-C', str(build), '-f', probe_manifest.name, target], check=True) +output = build / 'text-fixed-size' +output.mkdir(exist_ok=True) +report = output / 'results.txt' +result = subprocess.run([str(probe_binary), str(fixture), str(report), str(output)], timeout=90) +if report.exists(): + print(report.read_text(encoding='utf-8', errors='replace')) +sys.exit(result.returncode) diff --git a/tests/qttest/text_fixed_size_probe.cpp b/tests/qttest/text_fixed_size_probe.cpp new file mode 100644 index 000000000..7cfeafb2d --- /dev/null +++ b/tests/qttest/text_fixed_size_probe.cpp @@ -0,0 +1,129 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// Width and height of a symbol's text, each fixed or not, linked against +// the application's objects. +// +// In the text's properties, "Width (fixed)" and "Height (fixed)" each +// carry a tick box. Not ticked, the field follows the text and shows the +// size it has now; ticked, it keeps the size beside the box. A fixed +// height cuts off the lines that do not fit, to shorten a text where +// room is short: they are neither drawn nor picked. Both are saved with +// the text and undone as any other change. +#include +#include +#include +#include +#include +#include +#include + +#include "../../sources/diagram.h" +#include "../../sources/qetproject.h" +#include "../../sources/qetmessagebox.h" +#include "../../sources/qetgraphicsitem/element.h" +#include "../../sources/qetgraphicsitem/dynamicelementtextitem.h" +#include "../../sources/ui/dynamicelementtextmodel.h" + +static void check(bool value, const char *message) +{ + if (!value) throw std::runtime_error(message); + std::printf("ok: %s\n", message); +} + +/// The value cell of a text's row with the given type +static QStandardItem *cell(DynamicElementTextModel &model, DynamicElementTextItem *text, int type) +{ + QStandardItem *row = model.itemFromIndex(model.indexFromText(text)); + for (int r = 0; r < row->rowCount(); ++r) + if (QStandardItem *c = row->child(r, 1)) + if (c->data(Qt::UserRole + 1).toInt() == type) return c; + throw std::runtime_error("row missing"); +} + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + std::freopen(argv[2], "w", stdout); + + QTemporaryDir settings; + QSettings::setDefaultFormat(QSettings::IniFormat); + QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, settings.path()); + QCoreApplication::setOrganizationName("QETTextFixedSizeRegression"); + QETProject::setBackupEnabled(false); + QET::QetMessageBox::setNonInteractive(true); + QFontDatabase::addApplicationFont(":/fonts/LiberationSans-Regular.ttf"); + + try + { + QETProject project(QString::fromLocal8Bit(argv[1])); + check(project.state() == QETProject::Ok, "fixture opens"); + project.buildFolios(project.diagrams()); + Diagram *scene = project.diagrams().first(); + + DynamicElementTextItem *text = nullptr; + Element *element = nullptr; + for (Element *e : scene->elements()) + for (DynamicElementTextItem *t : e->dynamicTextItems()) + if (!text) { text = t; element = e; } + check(text, "the fixture has a symbol with a text"); + text->setTextFrom(DynamicElementTextItem::UserText); + text->setText(QStringLiteral("Sockets bathroom first floor, 5")); + text->setTextWidth(-1); + text->setTextHeight(-1); + + // The properties: not ticked, the size the field has now. + DynamicElementTextModel model(element); + QStandardItem *width = cell(model, text, DynamicElementTextModel::textWidth); + QStandardItem *height = cell(model, text, DynamicElementTextModel::textHeight); + check(width->isCheckable() && width->checkState() == Qt::Unchecked, "width not fixed: not ticked"); + check(height->isCheckable() && height->checkState() == Qt::Unchecked, "height not fixed: not ticked"); + check(qAbs(width->data(Qt::EditRole).toDouble() - text->boundingRect().width()) <= 1, + "it shows the width the field has now"); + + // Fix the width at 50: the text wraps onto more lines. + const qreal one_line = text->boundingRect().height(); + width->setData(50, Qt::EditRole); + width->setCheckState(Qt::Checked); + scene->undoStack().push(model.undoForEditedText(text)); + check(qFuzzyCompare(text->textWidth(), 50), "ticked, the width is fixed at the value beside it"); + const qreal wrapped = text->boundingRect().height(); + check(wrapped > one_line * 2, "the text wraps inside it"); + + // Fix the height at one line: the other lines are cut off. + height->setData(qRound(one_line), Qt::EditRole); + height->setCheckState(Qt::Checked); + scene->undoStack().push(model.undoForEditedText(text)); + check(qFuzzyCompare(text->textHeight(), qRound(one_line)), "ticked, the height is fixed"); + check(qAbs(text->boundingRect().height() - qRound(one_line)) < 0.01, "the field keeps that height"); + const QPointF below(text->boundingRect().center().x(), wrapped - 2); + check(!text->contains(below) && !text->shape().contains(below), "the lines cut off are not picked"); + + // Kept in the file. + QDomDocument doc; + const QDomElement xml = text->toXml(doc); + check(xml.attribute("text_height").toDouble() == qRound(one_line), "the height is saved with the text"); + text->setTextHeight(-1); + QDomElement copy = xml; + text->fromXml(copy); + check(qFuzzyCompare(text->textHeight(), qRound(one_line)), "and read back"); + + // Undo, untick. + scene->undoStack().undo(); + check(text->textHeight() < 0 && qAbs(text->boundingRect().height() - wrapped) < 0.01, + "undo gives the text its full height back"); + check(cell(model, text, DynamicElementTextModel::textHeight)->checkState() == Qt::Unchecked, + "and the properties show it not fixed"); + width->setCheckState(Qt::Unchecked); + scene->undoStack().push(model.undoForEditedText(text)); + check(text->textWidth() < 0, "not ticked, the width follows the text again"); + check(!text->toXml(doc).hasAttribute("text_height"), "a height that follows the text is not written"); + std::puts("PASS"); + } + catch (const std::exception &error) + { + std::printf("FAIL: %s\n", error.what()); + std::fflush(stdout); + return 1; + } + std::fflush(stdout); + return 0; +} From 2222153662f6282401f30ac2fa0b296c90c82a8b Mon Sep 17 00:00:00 2001 From: DaTweety <129504390+DaTweety@users.noreply.github.com> Date: Mon, 19 Oct 2026 15:56:50 +0200 Subject: [PATCH 2/2] Text size: the value and "fixed" on rows of their own A tick box and a value in the same cell was not clear to use. Width and height now take two rows each: "Width" / "Width fixed" and "Height" / "Height fixed". Not fixed, the value shows the size the field has now and cannot be edited; ticking "fixed" makes it editable at once. Co-Authored-By: Claude Opus 5.5 --- lang/qet_ar.ts | 35 +++--- lang/qet_ca.ts | 35 +++--- lang/qet_cs.ts | 35 +++--- lang/qet_da.ts | 35 +++--- lang/qet_de.ts | 35 +++--- lang/qet_el.ts | 35 +++--- lang/qet_en.ts | 35 +++--- lang/qet_es.ts | 35 +++--- lang/qet_fi.ts | 35 +++--- lang/qet_fr.ts | 35 +++--- lang/qet_hr.ts | 35 +++--- lang/qet_hu.ts | 35 +++--- lang/qet_it.ts | 35 +++--- lang/qet_ja.ts | 35 +++--- lang/qet_ko.ts | 35 +++--- lang/qet_mn.ts | 35 +++--- lang/qet_nb.ts | 35 +++--- lang/qet_nl.ts | 35 +++--- lang/qet_nl_BE.ts | 35 +++--- lang/qet_nl_NL.ts | 35 +++--- lang/qet_no.ts | 35 +++--- lang/qet_pl.ts | 35 +++--- lang/qet_pt.ts | 35 +++--- lang/qet_pt_BR.ts | 35 +++--- lang/qet_ro.ts | 35 +++--- lang/qet_rs.ts | 35 +++--- lang/qet_ru.ts | 35 +++--- lang/qet_sk.ts | 35 +++--- lang/qet_sl.ts | 35 +++--- lang/qet_sr.ts | 35 +++--- lang/qet_sv.ts | 35 +++--- lang/qet_tr.ts | 35 +++--- lang/qet_uk.ts | 35 +++--- lang/qet_zh.ts | 35 +++--- lang/qet_zh_TW.ts | 35 +++--- sources/ui/dynamicelementtextmodel.cpp | 152 +++++++++++++++---------- sources/ui/dynamicelementtextmodel.h | 2 + tests/qttest/text_fixed_size_probe.cpp | 36 +++--- 38 files changed, 814 insertions(+), 601 deletions(-) diff --git a/lang/qet_ar.ts b/lang/qet_ar.ts index 98d373eb1..1d51ae998 100644 --- a/lang/qet_ar.ts +++ b/lang/qet_ar.ts @@ -3975,24 +3975,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - العرض (ثابت) - - - - Height (fixed) - الارتفاع (ثابت) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - عند التحديد يحتفظ حقل النص بهذا العرض ويلتف النص داخله. بدون تحديد يكون بعرض النص. + + Height + الارتفاع - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - عند التحديد يحتفظ حقل النص بهذا الارتفاع وتُقص الأسطر التي لا تتسع. بدون تحديد يكون بارتفاع النص. + Width fixed + العرض ثابت + + + + Height fixed + الارتفاع ثابت + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + عند التحديد يحتفظ حقل النص بالعرض أعلاه ويلتف النص داخله. بدون تحديد يكون بعرض النص. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + عند التحديد يحتفظ حقل النص بالارتفاع أعلاه وتُقص الأسطر التي لا تتسع. بدون تحديد يكون بارتفاع النص. diff --git a/lang/qet_ca.ts b/lang/qet_ca.ts index 74ff049c0..6d2e76483 100644 --- a/lang/qet_ca.ts +++ b/lang/qet_ca.ts @@ -3896,24 +3896,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Amplada (fixa) - - - - Height (fixed) - Alçada (fixa) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Marcat, el camp de text manté aquesta amplada i el text s'ajusta a dins. Sense marcar, és tan ample com el text. + + Height + Alçada - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Marcat, el camp de text manté aquesta alçada i les línies que no hi caben es tallen. Sense marcar, és tan alt com el text. + Width fixed + Amplada fixa + + + + Height fixed + Alçada fixa + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Marcat, el camp de text manté l'amplada de dalt i el text s'ajusta a dins. Sense marcar, és tan ample com el text. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Marcat, el camp de text manté l'alçada de dalt i les línies que no hi caben es tallen. Sense marcar, és tan alt com el text. diff --git a/lang/qet_cs.ts b/lang/qet_cs.ts index 71915aab4..098c0cafb 100644 --- a/lang/qet_cs.ts +++ b/lang/qet_cs.ts @@ -3922,24 +3922,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Šířka (pevná) - - - - Height (fixed) - Výška (pevná) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Zaškrtnuto: textové pole si drží tuto šířku a text se v něm zalamuje. Nezaškrtnuto: je široké jako text. + + Height + Výška - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Zaškrtnuto: textové pole si drží tuto výšku a řádky, které se nevejdou, se oříznou. Nezaškrtnuto: je vysoké jako text. + Width fixed + Pevná šířka + + + + Height fixed + Pevná výška + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Zaškrtnuto: textové pole si drží šířku výše a text se v něm zalamuje. Nezaškrtnuto: je široké jako text. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Zaškrtnuto: textové pole si drží výšku výše a řádky, které se nevejdou, se oříznou. Nezaškrtnuto: je vysoké jako text. diff --git a/lang/qet_da.ts b/lang/qet_da.ts index 0b3b53ad3..aa16f82bf 100644 --- a/lang/qet_da.ts +++ b/lang/qet_da.ts @@ -3876,24 +3876,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Bredde (fast) - - - - Height (fixed) - Højde (fast) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Markeret beholder tekstfeltet denne bredde, og teksten ombrydes i det. Ikke markeret er det lige så bredt som teksten. + + Height + Højde - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Markeret beholder tekstfeltet denne højde, og linjer der ikke er plads til, skæres af. Ikke markeret er det lige så højt som teksten. + Width fixed + Fast bredde + + + + Height fixed + Fast højde + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Markeret beholder tekstfeltet bredden ovenfor, og teksten ombrydes i det. Ikke markeret er det lige så bredt som teksten. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Markeret beholder tekstfeltet højden ovenfor, og linjer der ikke er plads til, skæres af. Ikke markeret er det lige så højt som teksten. diff --git a/lang/qet_de.ts b/lang/qet_de.ts index d03900b6c..216bfe6c3 100644 --- a/lang/qet_de.ts +++ b/lang/qet_de.ts @@ -3898,24 +3898,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Breite (fixiert) - - - - Height (fixed) - Höhe (fixiert) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Angehakt behält das Textfeld diese Breite, der Text bricht darin um. Nicht angehakt ist es so breit wie der Text. + + Height + Höhe - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Angehakt behält das Textfeld diese Höhe, Zeilen, die nicht hineinpassen, werden abgeschnitten. Nicht angehakt ist es so hoch wie der Text. + Width fixed + Breite fixiert + + + + Height fixed + Höhe fixiert + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Angehakt behält das Textfeld die Breite darüber, der Text bricht darin um. Nicht angehakt ist es so breit wie der Text. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Angehakt behält das Textfeld die Höhe darüber, Zeilen, die nicht hineinpassen, werden abgeschnitten. Nicht angehakt ist es so hoch wie der Text. diff --git a/lang/qet_el.ts b/lang/qet_el.ts index e4134e7d7..9f6adcc7f 100644 --- a/lang/qet_el.ts +++ b/lang/qet_el.ts @@ -3895,24 +3895,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Πλάτος (σταθερό) - - - - Height (fixed) - Ύψος (σταθερό) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Επιλεγμένο: το πεδίο κειμένου κρατά αυτό το πλάτος και το κείμενο αναδιπλώνεται μέσα του. Μη επιλεγμένο: είναι όσο φαρδύ είναι το κείμενο. + + Height + Ύψος - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Επιλεγμένο: το πεδίο κειμένου κρατά αυτό το ύψος και οι γραμμές που δεν χωρούν αποκόπτονται. Μη επιλεγμένο: είναι όσο ψηλό είναι το κείμενο. + Width fixed + Σταθερό πλάτος + + + + Height fixed + Σταθερό ύψος + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Επιλεγμένο: το πεδίο κειμένου κρατά το παραπάνω πλάτος και το κείμενο αναδιπλώνεται μέσα του. Μη επιλεγμένο: είναι όσο φαρδύ είναι το κείμενο. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Επιλεγμένο: το πεδίο κειμένου κρατά το παραπάνω ύψος και οι γραμμές που δεν χωρούν αποκόπτονται. Μη επιλεγμένο: είναι όσο ψηλό είναι το κείμενο. diff --git a/lang/qet_en.ts b/lang/qet_en.ts index 6f3095a1d..c18871e12 100644 --- a/lang/qet_en.ts +++ b/lang/qet_en.ts @@ -3895,24 +3895,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Width (fixed) - - - - Height (fixed) - Height (fixed) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. + + Height + Height - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Width fixed + Width fixed + + + + Height fixed + Height fixed + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. diff --git a/lang/qet_es.ts b/lang/qet_es.ts index 9a41606a1..a0f002690 100644 --- a/lang/qet_es.ts +++ b/lang/qet_es.ts @@ -3898,24 +3898,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Ancho (fijo) - - - - Height (fixed) - Alto (fijo) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Marcado, el campo de texto mantiene este ancho y el texto se ajusta dentro. Sin marcar, es tan ancho como el texto. + + Height + Alto - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Marcado, el campo de texto mantiene este alto y las líneas que no caben se cortan. Sin marcar, es tan alto como el texto. + Width fixed + Ancho fijo + + + + Height fixed + Alto fijo + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Marcado, el campo de texto mantiene el ancho de arriba y el texto se ajusta dentro. Sin marcar, es tan ancho como el texto. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Marcado, el campo de texto mantiene el alto de arriba y las líneas que no caben se cortan. Sin marcar, es tan alto como el texto. diff --git a/lang/qet_fi.ts b/lang/qet_fi.ts index 9e52ddf8d..9b54480fa 100644 --- a/lang/qet_fi.ts +++ b/lang/qet_fi.ts @@ -3871,24 +3871,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Leveys (kiinteä) - - - - Height (fixed) - Korkeus (kiinteä) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Valittuna tekstikenttä pitää tämän leveyden ja teksti rivittyy sen sisään. Valitsematta se on tekstin levyinen. + + Height + Korkeus - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Valittuna tekstikenttä pitää tämän korkeuden ja rivit, jotka eivät mahdu, katkaistaan. Valitsematta se on tekstin korkuinen. + Width fixed + Kiinteä leveys + + + + Height fixed + Kiinteä korkeus + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Valittuna tekstikenttä pitää yllä olevan leveyden ja teksti rivittyy sen sisään. Valitsematta se on tekstin levyinen. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Valittuna tekstikenttä pitää yllä olevan korkeuden ja rivit, jotka eivät mahdu, katkaistaan. Valitsematta se on tekstin korkuinen. diff --git a/lang/qet_fr.ts b/lang/qet_fr.ts index 4e8450740..80975527e 100644 --- a/lang/qet_fr.ts +++ b/lang/qet_fr.ts @@ -3896,24 +3896,29 @@ Maintenir Maj et faire glisser pour déplacer ce texte seul DynamicElementTextModel - - Width (fixed) - Largeur (fixe) - - - - Height (fixed) - Hauteur (fixe) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Cochée, le champ de texte garde cette largeur et le texte y passe à la ligne. Non cochée, il est aussi large que le texte. + + Height + Hauteur - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Cochée, le champ de texte garde cette hauteur et les lignes qui ne tiennent pas sont coupées. Non cochée, il est aussi haut que le texte. + Width fixed + Largeur fixe + + + + Height fixed + Hauteur fixe + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Cochée, le champ de texte garde la largeur ci-dessus et le texte y passe à la ligne. Non cochée, il est aussi large que le texte. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Cochée, le champ de texte garde la hauteur ci-dessus et les lignes qui ne tiennent pas sont coupées. Non cochée, il est aussi haut que le texte. diff --git a/lang/qet_hr.ts b/lang/qet_hr.ts index db5950425..86159c114 100644 --- a/lang/qet_hr.ts +++ b/lang/qet_hr.ts @@ -3896,24 +3896,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Širina (fiksna) - - - - Height (fixed) - Visina (fiksna) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Označeno: tekstno polje zadržava ovu širinu i tekst se u njemu prelama. Neoznačeno: široko je koliko i tekst. + + Height + Visina - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Označeno: tekstno polje zadržava ovu visinu, a redci koji ne stanu se odrežu. Neoznačeno: visoko je koliko i tekst. + Width fixed + Fiksna širina + + + + Height fixed + Fiksna visina + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Označeno: tekstno polje zadržava gornju širinu i tekst se u njemu prelama. Neoznačeno: široko je koliko i tekst. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Označeno: tekstno polje zadržava gornju visinu, a redci koji ne stanu se odrežu. Neoznačeno: visoko je koliko i tekst. diff --git a/lang/qet_hu.ts b/lang/qet_hu.ts index 4c1b55db9..51f760d40 100644 --- a/lang/qet_hu.ts +++ b/lang/qet_hu.ts @@ -3875,24 +3875,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Szélesség (rögzített) - - - - Height (fixed) - Magasság (rögzített) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Bejelölve a szövegmező megtartja ezt a szélességet, és a szöveg benne tördelődik. Bejelöletlenül olyan széles, mint a szöveg. + + Height + Magasság - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Bejelölve a szövegmező megtartja ezt a magasságot, és a bele nem férő sorok levágódnak. Bejelöletlenül olyan magas, mint a szöveg. + Width fixed + Rögzített szélesség + + + + Height fixed + Rögzített magasság + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Bejelölve a szövegmező megtartja a fenti szélességet, és a szöveg benne tördelődik. Bejelöletlenül olyan széles, mint a szöveg. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Bejelölve a szövegmező megtartja a fenti magasságot, és a bele nem férő sorok levágódnak. Bejelöletlenül olyan magas, mint a szöveg. diff --git a/lang/qet_it.ts b/lang/qet_it.ts index 76ad9ad89..bd4d34806 100644 --- a/lang/qet_it.ts +++ b/lang/qet_it.ts @@ -3895,24 +3895,29 @@ Tieni premuto Maiusc e trascina per spostare solo questo testo DynamicElementTextModel - - Width (fixed) - Larghezza (fissa) - - - - Height (fixed) - Altezza (fissa) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Spuntato, il campo di testo mantiene questa larghezza e il testo va a capo al suo interno. Non spuntato, è largo quanto il testo. + + Height + Altezza - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Spuntato, il campo di testo mantiene questa altezza e le righe che non entrano vengono tagliate. Non spuntato, è alto quanto il testo. + Width fixed + Larghezza fissa + + + + Height fixed + Altezza fissa + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Spuntato, il campo di testo mantiene la larghezza sopra e il testo va a capo al suo interno. Non spuntato, è largo quanto il testo. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Spuntato, il campo di testo mantiene l'altezza sopra e le righe che non entrano vengono tagliate. Non spuntato, è alto quanto il testo. diff --git a/lang/qet_ja.ts b/lang/qet_ja.ts index 365bb52fe..a9acf46ca 100644 --- a/lang/qet_ja.ts +++ b/lang/qet_ja.ts @@ -3867,24 +3867,29 @@ Shift を押しながらドラッグすると、このテキストだけを移 DynamicElementTextModel - - Width (fixed) - 幅(固定) - - - - Height (fixed) - 高さ(固定) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - チェックするとテキスト欄はこの幅を保ち、テキストはその中で折り返します。チェックしないとテキストの幅になります。 + + Height + 高さ - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - チェックするとテキスト欄はこの高さを保ち、収まらない行は切り捨てられます。チェックしないとテキストの高さになります。 + Width fixed + 幅を固定 + + + + Height fixed + 高さを固定 + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + チェックするとテキスト欄は上の幅を保ち、テキストはその中で折り返します。チェックしないとテキストの幅になります。 + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + チェックするとテキスト欄は上の高さを保ち、収まらない行は切り捨てられます。チェックしないとテキストの高さになります。 diff --git a/lang/qet_ko.ts b/lang/qet_ko.ts index 653305b09..7c7a20e5c 100644 --- a/lang/qet_ko.ts +++ b/lang/qet_ko.ts @@ -3867,24 +3867,29 @@ Shift를 누른 채 끌면 이 텍스트만 이동합니다 DynamicElementTextModel - - Width (fixed) - 너비 (고정) - - - - Height (fixed) - 높이 (고정) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - 선택하면 텍스트 필드가 이 너비를 유지하고 텍스트가 그 안에서 줄 바꿈됩니다. 선택하지 않으면 텍스트 너비와 같습니다. + + Height + 높이 - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - 선택하면 텍스트 필드가 이 높이를 유지하고 들어가지 않는 줄은 잘립니다. 선택하지 않으면 텍스트 높이와 같습니다. + Width fixed + 너비 고정 + + + + Height fixed + 높이 고정 + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + 선택하면 텍스트 필드가 위의 너비를 유지하고 텍스트가 그 안에서 줄 바꿈됩니다. 선택하지 않으면 텍스트 너비와 같습니다. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + 선택하면 텍스트 필드가 위의 높이를 유지하고 들어가지 않는 줄은 잘립니다. 선택하지 않으면 텍스트 높이와 같습니다. diff --git a/lang/qet_mn.ts b/lang/qet_mn.ts index 728f45804..6e738de0d 100644 --- a/lang/qet_mn.ts +++ b/lang/qet_mn.ts @@ -3878,24 +3878,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Өргөн (тогтмол) - - - - Height (fixed) - Өндөр (тогтмол) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Тэмдэглэсэн үед текстийн талбар энэ өргөнийг хадгалж, текст дотор нь шилжинэ. Тэмдэглээгүй үед текстийн өргөнтэй тэнцүү. + + Height + Өндөр - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Тэмдэглэсэн үед текстийн талбар энэ өндрийг хадгалж, багтахгүй мөрүүд таслагдана. Тэмдэглээгүй үед текстийн өндөртэй тэнцүү. + Width fixed + Тогтмол өргөн + + + + Height fixed + Тогтмол өндөр + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Тэмдэглэсэн үед текстийн талбар дээрх өргөнийг хадгалж, текст дотор нь шилжинэ. Тэмдэглээгүй үед текстийн өргөнтэй тэнцүү. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Тэмдэглэсэн үед текстийн талбар дээрх өндрийг хадгалж, багтахгүй мөрүүд таслагдана. Тэмдэглээгүй үед текстийн өндөртэй тэнцүү. diff --git a/lang/qet_nb.ts b/lang/qet_nb.ts index 30ec04d72..6b67e5639 100644 --- a/lang/qet_nb.ts +++ b/lang/qet_nb.ts @@ -3879,24 +3879,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Bredde (fast) - - - - Height (fixed) - Høyde (fast) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Avkrysset beholder tekstfeltet denne bredden, og teksten brytes inni det. Ikke avkrysset er det like bredt som teksten. + + Height + Høyde - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Avkrysset beholder tekstfeltet denne høyden, og linjer som ikke får plass, kuttes. Ikke avkrysset er det like høyt som teksten. + Width fixed + Fast bredde + + + + Height fixed + Fast høyde + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Avkrysset beholder tekstfeltet bredden over, og teksten brytes inni det. Ikke avkrysset er det like bredt som teksten. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Avkrysset beholder tekstfeltet høyden over, og linjer som ikke får plass, kuttes. Ikke avkrysset er det like høyt som teksten. diff --git a/lang/qet_nl.ts b/lang/qet_nl.ts index 0292f1981..5afb10479 100644 --- a/lang/qet_nl.ts +++ b/lang/qet_nl.ts @@ -3876,24 +3876,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Breedte (vast) - - - - Height (fixed) - Hoogte (vast) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Aangevinkt houdt het tekstveld deze breedte en loopt de tekst erin door. Niet aangevinkt is het zo breed als de tekst. + + Height + Hoogte - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Aangevinkt houdt het tekstveld deze hoogte en worden regels die niet passen afgesneden. Niet aangevinkt is het zo hoog als de tekst. + Width fixed + Vaste breedte + + + + Height fixed + Vaste hoogte + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Aangevinkt houdt het tekstveld de breedte hierboven en loopt de tekst erin door. Niet aangevinkt is het zo breed als de tekst. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Aangevinkt houdt het tekstveld de hoogte hierboven en worden regels die niet passen afgesneden. Niet aangevinkt is het zo hoog als de tekst. diff --git a/lang/qet_nl_BE.ts b/lang/qet_nl_BE.ts index 628f19689..346685a0f 100644 --- a/lang/qet_nl_BE.ts +++ b/lang/qet_nl_BE.ts @@ -3896,24 +3896,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Breedte (vast) - - - - Height (fixed) - Hoogte (vast) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Aangevinkt houdt het tekstveld deze breedte en loopt de tekst erin door. Niet aangevinkt is het zo breed als de tekst. + + Height + Hoogte - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Aangevinkt houdt het tekstveld deze hoogte en worden regels die niet passen afgesneden. Niet aangevinkt is het zo hoog als de tekst. + Width fixed + Vaste breedte + + + + Height fixed + Vaste hoogte + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Aangevinkt houdt het tekstveld de breedte hierboven en loopt de tekst erin door. Niet aangevinkt is het zo breed als de tekst. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Aangevinkt houdt het tekstveld de hoogte hierboven en worden regels die niet passen afgesneden. Niet aangevinkt is het zo hoog als de tekst. diff --git a/lang/qet_nl_NL.ts b/lang/qet_nl_NL.ts index 044bc2956..976ff9935 100644 --- a/lang/qet_nl_NL.ts +++ b/lang/qet_nl_NL.ts @@ -2698,24 +2698,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Breedte (vast) - - - - Height (fixed) - Hoogte (vast) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Aangevinkt houdt het tekstveld deze breedte en loopt de tekst erin door. Niet aangevinkt is het zo breed als de tekst. + + Height + Hoogte - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Aangevinkt houdt het tekstveld deze hoogte en worden regels die niet passen afgesneden. Niet aangevinkt is het zo hoog als de tekst. + Width fixed + Vaste breedte + + + + Height fixed + Vaste hoogte + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Aangevinkt houdt het tekstveld de breedte hierboven en loopt de tekst erin door. Niet aangevinkt is het zo breed als de tekst. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Aangevinkt houdt het tekstveld de hoogte hierboven en worden regels die niet passen afgesneden. Niet aangevinkt is het zo hoog als de tekst. diff --git a/lang/qet_no.ts b/lang/qet_no.ts index 5606f5124..1ba4ba438 100644 --- a/lang/qet_no.ts +++ b/lang/qet_no.ts @@ -3871,24 +3871,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Bredde (fast) - - - - Height (fixed) - Høyde (fast) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Avkrysset beholder tekstfeltet denne bredden, og teksten brytes inni det. Ikke avkrysset er det like bredt som teksten. + + Height + Høyde - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Avkrysset beholder tekstfeltet denne høyden, og linjer som ikke får plass, kuttes. Ikke avkrysset er det like høyt som teksten. + Width fixed + Fast bredde + + + + Height fixed + Fast høyde + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Avkrysset beholder tekstfeltet bredden over, og teksten brytes inni det. Ikke avkrysset er det like bredt som teksten. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Avkrysset beholder tekstfeltet høyden over, og linjer som ikke får plass, kuttes. Ikke avkrysset er det like høyt som teksten. diff --git a/lang/qet_pl.ts b/lang/qet_pl.ts index 5523a3721..d27298d4b 100644 --- a/lang/qet_pl.ts +++ b/lang/qet_pl.ts @@ -3936,24 +3936,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Szerokość (stała) - - - - Height (fixed) - Wysokość (stała) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Zaznaczone: pole tekstowe zachowuje tę szerokość, a tekst jest w nim zawijany. Niezaznaczone: jest tak szerokie jak tekst. + + Height + Wysokość - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Zaznaczone: pole tekstowe zachowuje tę wysokość, a wiersze, które się nie mieszczą, są obcinane. Niezaznaczone: jest tak wysokie jak tekst. + Width fixed + Stała szerokość + + + + Height fixed + Stała wysokość + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Zaznaczone: pole tekstowe zachowuje szerokość powyżej, a tekst jest w nim zawijany. Niezaznaczone: jest tak szerokie jak tekst. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Zaznaczone: pole tekstowe zachowuje wysokość powyżej, a wiersze, które się nie mieszczą, są obcinane. Niezaznaczone: jest tak wysokie jak tekst. diff --git a/lang/qet_pt.ts b/lang/qet_pt.ts index e27c4387b..6cc5dc8cb 100644 --- a/lang/qet_pt.ts +++ b/lang/qet_pt.ts @@ -3897,24 +3897,29 @@ Mantenha Shift premido e arraste para mover este texto sozinho DynamicElementTextModel - - Width (fixed) - Largura (fixa) - - - - Height (fixed) - Altura (fixa) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Marcado, o campo de texto mantém esta largura e o texto quebra dentro dele. Desmarcado, é tão largo como o texto. + + Height + Altura - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Marcado, o campo de texto mantém esta altura e as linhas que não cabem são cortadas. Desmarcado, é tão alto como o texto. + Width fixed + Largura fixa + + + + Height fixed + Altura fixa + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Marcado, o campo de texto mantém a largura acima e o texto quebra dentro dele. Desmarcado, é tão largo como o texto. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Marcado, o campo de texto mantém a altura acima e as linhas que não cabem são cortadas. Desmarcado, é tão alto como o texto. diff --git a/lang/qet_pt_BR.ts b/lang/qet_pt_BR.ts index 8e8cc1159..2024ab0ad 100644 --- a/lang/qet_pt_BR.ts +++ b/lang/qet_pt_BR.ts @@ -3896,24 +3896,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Largura (fixa) - - - - Height (fixed) - Altura (fixa) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Marcado, o campo de texto mantém esta largura e o texto quebra dentro dele. Desmarcado, é tão largo quanto o texto. + + Height + Altura - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Marcado, o campo de texto mantém esta altura e as linhas que não cabem são cortadas. Desmarcado, é tão alto quanto o texto. + Width fixed + Largura fixa + + + + Height fixed + Altura fixa + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Marcado, o campo de texto mantém a largura acima e o texto quebra dentro dele. Desmarcado, é tão largo quanto o texto. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Marcado, o campo de texto mantém a altura acima e as linhas que não cabem são cortadas. Desmarcado, é tão alto quanto o texto. diff --git a/lang/qet_ro.ts b/lang/qet_ro.ts index 8544e0c1a..bd4610356 100644 --- a/lang/qet_ro.ts +++ b/lang/qet_ro.ts @@ -3895,24 +3895,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Lățime (fixă) - - - - Height (fixed) - Înălțime (fixă) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Bifat, câmpul de text păstrează această lățime și textul se încadrează în el. Nebifat, este cât textul de lat. + + Height + Înălțime - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Bifat, câmpul de text păstrează această înălțime și rândurile care nu încap sunt tăiate. Nebifat, este cât textul de înalt. + Width fixed + Lățime fixă + + + + Height fixed + Înălțime fixă + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Bifat, câmpul de text păstrează lățimea de deasupra și textul se încadrează în el. Nebifat, este cât textul de lat. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Bifat, câmpul de text păstrează înălțimea de deasupra și rândurile care nu încap sunt tăiate. Nebifat, este cât textul de înalt. diff --git a/lang/qet_rs.ts b/lang/qet_rs.ts index 504dc33e3..8459d9eb7 100644 --- a/lang/qet_rs.ts +++ b/lang/qet_rs.ts @@ -3895,24 +3895,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Širina (fiksna) - - - - Height (fixed) - Visina (fiksna) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Označeno: tekstualno polje zadržava ovu širinu i tekst se u njemu prelama. Neoznačeno: široko je koliko i tekst. + + Height + Visina - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Označeno: tekstualno polje zadržava ovu visinu, a redovi koji ne stanu se odsecaju. Neoznačeno: visoko je koliko i tekst. + Width fixed + Fiksna širina + + + + Height fixed + Fiksna visina + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Označeno: tekstualno polje zadržava gornju širinu i tekst se u njemu prelama. Neoznačeno: široko je koliko i tekst. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Označeno: tekstualno polje zadržava gornju visinu, a redovi koji ne stanu se odsecaju. Neoznačeno: visoko je koliko i tekst. diff --git a/lang/qet_ru.ts b/lang/qet_ru.ts index ec1809cb2..61e7dc16a 100644 --- a/lang/qet_ru.ts +++ b/lang/qet_ru.ts @@ -3933,24 +3933,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Ширина (фиксированная) - - - - Height (fixed) - Высота (фиксированная) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Если отмечено, текстовое поле сохраняет эту ширину, и текст переносится внутри него. Если не отмечено, поле по ширине текста. + + Height + Высота - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Если отмечено, текстовое поле сохраняет эту высоту, а не поместившиеся строки обрезаются. Если не отмечено, поле по высоте текста. + Width fixed + Фиксированная ширина + + + + Height fixed + Фиксированная высота + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Если отмечено, текстовое поле сохраняет ширину выше, и текст переносится внутри него. Если не отмечено, поле по ширине текста. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Если отмечено, текстовое поле сохраняет высоту выше, а не поместившиеся строки обрезаются. Если не отмечено, поле по высоте текста. diff --git a/lang/qet_sk.ts b/lang/qet_sk.ts index cedf0c17b..79fbe29c5 100644 --- a/lang/qet_sk.ts +++ b/lang/qet_sk.ts @@ -3913,24 +3913,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Šírka (pevná) - - - - Height (fixed) - Výška (pevná) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Začiarknuté: textové pole si drží túto šírku a text sa v ňom zalamuje. Nezačiarknuté: je široké ako text. + + Height + Výška - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Začiarknuté: textové pole si drží túto výšku a riadky, ktoré sa nezmestia, sa orežú. Nezačiarknuté: je vysoké ako text. + Width fixed + Pevná šírka + + + + Height fixed + Pevná výška + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Začiarknuté: textové pole si drží šírku vyššie a text sa v ňom zalamuje. Nezačiarknuté: je široké ako text. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Začiarknuté: textové pole si drží výšku vyššie a riadky, ktoré sa nezmestia, sa orežú. Nezačiarknuté: je vysoké ako text. diff --git a/lang/qet_sl.ts b/lang/qet_sl.ts index 6dd9137a3..49d811688 100644 --- a/lang/qet_sl.ts +++ b/lang/qet_sl.ts @@ -3919,24 +3919,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Širina (fiksna) - - - - Height (fixed) - Višina (fiksna) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Označeno: besedilno polje ohrani to širino in besedilo se v njem prelamlja. Neoznačeno: je široko kot besedilo. + + Height + Višina - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Označeno: besedilno polje ohrani to višino, vrstice, ki ne gredo vanj, se odrežejo. Neoznačeno: je visoko kot besedilo. + Width fixed + Fiksna širina + + + + Height fixed + Fiksna višina + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Označeno: besedilno polje ohrani zgornjo širino in besedilo se v njem prelamlja. Neoznačeno: je široko kot besedilo. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Označeno: besedilno polje ohrani zgornjo višino, vrstice, ki ne gredo vanj, se odrežejo. Neoznačeno: je visoko kot besedilo. diff --git a/lang/qet_sr.ts b/lang/qet_sr.ts index 1e2dc808d..0210eb356 100644 --- a/lang/qet_sr.ts +++ b/lang/qet_sr.ts @@ -3895,24 +3895,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Ширина (фиксна) - - - - Height (fixed) - Висина (фиксна) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Означено: текстуално поље задржава ову ширину и текст се у њему прелама. Неозначено: широко је колико и текст. + + Height + Висина - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Означено: текстуално поље задржава ову висину, а редови који не стану се одсецају. Неозначено: високо је колико и текст. + Width fixed + Фиксна ширина + + + + Height fixed + Фиксна висина + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Означено: текстуално поље задржава горњу ширину и текст се у њему прелама. Неозначено: широко је колико и текст. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Означено: текстуално поље задржава горњу висину, а редови који не стану се одсецају. Неозначено: високо је колико и текст. diff --git a/lang/qet_sv.ts b/lang/qet_sv.ts index 88f230f3e..4f364c270 100644 --- a/lang/qet_sv.ts +++ b/lang/qet_sv.ts @@ -3876,24 +3876,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Bredd (fast) - - - - Height (fixed) - Höjd (fast) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Markerat behåller textfältet denna bredd och texten radbryts i det. Omarkerat är det lika brett som texten. + + Height + Höjd - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Markerat behåller textfältet denna höjd och rader som inte får plats skärs av. Omarkerat är det lika högt som texten. + Width fixed + Fast bredd + + + + Height fixed + Fast höjd + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Markerat behåller textfältet bredden ovan och texten radbryts i det. Omarkerat är det lika brett som texten. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Markerat behåller textfältet höjden ovan och rader som inte får plats skärs av. Omarkerat är det lika högt som texten. diff --git a/lang/qet_tr.ts b/lang/qet_tr.ts index aa6575cf6..bfd70643f 100644 --- a/lang/qet_tr.ts +++ b/lang/qet_tr.ts @@ -3875,24 +3875,29 @@ Bu metni tek başına taşımak için Shift tuşunu basılı tutup sürükleyin< DynamicElementTextModel - - Width (fixed) - Genişlik (sabit) - - - - Height (fixed) - Yükseklik (sabit) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - İşaretliyse metin alanı bu genişliği korur ve metin içinde kaydırılır. İşaretli değilse metin kadar geniştir. + + Height + Yükseklik - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - İşaretliyse metin alanı bu yüksekliği korur ve sığmayan satırlar kesilir. İşaretli değilse metin kadar yüksektir. + Width fixed + Sabit genişlik + + + + Height fixed + Sabit yükseklik + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + İşaretliyse metin alanı yukarıdaki genişliği korur ve metin içinde kaydırılır. İşaretli değilse metin kadar geniştir. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + İşaretliyse metin alanı yukarıdaki yüksekliği korur ve sığmayan satırlar kesilir. İşaretli değilse metin kadar yüksektir. diff --git a/lang/qet_uk.ts b/lang/qet_uk.ts index acddada94..d0be7563a 100644 --- a/lang/qet_uk.ts +++ b/lang/qet_uk.ts @@ -3923,24 +3923,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - Ширина (фіксована) - - - - Height (fixed) - Висота (фіксована) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - Якщо позначено, текстове поле зберігає цю ширину, і текст переноситься всередині. Якщо ні, поле за шириною тексту. + + Height + Висота - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - Якщо позначено, текстове поле зберігає цю висоту, а рядки, що не вміщуються, обрізаються. Якщо ні, поле за висотою тексту. + Width fixed + Фіксована ширина + + + + Height fixed + Фіксована висота + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + Якщо позначено, текстове поле зберігає ширину вище, і текст переноситься всередині. Якщо ні, поле за шириною тексту. + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + Якщо позначено, текстове поле зберігає висоту вище, а рядки, що не вміщуються, обрізаються. Якщо ні, поле за висотою тексту. diff --git a/lang/qet_zh.ts b/lang/qet_zh.ts index 5c9ce2d2c..02c788158 100644 --- a/lang/qet_zh.ts +++ b/lang/qet_zh.ts @@ -3866,24 +3866,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - 宽度(固定) - - - - Height (fixed) - 高度(固定) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - 勾选后文本框保持此宽度,文本在其中换行。不勾选时与文本同宽。 + + Height + 高度 - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - 勾选后文本框保持此高度,放不下的行被截断。不勾选时与文本同高。 + Width fixed + 固定宽度 + + + + Height fixed + 固定高度 + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + 勾选后文本框保持上面的宽度,文本在其中换行。不勾选时与文本同宽。 + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + 勾选后文本框保持上面的高度,放不下的行被截断。不勾选时与文本同高。 diff --git a/lang/qet_zh_TW.ts b/lang/qet_zh_TW.ts index 60297172e..b5bcb59e2 100644 --- a/lang/qet_zh_TW.ts +++ b/lang/qet_zh_TW.ts @@ -3866,24 +3866,29 @@ Hold Shift and drag to move this text on its own DynamicElementTextModel - - Width (fixed) - 寬度(固定) - - - - Height (fixed) - 高度(固定) - - - - Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text. - 勾選後文字框保持此寬度,文字在其中換行。不勾選時與文字同寬。 + + Height + 高度 - Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text. - 勾選後文字框保持此高度,放不下的行會被截斷。不勾選時與文字同高。 + Width fixed + 固定寬度 + + + + Height fixed + 固定高度 + + + + Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text. + 勾選後文字框保持上方的寬度,文字在其中換行。不勾選時與文字同寬。 + + + + Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text. + 勾選後文字框保持上方的高度,放不下的行會被截斷。不勾選時與文字同高。 diff --git a/sources/ui/dynamicelementtextmodel.cpp b/sources/ui/dynamicelementtextmodel.cpp index 90e0f089f..849ca44b0 100644 --- a/sources/ui/dynamicelementtextmodel.cpp +++ b/sources/ui/dynamicelementtextmodel.cpp @@ -48,12 +48,14 @@ static int font_txt_row = 5; static int color_txt_row = 6; static int frame_txt_row = 7; static int width_txt_row = 8; -static int height_txt_row = 9; -static int x_txt_row = 10; -static int y_txt_row = 11; -static int rot_txt_row = 12; -static int keep_rot_row = 13; -static int align_txt_row = 14; +static int width_fix_row = 9; +static int height_txt_row = 10; +static int height_fix_row = 11; +static int x_txt_row = 12; +static int y_txt_row = 13; +static int rot_txt_row = 14; +static int keep_rot_row = 15; +static int align_txt_row = 16; static int align_grp_row = 0; static int x_grp_row = 1; @@ -98,24 +100,36 @@ DynamicElementTextModel::~DynamicElementTextModel() } /** - @brief setSizeItems - Show the width and the height of @a deti: ticked with the size set - when it is fixed, not ticked with the size the field has now when it - follows the text, so that ticking it fixes what one sees. + @brief setSizeItem + Show one size of a text, width or height, on two rows: the value, and + whether it is fixed. Fixed, the value is the size set, and it can be + edited. Not fixed, the field follows the text: the value shows the + size it has now, ready to be fixed, and cannot be edited. + @param value : the row of the value + @param fixed : the row of the tick box + @param size : the size set, -1 when not fixed + @param now : the size the field has now */ -static void setSizeItems(QStandardItem *width, QStandardItem *height, DynamicElementTextItem *deti) +static void setSizeItem(QStandardItem *value, QStandardItem *fixed, qreal size, qreal now) +{ + if (!value || !fixed) + return; + const bool is_fixed = size > 0; + fixed->setCheckState(is_fixed ? Qt::Checked : Qt::Unchecked); + value->setData(qRound(is_fixed ? size : now), Qt::EditRole); + Qt::ItemFlags flags = Qt::ItemIsSelectable | Qt::ItemIsEnabled; + if (is_fixed) + flags |= Qt::ItemIsEditable; + value->setFlags(flags); +} + +static void setSizeItems(QStandardItem *text_qsi, DynamicElementTextItem *deti) { const QRectF box = deti->boundingRect(); - if (width) { - const bool fixed = deti->textWidth() > 0; - width->setCheckState(fixed ? Qt::Checked : Qt::Unchecked); - width->setData(qRound(fixed ? deti->textWidth() : box.width()), Qt::EditRole); - } - if (height) { - const bool fixed = deti->textHeight() > 0; - height->setCheckState(fixed ? Qt::Checked : Qt::Unchecked); - height->setData(qRound(fixed ? deti->textHeight() : box.height()), Qt::EditRole); - } + setSizeItem(text_qsi->child(width_txt_row, 1), text_qsi->child(width_fix_row, 1), + deti->textWidth(), box.width()); + setSizeItem(text_qsi->child(height_txt_row, 1), text_qsi->child(height_fix_row, 1), + deti->textHeight(), box.height()); } /** @@ -303,41 +317,45 @@ QList DynamicElementTextModel::itemsForText( qsi_list << frame << frame_a; qsi->appendRow(qsi_list); - //Width and height: ticked, the field keeps the size given beside - //it; not ticked, it follows the text, and the size shown is the - //one it has now, ready to be fixed - QStandardItem *width = new QStandardItem(tr("Width (fixed)")); - width->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); - width->setToolTip(tr("Ticked, the text field keeps this width and the text wraps inside it. Not ticked, it is as wide as the text.")); - - QStandardItem *width_a = new QStandardItem; - width_a->setCheckable(true); - width_a->setData(DynamicElementTextModel::textWidth, Qt::UserRole+1); - width_a->setFlags(Qt::ItemIsSelectable - | Qt::ItemIsEnabled - | Qt::ItemIsEditable - | Qt::ItemIsUserCheckable); - - qsi_list.clear(); - qsi_list << width << width_a; - qsi->appendRow(qsi_list); + //Width and height, each on two rows: the value, and whether it + //is fixed. Not fixed, the field follows the text and the value + //only shows the size it has now. + const struct { + QString name, fixed_name, tip; + int value_type, fixed_type; + } sizes[] = { + {tr("Width"), tr("Width fixed"), + tr("Ticked, the text field keeps the width above and the text wraps inside it. Not ticked, it is as wide as the text."), + DynamicElementTextModel::textWidth, DynamicElementTextModel::textWidthFixed}, + {tr("Height"), tr("Height fixed"), + tr("Ticked, the text field keeps the height above and the lines that do not fit are cut off. Not ticked, it is as high as the text."), + DynamicElementTextModel::textHeight, DynamicElementTextModel::textHeightFixed} + }; + for (const auto &size : sizes) + { + QStandardItem *name = new QStandardItem(size.name); + name->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + QStandardItem *value = new QStandardItem; + value->setData(size.value_type, Qt::UserRole+1); + qsi_list.clear(); + qsi_list << name << value; + qsi->appendRow(qsi_list); - QStandardItem *height = new QStandardItem(tr("Height (fixed)")); - height->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); - height->setToolTip(tr("Ticked, the text field keeps this height and the lines that do not fit are cut off. Not ticked, it is as high as the text.")); - - QStandardItem *height_a = new QStandardItem; - height_a->setCheckable(true); - height_a->setData(DynamicElementTextModel::textHeight, Qt::UserRole+1); - height_a->setFlags(Qt::ItemIsSelectable - | Qt::ItemIsEnabled - | Qt::ItemIsEditable - | Qt::ItemIsUserCheckable); - - qsi_list.clear(); - qsi_list << height << height_a; - qsi->appendRow(qsi_list); - setSizeItems(width_a, height_a, deti); + QStandardItem *fixed_name = new QStandardItem(size.fixed_name); + fixed_name->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + fixed_name->setToolTip(size.tip); + QStandardItem *fixed = new QStandardItem; + fixed->setCheckable(true); + fixed->setToolTip(size.tip); + fixed->setData(size.fixed_type, Qt::UserRole+1); + fixed->setFlags(Qt::ItemIsSelectable + | Qt::ItemIsEnabled + | Qt::ItemIsUserCheckable); + qsi_list.clear(); + qsi_list << fixed_name << fixed; + qsi->appendRow(qsi_list); + } + setSizeItems(qsi, deti); if(deti->parentGroup() == nullptr) { @@ -630,9 +648,8 @@ QUndoCommand *DynamicElementTextModel::undoForEditedText( quc->setText(tr("Modify the frame of an element text")); } - QStandardItem *width_item = text_qsi->child(width_txt_row, 1); - qreal text_width = width_item->checkState() == Qt::Checked - ? width_item->data(Qt::EditRole).toDouble() : -1; + qreal text_width = text_qsi->child(width_fix_row, 1)->checkState() == Qt::Checked + ? text_qsi->child(width_txt_row, 1)->data(Qt::EditRole).toDouble() : -1; if(text_width != deti->textWidth()) { QPropertyUndoCommand *quc = new QPropertyUndoCommand(deti, "textWidth", QVariant(deti->textWidth()), QVariant(text_width), undo); @@ -640,9 +657,8 @@ QUndoCommand *DynamicElementTextModel::undoForEditedText( quc->setText(tr("Change the width of an element text")); } - QStandardItem *height_item = text_qsi->child(height_txt_row, 1); - qreal text_height = height_item->checkState() == Qt::Checked - ? height_item->data(Qt::EditRole).toDouble() : -1; + qreal text_height = text_qsi->child(height_fix_row, 1)->checkState() == Qt::Checked + ? text_qsi->child(height_txt_row, 1)->data(Qt::EditRole).toDouble() : -1; if(text_height != deti->textHeight()) { QPropertyUndoCommand *quc = new QPropertyUndoCommand(deti, "textHeight", QVariant(deti->textHeight()), QVariant(text_height), undo); @@ -1394,6 +1410,18 @@ void DynamicElementTextModel::itemDataChanged(QStandardItem *qsi) QString text = qsi->data(Qt::DisplayRole).toString(); text_qsi->setData(text, Qt::DisplayRole); } + else if (qsi->data().toInt() == textWidthFixed || qsi->data().toInt() == textHeightFixed) + { + //The value can be edited as soon as it is fixed + const int row = qsi->data().toInt() == textWidthFixed ? width_txt_row : height_txt_row; + if (QStandardItem *value = text_qsi->child(row, 1)) { + Qt::ItemFlags flags = Qt::ItemIsSelectable | Qt::ItemIsEnabled; + if (qsi->checkState() == Qt::Checked) + flags |= Qt::ItemIsEditable; + if (value->flags() != flags) + value->setFlags(flags); + } + } else if (qsi->data().toInt() == infoText && deti->elementUseForInfo()) { QString info = qsi->data(Qt::UserRole+2).toString(); @@ -1582,7 +1610,7 @@ void DynamicElementTextModel::updateDataFromText(DynamicElementTextItem *deti, case textWidth: case textHeight: { - setSizeItems(qsi->child(width_txt_row,1), qsi->child(height_txt_row,1), deti); + setSizeItems(qsi, deti); break; } default:break; diff --git a/sources/ui/dynamicelementtextmodel.h b/sources/ui/dynamicelementtextmodel.h index fb2c38029..02d29a214 100644 --- a/sources/ui/dynamicelementtextmodel.h +++ b/sources/ui/dynamicelementtextmodel.h @@ -53,7 +53,9 @@ class DynamicElementTextModel : public QStandardItemModel rotation, keepVisualRotation, textWidth, + textWidthFixed, textHeight, + textHeightFixed, grpAlignment, grpPos, grpRotation, diff --git a/tests/qttest/text_fixed_size_probe.cpp b/tests/qttest/text_fixed_size_probe.cpp index 7cfeafb2d..f3e370896 100644 --- a/tests/qttest/text_fixed_size_probe.cpp +++ b/tests/qttest/text_fixed_size_probe.cpp @@ -2,9 +2,10 @@ // Width and height of a symbol's text, each fixed or not, linked against // the application's objects. // -// In the text's properties, "Width (fixed)" and "Height (fixed)" each -// carry a tick box. Not ticked, the field follows the text and shows the -// size it has now; ticked, it keeps the size beside the box. A fixed +// In the text's properties, width and height each take two rows: the +// value, and "fixed" with a tick box. Not fixed, the field follows the +// text, and the value shows the size it has now and cannot be edited; +// fixed, the field keeps the value, which can then be edited. A fixed // height cuts off the lines that do not fit, to shorten a text where // room is short: they are neither drawn nor picked. Both are saved with // the text and undone as any other change. @@ -70,29 +71,35 @@ int main(int argc, char **argv) text->setTextWidth(-1); text->setTextHeight(-1); - // The properties: not ticked, the size the field has now. + // The properties: not fixed, the size the field has now, read only. DynamicElementTextModel model(element); QStandardItem *width = cell(model, text, DynamicElementTextModel::textWidth); + QStandardItem *width_fixed = cell(model, text, DynamicElementTextModel::textWidthFixed); QStandardItem *height = cell(model, text, DynamicElementTextModel::textHeight); - check(width->isCheckable() && width->checkState() == Qt::Unchecked, "width not fixed: not ticked"); - check(height->isCheckable() && height->checkState() == Qt::Unchecked, "height not fixed: not ticked"); + QStandardItem *height_fixed = cell(model, text, DynamicElementTextModel::textHeightFixed); + check(width_fixed->isCheckable() && width_fixed->checkState() == Qt::Unchecked, "width not fixed: not ticked"); + check(height_fixed->isCheckable() && height_fixed->checkState() == Qt::Unchecked, "height not fixed: not ticked"); + check(!width->isCheckable() && !height->isCheckable(), "the values are rows of their own, without a tick box"); check(qAbs(width->data(Qt::EditRole).toDouble() - text->boundingRect().width()) <= 1, - "it shows the width the field has now"); + "the width shows the size the field has now"); + check(!(width->flags() & Qt::ItemIsEditable) && !(height->flags() & Qt::ItemIsEditable), + "and cannot be edited while not fixed"); - // Fix the width at 50: the text wraps onto more lines. + // Fix the width: the value can be edited at once; at 50 the text wraps. const qreal one_line = text->boundingRect().height(); + width_fixed->setCheckState(Qt::Checked); + check(width->flags() & Qt::ItemIsEditable, "ticking fixed makes the width editable at once"); width->setData(50, Qt::EditRole); - width->setCheckState(Qt::Checked); scene->undoStack().push(model.undoForEditedText(text)); - check(qFuzzyCompare(text->textWidth(), 50), "ticked, the width is fixed at the value beside it"); + check(qFuzzyCompare(text->textWidth(), 50), "fixed, the width is the value above"); const qreal wrapped = text->boundingRect().height(); check(wrapped > one_line * 2, "the text wraps inside it"); // Fix the height at one line: the other lines are cut off. + height_fixed->setCheckState(Qt::Checked); height->setData(qRound(one_line), Qt::EditRole); - height->setCheckState(Qt::Checked); scene->undoStack().push(model.undoForEditedText(text)); - check(qFuzzyCompare(text->textHeight(), qRound(one_line)), "ticked, the height is fixed"); + check(qFuzzyCompare(text->textHeight(), qRound(one_line)), "fixed, the height is the value above"); check(qAbs(text->boundingRect().height() - qRound(one_line)) < 0.01, "the field keeps that height"); const QPointF below(text->boundingRect().center().x(), wrapped - 2); check(!text->contains(below) && !text->shape().contains(below), "the lines cut off are not picked"); @@ -110,9 +117,10 @@ int main(int argc, char **argv) scene->undoStack().undo(); check(text->textHeight() < 0 && qAbs(text->boundingRect().height() - wrapped) < 0.01, "undo gives the text its full height back"); - check(cell(model, text, DynamicElementTextModel::textHeight)->checkState() == Qt::Unchecked, + check(cell(model, text, DynamicElementTextModel::textHeightFixed)->checkState() == Qt::Unchecked + && !(cell(model, text, DynamicElementTextModel::textHeight)->flags() & Qt::ItemIsEditable), "and the properties show it not fixed"); - width->setCheckState(Qt::Unchecked); + width_fixed->setCheckState(Qt::Unchecked); scene->undoStack().push(model.undoForEditedText(text)); check(text->textWidth() < 0, "not ticked, the width follows the text again"); check(!text->toXml(doc).hasAttribute("text_height"), "a height that follows the text is not written");