メインウィジェットと複数の子ウィジェットを表示しています。
すべての子ウィジェットをメイン ウィジェット レイアウトに追加し、1 つの子のみの show を呼び出し、他の子を非表示にします。
Windows PC では、これで問題なく動作します。しかし、Android では、hide が呼び出されても子ウィジェットが表示されます。誰が私が間違っているかを提案できますか。
#include "mainframe.h"
#include "ui_mainframe.h"
MainFrame::MainFrame(QWidget *parent) :
QWidget(parent),
ui(new Ui::MainFrame)
{
ui->setupUi(this);
m_pMainLayout = ui->gridLayout;
initialize();
}
MainFrame::~MainFrame()
{
delete ui;
}
void MainFrame::initialize()
{
m_pStartupScreen = new StartupScreen(this);
m_pSystemScreen = new SystemScreen(this);
m_pMainLayout->addWidget(m_pStartupScreen);
m_pMainLayout->addWidget(m_pSystemScreen);
connect(m_pStartupScreen, SIGNAL(reportsButtonClick()),
this, SLOT(handleUserOptionReports()));
connect(m_pStartupScreen, SIGNAL(systemButtonClick()),
this, SLOT(handleUserOptionSystem()));
connect(m_pStartupScreen, SIGNAL(salesButtonClick()),
this, SLOT(handleUserOptionSales()));
m_pSystemScreen->hide();
m_pStartupScreen->show();
connect(m_pSystemScreen, SIGNAL(closeInvoked()), m_pStartupScreen, SLOT(show()));
}
m_pStartupScreen
Android デバイスにm_pSystemScreen
表示されます。つまり、両方の子ウィジェットが重なって表示されます。