[英]Resizing QLabel using QSizeGrip
Actually I want to create a QLabel
which can be resized by the user, So I found the QSizeGrip class which is used to resized parents window, but actually I want to use this QSizeGrip on my label so that using that grip user can resize my label but the problem I am facing is that this grip when i use with my label resizing my widget window not the label so please provide me code how to make this grip works on QLabel
instead of my widget window. 到目前為止,我的 class 繼承了QLabel
。
class resizeLabel: public QLabel
{
Q_OBJECT
public:
resizeLabel(QWidget *parent=nullptr): QLabel(parent){
setFrameShape(QFrame::Box);
QSizeGrip *resizing= new QSizeGrip(this);
}
使用setWindowFlags(Qt::SubWindow);
創建QSizeGrip
object 后的該語句,此標志將位於此手柄上以調整小部件 window 的QLabel
的大小。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.