1

Topic: Text Box With Rounded Corners

Hello friends

What I want to do is add a text box. However, the edges of the frame should be rounded. Same as below:

Element.png: Edit The Element -> Text -> Property -> Frame

Text.png: Add A Textfield

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'STIX Two Text'; font-size:9pt; font-weight:400; font-style:normal;">
<table border="1" style=" border-color:#000000; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; border-collapse:collapse;" cellspacing="2" cellpadding="0">
<tr>
<td>
<p style=" margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px; -qt-block-indent:0; text-indent:0px;">QElectroTech</p></td></tr></table></body></html>

Whatever I did in the code above did not work or I lack information.

I would appreciate your help. Thank you very much.

Post's attachments

Attachment icon Element.png 10.91 kb, 6 downloads since 2025-04-06 

Attachment icon Text.png 9.48 kb, 7 downloads since 2025-04-06 

2

Re: Text Box With Rounded Corners

QElectroTech uses the RichText-Editor from Qt for Text-Fields.

"border-radius" is supported by plain html / css but not in RichText-Editor of Qt:
See here: https://doc.qt.io/qt-6/richtext-html-subset.html

As a workaround you may create an element with a rounded rect, place it in diagram and place a free text above it in diagram-editor...

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

3

Re: Text Box With Rounded Corners

Thank you @plc-user for your quick response. It helped me.