コード例 #1
0
//----------------------------------------------------------------------------------------
void DetailsInfo::loadBtnWidget()
{
    returnBtn = new QPushButton(tr("返回"));
    repealBtn = new QPushButton(tr("撤销"));
    alterOkBtn = new QPushButton(tr("提交"));
    cancelBtn = new QPushButton(tr("取消"));

    //add widget
    btnLayout = new QHBoxLayout();

    btnLayout->addStretch(1);
    btnLayout->addWidget(returnBtn);
    btnLayout->addWidget(repealBtn);
    btnLayout->addWidget(alterOkBtn);
    btnLayout->addWidget(cancelBtn);

    connect(returnBtn, SIGNAL(clicked()),
            this, SLOT(returnBtnClicked()));
    connect(repealBtn, SIGNAL(clicked()),
            this, SLOT(repealBtnClicked()));\
    connect(alterOkBtn ,SIGNAL(clicked()),
            this, SLOT(alterOkBtnClicked()));
    connect(cancelBtn, SIGNAL(clicked()),
            this, SLOT(cancelBtnClicked()));
}
コード例 #2
0
ファイル: aboutbar.cpp プロジェクト: xkommando/StatterPhoto
AboutBar::AboutBar(QWidget *parent) :
    QFrame(parent),
    ui(new Ui::AboutBar)
{
    ui->setupUi(this);
    setStyleSheet("QFrame{border-image: url(:/images/sidebar_bg.png);}");

    p_returnBtn = new QPushButton(this);
    p_returnBtn->setGeometry(20, 20, 35, 35);

    p_returnBtn->setStyleSheet("QPushButton{border-image: url(:/images/return.png);}"
                             "QPushButton:hover{border-image: url(:/images/return_on.png);}"
                             "QPushButton:pressed{border-image: url(:/images/return.png);}");

    connect(p_returnBtn, SIGNAL(clicked()), this, SLOT(returnBtnClicked()));
}