swift
Loading...
Searching...
No Matches
audiodeviceinfolistmodel.cpp
1// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#include <Qt>
7#include <QtGlobal>
8
10#include "gui/models/columns.h"
11
12using namespace swift::misc;
13using namespace swift::misc::audio;
14
15namespace swift::gui::models
16{
18 : CListModelBase("AudioDeviceInfoListModel", parent)
19 {
20 m_columns.addColumn(CColumn::standardString("type", CAudioDeviceInfo::IndexDeviceTypeAsString));
21 m_columns.addColumn(CColumn::standardString("name", CAudioDeviceInfo::IndexName));
22 m_columns.addColumn(
23 CColumn::standardString("machine", { CAudioDeviceInfo::IndexIdentifier, CIdentifier::IndexMachineName }));
24 m_columns.addColumn(
25 CColumn::standardString("process", { CAudioDeviceInfo::IndexIdentifier, CIdentifier::IndexProcessName }));
26
27 // default sort order
28 this->setSortColumnByPropertyIndex(CAudioDeviceInfo::IndexName);
30 }
31} // namespace swift::gui::models
CAudioDeviceInfoListModel(QObject *parent=nullptr)
Constructor.
static CColumn standardString(const QString &headerName, const swift::misc::CPropertyIndex &propertyIndex, int alignment=CDefaultFormatter::alignDefault())
Get a standard string object formatted column.
Definition columns.cpp:57
CListModelBase(const QString &translationContext, QObject *parent=nullptr)
virtual bool setSortColumnByPropertyIndex(const swift::misc::CPropertyIndex &propertyIndex)
Set column for sorting.
QModelIndex parent(const QModelIndex &child) const final
Models to be used with views, mainly QTableView.
Free functions in swift::misc.
QObject(QObject *parent)
AscendingOrder