如何在Qt无框架窗口中实现QSizeGrip?
代码会是什么样子的?
发布于 2011-08-22 02:46:09
你只需要在布局中窗口的一角添加一个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();https://stackoverflow.com/questions/7139559
复制相似问题