Fix Qt widget embedding: pages rendered as floating windows instead of tabs

Move centralWidget assignment before page creation to fix use of
uninitialized pointer. Use Qt::Widget flags when pages have a parent
(embedded in QStackedWidget) and pass centralWidget as parent for all
lazily-created pages (messagePage, signMessagePage, verifyMessagePage).
Also fix TransactionView which unconditionally set FramelessWindowHint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-26 22:18:01 -07:00
parent 2e19ec350d
commit f52f83dc71
4 changed files with 19 additions and 10 deletions
+4 -1
View File
@@ -28,7 +28,10 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
model(0)
{
ui->setupUi(this);
setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::Window);
if (parent)
setWindowFlags(Qt::Widget);
else
setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::Window);
#ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac
ui->addButton->setIcon(QIcon());