簡體   English   中英

Qt-QVBoxLayout中的重疊標簽

[英]Qt - overlap labels in QVBoxLayout

我試圖像這樣在QVBoxLayout中使標簽彼此重疊:

this->layout = new QGridLayout;
this->layout->addLayout(new QVBoxLayout, 1, 0);

for (int j = 0; j < 7; j++) {
    ClickableLabel *label = new ClickableLabel();

    auto stack = this->layout->findChildren<QVBoxLayout*>();
    stack[0]->addWidget(label);
    stack[0]->setAlignment(Qt::AlignTop);

    button->setGeometry(10000, 100, 0, 0);
}

現在, setGeometry不執行任何操作。 所以我的問題是:我可以在QVBoxLayout實現重疊標簽嗎?

不,您不能在QVBoxLayout實現重疊標簽。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM