Commit 282cec81 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add parent directly

parent caadee6a
......@@ -775,6 +775,7 @@ void AutoCorrection::uppercaseFirstCharOfSentence()
int position = mCursor.selectionEnd();
const QString text = mCursor.selectedText();
qDebug()<<" text :"<< text << "position " << position << " block.position()" << block.position() << " startPos "<<startPos << mCursor.atStart();
if (text.isEmpty()) {// start of a paragraph
if (!excludeToUppercase(mWord)) {
......
......@@ -29,16 +29,15 @@ StorageAuthViewDialog::StorageAuthViewDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("Authorize"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &StorageAuthViewDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &StorageAuthViewDialog::reject);
mView = new StorageAuthViewWidget;
mView = new StorageAuthViewWidget(this);
mainLayout->addWidget(mView);
mainLayout->addWidget(buttonBox);
......
......@@ -26,7 +26,7 @@ using namespace PimCommon;
StorageAuthViewWidget::StorageAuthViewWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *lay = new QVBoxLayout;
QVBoxLayout *lay = new QVBoxLayout(this);
lay->setMargin(0);
mWebView = new StorageAuthWebView;
mProgressBar = new QProgressBar;
......@@ -37,7 +37,6 @@ StorageAuthViewWidget::StorageAuthViewWidget(QWidget *parent)
connect(mWebView, &StorageAuthWebView::loadFinished, this, &StorageAuthViewWidget::slotLoadFinished);
lay->addWidget(mWebView);
lay->addWidget(mProgressBar);
setLayout(lay);
}
StorageAuthViewWidget::~StorageAuthViewWidget()
......
......@@ -34,8 +34,7 @@ StorageServiceCheckNameDialog::StorageServiceCheckNameDialog(QWidget *parent)
{
setWindowTitle(i18n("New name"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
mOkButton->setDefault(true);
mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......
......@@ -93,8 +93,7 @@ StorageServiceDeleteDialog::StorageServiceDeleteDialog(DeleteType type, PimCommo
connect(mStorageServiceProgressIndicator, &PimCommon::StorageServiceProgressIndicator::updatePixmap, this, &StorageServiceDeleteDialog::slotUpdatePixmap);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mUser1Button = new QPushButton;
buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::rejected, this, &StorageServiceDeleteDialog::reject);
......
......@@ -36,8 +36,7 @@ TemplateEditDialog::TemplateEditDialog(QWidget *parent, bool defaultTemplate)
: QDialog(parent), mOkButton(Q_NULLPTR)
{
setWindowTitle(defaultTemplate ? i18n("Default template") : i18n("Template"));
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = Q_NULLPTR;
if (defaultTemplate) {
buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
......
......@@ -30,17 +30,17 @@ TranslatorDebugDialog::TranslatorDebugDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("Translator Debug"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mUser1Button = new QPushButton;
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
mUser1Button = new QPushButton(this);
buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::accepted, this, &TranslatorDebugDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &TranslatorDebugDialog::reject);
mUser1Button->setText(i18n("Save As..."));
connect(mUser1Button, &QPushButton::clicked, this, &TranslatorDebugDialog::slotSaveAs);
mEdit = new KPIMTextEdit::PlainTextEditorWidget;
mEdit = new KPIMTextEdit::PlainTextEditorWidget(this);
mEdit->setReadOnly(true);
mainLayout->addWidget(mEdit);
mainLayout->addWidget(buttonBox);
......
......@@ -64,8 +64,7 @@ AnnotationEditDialog::AnnotationEditDialog(const Akonadi::Item &item, QWidget *p
d->mHasAnnotation = item.hasAttribute<Akonadi::EntityAnnotationsAttribute>();
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
......
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