// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void StatsGenODFWidget::setupGui() { // Setup the TableView and Table Models QHeaderView* headerView = new QHeaderView(Qt::Horizontal, m_ODFTableView); headerView->sectionResizeMode(QHeaderView::Interactive); m_ODFTableView->setHorizontalHeader(headerView); headerView->show(); m_OdfBulkTableModel = new SGODFTableModel; m_OdfBulkTableModel->setCrystalStructure(m_CrystalStructure); m_OdfBulkTableModel->setInitialValues(); m_ODFTableView->setModel(m_OdfBulkTableModel); m_ODFTableModel = new SGODFTableModel; m_ODFTableModel->setCrystalStructure(m_CrystalStructure); m_ODFTableModel->setInitialValues(); m_ODFTableView->setModel(m_ODFTableModel); QAbstractItemDelegate* idelegate = m_ODFTableModel->getItemDelegate(); m_ODFTableView->setItemDelegate(idelegate); addODFTextureBtn->setToolTip("Add ODF Weight"); deleteODFTextureBtn->setToolTip("Delete ODF Weight"); m_PlotCurves.push_back(new QwtPlotCurve); m_PlotCurves.push_back(new QwtPlotCurve); m_PlotCurves.push_back(new QwtPlotCurve); }
pTableWidget::pTableWidget(QWidget *parent) : QTableWidget(parent), m_defaultSortedColumn(0) { setSortingEnabled(true); QHeaderView *header; // Horizontal header header = horizontalHeader(); header->setHighlightSections(false); header->setSortIndicatorShown(false); header->setDefaultSectionSize(50); header->show(); // Vertical header header = verticalHeader(); header->setDefaultSectionSize(21); header->hide(); // Frame //setFrameStyle(QFrame::NoFrame); setSelectionMode(QAbstractItemView::SingleSelection); setSelectionBehavior(QAbstractItemView::SelectRows); setEditTriggers(QAbstractItemView::NoEditTriggers); setAlternatingRowColors(true); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); connect(horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(updateToolButtonNumber())); }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void StatsGenPlotWidget::setupGui() { distributionTypeCombo->blockSignals(true); distributionTypeCombo->addItem(DREAM3D::StringConstants::BetaDistribution.toLatin1().data()); distributionTypeCombo->addItem(DREAM3D::StringConstants::LogNormalDistribution.toLatin1().data()); distributionTypeCombo->addItem(DREAM3D::StringConstants::PowerLawDistribution.toLatin1().data()); distributionTypeCombo->blockSignals(false); // Setup the TableView and Table Models QHeaderView* headerView = new QHeaderView(Qt::Horizontal, m_TableView); headerView->sectionResizeMode(QHeaderView::Interactive); m_TableView->setHorizontalHeader(headerView); headerView->show(); // Setup the Qwt Plot Widget //plot->setCanvasBackground(QColor(Qt::white)); //m_PlotView->canvas()->setFrameShape(QFrame::NoFrame); m_grid = new QwtPlotGrid; m_grid->enableXMin(true); m_grid->enableYMin(true); #if (QWT_VERSION > 0x060000) m_grid->setMajorPen(QPen(Qt::gray, 0, Qt::SolidLine)); m_grid->setMinorPen(QPen(Qt::lightGray, 0, Qt::DotLine)); #else m_grid->setMajPen(QPen(Qt::gray, 0, Qt::SolidLine)); m_grid->setMinPen(QPen(Qt::lightGray, 0, Qt::DotLine)); #endif m_grid->attach(m_PlotView); resetTableModel(); if (NULL != m_TableModel) { // Update the plots updatePlotCurves(); } }
StockTable::StockTable(QWidget *parent) : pMiniTableWidget(parent) { setColumnCount(3); QStringList headerLabels; headerLabels.append(tr("Package")); headerLabels.append(tr("Stock")); headerLabels.append(tr("Low")); setHorizontalHeaderLabels(headerLabels); QHeaderView *header; header = horizontalHeader(); header->setResizeMode(0, QHeaderView::Stretch); header->setResizeMode(1, QHeaderView::Fixed); header->setResizeMode(2, QHeaderView::Fixed); header->setStretchLastSection(false); header->show(); setColumnWidth(1, 70); setColumnWidth(2, 70); }