PDA

View Full Version : disable tslib support without reconfiguring Qt



raman_31181
22nd September 2008, 15:06
I have a QT application here where I have a QTableWidget of a certain colour(white).
Now when I touch the table with stylus the colour of the tablewidgetitem changes, which I dont want.I have Qt configured for tslib support ....I am not using tslib since I already have the coordinate data of the touchscreen.Is there any way to disable tslib support other than ,of course, reconfiguring Qt.

QbelcorT
23rd September 2008, 04:12
Hi,
Maybe this function will help you. It should release the mouse grabbing abilities.QWidget::releaseMouse()

raman_31181
23rd September 2008, 06:34
Unfortunately this function seems to have no effect......There must be a way to disable tslib without reconfiguring Qt......

QbelcorT
23rd September 2008, 10:57
Hi.
From your comment "Now when I touch the table with stylus the colour of the tablewidgetitem changes" I understand that you need the touchscreen support because you are using a stylus, you just don't want the mouse to grab on that widget. Is that correct? Correct me if I am wrong I don't think you want to disable the tslib support, just the mouse support on that item.
Might help if you post your widget code, where are you invoking that function - ungrabmouse?

raman_31181
23rd September 2008, 12:09
Hi,

My apologies for having caused any confusion...
I reconfigured Qt without tslib support this time and updates the libs on the board.
The scenario is I have a page whcih has a Qtablewidget and a set of QPushButtons.I have a touch screen here with an in built linux driver which gives me coordinate data.I am not using any clicked events in my code as such....I am just polling the touch screen cordinate data on a regular basis.....

The problem is when I touch any section within the table the colour of the table contents changes .......Even when I touch the buttons their colour also changes....its like these widgets are responding to mouse click events which is not what I want....I am not using mouse here.....You are right I want to disable mouse clicks on that widget but also tslib since I dont need it anyway...

Regarding the function you had referred to I have attached my code here...look in the createPumpStatusTable function....

QbelcorT
24th September 2008, 04:45
Hi,
I also tried the mouseRelease function and it did not work, I looked into it a bit more , if you read the QWidget::grabMouse() description it says that mouse events are automatically grabbed in a widget. Without knowing the details of your implementation, here are some other suggestions.
Look in the QWidget Class Reference, you may have two choices.
#1 - disable the widget using QWidget::setEnabled - setting the value to false will disable the widgets - any events to that widget. Not sure if this will have a side effect to your functionality to that widget.
#2 - reimplement the virtual function QWidget::mousePressEvent and just ignore any mouse events from there. This may be safer.
Good luck.

raman_31181
24th September 2008, 11:14
The QWidget::setEnabled function seems to have done the job, at least for the tables.The numberings of the tables have hidden but thats not a problem...
Thanks for the help...