w->setMinimumWidth(m_minWidth);
if (w->sizeHint().width() > m_maxw[m_col])
m_maxw[m_col] = w->sizeHint().width();
- if (w->sizeHint().height() > m_maxh)
- m_maxh = w->sizeHint().height();
grid->addWidget(w, m_row, m_col, align | Qt::AlignVCenter);
m_col++;
if (m_col == m_cols) {
}
}
-void ApplicationWindow::addTabs(int size[])
+void ApplicationWindow::addTabs(int m_winWidth)
{
v4l2_query_ext_ctrl qec = { 0 };
unsigned ctrl_class;
fixWidth(grid);
int totalw = 0;
- int totalh = 0;
int diff = 0;
for (int i = 0; i < m_cols; i++) {
totalw += m_maxw[i] + m_pxw;
}
- totalh = grid->rowCount() * m_maxh;
- if (totalw > size[0])
- size[0] = totalw;
+ if (totalw > m_winWidth)
+ m_winWidth = totalw;
else {
- diff = size[0] - totalw;
+ diff = m_winWidth - totalw;
grid->setHorizontalSpacing(diff/5);
}
- if (totalh > size[1])
- size[1] = totalh;
- setMinimumSize(size[0], size[1]);
-
grid = new QGridLayout(w);
finishGrid(grid, ctrl_class);
}
m_pxw(25.0),
m_vMargin(10),
m_hMargin(20),
- m_maxh(0),
m_isRadio(false),
m_isSDR(false),
m_isVbi(false),
w->setMinimumWidth(m_minWidth);
if (w->sizeHint().width() > m_maxw[m_col])
m_maxw[m_col] = w->sizeHint().width();
- if (w->sizeHint().height() > m_maxh)
- m_maxh = w->sizeHint().height();
QGridLayout::addWidget(w, m_row, m_col, align | Qt::AlignVCenter);
m_col++;
if (m_col == m_cols) {
return total;
}
-int GeneralTab::getHeight()
-{
- return rowCount() * m_maxh;
-}
-
bool GeneralTab::isSlicedVbi() const
{
return m_vbiMethods && m_vbiMethods->currentText() == "Sliced";
unsigned getDisplayColorspace() const;
unsigned getColorspace() const;
int getWidth();
- int getHeight();
public slots:
void showAllAudioDevices(bool use);
m_minWidth(175),
m_vMargin(15),
m_hMargin(5),
- m_maxh(0),
m_genTab(NULL),
m_sigMapper(NULL)
{
QWidget *w = new QWidget(m_tabs);
m_genTab = new GeneralTab(device, this, 4, w);
- int size[2];
- size[0] = m_genTab->getWidth();
- size[1] = m_genTab->getHeight();
- setMinimumSize(size[0], size[1]);
+ int m_winWidth = m_genTab->getWidth();
#ifdef HAVE_ALSA
if (m_genTab->hasAlsaAudio()) {
connect(m_genTab, SIGNAL(displayColorspaceChanged()), this, SLOT(updateDisplayColorspace()));
connect(m_genTab, SIGNAL(clearBuffers()), this, SLOT(clearBuffers()));
m_tabs->addTab(w, "General Settings");
- addTabs(size);
+ addTabs(m_winWidth);
m_vbiTab = NULL;
if (has_vbi_cap()) {
w = new QWidget(m_tabs);
addWidget(grid, new QLabel(text, parentWidget()), align);
}
void fixWidth(QGridLayout *grid);
- void addTabs(int size[]);
+ void addTabs(int m_winWidth);
void finishGrid(QGridLayout *grid, unsigned ctrl_class);
void addCtrl(QGridLayout *grid, const struct v4l2_query_ext_ctrl &qec);
void updateCtrl(unsigned id);
const int m_vMargin;
const int m_hMargin;
int m_maxw[4];
- int m_maxh;
int m_increment;
GeneralTab *m_genTab;
VbiTab *m_vbiTab;