Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions

QVBoxLayout and QCheckBox



  • @else if(ZERO == qstrncmp(ExitFromNet.toHex().data(), NewDatagram.left(FOUR).data(), ExitFromNet.size()) )
    {
    if (MainWin::IpHostTbl.contains(SndrIp) )
    { THash::iterator iter = IpHostTbl.find(SndrIp);
    MainWin::IpHostTbl.erase(iter);
    QCheckBox* ForRemove = this->LstUser->VBoxLt->findChild<QCheckBox*>(QString(NewDatagram.remove(ZERO, FOUR)) );
    this->LstUser->VBoxLt->removeWidget(ForRemove);
    delete ForRemove;
    this->LstUser->VBoxLt->update();
    }
    }
    @

    Why not delete ForRemove from VBoxLt ? children->count() = 0 ? But in VBoxLt is have QCheckBox* - in screen OS(win7) is show. How I can delete?


  • Qt Champions 2017

    checkBox is not a child of VBox. Probably your program should be crashing. You should use index method of layout to get the pointer to checkbox and remove it.


Log in to reply