QtableView extract data without selection - qt

I am using a qtableview and i would like to extract all the visible column
I cannot use the model because some columns are hidden
and I do not have a selection.
Thanks for your answer

You can test if column is hidden: QTableView::isColumnHidden(int column)

Related

IcCube Reporting V8 : Multi Header Pivot - Conditional Color expression

Using IcCube Reporting V8, I want to do conditional colors in the cells of a pivot column, the problem is that I can't identify this column when there are multiple header levels :
In the sample below, I want to identify the column "Interventions/Evolution"
Picture below shows that $_currentColumn.mdxName$ reports only the 1st row header text "Interventions" even though the current column mentions the complete one "Interventions, 2019":
How can I catch the complete column name in order to apply conditional colors ?
The Current Column selection menu in the expression editor sets the currentColumn only for the editor (so you can test the expression). The transformation itself runs on all the selected columns where each iteration the currentColumn changes.
There are two ways to apply a conditional color transformation to a single column from the table.
Set the columns option of the transformation to only the "Interventions/Evolution" column.
Set the columns option to All Columns and use the following expression:
if ("$_currentColumn.caption$".startsWith("Interventions")) {
return "blue";
}
return "purple";

BIRT report: dynamically adding columns to a table based on dataset data

In my report, a table is displaying results from a dataset and it has 6 columns.
But sometimes the dataset returns more than 6 columns depending on the report parameters.
So I need a way to dynamically add columns to my table
Thanks
I'd do it the other way round.
The number of the columns in the query is fixed anyway (for example: FIXED_A, FIXED_B, DYNCOL01, ..., DYNCOL20).
In the layout, your table should have columns for all columns (FIXED_A to DYN_COL20).
Clear the table's width. Set a fixed width for the fixed columns (with enough room left for the dynamic columns). Clear the width of all dynamic columns.
From now on, do not resize and column with the mouse, because this would set individual widths for each column again.
In your table properties, add aggregate bindings for each DYN_COLnn using the MAXIMUM function (let's call these MAX_COL01, ..., MAX_COL20).
For each columns, use a visibility expression like this (the number matching the layout column to the query column accordingly), e.g. for the first dynamic column:
!!row["MAX_COL01"]]
The !! means basically: interprete this as boolean, so the result is: show this column only if MAX_COL01 is not null - or in other words: if DYN_COL1 is not empty in any of the rows.

Calculate a value for a column in a WebGrid

I'm trying to calculate a column value using two properties of the DataSource.
This is my column:
grid.Column(header:"Duration", format:#<text>#{((TimeSpan)(item.EndTime - item.StartTime)).TotalMilliseconds}</text>)))
I keep getting an HTTPCompileException when I try to navigate to this grid. Why is it unhappy with this?
Needed to remove the {} from the format block.

How to make RDLC report two column

I have a simple report which is supposed to be used for printing stickers. The sticker paper is A4 size and it has two columns. I successfully managed to print data to left column. I also want to print data to right column too. My current report looks like this :
[Title]
[NameLastName]
[Address]
How can I make my report to fill data to two columns? Thanks.
EDIT :
I have generated another column as suggested in other questions. But the result is still one column, Can anyone tell me the next step?
The simplest way to do it [I think] is to:
add additional "columnNumber" column and make it "1" for, say, all odd rows and "2" for all even rows.
then place two tables side by side and make the same DataSetName property for both of them
then filter the data in each table based on the columnNumber Value (add Filter to Filters property of the table)

Table and List view with single Model in Qt

I have a 2D model where each row represents a frame in a video, and each column represents an object. The object can have different states on each frame, and this is stored in the model. Then I have a QTableView that shows this data. The model has header data, so each row has a header like "frame k" and each column has a header like "object n". This table is editable. But I want the user to edit it another way. The other way is a graphics view that shows a single frame. Below the graphics view is a list (oriented horizontally) that represents each frame. This way the user can click on a frame in the list and the graphics view now displays that frame.
The problem is that the list displays the first column of each row in the model. What I want it to do is show the header of each row instead (so the list says "frame 1, frame 2, etc"). Is there a way to do this?
Two possible solutions:
Try to use a proxy model (a subclass of QAbstractProxyModel) which accesses row headers as columns in a single row. Not trivial because the proxy model displays as data what the original model considers to be header.
Display a second 2D view of your model, but hide everything except for the column headers. Since your frames are rows, you'll need a proxy model to transpose between rows and columns.
DISCLAIMER: I did not actually implement any of the solutions.

Resources