简介

普通继承与 QWidget 的元器件可以重定义函数

        QSize sizeHint() const {
	    QRect rect = QApplication::desktop()->screenGeometry();
	    std::cout << rect.width() << " " << rect.height() << std::endl;
    	    return QSize( int(rect.width()*1),rect.height() );
	}

对于继承于 QMainWindow 的元器件可以使用
函数 resize(QSize( int(rect.width()*0.1),rect.height() ));实现

posted on 2020-11-19 22:20  HDU李少帅  阅读(139)  评论(0)    收藏  举报