1
在我的应用程序中,我在打开文件(在菜单栏中使用QAction)后立即执行了广泛的算法。我想改变光标占线模式,但不知何故,我的代码无法正常工作:如何更改由QAction触发的插槽内的光标
MyApp::MyApp(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
connect(ui.openFileOption, SIGNAL(triggered()), this, SLOT(OpenFileAction()));
}
MyApp::~MyApp()
{
}
void MyApp::OpenFileAction()
{
//change cursor
this->setCursor(Qt::WaitCursor);
QApplication::processEvents();
// load file
// do something long here...
this->setCursor(Qt::ArrowCursor);
}
你试过设置processEvents()后面的游标; – drescherjm
不起作用:) – azer89