Commit 177caa5a authored by Laurent Montel's avatar Laurent Montel 😁 Committed by Pali Rohár

Fix some layout

parent 3bb17ef4
......@@ -42,10 +42,10 @@ AddressBookSelectorDialog::AddressBookSelectorDialog(const QString &title, const
: QDialog( parent )
{
setWindowTitle( title );
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Help);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Help, this);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
......
......@@ -41,8 +41,10 @@ class AvatarDialog::Private
{
public:
Private()
: mainWidget(0)
{}
: mainWidget(nullptr)
{
}
AvatarSelectorWidget *mainWidget;
QString selectedPath;
......
......@@ -27,24 +27,22 @@ QDialog(parent)
setAttribute(Qt::WA_DeleteOnClose);
QWidget *widget = new QWidget(this);
ui.setupUi(widget);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(widget);
setWindowTitle(i18n("XML Console"));
// Buttons
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
QPushButton *user1Button = new QPushButton;
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
QPushButton *user2Button = new QPushButton;
buttonBox->addButton(user2Button, QDialogButtonBox::ActionRole);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
//PORTING SCRIPT: WARNING mainLayout->addWidget(buttonBox) must be last item in layout. Please move it.
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
mainLayout->addWidget(buttonBox);
user1Button->setText(i18n("Clear"));
user2Button->setText(i18n("Send"));
connect(user1Button, SIGNAL(clicked()), this, SLOT(slotClear()));
connect(user2Button, SIGNAL(clicked()), this, SLOT(slotSend()));
connect(user1Button, &QAbstractButton::clicked, this, &dlgXMPPConsole::slotClear);
connect(user2Button, &QAbstractButton::clicked, this, &dlgXMPPConsole::slotSend);
}
dlgXMPPConsole::~dlgXMPPConsole()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment