我做了QToolButton
一些动作,比如:
QToolButton * toolBut1 = new QToolButton(this);
actionGroup1 = new QActionGroup(this);
actionGroup1->setExclusive(true);
action1 = new QAction(QIcon(":/images/icon1"),"", actionGroup1);
action1->setCheckable(true);
action2 = new QAction(QIcon(":/images/icon2"),"", actionGroup1);
action2->setCheckable(true);
action3 = new QAction(QIcon(":/images/icon3"),"", actionGroup1);
action3->setCheckable(true);
toolBut1->addAction(action1);
toolBut1->addAction(action2);
toolBut1->addAction(action3);
但是当我将鼠标指针悬停在操作上时,应用程序输出中会显示一些警告:
QGradient::setColorAt: 颜色位置必须在0到1的范围内指定
为什么会这样?如何解决?
PS 我在 Windows 7 上使用 Qt 4.8.4。