QLabel not update, when the parent widget is Qt::FramelessWindowHint
-
Hi, I create a QDialog, and put a QLabel into the dialog, set the QLabel word wrap, when i revoke the function
this->setWindowFlag(Qt::FramelessWindowHint);, and reset the text of QLabel by callsetText, it not update the text .
but if i don't set theFramelessWindowHintflag, the QLabel update normally;
My Qt's Version is 5.15.2, system version is Windows10.QString strWinDesktopPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); auto selectDir = QFileDialog::getExistingDirectory(this, tr("Select Dirctory"), ui->savePathLabel->text(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if (selectDir.isEmpty()) { return; } ui->savePathLabel->setText(selectDir);if i call
qApp->processEvent(), the text is update, and qlabel wrap the text, but the height is not suitable.

-
Hi,
Qt 5.15.2 is long outdated, please try Qt 6.5 or newer. -
@Gaobo said in QLabel not update, when the parent widget is Qt::FramelessWindowHint:
s that question a bug of Qt5.15.2?
Since you did not provide a minimal, compilable example of your problem I would say no - it's a problem of your code.
-
@Gaobo said in QLabel not update, when the parent widget is Qt::FramelessWindowHint:
s that question a bug of Qt5.15.2?
Since you did not provide a minimal, compilable example of your problem I would say no - it's a problem of your code.
@Christian-Ehrlicher said in QLabel not update, when the parent widget is Qt::FramelessWindowHint:
@Gaobo said in QLabel not update, when the parent widget is Qt::FramelessWindowHint:
s that question a bug of Qt5.15.2?
Since you did not provide a minimal, compilable example of your problem I would say no - it's a problem of your code.
so, how do i solve this problem? if not set
FramelessWindowHint, everything is ok. Can you give me some reasons why this might be happening or some directions I can troubleshoot this issue? thanks -
@Christian-Ehrlicher said in QLabel not update, when the parent widget is Qt::FramelessWindowHint:
@Gaobo said in QLabel not update, when the parent widget is Qt::FramelessWindowHint:
s that question a bug of Qt5.15.2?
Since you did not provide a minimal, compilable example of your problem I would say no - it's a problem of your code.
so, how do i solve this problem? if not set
FramelessWindowHint, everything is ok. Can you give me some reasons why this might be happening or some directions I can troubleshoot this issue? thanks@Gaobo said in QLabel not update, when the parent widget is Qt::FramelessWindowHint:
so, how do i solve this problem?
How should we know when you don't show us what exactly you are doing?
Create a minimal reproduce of your problem. From your description I would guess it's not more than 30 lines. -
@Gaobo said in QLabel not update, when the parent widget is Qt::FramelessWindowHint:
so, how do i solve this problem?
How should we know when you don't show us what exactly you are doing?
Create a minimal reproduce of your problem. From your description I would guess it's not more than 30 lines.@Christian-Ehrlicher said in QLabel not update, when the parent widget is Qt::FramelessWindowHint:
@Gaobo said in QLabel not update, when the parent widget is Qt::FramelessWindowHint:
so, how do i solve this problem?
How should we know when you don't show us what exactly you are doing?
Create a minimal reproduce of your problem. From your description I would guess it's not more than 30 lines.ok, i try to reproduce this problem, thanks
-
G Gaobo has marked this topic as solved on