[Qt-interest] Updating the TableWidgetItem slows down the operation significantly.
Yong Zhang
yzhang.qt at gmail.com
Sat Feb 27 20:47:55 CET 2010
David,
Thanks. Actually my goal is to synchronize the QTableWidget with the
location information of the mouse on the screen. I have some sample
codes listed below and thanks again for any help.
value = getPositions();
QString valueString = QString("%1").arg(QString::number(double( value )));
tableWidget->item(index, 2)->setData(Qt::DisplayRole, valueString);
value is updated when user moves mouse and the valueString is also
updated to refresh the table. This slows down the operation. If
valueString does not update then it works very smoothly. Can you tell me
what is wrong with the codes?
Yong
On 2/27/2010 8:35 AM, David Boosalis wrote:
>
> So you want to change the cursor from an arrow to a hand. Why not use a
> method like setCursor() and let QT do all the work? Or am I missing
> something
>
> -David
>
>
> On Thu, Feb 25, 2010 at 4:35 PM, Yong Zhang <yzhang.qt at gmail.com
> <mailto:yzhang.qt at gmail.com>> wrote:
>
> Hi All,
>
> I use a QTableWidget to display the current location values (x, y) of
> the mouse on the screen. I display the mouse location using a hand image
> on the screen. When the mouse moves, the mouse image is updated on the
> screen to indicate the new location. My goal is to also update the
> location values (x, y) in the QTableWidget as two QTableWidgetItems. The
> system works well, however, I found that it significantly slows down the
> operations, that is, the update of the mouse image on the screen is very
> slow and the mouse movements are not smooth. When I do not update the
> location values in the QTableWidget, I can move the mouse around very
> smoothly and the mouse image is also updated very smoothly. My question
> is, is there anyway to make it fast and smooth enough to update the
> information in the QTableWidget?
>
> Thank you very much,
>
> Yong
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com <mailto:Qt-interest at trolltech.com>
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
More information about the Qt-interest-old
mailing list