本文整理汇总了C++中QTableView::setMinimumSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QTableView::setMinimumSize方法的具体用法?C++ QTableView::setMinimumSize怎么用?C++ QTableView::setMinimumSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTableView
的用法示例。
在下文中一共展示了QTableView::setMinimumSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AbstractAnalysisWidget
/*! Constructor */
StateBasedPhiWidget::StateBasedPhiWidget(QWidget *parent) : AbstractAnalysisWidget(parent){
QVBoxLayout *mainVerticalBox = new QVBoxLayout(this);
//Create a state based phi analysis dao to be used by this class
stateDao = new StateBasedPhiAnalysisDao(Globals::getAnalysisDao()->getDBInfo());
//Initialize analysis parameters and other variables
initializeAnalysisInfo();
//Set up analysis runner with function to create threads to analyze for state-based phi
analysisRunner->setTimeStepThreadCreationFunction(&createAnalysisTimeStepThread);
//Add tool bar to top of widget
toolBar = getDefaultToolBar();
checkToolBarEnabled();//Can only carry out analysis if a network and archive are loaded
mainVerticalBox->addWidget(toolBar);
//Create a tabbed widget to hold progress and results
QTabWidget* tabWidget = new QTabWidget(this);
//Add the model and view displaying the current analysis
fullResultsModel = new FullResultsModel(&analysisInfo, stateDao);
QTableView* fullResultsTableView = new FullResultsTableView(this, fullResultsModel);
fullResultsTableView->setMinimumSize(500, 500);
tabWidget->addTab(fullResultsTableView, "Results");
//Add widget displaying progress
progressWidget = new ProgressWidget(this);
connect(analysisRunner, SIGNAL(progress(const QString&, unsigned int, unsigned int, unsigned int)), progressWidget, SLOT(updateProgress(const QString&, unsigned int, unsigned int, unsigned int)), Qt::QueuedConnection);
connect(analysisRunner, SIGNAL(timeStepComplete(unsigned int)), progressWidget, SLOT(timeStepComplete(unsigned int)), Qt::QueuedConnection);
progressWidget->setMinimumSize(500, 500);
QScrollArea* progressScrollArea = new QScrollArea(this);
progressScrollArea->setWidget(progressWidget);
tabWidget->addTab(progressScrollArea, "Progress");
mainVerticalBox->addWidget(tabWidget);
mainVerticalBox->addStretch(5);
}
示例2: QMainWindow
//.........这里部分代码省略.........
for (auto i = 1u; i <= DraftSettings::Get().OwnerCount; i++) {
pVecOwnerLabels->append(new QLabel(DraftSettings::Get().OwnerNames[i]));
}
// Update label helper
auto UpdateOwnerLabels = [=]() {
for (auto i = 1u; i <= DraftSettings::Get().OwnerCount; i++) {
pVecOwnerLabels->at(i)->setText(DraftSettings::Get().OwnerNames[i]);
}
};
// Initialize
UpdateOwnerLabels();
// Loop owners
for (uint32_t ownerId = 1; ownerId <= DraftSettings::Get().OwnerCount; ownerId++) {
// V-Layout per owner
QVBoxLayout* perOwnerLayout = new QVBoxLayout(this);
ownersLayout->addLayout(perOwnerLayout);
perOwnerLayout->setSizeConstraint(QLayout::SetNoConstraint);
// Proxy model for this owner
OwnerSortFilterProxyModel* ownerSortFilterProxyModel = new OwnerSortFilterProxyModel(ownerId, playerTableModel, this);
vecOwnerSortFilterProxyModels.push_back(ownerSortFilterProxyModel);
// Owner name label
pVecOwnerLabels->at(ownerId)->setAlignment(Qt::AlignCenter);
perOwnerLayout->addWidget(pVecOwnerLabels->at(ownerId));
// Per-owner roster table view
const uint32_t tableWidth = 225;
QTableView* ownerRosterTableView = MakeTableView(ownerSortFilterProxyModel, true, 0);
ownerRosterTableView->setMinimumSize(tableWidth, 65);
ownerRosterTableView->setMaximumSize(tableWidth, 4096);
ownerRosterTableView->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
perOwnerLayout->addWidget(ownerRosterTableView);
// XXX: This should be a form layout...
QGridLayout* ownerSummaryGridLayout = new QGridLayout(this);
ownerSummaryGridLayout->setSpacing(0);
ownerSummaryGridLayout->addWidget(MakeLabel("Budget: "), 0, 0);
ownerSummaryGridLayout->addWidget(MakeLabel("# Hitters: "), 1, 0);
ownerSummaryGridLayout->addWidget(MakeLabel("# Pitchers: "), 2, 0);
ownerSummaryGridLayout->addWidget(MakeLabel("Max Bid: "), 3, 0);
QLabel* budgetLabel = MakeLabel();
QLabel* numHittersLabel = MakeLabel();
QLabel* numPitchersLabel = MakeLabel();
QLabel* maxBidLabel = MakeLabel();
// Helper
auto UpdateLabels = [=]()
{
budgetLabel->setText(QString("$%1").arg(ownerSortFilterProxyModel->GetRemainingBudget()));
numHittersLabel->setText(QString("%1 / %2").arg(ownerSortFilterProxyModel->Count(Player::Hitter)).arg(DraftSettings::Get().HitterCount));
numPitchersLabel->setText(QString("%1 / %2").arg(ownerSortFilterProxyModel->Count(Player::Pitcher)).arg(DraftSettings::Get().PitcherCount));
maxBidLabel->setText(QString("$%1").arg(ownerSortFilterProxyModel->GetMaxBid()));
};
// Update labels when a draft event happens
connect(playerTableModel, &PlayerTableModel::DraftedEnd, [=]() {
UpdateLabels();
});
UpdateLabels();