How to add space to QLabel
-
-
@Bharth Set this to false: https://doc.qt.io/qt-5/qlabel.html#wordWrap-prop
-
thank you so much now woking fine
one more doubt please help me
how to delete entire row i gave popUp option next to message like copy,edit,delete -
@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?
-
i have to delete message from listwidget(selected message should delete)
ex: hi message is in above list right,,i have to delete that one -
@Bharth I'm sure you can. How exactly depends on how all this is implemented. Where are these QLabels inserted?
-
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 ?
-
we can directly insert meassage to Qlistwidget,,,for server integration, we must need qlist object to save datas from server. so i created separate cell for sender side and reciver side then i added these to Qlistwidget
-
@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
6/10