mpi
3rd November 2009, 10:40
Hey,
I want to display a widget as disabled (setEnabled(false)) with its cursor set to Qt::WaitCursor. Disabling the widget, however, always display the widget with a normal Qt::ArrowCursor. How do I obtain a disabled widget with a Qt::WaitCursor. Code that reproduces the problem is shown below.
Best regards,
Mads
#include <QWidget>
#include <QApplication>
#include <QCursor>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget *widget = new QWidget;
widget->show();
QCursor cursor(Qt::WaitCursor);
widget->setCursor(cursor);
widget->setDisabled(true);
return app.exec();
}
I want to display a widget as disabled (setEnabled(false)) with its cursor set to Qt::WaitCursor. Disabling the widget, however, always display the widget with a normal Qt::ArrowCursor. How do I obtain a disabled widget with a Qt::WaitCursor. Code that reproduces the problem is shown below.
Best regards,
Mads
#include <QWidget>
#include <QApplication>
#include <QCursor>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget *widget = new QWidget;
widget->show();
QCursor cursor(Qt::WaitCursor);
widget->setCursor(cursor);
widget->setDisabled(true);
return app.exec();
}