Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. delete
    Log in to post

    • SOLVED Check if a pointer was deleted in Qt for GUI Application
      General and Desktop • delete pointer • • SpaceToon  

      7
      0
      Votes
      7
      Posts
      209
      Views

      @SpaceToon said in Check if a pointer was deleted in Qt for GUI Application: Thank you very much, that worked! Do you mean just replacing delete with deleteLater()? It would be discoveryAgent->deleteLater(); Check out the documentation under the given link in my post.
    • UNSOLVED Apagar conta
      Portuguese • delete account • • deleted37  

      2
      0
      Votes
      2
      Posts
      300
      Views

      Olá @Seph123. Infelizmente essa funcionalidade não está diretamente disponível para nós. Eu recomendo que você encaminhe um e-mail para qtaccount@qt.io.
    • SOLVED How to delete the objects from QMap?
      General and Desktop • qmap delete deletelater qdeleteall • • Yash001  

      5
      0
      Votes
      5
      Posts
      1223
      Views

      @mpergand Thank you for help.
    • SOLVED can I assign another object after using deleteLater(); funcation?
      General and Desktop • qfile delete deletelater • • Yash001  

      3
      0
      Votes
      3
      Posts
      267
      Views

      @koahnig thank you.
    • SOLVED How to properly delete a dynamically created pushbutton from a UI form?
      General and Desktop • delete push button customplugin dynamically ui-setupuithis • • Sh1gs  

      5
      0
      Votes
      5
      Posts
      5608
      Views

      Thank you @mrjj I will go ahead and mark this as solved then. I know my IP Editor isn't exactly elegant, but with the requirements I'm given and the restrictions, I've done the best I can.
    • SOLVED IP Editor popuppad Delete not clearing LineEdit
      General and Desktop • plugin delete keypressevent ip editor backspace • • Sh1gs  

      13
      0
      Votes
      13
      Posts
      2697
      Views

      @mrjj I've changed it to check if it's in the first edit, to stop the timer so it'd look like 123.___.___.___ And then the user will have to manually hit "Delete" repeatedly to delete the characters. This way, the program doesn't crash. It's not exactly elegant, but it's close enough to the requirements I was given. I have also changed that curEdit->installEventFilter(this) is only called once. Thank you very much for your help, I will go ahead and mark this as solved.
    • SOLVED Clarification on deleting layouts and widgets within them
      General and Desktop • qwidget qlayout delete runtime qlayoutitem • • Sh1gs  

      5
      0
      Votes
      5
      Posts
      2405
      Views

      No, it doesn't. The QLayoutItem is not the parent of the widget, it is not a QObject. That's not its job.
    • UNSOLVED QListWidget delete selected item
      General and Desktop • qlistwidget delete qlistwidgetitem removerow delete row • • testerius  

      7
      0
      Votes
      7
      Posts
      15653
      Views

      @kishore_hemmady said in QListWidget delete selected item: how can i achieve this by selecting the check Box rather than selecting the list content? for(int i=ui->listWidget->model()->rowCount()-1;i>=0;--i){ if(ui->listWidget->model()->index(i,0).data(Qt::CheckStateRole).toInt()==Qt::Checked) ui->listWidgetMy->model()->removeRow(i); }
    • UNSOLVED Qt3DWindow inside WindowContainer crash when deleted
      General and Desktop • qt3d crash delete qt3dwindow container • • Keyos  

      4
      0
      Votes
      4
      Posts
      2125
      Views

      @Keyos I meet the same problem,and when i launch my app,the memory usage become 50% even the dialog is not actived,maybe the next release will be better.
    • SOLVED qt application closed, a message error of microsoft appear
      General and Desktop • application delete ui object • • cdcc0606  

      8
      0
      Votes
      8
      Posts
      1482
      Views

      I've found the problem it is a process deleted without initialized.
    • UNSOLVED Delete a selected folder and all sub folders in QTreeView
      General and Desktop • qtreeview qt5.6 delete qfilesystemmode removerow • • Punit  

      4
      0
      Votes
      4
      Posts
      1682
      Views

      That wasn't really clear from your original description. In that case, use a filter. QSortFilterProxyModel for example
    • SOLVED Delete only one file from Folder Documents
      General and Desktop • file delete qdir • • HenrikSt.  

      5
      0
      Votes
      5
      Posts
      1619
      Views

      @panosk Thanks it works :) Henrik
    • SOLVED Clean QList for QMLListProperty
      General and Desktop • qlist delete clear qdeleteall qmllistproperty • • Alart  

      3
      0
      Votes
      3
      Posts
      1704
      Views

      However I did certainly what you said that was only little part. Thank for your answer, without it I would only find a way around this issue probably. (like 2 parallel QLists) So what works? I make additional QObject with parent "this (list of lists)". Then I make it parent of every QObject I want to delete (QObjects with list and QObjects within lists). I don't change CppOwnership. After that I clear() list and add new QObjects (obsolete QObjects stay accessible as children of that additional QObject). After final emit I delete that QObject with deleteLater(). QPointer isn't necessary here I think. I tried deleteLater in another way of doing things and it crashed, so that is the only way I found. My application deletes QObject and all children with it. With neither crash or leak. QObject * delQObject = new QObject (this); set_parents_list(delQObject ); m_list_of_listQobjects.clear(); for () m_list_of_listQobjects.append(new listQobject); emit m_list_of_listQobjectsChanged(m_list_of_listQobjects()); delQObject->deleteLater(); where: listoflistsofQObjects :: set_parents_list(QObject * parent) { for (int i = m_list_of_listQobjects.count(); i>0; i--) { m_list_of_listQobjects[i-1]->setParent(parent); m_list_of_listQobjects[i-1]->set_parents_list(parent); } } Following function isn't necessary if QObjects already have parent that is deleted (like listofQObjects or some QObject inside it). It's safer to make elements children, because then one doesn't need to call deletes in destructor. listofQObjects :: set_parents_list(QObject * parent) { for (int i = m_list_ofQobjects.count(); i>0; i--) { m_list_ofQobjects[i-1]->setParent(parent); } } I don't know if is it "right way", I even found here somebody uses my earlier version with additional list (but it's unsafe for sure). The best explanation how to manage memory in qt I found here. If there is better way to do so, please share.
    • SOLVED how to stylesheet delete?
      General and Desktop • stylesheet delete • • ForestPoem  

      5
      0
      Votes
      5
      Posts
      1226
      Views

      @Chris-Kawa thank you .
    • SOLVED how to remove Item in Qtablewidget?
      General and Desktop • qtablewidget memory item delete free • • ForestPoem  

      6
      0
      Votes
      6
      Posts
      5562
      Views

      Using setText will avoid useless delete/allocation of items.
    • UNSOLVED how to remove Item in Qtablewidget?
      General and Desktop • qtablewidget item delete • • ForestPoem  

      3
      0
      Votes
      3
      Posts
      1469
      Views

      When you set the item, The table takes ownership of the item. So just deleting the tableWidget should satisfy. If you want to selectively delete, what you are doing should be good enough.
    • [solved] Delete all Items from Layout
      General and Desktop • layout delete all items • • QT-static-prgm  

      7
      0
      Votes
      7
      Posts
      7754
      Views

      @mrjj yes debugging the whole destructor are many steps. My F11 key is still blazing. ähm and it's afternoon for me :D but thanks
    • QObject delete order in multi-threaded application
      General and Desktop • threads parent delete destroy • • s.frings74  

      4
      0
      Votes
      4
      Posts
      1533
      Views

      @SGaist said: Hi, @SysTech : deleteLater won't remove things when the thread is done, but at the next event loop iteration. Thanks. I wasn't exactly sure when it deleted it but good to know!
    • How to clear or delete Image in QML
      QML and Qt Quick • qml qt quick image map delete • • halil sogut68  

      2
      0
      Votes
      2
      Posts
      2625
      Views

      Hi @halil-sogut68 if you meant in Image then setting source to blank (i.e "") will remove that image.
    • Correct way to free up QTcpSocket* when connecting fails
      General and Desktop • qtcpsocket memory leak delete piping • • nickaein  

      4
      0
      Votes
      4
      Posts
      5908
      Views

      Hello, Few issues with Your code: QThread constructor moveToThread( this); is error. QThread class is just control object and is not actually a separate thread. You should move class base on QObject (with would be wrapper for QTcpSocket communication) or QTcpSocket to separate thread. 2.. Don't know if this is Ui application but You are using blocking approach (may be ok for Your case) Error handing : connect (QTcpSocket, SIGNAL( error(QAbstractSocket::SocketError socketError)), this, SLOT( error(QAbstractSocket::SocketError socketError))); to handle connection error. Close socket via QTcpSocket::close() or abort() + close()
    • [solved] How to properly delete a QLayoutItem from the layout
      General and Desktop • qwidget qlayout delete qlayoutitem • • A Former User  

      5
      0
      Votes
      5
      Posts
      3556
      Views

      Yay, that's what I was looking for. Thanks!