How to delete widgets from Qvboxlayout



  • Hi friends,

              i am facing the one issue,,how to delete all widget from qvboxlayout in Qt,,After deleteing the widget i need to add some widget in the same Qvboxlayout,,now i delete the widget from Qvboxlayout,,and after that i add the new widget means Qvboxlayout take more spaces between the two widgets,, In below i added the code for deleting the widget from layout
    

    @QLayoutItem* item;
    while ( ( item = rightui->listLayout->takeAt( 0 ) ) != NULL )
    {
    if (item->widget()) {
    qDebug() << "item widget: " << item->widget();
    delete item->widget();
    }
    delete item;
    }@
    Please Give me a good solution for this,,,Thanks


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.