swift
Loading...
Searching...
No Matches
textmessageview.cpp
1// SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#include <QtGlobal>
7
9
10using namespace swift::misc;
11using namespace swift::gui::models;
12
13namespace swift::gui::views
14{
16 {
17 this->standardInit(new CTextMessageListModel(CTextMessageListModel::FromTo, this));
19 }
20
22 {
23 Q_ASSERT(m_model);
24 m_model->setTextMessageMode(mode);
25 this->setSortIndicator();
26 }
27
28 bool CTextMessageView::isSortedByTimestampProperty() const { return m_model->isSortedByTimestampProperty(); }
29
31 {
32 return m_model->isSortedByTimestampProperty() && this->getSortOrder() == Qt::AscendingOrder;
33 }
34
35} // namespace swift::gui::views
bool isSortedByTimestampPropertyLatestLast() const
Sorted by a timestamp property, latest messages at the end.
void setTextMessageMode(swift::gui::models::CTextMessageListModel::TextMessageMode mode)
Set display mode.
CTextMessageView(QWidget *parent=nullptr)
Constructor.
bool isSortedByTimestampProperty() const
Sorted by a timestamp property.
CViewBase(QWidget *parent, ModelClass *model=nullptr)
Definition viewbase.cpp:31
Menu m_menus
Default menu settings.
Definition viewbase.h:603
@ MenuClear
allow clearing the view via menu
Definition viewbase.h:120
Models to be used with views, mainly QTableView.
Views, mainly QTableView.
Free functions in swift::misc.
QObject * parent() const const
AscendingOrder