Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: QTreeWidget and SpinBox  (Read 169 times)

JAVH

  • Newbie
  • *
  • Posts: 2
    • View Profile
QTreeWidget and SpinBox
« on: January 07, 2019, 02:20:52 am »
Hi!!, sorry for this question that is newbie, recently i'm learning this Report generator and is amazing.

I have a QTreeWidget with a QDoubleSpinBox inside



In this topic topic i did learn how to send data from Widget to the report, I can send all, except the last field (SpinBox)

I did try with a casting sending value of SpinBox to a QAbstractItemModel

Code: [Select]
    LimeReport::ReportEngine *Ticket =new LimeReport::ReportEngine(this);
    Ticket->dataManager()->addModel("treeWidget",ui->TrWVenta->model(),false);
    QAbstractItemModel *ModCant;
    ModCant=dynamic_cast<QAbstractItemModel*>(ui->TrWVenta->itemWidget(Item,3));
    Ticket->dataManager()->addModel("Cantidad",ModCant,true);
    Ticket->designReport();

But in data manager I get only this (with red circle) and I cannot view any data



How can send data from QDoubleSpinBox to the report??

Thanks and sorry for my bad english!!

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 661
    • View Profile
Re: QTreeWidget and SpinBox
« Reply #1 on: January 07, 2019, 07:09:26 pm »
Hi!
Quote
Thanks and sorry for my bad english!!
I am not native speaker too :) If we can understand each other in my opinion this is enough :)
 
As i can see the field "Candidad" is present in the model that you sent to limereport.
As i guess you don't see the value of this field, isn't it?
I think the problem in your delegate item that represent field value as spinbox in the treewidget.
Possible it does not sending the value to the treewidget model.
 

JAVH

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: QTreeWidget and SpinBox
« Reply #2 on: January 12, 2019, 02:17:13 am »
Thanks, I can't sent value, SpinBox haven't model property and QTreeWidgetItem value (QSpinBox delegate) is in blank, only QSpinBox save the value but cannot send to report.

I did create another QTreeWidget and did copy all values to this, including SpinBox value, and sent this to LimeReport.

If there are a better way to do this I will be grateful.

Best regards.
« Last Edit: January 12, 2019, 02:19:53 am by JAVH »

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 661
    • View Profile
Re: QTreeWidget and SpinBox
« Reply #3 on: January 22, 2019, 12:28:04 am »
Just for example

solomon78

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: QTreeWidget and SpinBox
« Reply #4 on: January 24, 2019, 09:39:30 pm »
@Arin Alex, please is there any way I can run the report direct to PDF without going through the process of adding data band, headers on Lime Report Designer?

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 661
    • View Profile
Re: QTreeWidget and SpinBox
« Reply #5 on: January 24, 2019, 10:20:38 pm »
solomon78
I don't clearly understand what do you mean?
You can create a report pattern in the designer than save it to disk and print it to the pdf file.