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; +}