Changeset View
Changeset View
Standalone View
Standalone View
src/categorydialog.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 41 | public: | |||
---|---|---|---|---|---|
45 | } | 45 | } | ||
46 | }; | 46 | }; | ||
47 | 47 | | |||
48 | CategoryWidget::CategoryWidget(CategoryConfig *cc, QWidget *parent) | 48 | CategoryWidget::CategoryWidget(CategoryConfig *cc, QWidget *parent) | ||
49 | : QWidget(parent) | 49 | : QWidget(parent) | ||
50 | , mCategoryConfig(cc) | 50 | , mCategoryConfig(cc) | ||
51 | { | 51 | { | ||
52 | QHBoxLayout *topL = new QHBoxLayout(this); | 52 | QHBoxLayout *topL = new QHBoxLayout(this); | ||
53 | topL->setMargin(0); | 53 | topL->setContentsMargins(0, 0, 0, 0); | ||
54 | mWidgets = new CategoryWidgetBase(this); | 54 | mWidgets = new CategoryWidgetBase(this); | ||
55 | topL->addWidget(mWidgets); | 55 | topL->addWidget(mWidgets); | ||
56 | 56 | | |||
57 | mWidgets->mButtonAdd->setIcon(QIcon::fromTheme(QStringLiteral("list-add"))); | 57 | mWidgets->mButtonAdd->setIcon(QIcon::fromTheme(QStringLiteral("list-add"))); | ||
58 | mWidgets->mButtonRemove->setIcon(QIcon::fromTheme(QStringLiteral("list-remove"))); | 58 | mWidgets->mButtonRemove->setIcon(QIcon::fromTheme(QStringLiteral("list-remove"))); | ||
59 | mWidgets->mLineEdit->setPlaceholderText(i18n("Click to add a new category")); | 59 | mWidgets->mLineEdit->setPlaceholderText(i18n("Click to add a new category")); | ||
60 | 60 | | |||
61 | connect(mWidgets->mLineEdit, &QLineEdit::textChanged, | 61 | connect(mWidgets->mLineEdit, &QLineEdit::textChanged, | ||
▲ Show 20 Lines • Show All 180 Lines • ▼ Show 20 Line(s) | 234 | { | |||
242 | okButton->setDefault(true); | 242 | okButton->setDefault(true); | ||
243 | okButton->setShortcut(Qt::CTRL | Qt::Key_Return); | 243 | okButton->setShortcut(Qt::CTRL | Qt::Key_Return); | ||
244 | connect(buttonBox, &QDialogButtonBox::rejected, this, &CategoryDialog::reject); | 244 | connect(buttonBox, &QDialogButtonBox::rejected, this, &CategoryDialog::reject); | ||
245 | 245 | | |||
246 | QWidget *page = new QWidget; | 246 | QWidget *page = new QWidget; | ||
247 | mainLayout->addWidget(page); | 247 | mainLayout->addWidget(page); | ||
248 | mainLayout->addWidget(buttonBox); | 248 | mainLayout->addWidget(buttonBox); | ||
249 | QVBoxLayout *lay = new QVBoxLayout(page); | 249 | QVBoxLayout *lay = new QVBoxLayout(page); | ||
250 | lay->setMargin(0); | 250 | lay->setContentsMargins(0, 0, 0, 0); | ||
251 | 251 | | |||
252 | mWidgets = new CategoryWidget(cc, this); | 252 | mWidgets = new CategoryWidget(cc, this); | ||
253 | mCategoryConfig = cc; | 253 | mCategoryConfig = cc; | ||
254 | mWidgets->setObjectName(QStringLiteral("CategorySelection")); | 254 | mWidgets->setObjectName(QStringLiteral("CategorySelection")); | ||
255 | mWidgets->hideHeader(); | 255 | mWidgets->hideHeader(); | ||
256 | lay->addWidget(mWidgets); | 256 | lay->addWidget(mWidgets); | ||
257 | 257 | | |||
258 | mWidgets->setCategories(); | 258 | mWidgets->setCategories(); | ||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |