ToolForm
::ToolForm( QDialog *parent, Qt
::WindowFlags f
){
setupViews();
setupUi(this);
}
ToolForm::~ToolForm()
{
}
void ToolForm::setupViews()
{
tooltableWidget
->setHorizontalHeaderLabels
(QStringList() << tr
("TOOL NUMBER") << tr("DIAMETER")
<< tr("LENGTH")
<< tr("UNITS"));
tooltableWidget->verticalHeader()->setVisible(false);
tooltableWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
tooltableWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
tooltableWidget->setShowGrid(false);
tooltableWidget
->setGeometry
(QRect(0,
100,
781,
281));
tooltableWidget->horizontalHeader()->resizeSection(1, 250);
tooltableWidget->horizontalHeader()->resizeSection(2, 250);
tooltableWidget->horizontalHeader()->resizeSection(3, 180);
}
void ToolForm::add_tool()
{
ToolAddDialog tooladddialog;
if( tooladddialog.exec())
{
QString str
= tooladddialog.
toolgetValues();
//now i need to display the values from tooladddialog. to TableWidget
}
}
ToolForm::ToolForm( QDialog *parent, Qt::WindowFlags f)
: QDialog( parent, f),
{
setupViews();
setupUi(this);
}
ToolForm::~ToolForm()
{
}
void ToolForm::setupViews()
{
QTableWidget *tooltableWidget = new QTableWidget(200, 4, this);
tooltableWidget->setHorizontalHeaderLabels(QStringList() << tr("TOOL NUMBER")
<< tr("DIAMETER")
<< tr("LENGTH")
<< tr("UNITS"));
tooltableWidget->verticalHeader()->setVisible(false);
tooltableWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
tooltableWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
tooltableWidget->setShowGrid(false);
tooltableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
tooltableWidget->setGeometry(QRect(0, 100, 781, 281));
tooltableWidget->horizontalHeader()->resizeSection(1, 250);
tooltableWidget->horizontalHeader()->resizeSection(2, 250);
tooltableWidget->horizontalHeader()->resizeSection(3, 180);
}
void ToolForm::add_tool()
{
ToolAddDialog tooladddialog;
if( tooladddialog.exec())
{
QTableWidget *tooltableWidget = new QTableWidget;
QString str = tooladddialog.toolgetValues();
QStringList fields = str.split(" ");
//now i need to display the values from tooladddialog. to TableWidget
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks