English 中文(简体)
当项目部件关闭时, Get QListWitPhart 项目被删除
原标题:Get QListWidgetItem deleted when it s itemWidget get closed
  • 时间:2012-05-25 01:50:46
  •  标签:
  • qt4
  • qt4.8

当部件(我使用 setThemitoffice () ) 被 关闭() ?

现在,我通过行号 并信号返回主窗口, 这将逐行删除项目, 但听起来很愚蠢。

问题回答

您是否想要删除 QListWidact. close () 上的所有项目? 让我们试试这个

list = MyListWidget.items();
qDeleteAll(list.begin(), list.end());
list.clear();

关闭 Event () 。 必须从 QListParty 创建您自己的部件以重新执行\\\ use protected 方法 。





相关问题
Qt (Creator) with WinSocks (ws2_32)

I want to use an older code-fragment in my Qt-project, which is using WinSocks. I created my program with Qt Creator and I don t know, how I can link to the ws2_32-Library. I already added LIBS += -...

Drag & drop with .ui files

I m having big troubles with drag & drop. I ve created a new Qt Designer Form Class in which I have one QListWidget and one QWidget. Now I want to enable dragging & dropping between these two ...

PRECOMPILED_HEADER and Subdirs template on Qt

I have a big Qt project, splitted on several static libraries (around 70) and one application, and for that I m using a .pro file with the subdirs template. To speed up the compilations time, I want ...

how do i place QTableWidgetItem Icon in center of cell

i want a table cell to have just an icon without any text. i see the QTableWidgetItem class has a method to align the text (int QTableWidgetItem::textAlignment () const) i find no way to adjust the ...

Showing two windows in Qt4

My friend and I have each created parts of a GUI using Qt 4. They both work independently and I am trying to integrate his form with the my main window. As of now this is the code I am using to try ...

Hiding a QWidget on a QToolbar?

I have directly added some QWidgets to a QToolbar but simply going widget->setVisible(false) did not work. Can someone please give me an example of how to show and hide a widget that is on a QToolbar? ...

热门标签