Duckstation/src/duckstation-qt/qtutils.h

20 lines
591 B
C
Raw Normal View History

2019-12-31 06:17:17 +00:00
#pragma once
#include <QtCore/QString>
2019-12-31 06:17:17 +00:00
#include <initializer_list>
#include <optional>
2019-12-31 06:17:17 +00:00
class QTableView;
namespace QtUtils {
/// Resizes columns of the table view to at the specified widths. A width of -1 will stretch the column to use the
/// remaining space.
void ResizeColumnsForTableView(QTableView* view, const std::initializer_list<int>& widths);
/// Returns a string identifier for a Qt key ID.
QString GetKeyIdentifier(int key);
/// Returns the integer Qt key ID for an identifier.
std::optional<int> GetKeyIdForIdentifier(const QString& key_identifier);
2019-12-31 06:17:17 +00:00
} // namespace QtUtils