Solved QScrollBar no scrolling signal emitted from QTableWidget
-
QScrollBar no signal emitted from QTableWidget
connect(ui->tableTimes->horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(timeScrolled()));
What is done wrong?
Is it possible to catch sorting click of horizontal tab also?
-
This should work, please check if the connect is working correctly (it returns a bool) and show us some more code.
-
In mainWin.h
public slots: void timeScrolled();
.cpp
connect(ui->tableTimes->horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(timeScrolled()));
Also tryed insering items and connecting signal after scrollbar appeared on list.
No error of connect failed in log , but no signal emitted also when scrolling with mouse or dragging etc.
If needed il make empty project with minimal code. -
@Q139 said in QScrollBar no scrolling signal emitted from QTableWidget:
No error of connect failed in log
Which log? Such errors are printed to stdout. And did you now check the return value of the connect statement?
If needed il make empty project with minimal code.
This would be good, should be no more than 20 lines I would guess.
-
App output log, it usually displays if signals fail to connect to slots.
This is small(3kB) project to test:
https://easyupload.io/y9wopfreturn value of connect statement is 1
On disconnect 1 once then 0-es forever
-
There is no horizontal scrollbar in your example.
-
@Christian-Ehrlicher
Great...
I copied the connect code from internet , sligtly altered and didnot notice horizontal/vertical .
Thanks for pointing that out, you have made my day productive. -
@Q139 Then please mark this topic as solved, thx.