2011-08-21 24 views

回答

7

您只需在布局中的窗口一角添加一个QSizeGrip,使其保留在该角落。

QDialog *dialog = new QDialog(0, Qt::FramelessWindowHint); 
QVBoxLayout *layout = new QVBoxLayout(dialog); 

// To remove any space between the borders and the QSizeGrip...  
layout->setContentsMargins(QMargins());   
// and between the other widget and the QSizeGrip 
layout->setSpacing(0); 
layout->addWidget(new QTextEdit(dialog)); 

// The QSizeGrip position (here Bottom Right Corner) determines its 
// orientation too 
layout->addWidget(new QSizeGrip(dialog), 0, Qt::AlignBottom | Qt::AlignRight); 

dialog->show();