Home > Mobile > QTableWidget built-in custom controls in the location problem
QTableWidget built-in custom controls in the location problem
Time:09-18
Soon I contact QT libraries, encounter the following problems in the practice, As shown, the third column in the QTableWidget embedded is custom object (the combination of the three buttons, delete, up, down), through the three buttons to achieve the corresponding function, but can't locate the point in using line button, Found on the Internet is shown in figure 2, the method of sender () object location of emission signal, and then through the button. The pos (), and the self. The indexAt () to locate the line, but actually found when using the button. The pos () returns the position is relative to its parent control TableBtnGroup control, so these buttons to locate through indexAt line, if the common QPushButton does not exist the problem, I want to know that I still have what method can locate the button's line number?
CodePudding user response:
MapToParent can don't know,, Or directly to reload button (or put a button that controls) to write a line number in the button id, signal all received the same slot function outside, judging by the id which line detection is?