Commit 409ec584 authored by Laurent Montel's avatar Laurent Montel
Browse files

auto * -> auto

parent ea0cdd3b
......@@ -89,7 +89,7 @@ bool WinIdEmbedder::eventFilter(QObject *o, QEvent *e)
{
if (e->type() == QEvent::Show && o->isWidgetType()
&& o->inherits("QDialog")) {
auto *w = static_cast<QWidget *>(o);
auto w = static_cast<QWidget *>(o);
if (print) {
cout << "winId: " << w->winId() << endl;
}
......@@ -477,7 +477,7 @@ int main(int argc, char *argv[])
QDialog dialog;
dialog.setWindowTitle(title);
auto *buttonBox = new QDialogButtonBox(&dialog);
auto buttonBox = new QDialogButtonBox(&dialog);
KMessageBox::Options options = KMessageBox::NoExec;
switch (type) {
......@@ -521,7 +521,7 @@ int main(int argc, char *argv[])
if (!dontagain.isEmpty()) {
// We use NoExec in order to call handleXGeometry before exec
// But that means we need to query the state of the dontShowAgain checkbox ourselves too...
auto *cb = dialog.findChild<QCheckBox *>();
auto cb = dialog.findChild<QCheckBox *>();
Q_ASSERT(cb);
if (cb && cb->isChecked()) {
if (type == KMessageBox::WarningContinueCancel) {
......@@ -617,7 +617,7 @@ QT_WARNING_DISABLE_DEPRECATED
passiveicon,
(QWidget *)nullptr, // parent
timeout);
auto *timer = new QTimer();
auto timer = new QTimer();
QObject::connect(timer, SIGNAL(timeout()), qApp, SLOT(quit()));
QObject::connect(popup, QOverload<>::of(&KPassivePopup::clicked), qApp, &QApplication::quit);
timer->setSingleShot(true);
......
......@@ -11,7 +11,7 @@ KListBoxDialog::KListBoxDialog(const QString &text, QWidget *parent)
: QDialog(parent)
{
setModal(true);
auto *vLayout = new QVBoxLayout(this);
auto vLayout = new QVBoxLayout(this);
label = new QLabel(text, this);
vLayout->addWidget(label);
......@@ -21,7 +21,7 @@ KListBoxDialog::KListBoxDialog(const QString &text, QWidget *parent)
vLayout->addWidget(table);
table->setFocus();
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
vLayout->addWidget(buttonBox);
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
......
......@@ -30,7 +30,7 @@
static void addButtonBox(QDialog &dlg, QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Ok | QDialogButtonBox::Cancel)
{
auto *buttonBox = new QDialogButtonBox(buttons, &dlg);
auto buttonBox = new QDialogButtonBox(buttons, &dlg);
dlg.layout()->addWidget(buttonBox);
QObject::connect(buttonBox, &QDialogButtonBox::accepted, &dlg, &QDialog::accept);
QObject::connect(buttonBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject);
......@@ -87,9 +87,9 @@ int Widgets::textBox(QWidget *parent, int width, int height, const QString &titl
QDialog dlg(parent);
dlg.setWindowTitle(title);
auto *mainLayout = new QVBoxLayout(&dlg);
auto mainLayout = new QVBoxLayout(&dlg);
auto *edit = new KTextEdit(&dlg);
auto edit = new KTextEdit(&dlg);
mainLayout->addWidget(edit);
edit->setReadOnly(true);
edit->setFocus();
......@@ -129,9 +129,9 @@ int Widgets::imgBox(QWidget *parent, const QString &title, const QString &file)
QDialog dlg(parent);
dlg.setWindowTitle(title);
auto *mainLayout = new QVBoxLayout(&dlg);
auto mainLayout = new QVBoxLayout(&dlg);
auto *label = new QLabel(&dlg);
auto label = new QLabel(&dlg);
mainLayout->addWidget(label);
addButtonBox(dlg, QDialogButtonBox::Ok);
......@@ -158,20 +158,20 @@ int Widgets::imgInputBox(QWidget *parent, const QString &title, const QString &f
QDialog dlg(parent);
dlg.setWindowTitle(title);
auto *mainLayout = new QVBoxLayout(&dlg);
auto mainLayout = new QVBoxLayout(&dlg);
if (!text.isEmpty()) {
auto *head = new QLabel(&dlg);
auto head = new QLabel(&dlg);
head->setText(text);
mainLayout->addWidget(head);
}
auto *label = new QLabel(&dlg);
auto label = new QLabel(&dlg);
mainLayout->addWidget(label);
label->setPixmap(QPixmap(file));
auto *edit = new QLineEdit(&dlg);
auto edit = new QLineEdit(&dlg);
mainLayout->addWidget(edit);
edit->setReadOnly(false);
edit->setFocus();
......@@ -192,15 +192,15 @@ int Widgets::textInputBox(QWidget *parent, int width, int height, const QString
{
QDialog dlg(parent);
dlg.setWindowTitle(title);
auto *mainLayout = new QVBoxLayout(&dlg);
auto mainLayout = new QVBoxLayout(&dlg);
if (!text.isEmpty()) {
auto *label = new QLabel(&dlg);
auto label = new QLabel(&dlg);
mainLayout->addWidget(label);
label->setText(text);
}
auto *edit = new KTextEdit(&dlg);
auto edit = new KTextEdit(&dlg);
mainLayout->addWidget(edit);
edit->setReadOnly(false);
edit->setFocus();
......@@ -224,12 +224,12 @@ bool Widgets::comboBox(QWidget *parent, const QString &title, const QString &tex
QDialog dlg(parent);
dlg.setWindowTitle(title);
auto *mainLayout = new QVBoxLayout(&dlg);
auto mainLayout = new QVBoxLayout(&dlg);
auto *label = new QLabel(&dlg);
auto label = new QLabel(&dlg);
label->setText(text);
mainLayout->addWidget(label);
auto *combo = new QComboBox(&dlg);
auto combo = new QComboBox(&dlg);
combo->addItems(args);
combo->setCurrentIndex(combo->findText(defaultEntry));
combo->setFocus();
......@@ -352,12 +352,12 @@ bool Widgets::slider(QWidget *parent, const QString &title, const QString &text,
QDialog dlg(parent);
dlg.setWindowTitle(title);
auto *mainLayout = new QVBoxLayout(&dlg);
auto mainLayout = new QVBoxLayout(&dlg);
auto *label = new QLabel(&dlg);
auto label = new QLabel(&dlg);
mainLayout->addWidget(label);
label->setText(text);
auto *slider = new QSlider(&dlg);
auto slider = new QSlider(&dlg);
mainLayout->addWidget(slider);
slider->setMinimum(minValue);
slider->setMaximum(maxValue);
......@@ -384,12 +384,12 @@ bool Widgets::calendar(QWidget *parent, const QString &title, const QString &tex
QDialog dlg(parent);
dlg.setWindowTitle(title);
auto *mainLayout = new QVBoxLayout(&dlg);
auto mainLayout = new QVBoxLayout(&dlg);
auto *label = new QLabel(&dlg);
auto label = new QLabel(&dlg);
mainLayout->addWidget(label);
label->setText(text);
auto *dateWidget = new KDatePicker(defaultEntry, &dlg);
auto dateWidget = new KDatePicker(defaultEntry, &dlg);
mainLayout->addWidget(dateWidget);
dateWidget->setFocus();
addButtonBox(dlg);
......
Supports Markdown
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