40 std::numeric_limits<size_t>::max();
44 : QComboBox(parent), reconstruction_manager_(reconstruction_manager) {
46 font.setPointSize(10);
51 if (view()->isVisible()) {
57 const int prev_idx = currentIndex() == -1 ? 0 : currentIndex();
61 addItem(
"Newest model");
64 for (
size_t i = 0; i < reconstruction_manager_->
Size(); ++i) {
65 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
66 const QString item = QString::asprintf(
67 "Model %d (%d images, %d points)",
static_cast<int>(i + 1),
71 const QString item = QString().sprintf(
72 "Model %d (%d images, %d points)",
static_cast<int>(i + 1),
76 QFontMetrics font_metrics(view()->font());
81 view()->setMinimumWidth(max_width);
83 if (reconstruction_manager_->
Size() == 0) {
86 setCurrentIndex(prev_idx);
93 if (reconstruction_manager_->
Size() == 0) {
96 if (currentIndex() == 0) {
99 return currentIndex() - 1;
105 if (reconstruction_manager_->
Size() == 0) {
111 setCurrentIndex(idx + 1);
#define QTCOMPAT_FONTMETRICS_WIDTH(fm, text)
const Reconstruction & Get(const size_t idx) const
size_t NumRegImages() const
size_t NumPoints3D() const