How to add space to QLabel
-
@Bharth Set this to false: https://doc.qt.io/qt-5/qlabel.html#wordWrap-prop
-
@Bharth said in How to add space to QLabel:
how to delete entire row i gave popUp option next to message like copy,edit,delete
Sorry, I don't understand. What row do you want to remove and from where?
-
in Qlistwidet,,,, i created separete widget class for label then im adding that to qlistwidget,,,
this is the class for qlabel and for copy ,edit im passing string but what to pass for delete entire row
..................................................
connect(pCopyText, &QAction::triggered, this
{
(dynamic_cast<ChatPage*>(m_pParentWidget))->copyText(p_mstr);
});
connect(pDeleteText, &QAction::triggered, this
{
(dynamic_cast<ChatPage*>(m_pParentWidget))->deleteText();
});
connect(pEditText, &QAction::triggered, this
{
(dynamic_cast<ChatPage*>(m_pParentWidget))->editText(p_mstr);
}); -
Hi,
Why are you using QLabel if you have a QListWidget anyway ?
-
@Bharth I think what @SGaist wants to say is that you already can add text entries to a QListWidget without the need to create QLabel (see https://doc.qt.io/qt-5/qlistwidget.html#addItem and https://doc.qt.io/qt-5/qlistwidget.html#addItems). So, still not clear why you create and insert QLabel instances.
To remove a row use https://doc.qt.io/qt-5/qlistwidget.html#takeItem