Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED]Destruct and rePaint a widget

[SOLVED]Destruct and rePaint a widget

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vetryaspa
    wrote on last edited by
    #1

    Hi all,

    I have a problemi for "reload" a widget follow the code:

    @#include "Imigliori/imigliori.h"
    #include "ui_imigliori.h"
    #include "CineticList/listawidget.h"
    #include <QDebug>
    #include <QVBoxLayout>
    #include <SQLInteraction/sqlinteraction.h>

    IMigliori::IMigliori(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::IMigliori)
    {
    ui->setupUi(this);

    connect(ui->gamberi,SIGNAL(clicked()),this,SLOT(gamberi()));
    
    showLista = new QLinkedList<Ristorante*>();
    QString query("Select * From ristoranti where FORCHETTE = 3");
    showLista = SQLInteraction::instance()->queryRequest(query);
    lista = new listaWidget(showLista,this);
    lista->setGeometry(0,100,360,500);
    

    }

    IMigliori::~IMigliori()
    {
    delete lista;
    delete ui;
    }

    void IMigliori::paintEvent(QPaintEvent *event){
    qDebug()<< "PAINT EVENT IMIGLIORI";

    }

    void IMigliori::gamberi(){
    qDebug("Pulsante Gamberi()");
    delete lista;

    QString query("Select * From ristoranti where GAMBERI = 3");
    showLista = SQLInteraction::instance()->queryRequest(query);
    lista = new listaWidget(showLista,this);
    lista->setGeometry(0,100,360,500);
    

    // lista->update();
    }
    @

    in the construct I create the Widget "lista" that i have declared in the .h file.

    but i have to change it if i click the Button "ui->gamberi" but when i click the button the widget was deleted but was not rePaint however the construct of the widget "lista" was call.

    What is my error?

    Regards

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Vetryaspa
      wrote on last edited by
      #2

      Solved with a reload method implement in the list widget that cange the item to load!!! :)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved