Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PimCommon
Commits
0091f6ea
Commit
0091f6ea
authored
Nov 02, 2020
by
Laurent Montel
😁
Browse files
Modernize code
parent
47a70b17
Pipeline
#39286
passed with stage
in 15 minutes and 26 seconds
Changes
69
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/pimcommon/autocorrection/autocorrectionwidget.cpp
View file @
0091f6ea
...
...
@@ -112,7 +112,7 @@ AutoCorrectionWidget::AutoCorrectionWidget(QWidget *parent)
slotEnableDisableAbreviationList
();
slotEnableDisableTwoUpperEntry
();
QMenu
*
menu
=
new
QMenu
(
this
);
auto
*
menu
=
new
QMenu
(
this
);
d
->
ui
->
importAutoCorrection
->
setMenu
(
menu
);
QAction
*
act
=
new
QAction
(
i18n
(
"LibreOffice Autocorrection"
),
this
);
...
...
@@ -547,7 +547,7 @@ void AutoCorrectionWidget::slotEnableDisableTwoUpperEntry()
void
AutoCorrectionWidget
::
slotImportAutoCorrection
(
QAction
*
act
)
{
if
(
act
)
{
A
uto
CorrectionWidget
::
ImportFileType
type
=
act
->
data
().
value
<
AutoCorrectionWidget
::
ImportFileType
>
();
a
uto
type
=
act
->
data
().
value
<
AutoCorrectionWidget
::
ImportFileType
>
();
QString
title
;
QString
filter
;
switch
(
type
)
{
...
...
src/pimcommon/autocorrection/import/importlibreofficeautocorrection.cpp
View file @
0091f6ea
...
...
@@ -91,7 +91,7 @@ bool ImportLibreOfficeAutocorrection::importFile(Type type, const KArchiveDirect
}
documentList
=
archiveDirectory
->
entry
(
archiveFileName
);
if
(
documentList
&&
documentList
->
isFile
())
{
const
KArchiveFile
*
archiveFile
=
static_cast
<
const
KArchiveFile
*>
(
documentList
);
const
auto
*
archiveFile
=
static_cast
<
const
KArchiveFile
*>
(
documentList
);
archiveFile
->
copyTo
(
mTempDir
->
path
());
QFile
file
(
mTempDir
->
path
()
+
QLatin1Char
(
'/'
)
+
archiveFileName
);
QDomDocument
doc
;
...
...
src/pimcommon/autocorrection/tests/autocorrection_gui.cpp
View file @
0091f6ea
...
...
@@ -26,7 +26,7 @@ ConfigureTestDialog::ConfigureTestDialog(PimCommon::AutoCorrection *autoCorrecti
:
QDialog
(
parent
)
{
setWindowTitle
(
QStringLiteral
(
"Configure Autocorrection"
));
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
this
);
QPushButton
*
okButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
okButton
->
setDefault
(
true
);
...
...
@@ -92,8 +92,8 @@ AutocorrectionTestWidget::AutocorrectionTestWidget(QWidget *parent)
PimCommon
::
PimCommonSettings
::
self
()
->
load
();
mAutoCorrection
=
new
PimCommon
::
AutoCorrection
;
QVBoxLayo
ut
*
lay
=
new
QVBoxLayout
(
this
);
QToolBar
*
bar
=
new
QToolBar
;
a
ut
o
*
lay
=
new
QVBoxLayout
(
this
);
auto
*
bar
=
new
QToolBar
;
lay
->
addWidget
(
bar
);
bar
->
addAction
(
QStringLiteral
(
"Configure..."
),
this
,
&
AutocorrectionTestWidget
::
slotConfigure
);
QAction
*
richText
=
new
QAction
(
QStringLiteral
(
"HTML mode"
),
this
);
...
...
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
parser
.
addHelpOption
();
parser
.
process
(
app
);
A
uto
correctionTestWidget
*
w
=
new
AutocorrectionTestWidget
();
a
uto
*
w
=
new
AutocorrectionTestWidget
();
w
->
resize
(
800
,
600
);
w
->
show
();
...
...
src/pimcommon/autocorrection/tests/richtexteditwithautocorrection_gui.cpp
View file @
0091f6ea
...
...
@@ -21,7 +21,7 @@ int main(int argc, char **argv)
parser
.
addHelpOption
();
parser
.
process
(
app
);
PimCommon
::
RichTextEditWithAutoCorrection
*
w
=
new
PimCommon
::
RichTextEditWithAutoCorrection
;
auto
*
w
=
new
PimCommon
::
RichTextEditWithAutoCorrection
;
w
->
show
();
app
.
exec
();
...
...
src/pimcommon/configureplugins/autotests/configurepluginslistwidgettest.cpp
View file @
0091f6ea
...
...
@@ -23,11 +23,11 @@ void ConfigurePluginsListWidgetTest::shouldHaveDefaultValue()
{
PimCommon
::
ConfigurePluginsListWidget
w
;
QVBoxLayo
ut
*
mainLayout
=
w
.
findChild
<
QVBoxLayout
*>
(
QStringLiteral
(
"mainlayout"
));
a
ut
o
*
mainLayout
=
w
.
findChild
<
QVBoxLayout
*>
(
QStringLiteral
(
"mainlayout"
));
QVERIFY
(
mainLayout
);
QCOMPARE
(
mainLayout
->
contentsMargins
(),
QMargins
(
0
,
0
,
0
,
0
));
QTreeWidget
*
mListWidget
=
w
.
findChild
<
QTreeWidget
*>
(
QStringLiteral
(
"listwidget"
));
auto
*
mListWidget
=
w
.
findChild
<
QTreeWidget
*>
(
QStringLiteral
(
"listwidget"
));
QVERIFY
(
mListWidget
);
QVERIFY
(
mListWidget
->
isSortingEnabled
());
}
...
...
src/pimcommon/configureplugins/autotests/configurepluginswidgettest.cpp
View file @
0091f6ea
...
...
@@ -27,19 +27,19 @@ void ConfigurePluginsWidgetTest::shouldHaveDefaultValue()
{
PimCommon
::
ConfigurePluginsWidget
w
;
KMessageWidget
*
mMessageWidget
=
w
.
findChild
<
KMessageWidget
*>
(
QStringLiteral
(
"mMessageWidget"
));
auto
*
mMessageWidget
=
w
.
findChild
<
KMessageWidget
*>
(
QStringLiteral
(
"mMessageWidget"
));
QVERIFY
(
mMessageWidget
);
QVERIFY
(
!
mMessageWidget
->
isCloseButtonVisible
());
QVERIFY
(
!
mMessageWidget
->
text
().
isEmpty
());
QSplitter
*
mSplitter
=
w
.
findChild
<
QSplitter
*>
(
QStringLiteral
(
"splitter"
));
auto
*
mSplitter
=
w
.
findChild
<
QSplitter
*>
(
QStringLiteral
(
"splitter"
));
QVERIFY
(
mSplitter
);
QCOMPARE
(
mSplitter
->
count
(),
2
);
PimCommon
::
ConfigurePluginsListWidget
*
mConfigureListWidget
=
mSplitter
->
findChild
<
PimCommon
::
ConfigurePluginsListWidget
*>
(
QStringLiteral
(
"configureListWidget"
));
auto
*
mConfigureListWidget
=
mSplitter
->
findChild
<
PimCommon
::
ConfigurePluginsListWidget
*>
(
QStringLiteral
(
"configureListWidget"
));
QVERIFY
(
mConfigureListWidget
);
QTextEdit
*
mDescription
=
mSplitter
->
findChild
<
QTextEdit
*>
(
QStringLiteral
(
"description"
));
auto
*
mDescription
=
mSplitter
->
findChild
<
QTextEdit
*>
(
QStringLiteral
(
"description"
));
QVERIFY
(
mDescription
);
QVERIFY
(
mDescription
->
isReadOnly
());
QVERIFY
(
mDescription
->
document
()
->
isEmpty
());
...
...
src/pimcommon/configureplugins/configureplugindialog.cpp
View file @
0091f6ea
...
...
@@ -26,7 +26,7 @@ ConfigurePluginDialog::~ConfigurePluginDialog()
void
ConfigurePluginDialog
::
initLayout
(
bool
addSpacer
)
{
QVBoxLayo
ut
*
layout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
layout
=
new
QVBoxLayout
(
this
);
layout
->
addWidget
(
createLayout
());
if
(
addSpacer
)
{
layout
->
addStretch
(
1
);
...
...
src/pimcommon/configureplugins/configurepluginslistwidget.cpp
View file @
0091f6ea
...
...
@@ -20,7 +20,7 @@ using namespace PimCommon;
ConfigurePluginsListWidget
::
ConfigurePluginsListWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
setObjectName
(
QStringLiteral
(
"mainlayout"
));
mainLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
...
...
@@ -56,7 +56,7 @@ void ConfigurePluginsListWidget::slotItemChanged(QTreeWidgetItem *item, int colu
void
ConfigurePluginsListWidget
::
slotItemSelectionChanged
()
{
QTreeWidgetItem
*
item
=
mListWidget
->
currentItem
();
if
(
PluginItem
*
pluginItem
=
dynamic_cast
<
PluginItem
*>
(
item
))
{
if
(
auto
*
pluginItem
=
dynamic_cast
<
PluginItem
*>
(
item
))
{
Q_EMIT
descriptionChanged
(
pluginItem
->
mDescription
);
}
}
...
...
@@ -115,7 +115,7 @@ void ConfigurePluginsListWidget::fillTopItems(const QVector<PimCommon::PluginUti
topLevel
->
setFlags
(
topLevel
->
flags
()
&
~
Qt
::
ItemIsSelectable
);
const
QPair
<
QStringList
,
QStringList
>
pair
=
PimCommon
::
PluginUtil
::
loadPluginSetting
(
groupName
,
prefixKey
);
for
(
const
PimCommon
::
PluginUtilData
&
data
:
lst
)
{
PluginItem
*
subItem
=
new
PluginItem
(
topLevel
);
auto
*
subItem
=
new
PluginItem
(
topLevel
);
subItem
->
setText
(
0
,
data
.
mName
);
subItem
->
mIdentifier
=
data
.
mIdentifier
;
subItem
->
mDescription
=
data
.
mDescription
;
...
...
@@ -127,8 +127,8 @@ void ConfigurePluginsListWidget::fillTopItems(const QVector<PimCommon::PluginUti
subItem
->
setCheckState
(
0
,
isPluginActivated
?
Qt
::
Checked
:
Qt
::
Unchecked
);
}
if
(
data
.
mHasConfigureDialog
)
{
QToolButton
*
but
=
new
QToolButton
(
mListWidget
);
QAction
*
act
=
new
QAction
(
but
);
auto
*
but
=
new
QToolButton
(
mListWidget
);
auto
*
act
=
new
QAction
(
but
);
const
QStringList
actData
{
configureGroupName
,
data
.
mIdentifier
};
...
...
src/pimcommon/configureplugins/configurepluginswidget.cpp
View file @
0091f6ea
...
...
@@ -37,7 +37,7 @@ ConfigurePluginsWidget::~ConfigurePluginsWidget()
void
ConfigurePluginsWidget
::
initLayout
(
ConfigurePluginsListWidget
*
configurePluginListWidget
)
{
QVBoxLayo
ut
*
layout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
layout
=
new
QVBoxLayout
(
this
);
layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
mMessageWidget
=
new
KMessageWidget
(
i18n
(
"Restart is necessary for applying the changes."
),
this
);
...
...
src/pimcommon/customtools/autotests/customtoolswidgetngtest.cpp
View file @
0091f6ea
...
...
@@ -25,7 +25,7 @@ void CustomToolsWidgetNgTest::shouldHaveDefaultValue()
PimCommon
::
CustomToolsWidgetNg
widget
;
widget
.
show
();
QStackedWidget
*
stackWidget
=
widget
.
findChild
<
QStackedWidget
*>
(
QStringLiteral
(
"stackedwidget"
));
auto
*
stackWidget
=
widget
.
findChild
<
QStackedWidget
*>
(
QStringLiteral
(
"stackedwidget"
));
QVERIFY
(
stackWidget
);
}
...
...
src/pimcommon/customtools/customtoolswidgetng.cpp
View file @
0091f6ea
...
...
@@ -31,7 +31,7 @@ CustomToolsWidgetNg::CustomToolsWidgetNg(QWidget *parent)
:
QWidget
(
parent
)
,
d
(
new
PimCommon
::
CustomToolsWidgetNgPrivate
)
{
QHBoxLayo
ut
*
lay
=
new
QHBoxLayout
(
this
);
a
ut
o
*
lay
=
new
QHBoxLayout
(
this
);
d
->
mStackedWidget
=
new
QStackedWidget
;
d
->
mStackedWidget
->
setObjectName
(
QStringLiteral
(
"stackedwidget"
));
lay
->
addWidget
(
d
->
mStackedWidget
);
...
...
src/pimcommon/genericplugins/autotests/actiontypetest.cpp
View file @
0091f6ea
...
...
@@ -27,7 +27,7 @@ void ActionTypeTest::shouldHaveDefaultValue()
void
ActionTypeTest
::
shouldAssignValue
()
{
QAction
*
act
=
new
QAction
(
nullptr
);
auto
*
act
=
new
QAction
(
nullptr
);
PimCommon
::
ActionType
::
Type
type
=
PimCommon
::
ActionType
::
File
;
PimCommon
::
ActionType
actionType
(
act
,
type
);
QCOMPARE
(
actionType
.
action
(),
act
);
...
...
src/pimcommon/logactivities/autotests/logactivitiesdialogtest.cpp
View file @
0091f6ea
...
...
@@ -30,18 +30,18 @@ LogActivitiesDialogTest::~LogActivitiesDialogTest()
void
LogActivitiesDialogTest
::
shouldHaveDefaultValue
()
{
PimCommon
::
LogActivitiesDialog
w
;
QVBoxLayo
ut
*
mainLayout
=
w
.
findChild
<
QVBoxLayout
*>
(
QStringLiteral
(
"mainLayout"
));
a
ut
o
*
mainLayout
=
w
.
findChild
<
QVBoxLayout
*>
(
QStringLiteral
(
"mainLayout"
));
QVERIFY
(
mainLayout
);
PimCommon
::
LogActivitiesWidget
*
mLogWidget
=
w
.
findChild
<
PimCommon
::
LogActivitiesWidget
*>
(
QStringLiteral
(
"logwidget"
));
auto
*
mLogWidget
=
w
.
findChild
<
PimCommon
::
LogActivitiesWidget
*>
(
QStringLiteral
(
"logwidget"
));
QVERIFY
(
mLogWidget
);
QCheckBox
*
mEnableLogActivities
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"enablelogactivities"
));
auto
*
mEnableLogActivities
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"enablelogactivities"
));
QVERIFY
(
mEnableLogActivities
);
QVERIFY
(
!
mEnableLogActivities
->
text
().
isEmpty
());
QVERIFY
(
!
mEnableLogActivities
->
isChecked
());
QDialogButtonBox
*
buttonBox
=
w
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
auto
*
buttonBox
=
w
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
QVERIFY
(
buttonBox
);
const
QList
<
QAbstractButton
*>
lstButtonBox
=
buttonBox
->
buttons
();
...
...
@@ -60,9 +60,9 @@ void LogActivitiesDialogTest::shouldHaveDefaultValue()
void
LogActivitiesDialogTest
::
shouldClearLog
()
{
PimCommon
::
LogActivitiesDialog
w
;
QDialogButtonBox
*
buttonBox
=
w
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
auto
*
buttonBox
=
w
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
PimCommon
::
LogActivitiesWidget
*
mLogWidget
=
w
.
findChild
<
PimCommon
::
LogActivitiesWidget
*>
(
QStringLiteral
(
"logwidget"
));
auto
*
mLogWidget
=
w
.
findChild
<
PimCommon
::
LogActivitiesWidget
*>
(
QStringLiteral
(
"logwidget"
));
QVERIFY
(
mLogWidget
->
log
().
isEmpty
());
...
...
@@ -87,7 +87,7 @@ void LogActivitiesDialogTest::shouldHaveCorrectLogActivities()
{
PimCommon
::
LogActivitiesManager
::
self
()
->
setEnableLogActivities
(
true
);
PimCommon
::
LogActivitiesDialog
w
;
QCheckBox
*
mEnableLogActivities
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"enablelogactivities"
));
auto
*
mEnableLogActivities
=
w
.
findChild
<
QCheckBox
*>
(
QStringLiteral
(
"enablelogactivities"
));
QVERIFY
(
mEnableLogActivities
->
isChecked
());
}
...
...
src/pimcommon/logactivities/autotests/logactivitieswidgettest.cpp
View file @
0091f6ea
...
...
@@ -22,11 +22,11 @@ LogActivitiesWidgetTest::~LogActivitiesWidgetTest()
void
LogActivitiesWidgetTest
::
shouldHaveDefaultValue
()
{
PimCommon
::
LogActivitiesWidget
w
;
QVBoxLayo
ut
*
mainLayout
=
w
.
findChild
<
QVBoxLayout
*>
(
QStringLiteral
(
"mainLayout"
));
a
ut
o
*
mainLayout
=
w
.
findChild
<
QVBoxLayout
*>
(
QStringLiteral
(
"mainLayout"
));
QVERIFY
(
mainLayout
);
QCOMPARE
(
mainLayout
->
contentsMargins
(),
QMargins
(
0
,
0
,
0
,
0
));
KPIMTextEdit
::
PlainTextEditorWidget
*
mLog
=
w
.
findChild
<
KPIMTextEdit
::
PlainTextEditorWidget
*>
(
QStringLiteral
(
"log"
));
auto
*
mLog
=
w
.
findChild
<
KPIMTextEdit
::
PlainTextEditorWidget
*>
(
QStringLiteral
(
"log"
));
QVERIFY
(
mLog
);
QVERIFY
(
mLog
->
isReadOnly
());
}
...
...
src/pimcommon/logactivities/logactivitiesdialog.cpp
View file @
0091f6ea
...
...
@@ -23,7 +23,7 @@ LogActivitiesDialog::LogActivitiesDialog(QWidget *parent)
:
QDialog
(
parent
)
{
setWindowTitle
(
i18nc
(
"@title:window"
,
"Log activities"
));
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
setObjectName
(
QStringLiteral
(
"mainLayout"
));
mLogWidget
=
new
LogActivitiesWidget
(
this
);
...
...
@@ -46,7 +46,7 @@ LogActivitiesDialog::LogActivitiesDialog(QWidget *parent)
mSaveButton
->
setObjectName
(
QStringLiteral
(
"savebutton"
));
mSaveButton
->
setEnabled
(
false
);
LogactivitiesPurposeMenuWidget
*
purposeMenu
=
new
LogactivitiesPurposeMenuWidget
(
this
,
this
);
auto
*
purposeMenu
=
new
LogactivitiesPurposeMenuWidget
(
this
,
this
);
mShareButton
=
new
QPushButton
(
i18n
(
"Share..."
),
this
);
mShareButton
->
setMenu
(
purposeMenu
->
menu
());
mShareButton
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-share"
)));
...
...
src/pimcommon/logactivities/logactivitieswidget.cpp
View file @
0091f6ea
...
...
@@ -13,7 +13,7 @@ using namespace PimCommon;
LogActivitiesWidget
::
LogActivitiesWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
mainLayout
->
setObjectName
(
QStringLiteral
(
"mainLayout"
));
...
...
src/pimcommon/logactivities/tests/logactivitiesmainwidget.cpp
View file @
0091f6ea
...
...
@@ -14,7 +14,7 @@
LogActivitiesMainWidget
::
LogActivitiesMainWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QHBoxLayo
ut
*
mainLayout
=
new
QHBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QHBoxLayout
(
this
);
QPushButton
*
button
=
new
QPushButton
(
QStringLiteral
(
"Open Log"
),
this
);
connect
(
button
,
&
QPushButton
::
clicked
,
this
,
&
LogActivitiesMainWidget
::
slotOpenDialog
);
mainLayout
->
addWidget
(
button
);
...
...
src/pimcommon/logactivities/tests/main.cpp
View file @
0091f6ea
...
...
@@ -19,7 +19,7 @@ int main(int argc, char **argv)
parser
.
process
(
app
);
LogActivitiesMainWidget
*
w
=
new
LogActivitiesMainWidget
;
auto
*
w
=
new
LogActivitiesMainWidget
;
w
->
show
();
app
.
exec
();
return
0
;
...
...
src/pimcommon/shareserviceurl/shareserviceurlmanager.cpp
View file @
0091f6ea
...
...
@@ -34,7 +34,7 @@ void ShareServiceUrlManagerPrivate::initializeMenu()
{
mMenu
=
new
KActionMenu
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-share"
)),
i18n
(
"Share On..."
),
q
);
for
(
int
i
=
0
;
i
<
ShareServiceUrlManager
::
ServiceEndType
;
++
i
)
{
const
ShareServiceUrlManager
::
ServiceType
type
=
static_cast
<
ShareServiceUrlManager
::
ServiceType
>
(
i
);
const
auto
type
=
static_cast
<
ShareServiceUrlManager
::
ServiceType
>
(
i
);
QAction
*
action
=
new
QAction
(
i18nc
(
"@action:inmenu Share On..."
,
"%1"
,
typeToI18n
(
type
)),
q
);
action
->
setData
(
QVariant
::
fromValue
(
type
));
const
QIcon
icon
=
typeToIcon
(
type
);
...
...
@@ -127,7 +127,7 @@ KActionMenu *ShareServiceUrlManager::menu() const
void
ShareServiceUrlManager
::
slotSelectServiceUrl
(
QAction
*
act
)
{
if
(
act
)
{
const
ServiceType
type
=
act
->
data
().
value
<
PimCommon
::
ShareServiceUrlManager
::
ServiceType
>
();
const
auto
type
=
act
->
data
().
value
<
PimCommon
::
ShareServiceUrlManager
::
ServiceType
>
();
Q_EMIT
serviceUrlSelected
(
type
);
}
}
...
...
src/pimcommon/templatewidgets/templateeditdialog.cpp
View file @
0091f6ea
...
...
@@ -26,7 +26,7 @@ TemplateEditDialog::TemplateEditDialog(QWidget *parent, bool defaultTemplate)
:
QDialog
(
parent
)
{
setWindowTitle
(
defaultTemplate
?
i18n
(
"Default template"
)
:
i18n
(
"Template"
));
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
QDialogButtonBox
*
buttonBox
=
nullptr
;
if
(
defaultTemplate
)
{
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Close
,
this
);
...
...
@@ -44,10 +44,10 @@ TemplateEditDialog::TemplateEditDialog(QWidget *parent, bool defaultTemplate)
mainLayout
->
addWidget
(
w
);
mainLayout
->
addWidget
(
buttonBox
);
QVBoxLayo
ut
*
vbox
=
new
QVBoxLayout
;
a
ut
o
*
vbox
=
new
QVBoxLayout
;
vbox
->
setContentsMargins
(
0
,
0
,
0
,
0
);
QHBoxLayo
ut
*
hbox
=
new
QHBoxLayout
;
a
ut
o
*
hbox
=
new
QHBoxLayout
;
QLabel
*
label
=
new
QLabel
(
i18n
(
"Name:"
));
hbox
->
addWidget
(
label
);
...
...
Prev
1
2
3
4
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment