Unsolved Changing cursor type when focus shifts from QTableView cell
-
Hi,
In my delegate's setModelData I would like to change the cursor to hourglass and at the end of setModelData back to arrow.
This is what I have now:void WhatFixViewDelegate::setModelData(QWidget* editor, QAbstractItemModel* fixModel, const QModelIndex& index) const { QCursor* hold = new QCursor(); hold->setShape (Qt::WaitCursor); QComboBox* whatComboEditor = editor->findChild<QComboBox*>(); Q_ASSERT(whatComboEditor); if (whatComboEditor) { QString newWhatText; newWhatText = whatComboEditor->currentText (); fixModel->setData (index, newWhatText, Qt::EditRole); fixModel->submit (); FixDb* mFixDb = new FixDb; mFixDb->exec (); } }
How can I set the cursor in this case, when the user clicks outside the box?
Thank you. -
Hi,
From your description you should rather emit signals at the start and end of your setModelData call and in the slot you connect to it use setCursor.
Note that currently it looks like you have two memory leaks.
-
@SGaist
Where do I have the leeks? -
You never delete
hold
normFixDb
. -
@SGaist
Would it be possible to integrate QtQuick's BusyIndicator for this? -
Do you mean replace the cursor with a BusyIndicator or just show a widget with that indicator ?
-
@SGaist
Show a widget with that indicator. -
Then yes.
-
@SGaist
Can you please recommend a tutorial about using QtKwick within a Qt app? -
The Qt documentation.