summaryrefslogtreecommitdiffstats
path: root/qt/qqcombores.cpp
blob: 45082d1864b5ed2d6f92f0cb9e53dc5607d58794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <qqcombores.h>
#include <sstream>
#include <string>
#include <QDebug>
#include <iostream>
#include <FakeWindow.h>

QqComboRes::QqComboRes(V4L2CamLayer *lay, QqWidget *parent) :
    QWidget(parent)
{
  m_QqWidget = parent;
  m_resBox = new QComboBox(this);
  m_resBox->setToolTip("V4L2 resolution");
  m_res = lay->getRes();
  m_lay = lay;
  QStringList res;
  
  QString qx, qy, qres;
  qDebug() << "++ nb:" << m_res->getNb();
  for (int i = 0; i < m_res->getNb(); i++){
    qx.setNum (m_res->getX(i));
    qy.setNum (m_res->getY(i));
    qDebug() << "++ x:" << m_res->getX(i) << " y:" << m_res->getY(i) << " i:" << i;
    qres.clear();
    qres = qx + "x" + qy;
    res << qres;
  }
  m_resBox->addItems(res);
  m_resBox->setCurrentIndex(m_res->getCurIdx());
  connect(m_resBox, SIGNAL(activated(int)), this, SLOT(changeRes(int)));
}

void QqComboRes::changeRes(int line) {
  m_lay->chgRes(line, m_res);
  m_QqWidget->resetZoom();
}