mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-22 09:54:54 -05:00
This will be more consistent with the widget styles used throughout OBS and solves a few layout issues
51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#pragma once
|
|
#include "export-symbol-helper.hpp"
|
|
|
|
#include <QLabel>
|
|
#include <QString>
|
|
#include <QToolButton>
|
|
#include <QTableWidget>
|
|
|
|
class QResizeEvent;
|
|
|
|
namespace advss {
|
|
|
|
class ADVSS_EXPORT ResourceTable : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
ResourceTable(QTabWidget *parent, const QString &help,
|
|
const QString &addToolTip, const QString &removeToolTip,
|
|
const QStringList &headers,
|
|
const std::function<void()> &openSettings);
|
|
virtual ~ResourceTable();
|
|
|
|
QTableWidget *Table() const { return _table; }
|
|
void SetHelpVisible(bool) const;
|
|
void HighlightAddButton(bool);
|
|
|
|
protected slots:
|
|
virtual void Add() {}
|
|
virtual void Remove() {}
|
|
|
|
protected:
|
|
void resizeEvent(QResizeEvent *event);
|
|
|
|
private:
|
|
QTableWidget *_table;
|
|
QToolButton *_add;
|
|
QToolButton *_remove;
|
|
QLabel *_help;
|
|
|
|
QObject *_highlightConnection = nullptr;
|
|
};
|
|
|
|
EXPORT void AddItemTableRow(QTableWidget *table, const QStringList &cells);
|
|
EXPORT void UpdateItemTableRow(QTableWidget *table, int row,
|
|
const QStringList &cells);
|
|
EXPORT void RenameItemTableRow(QTableWidget *table, const QString &oldName,
|
|
const QString &newName);
|
|
EXPORT void RemoveItemTableRow(QTableWidget *table, const QString &name);
|
|
|
|
} // namespace advss
|