天嵌 ARM开发社区

 找回密码
 注册
查看: 1997|回复: 4

关于qtopia的Qtable中clicked信号问题

[复制链接]
今夜私奔 发表于 2012-5-4 03:06:15 | 显示全部楼层 |阅读模式
先说下我的系统信息,TQ2440,用的都是天嵌公司自带的内核,BOOTLOADER,和QTOPIA版本。
今天碰到一个问题,我用Qtable来显示数据库的查询信息,然后要通过用户的单击事件,来完成和外部同步信息的功能。问题如下:
我把这个单击信号和我自己写的槽connect起来,
connect(tb,SIGNAL(clicked(int,int,int,QPoint&)),SLOT(set_syn_slot(int)));
那个set_syn_slot(int row)就是我自己的槽,我想要获取单击的是哪一行,但是不管我按哪一行,得到的row都是-1,我就想不通了,用qtopia的其他信号函数也一样。
请问有哪位大神能指点下么?
 楼主| 今夜私奔 发表于 2012-5-4 03:06:54 | 显示全部楼层
qtopia官方文档是这么声明clicked的
void QTable::clicked ( int row, int col, int button, const QPoint & mousePos ) [signal]

This signal is emitted as soon as a user clicks on row and col using mousebutton button. The actual mouse position is passed as mousePos.
回复

使用道具 举报

 楼主| 今夜私奔 发表于 2012-5-4 03:09:09 | 显示全部楼层
我知道Qtopia把许多事件在PC中用的,特别是鼠标和键盘事件为了更适合触摸屏都改成了鼠标事件,但是也不应该每次不管单击哪里row都是-1。
回复

使用道具 举报

 楼主| 今夜私奔 发表于 2012-5-4 03:11:30 | 显示全部楼层
在多说一句,其他信号currentChanged,pressed也是这样的一个结果。他们原型是:
void QTable::currentChanged ( int row, int col ) [signal]

This signal is emitted if the current cell has been changed to row, col.

void QTable::pressed ( int row, int col, int button, const QPoint & mousePos ) [signal]

This signal is emitted whenever the mousebutton button is pressed above the cell located in row and col. The actual mouse position is passed as mousePos.



我只需要row一个参数即可,哪位大神做过关于这方面或者类似这方面的,希望提携一下小弟。
回复

使用道具 举报

 楼主| 今夜私奔 发表于 2012-5-4 04:12:53 | 显示全部楼层
这个问题已经解决,跟槽和信号没关系,我初始化qtable出错,真是太2了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2025-8-21 19:18 , Processed in 2.043171 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表