it appears that QTtableView has a property of wordWrap, but I cannot seem to find either the property on the tab, or by typing this.?
Does anyone know if you can set the wordWrap to FALSE using the cascading style sheet? Or with a fancy way to call QT properties that ETM has not exposed?
The reason that this is important is the S7Plus system alarms are long with a CRLF in the message and it looks terrible in the alarm banner and on the alarm viewer. We have a way to read the entire message on a special popup, but we need to watch for these alarms.
Thanks for any help
Todd Malone
table wordwrap
Search
- hpuchegger
- Posts: 86
- Joined: Fri Oct 08, 2021 10:38 am
Re: table wordwrap
Why should there be a wordWrap at all in the table?
Maybe you can check the string if it contains a \n which can be escaped / deleted?
Br, Herbert
Maybe you can check the string if it contains a \n which can be escaped / deleted?
Br, Herbert
Re: table wordwrap
the default for QT TableView is wordWrap = TRUE. I assume that we inherited that same property value.
Yes, I know that the messages have a CRLF in the message. Are you suggesting that I change the message? Do you happen to have an idea how that code would do that?
Seems easier to just force the wordWrap = FALSE and not worry about it.
Todd
Yes, I know that the messages have a CRLF in the message. Are you suggesting that I change the message? Do you happen to have an idea how that code would do that?
Seems easier to just force the wordWrap = FALSE and not worry about it.
Todd
-
- Posts: 161
- Joined: Mon Feb 23, 2015 1:34 pm
Re: table wordwrap
The "wordWrap" property cannot be accessed via stylesheets, Boolean values are not valid for properties so "wordWrap: true" will not work.
We would need to access the function "setWordWrap" which is not available in WinCC OA.
But even if you could change the wordWrap property it would not help you as this property handles "word-breaks" and not "line-breaks".
You can test it with a small Python program using QT where you insert a table, call ".setWordWrap(false)" and try to insert a text with line breaks into the table. The text will still be multiple lines even with "wordWrap=False";


Also the table widgets in WinCC OA do not wrap a long text that has word breaks but not line breaks, indicating that wordWrap is actually already set to False.
(tested in WinCC OA 3.18 P14)
PS: I still tried to change the property with stylesheets but I did not work:
We would need to access the function "setWordWrap" which is not available in WinCC OA.
But even if you could change the wordWrap property it would not help you as this property handles "word-breaks" and not "line-breaks".
You can test it with a small Python program using QT where you insert a table, call ".setWordWrap(false)" and try to insert a text with line breaks into the table. The text will still be multiple lines even with "wordWrap=False";


Also the table widgets in WinCC OA do not wrap a long text that has word breaks but not line breaks, indicating that wordWrap is actually already set to False.
(tested in WinCC OA 3.18 P14)
PS: I still tried to change the property with stylesheets but I did not work:
Code: Select all
QTableView {
wordWrap: False;
}
Also tried with different widget names: QAbstractItemView and TableQT
and different property values: false, False, FALSE, and 0
-
- Posts: 373
- Joined: Tue Jan 15, 2019 3:12 pm
Re: table wordwrap
It needs to be prefixed with 'qproperty-' to tell that a Qt property needs to be set, so this might work:
Code: Select all
QTableView
{
qproperty-wordWrap: false;
}
-
- Posts: 161
- Joined: Mon Feb 23, 2015 1:34 pm
Re: table wordwrap
This is interesting as the "qproperty-xxx" syntax does seem to be recognized correctly.
Example: If I write the property name wrong I get an error message in the log which I don't get if I write it correctly.
But it does not change the behaviour of the table. "wordWrap" seems to be already false as no text is wrapped and changing the property to "true" does not change anything.
Maybe this is a bug?
Example: If I write the property name wrong I get an error message in the log which I don't get if I write it correctly.
Code: Select all
TableQT {
qproperty-wordwrap: true;
}
WCCOAui1:WCCOAui (1), 2024.11.27 10:49:17.844, Qt, TableQT(0x23460912920, name="TABLE1") does not have a property named "wordwrap"
Maybe this is a bug?