Commit e04640a0 authored by Hugo Hörnquist's avatar Hugo Hörnquist

Macroed away a bunch of stuff in admin.

parent 666fbbc0
This diff is collapsed.
......@@ -10,6 +10,27 @@
#include "disablingmodel.h"
#define SET_HEADER_DATA(MODEL,...) do { \
std::pair<int, QString> (model_data_ ## __LINE__) [] = { __VA_ARGS__ }; \
for (auto v : (model_data_ ## __LINE__)) { \
(MODEL)->setHeaderData(v.first, Qt::Horizontal, v.second); \
} \
} while (0)
#define SET_COL_DELEGATORS(VIEW,...) do { \
std::pair<int, QAbstractItemDelegate* > (view_data_ ## __LINE__) [] = { __VA_ARGS__ }; \
for (auto v : (view_data_ ## __LINE__)) { \
(VIEW)->setItemDelegateForColumn(v.first, v.second); \
} \
} while (0)
#define HIDE_COLUMNS(VIEW,...) do { \
auto ns ## __LINE__ = { __VA_ARGS__ }; \
for (int n : ns ## __LINE__) { \
(VIEW)->hideColumn(n); \
} \
} while (0)
namespace Ui {
class MainWindow;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment