The query values are not displayed in BlComboBox. QT4

0

I can not get a BlCombobox to show me the values of a query. I've done it like others in the code and nothing, I do not know what can happen.

interval_date.h

#ifndef INTERVALOFECHAS_H
#define INTERVALOFECHAS_H

#include "blcrear.h"
#include "tsystem.h"
#include "blhelp.h"
#include "pdefs_plugin_pro.h"
#include "ui_intervalo_fechasbase.h"
#include "blgenericcomboboxdelegate.h"
#include "blcomboboxdelegate.h"

class PLUGIN_PRO_EXPORT IntervaloFechas
        : public BlCrear
        , public Ui::IntervaloFechasBase
{
    Q_OBJECT
public:
    IntervaloFechas();
    ~IntervaloFechas();
    //void combo();
    void on_mui_aceptar_clicked();
public slots:
    void imprimir_resumen_global();

private slots:
    void on_mui_cancelar_clicked();
};

#endif

interval_date.cpp

#include "intervalo_fechas.h"

IntervaloFechas::IntervaloFechas()
{
    BL_FUNC_DEBUG;
    try{

        setAttribute(Qt::WA_DeleteOnClose);
        setupUi(this);

        mui_id_tipo_proto->setMainCompany(mainCompany());
        mui_id_tipo_proto->setQuery("SELECT id,concepto FROM pro.tipo_proto");
        mui_id_tipo_proto->setFieldId("id");
        mui_id_tipo_proto->m_valores["concepto"]= "";
        mui_id_tipo_proto->setAllowNull(true);

    } catch(...) {
        g_s->msgError(_("No se pudo abrir la ventana %1.").arg(metaObject()->className()), this);
    }

}

IntervaloFechas::~IntervaloFechas()
{
    BL_FUNC_DEBUG;
   // En el caso de querer usar esta venta para otros estados, seria ahcer un CASE y en el Ui, pasarle valor donde pone "Revisar" para que ponga el estado del case en el label.

}
void IntervaloFechas::on_mui_aceptar_clicked()
{
    g_s->msgError("generar informe");
    close();
}


void IntervaloFechas::on_mui_cancelar_clicked()
{
    close();
}

interval_date.ui

<item>
         <widget class="QLabel" name="label">
          <property name="maximumSize">
           <size>
            <width>50</width>
            <height>50</height>
           </size>
          </property>
          <property name="text">
           <string>Tipo</string>
          </property>
         </widget>
        </item>
        <item>
         <widget class="BlComboBox" name="mui_id_tipo_proto" native="true"/>
        </item>
        <item>
         <spacer name="horizontalSpacer_3">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </property>
          <property name="sizeType">
           <enum>QSizePolicy::Fixed</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
            <width>10</width>
            <height>20</height>
           </size>
          </property>
         </spacer>
        </item>
       </layout>
      </widget>
     </item>

Query Values:

1;"Prototipo"
2;"Madera"
3;"Metacrilato"
4;"Utillajes"
5;"Test Prototipos"

From the designer, he does not let me promote anything, and he does not get me any errors neither by debug nor by console.

In the other Blcombobox delegate examples in the code, no promos or anything is done. I do not understand how it does not show me the values in the drop-down.

Any help will be well received, thank you very much.

    
asked by user3158502 17.10.2018 в 10:26
source

1 answer

0

It is already fixed I still had to add in the cpp where I declare the blcombobox the line mui_id_tipo_proto-> setId ("");

    
answered by 18.10.2018 / 16:02
source