CWizGroupAttributeForm::CWizGroupAttributeForm(CWizExplorerApp& app, QWidget* parent)
    : QFrame(parent)
    , m_app(app)
    , m_web(new QWebView(parent))
{
    setFrameShadow(QFrame::Raised);
    setFrameShape(QFrame::StyledPanel);
    setAutoFillBackground(true);
    setAttribute(Qt::WA_MacShowFocusRect, true);


    QVBoxLayout* layout = new QVBoxLayout(this);
    setLayout(layout);

    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);

    layout->addWidget(m_web);

    QPushButton* btnClose = new QPushButton(this);
    btnClose->setDefault(true);
    btnClose->setIcon(::WizLoadSkinIcon(app.userSettings().skin(), palette().window().color(), "sheetHide"));
    btnClose->setFlat(true);
    btnClose->setMaximumHeight(18);
    btnClose->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    connect(btnClose, SIGNAL(clicked()), SLOT(on_btnClose_clicked()));

    layout->addWidget(btnClose);
    layout->setAlignment(btnClose, Qt::AlignHCenter);

    connect(&m_api, SIGNAL(clientLoginDone()), SLOT(on_clientLoginDone()));
}
Ejemplo n.º 2
0
FormMain::FormMain(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::FormMain)
{
    ui->setupUi(this);
    this->setWindowFlags(Qt::FramelessWindowHint);
    createPages();
    connect(ui->stackedWidget->widget(m_formIndex.value(FORMLOGIN)),SIGNAL(closeMainForm())
            ,this,SLOT(on_btnClose_clicked()));
    connect(ui->stackedWidget->widget(m_formIndex.value(FORMLOGIN)),SIGNAL(changeToMaintain())
            ,this,SLOT(LoginSuccess()));
    hideToolBox();
    setWidgetSize(400,300);
    //焦点默认给登陆界面
    ((FormLogin*)ui->stackedWidget->widget(m_formIndex.value(FORMLOGIN)))->setFocus();
}