kavinsiva
18th June 2010, 06:15
HI,
In My code i set some tab order but it doesnt works pls guide me to resolve this
mainwindow.cpp
#include "mainwindow.h"
#include<QtGui>
MainWindow::MainWindow(QWidget *parent) : QDialog(parent)
{
buttonBox = new QDialogButtonBox(this);
buttonBox->setGeometry(QRect(170, 90, 181, 34));
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialo gButtonBox::Save);
groupBox = new QGroupBox(this);
groupBox->setGeometry(QRect(10, 10, 141, 80));
RB1= new QRadioButton(groupBox);
RB1->setGeometry(QRect(10, 10, 121, 19));
RB1->setText("Absalute Time");
RB1->setChecked(true);
RB1->setFocus();
RB2 = new QRadioButton(groupBox);
RB2->setGeometry(QRect(10, 40, 111, 19));
RB2->setText("Relative Time");
CB1= new QComboBox(this);
CB1->setGeometry(QRect(170, 20, 78, 24));
CB1->addItem("1");
CB1->addItem("2");
CB1->addItem("3");
CB1->addItem("4");
CB2 = new QComboBox(this);
CB2->setGeometry(QRect(270, 20, 78, 24));
CB2->addItem("1");
CB2->addItem("2");
CB2->addItem("3");
CB2->addItem("4");
CB3 = new QComboBox(this);
CB3->setGeometry(QRect(170, 50, 78, 24));
CB3->addItem("1");
CB3->addItem("2");
CB3->addItem("3");
CB3->addItem("4");
QWidget::setTabOrder(CB1,CB2);
QWidget::setTabOrder(CB2,buttonBox);
QWidget::setTabOrder(CB3,buttonBox);
}
Regards:
In My code i set some tab order but it doesnt works pls guide me to resolve this
mainwindow.cpp
#include "mainwindow.h"
#include<QtGui>
MainWindow::MainWindow(QWidget *parent) : QDialog(parent)
{
buttonBox = new QDialogButtonBox(this);
buttonBox->setGeometry(QRect(170, 90, 181, 34));
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialo gButtonBox::Save);
groupBox = new QGroupBox(this);
groupBox->setGeometry(QRect(10, 10, 141, 80));
RB1= new QRadioButton(groupBox);
RB1->setGeometry(QRect(10, 10, 121, 19));
RB1->setText("Absalute Time");
RB1->setChecked(true);
RB1->setFocus();
RB2 = new QRadioButton(groupBox);
RB2->setGeometry(QRect(10, 40, 111, 19));
RB2->setText("Relative Time");
CB1= new QComboBox(this);
CB1->setGeometry(QRect(170, 20, 78, 24));
CB1->addItem("1");
CB1->addItem("2");
CB1->addItem("3");
CB1->addItem("4");
CB2 = new QComboBox(this);
CB2->setGeometry(QRect(270, 20, 78, 24));
CB2->addItem("1");
CB2->addItem("2");
CB2->addItem("3");
CB2->addItem("4");
CB3 = new QComboBox(this);
CB3->setGeometry(QRect(170, 50, 78, 24));
CB3->addItem("1");
CB3->addItem("2");
CB3->addItem("3");
CB3->addItem("4");
QWidget::setTabOrder(CB1,CB2);
QWidget::setTabOrder(CB2,buttonBox);
QWidget::setTabOrder(CB3,buttonBox);
}
Regards: