QTableWidget onCurrentItemChanged(QTableWidgetItem *cur, QTableWidgetItem *prev),When program started, prev is null
Unsolved
General and Desktop
-
- Environment
- OS: Ubuntu 20.04
- Qt -version 5.12.8
QTableWidget onCurrentItemChanged(QTableWidgetItem *cur, QTableWidgetItem *prev), When program frist starts, the address of prev is 0x0,how to handle with the problem?
QAQ
-
0x0 looks lile a wronged person or bear! ahaha
-
@echo_lovely
There is no "problem". First time it is called you are (presumably) changing from no current item (0x0
,nullptr
) to some current item. Perfectly reasonable? So do not try to accessprev->...
ifprev == nullptr
.