KPimTextEdit

inserttabledialog.cpp
1/*
2 SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5
6*/
7
8#include "inserttabledialog.h"
9#include "inserttablewidget.h"
10
11#include <KLocalizedString>
12#include <KSeparator>
13
14#include <QDialogButtonBox>
15#include <QPushButton>
16#include <QVBoxLayout>
17
18using namespace KPIMTextEdit;
19
20class InsertTableDialog::InsertTableDialogPrivate
21{
22public:
23 explicit InsertTableDialogPrivate(InsertTableDialog *qq)
24 : q(qq)
25 {
26 q->setWindowTitle(i18nc("@title:window", "Insert Table"));
27 auto mainLayout = new QVBoxLayout(q);
28
29 insertTableWidget = new InsertTableWidget(q);
30 mainLayout->addWidget(insertTableWidget);
31
32 auto sep = new KSeparator(q);
33 mainLayout->addWidget(sep);
34
36 QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
37 okButton->setText(i18n("Insert"));
41
42 mainLayout->addWidget(buttonBox);
43 }
44
45 InsertTableWidget *insertTableWidget = nullptr;
46 InsertTableDialog *const q;
47};
48
49InsertTableDialog::InsertTableDialog(QWidget *parent)
50 : QDialog(parent)
51 , d(new InsertTableDialogPrivate(this))
52{
53}
54
55InsertTableDialog::~InsertTableDialog() = default;
56
57int InsertTableDialog::columns() const
58{
59 return d->insertTableWidget->columns();
60}
61
62int InsertTableDialog::rows() const
63{
64 return d->insertTableWidget->rows();
65}
66
67int InsertTableDialog::border() const
68{
69 return d->insertTableWidget->border();
70}
71
72QTextLength::Type InsertTableDialog::typeOfLength() const
73{
74 return d->insertTableWidget->typeOfLength();
75}
76
77int InsertTableDialog::length() const
78{
79 return d->insertTableWidget->length();
80}
81
82void InsertTableDialog::setColumns(int col)
83{
84 d->insertTableWidget->setColumns(col);
85}
86
87void InsertTableDialog::setRows(int rows)
88{
89 d->insertTableWidget->setRows(rows);
90}
91
92void InsertTableDialog::setBorder(int border)
93{
94 d->insertTableWidget->setBorder(border);
95}
96
97void InsertTableDialog::setLength(int val)
98{
99 d->insertTableWidget->setLength(val);
100}
101
102void InsertTableDialog::setTypeOfLength(QTextLength::Type type)
103{
104 d->insertTableWidget->setTypeOfLength(type);
105}
106
107#include "moc_inserttabledialog.cpp"
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
void setShortcut(const QKeySequence &key)
void setText(const QString &text)
virtual void accept()
virtual void reject()
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
Key_Return
void setWindowTitle(const QString &)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:49 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.