2019-12-31 06:17:17 +00:00
|
|
|
#pragma once
|
2020-01-02 06:13:03 +00:00
|
|
|
#include <QtCore/QString>
|
2019-12-31 06:17:17 +00:00
|
|
|
#include <initializer_list>
|
2020-01-02 06:13:03 +00:00
|
|
|
#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);
|
|
|
|
|
2020-01-02 06:13:03 +00:00
|
|
|
/// 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
|