I have a QPlainTextEdit and whenever I select some text, there is empty space between the adjacent selected lines (see image below). I suspect that this is related to the line height, but so far I haven't been able to find a solution. Any suggestions?
For reference, I'm using Qt 5.15.0 on Mac.
Related
In Xamarin.Forms the TailTruncation mode for labels works fine for single lines of text.
We can also force the TailTruncation to happen at the 2nd or 3rd or Nth line, if we know in advance the lenght of the text, using a custom renderer like this one: Depechie MultilineLabel .
But what I really need is a TailTruncation that works even when I don't know in advance how many lines of text will fit in a label.
If the height of my Label changes, and so the number of lines of text that can fit in it, I want the TailTruncation happens at the end of the available space. Not at the line before and neither at the line after.
How can I get TailTruncation happens when the text meets the limit of the available word wrap space inside the Label bounds?
Is there a custom renderer trick that allows to calculate the number of lines that fit inside the bounds and set the TailTruncation line number accordingly (on both iOS and Android)?
Thanks in advance.
I'm trying to create a BIRT report. The code and query side of it works just fine, but the display is rather wonky.
There's one column whose text contents are rather long, and instead of showing some text and allowing scrolling of the text (which is the behavior I'd like there), it simply shows up as a very vertically long text block; kinda ruins the report a bit. I've also tried setting the width on the column, but no dice there either. Any ideas?
Also, as an aside, how do I get the table's columns to have grid lines? I can do that on the rows, but I can't seem to figure out how to do that for the columns. If anyone has insight into that issue, it'd be appreciated.
Here's a screenshot of the issue
Here's my BIRT report XML, without headers and footers in order reduce characters
I think there is no way to use a scrollable view element inside your report, because the output by the default html-emitter is completely static (I would like to see a different answer if this should be wrong).
To your second Question about how to add a border to a column. Click into the cell of your table, click on "Border" inside the "Properties Editor" and select the borders you like to use. This should be repreated for all cells where you want to use the borders, because this configuration is not applied for a whole column but just for one cell. If you want a border for the whole column you need to setup the border for every cell in the column.
If you have already a data cell inside your table cell, you can use the outline view to select the table cell instead of the data cell:
I have a QTreeView on my window and I want to set the following behaviour: columns width must be set to resize to contents, which I have done like this:
tabla->header()->setResizeMode(QHeaderView::ResizeToContents);
Now, what I need to do is set rows to only 1 line, so, if a column contains '\n', they should not be displayed (I have a detailed description dialog to see that).
To sum up, I need to set something like "no multiline" on my treeview.
Any help would be appreciated.
I'd rather not extend qtreeview, since I have a lot of thems and wouldn't like to change them all, but if that's what it takes...
QTreeView seems to ignore the newlines in contents when uniformRowHeights is true (seen with Qt-4.8)
This not documented, so normally it shouldn't be relied upon. It would be best to remove the newlines or replace them with spaces when populating the treeview.
Also, I've noticed an exception: if there is only one row in the treeview and it contains a newline, then it gets displayed in two lines, regardless of uniformRowHeights.
I entered one space as a QLineEdit's text in the Qt Creator GUI Designer. I can see that the space is there in the designer wiew, but if I compile and run it, the space disapears. I want this space to be a QLineEdit's default text, how can set it, or tell Qt to do not delete that one space?
My guess is that space disappears because UIs are stored as XML and nodes consisting only of whitespace are strippd (see this question).
But you can set the space to the QLineEdit in the window's constructor:
ui->lineEdit->setText(" ");
If what you want is to have a default text when the widget is empty, use the setPlaceholderText(QString)
If you want to just set a initial value, then do it in the constructor of your app/widget/class with setText(QString)
I have a report which was created using Microsoft Reporting in VS2010. It has labels which must display any text in single line. But it appears that if I don't set the label's height precisely correct, then the text will be displayed in lines bellow if it doesn't fit in a single line. I haven't found a property that enforces single line on labels. What are the ways to enforce single line except setting proper height?
Seems to be no other solution except setting CanGrow = false and guessing the correct label height.