Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KAlarm
Commits
2a475134
Commit
2a475134
authored
Jul 20, 2022
by
David Jarvie
Browse files
Rationalise use of listViewOptions()
parent
387f37e3
Pipeline
#209398
passed with stage
in 1 minute and 46 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/alarmlistview.cpp
View file @
2a475134
...
...
@@ -112,17 +112,6 @@ void AlarmListView::initSections()
header
()
->
resizeSection
(
AlarmListModel
::
TypeColumn
,
AlarmListModel
::
iconWidth
()
+
2
*
margin
+
2
);
}
QStyleOptionViewItem
AlarmListView
::
listViewOptions
()
const
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
return
QTreeView
::
viewOptions
();
#else
QStyleOptionViewItem
option
;
initViewItemOption
(
&
option
);
return
option
;
#endif
}
/******************************************************************************
* Called when the column order is changed.
* Save the new order for restoration on program restart.
...
...
src/alarmlistview.h
View file @
2a475134
...
...
@@ -39,7 +39,6 @@ private:
void
showHideColumn
(
QMenu
&
,
QAction
*
);
void
setReplaceBlankName
();
void
enableTimeColumns
(
QMenu
*
);
QStyleOptionViewItem
listViewOptions
()
const
;
QByteArray
mConfigGroup
;
};
...
...
src/eventlistview.cpp
View file @
2a475134
...
...
@@ -156,18 +156,6 @@ void EventListView::resizeEvent(QResizeEvent* se)
initSections
();
}
QStyleOptionViewItem
EventListView
::
listViewOptions
()
const
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
return
QTreeView
::
viewOptions
();
#else
QStyleOptionViewItem
option
;
initViewItemOption
(
&
option
);
return
option
;
#endif
}
/******************************************************************************
* Called when a ToolTip or WhatsThis event occurs.
*/
...
...
@@ -216,6 +204,17 @@ void EventListView::contextMenuEvent(QContextMenuEvent* e)
Q_EMIT
contextMenuRequested
(
e
->
globalPos
());
}
QStyleOptionViewItem
EventListView
::
listViewOptions
()
const
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
return
QTreeView
::
viewOptions
();
#else
QStyleOptionViewItem
option
;
initViewItemOption
(
&
option
);
return
option
;
#endif
}
bool
EventListDelegate
::
editorEvent
(
QEvent
*
e
,
QAbstractItemModel
*
model
,
const
QStyleOptionViewItem
&
,
const
QModelIndex
&
index
)
{
...
...
src/eventlistview.h
View file @
2a475134
...
...
@@ -47,13 +47,13 @@ protected:
void
resizeEvent
(
QResizeEvent
*
)
override
;
bool
viewportEvent
(
QEvent
*
)
override
;
void
contextMenuEvent
(
QContextMenuEvent
*
)
override
;
QStyleOptionViewItem
listViewOptions
()
const
;
protected
Q_SLOTS
:
virtual
void
initSections
()
=
0
;
void
sortChanged
(
int
column
,
Qt
::
SortOrder
);
private:
QStyleOptionViewItem
listViewOptions
()
const
;
void
findNext
(
bool
forward
);
Find
*
mFind
{
nullptr
};
...
...
src/resources/resourcemodel.cpp
View file @
2a475134
...
...
@@ -721,4 +721,5 @@ QStyleOptionViewItem ResourceView::listViewOptions() const
return
option
;
#endif
}
// vim: et sw=4:
src/resources/resourcemodel.h
View file @
2a475134
...
...
@@ -236,7 +236,6 @@ Q_SIGNALS:
protected:
void
mouseReleaseEvent
(
QMouseEvent
*
)
override
;
bool
viewportEvent
(
QEvent
*
)
override
;
private:
QStyleOptionViewItem
listViewOptions
()
const
;
};
...
...
src/templatelistview.cpp
View file @
2a475134
...
...
@@ -39,17 +39,6 @@ void TemplateListView::initSections()
sortByColumn
(
TemplateListModel
::
TemplateNameColumn
,
Qt
::
AscendingOrder
);
}
QStyleOptionViewItem
TemplateListView
::
listViewOptions
()
const
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
return
QTreeView
::
viewOptions
();
#else
QStyleOptionViewItem
option
;
initViewItemOption
(
&
option
);
return
option
;
#endif
}
void
TemplateListDelegate
::
edit
(
KAEvent
&
event
,
EventListView
*
view
)
{
KAlarm
::
editTemplate
(
event
,
static_cast
<
TemplateListView
*>
(
view
));
...
...
src/templatelistview.h
View file @
2a475134
...
...
@@ -19,8 +19,6 @@ public:
protected
Q_SLOTS
:
void
initSections
()
override
;
private:
QStyleOptionViewItem
listViewOptions
()
const
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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