qconnectorblob::qconnectorblob(QWidget *parent, bool type,
QNodeWidget *myPWidget, long myID, long connectToID) :
QRadioButton(parent)
{
setAcceptDrops(true);
this->setAutoExclusive(false);
mNodeWidget = myPWidget;
mtype = type;
//Resize for Android
this->resize(40,40);
我要更新“this”的大小吗? 父窗口小部件? “这个”小部件? 还是两者兼而有之?我怎样才能以40x40的尺寸导致重绘事件?Qt:resize(int,int)无法正常工作
只是尝试这样做,但小窗口“精灵/图像”不改变它的大小:
//Resize for Android
this->setFixedSize(40,40);
this->setMinimumSize(40,40);
this->setMaximumSize(40,40);
this->resize(40,40);
this->repaint();
Setfixedsize设置最小和最大尺寸。如果你使用布局检查:http://stackoverflow.com/questions/11000083/cant-resize-widgets-in-qvboxlayout也尝试使用resizeEvent,而不是paintEvent。 – Chernobyl 2014-10-12 11:15:27