kfontinst: Port to QDialog
ClosedPublic

Authored by volkov on May 20 2016, 1:11 PM.

Details

Reviewers
mart
Group Reviewers
Plasma
Commits
R119:20bbf2366ae5: kfontinst: Port to QDialog

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
volkov updated this revision to Diff 3906.May 20 2016, 1:11 PM
volkov retitled this revision from to kfontinst: Port to QDialog.
volkov updated this object.
volkov edited the test plan for this revision. (Show Details)
volkov added a reviewer: Plasma.
volkov set the repository for this revision to R119 Plasma Desktop.
Restricted Application added a project: Plasma. · View Herald TranscriptMay 20 2016, 1:11 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
apol added a subscriber: apol.May 20 2016, 1:40 PM

Other than that it looks quite good, interesting how much code gets cleaned up.

kcms/kfontinst/apps/Printer.cpp
349

Pass this as the last argument, so it has a parent and doesn't leak. On this one and the rest of new QDialogButtonBox.

350

Use new syntax. &QDialog::rejected and &CPrinter::slotCancelClicked

kcms/kfontinst/kcmfontinst/DuplicatesDialog.cpp
76

use new syntax as well.

volkov added inline comments.May 20 2016, 2:26 PM
kcms/kfontinst/apps/Printer.cpp
349

There is no need to set a parent in the constructor. QLayout::addWidget() will do it later.

volkov added inline comments.May 20 2016, 2:40 PM
kcms/kfontinst/apps/Printer.cpp
349

From the Qt documentation ( https://doc.qt.io/qt-5/layout.html ):
"When you use a layout, you do not need to pass a parent when constructing the child widgets. The layout will automatically reparent the widgets (using QWidget::setParent()) so that they are children of the widget on which the layout is installed."

volkov updated this revision to Diff 3908.May 20 2016, 2:47 PM

Use the new signal and slot syntax for QDialogButtonBox objects.

volkov marked 2 inline comments as done.May 20 2016, 2:51 PM
mart accepted this revision.May 23 2016, 8:37 AM
mart added a reviewer: mart.
mart added a subscriber: mart.
mart added inline comments.
kcms/kfontinst/apps/Printer.cpp
349

yep, that's correct, or alternatively to make it clearer, it works also the form
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel, layout);
that would add the widget to the layout and reparent it at the same time right upon creation

This revision is now accepted and ready to land.May 23 2016, 8:37 AM
This revision was automatically updated to reflect the committed changes.