当前位置: 首页>>代码示例>>C++>>正文


C++ QTableView::setFixedHeight方法代码示例

本文整理汇总了C++中QTableView::setFixedHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ QTableView::setFixedHeight方法的具体用法?C++ QTableView::setFixedHeight怎么用?C++ QTableView::setFixedHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QTableView的用法示例。


在下文中一共展示了QTableView::setFixedHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QWidget

ReportView::ReportView(QWidget *parent) :
    QWidget(parent), model(0), transactionProxyModel(0),
    reportView(0)
{
    // Build filter row
    setContentsMargins(0,0,0,0);

    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->setContentsMargins(0,0,0,0);
#ifdef MAC_OSX
    hlayout->setSpacing(5);
    hlayout->addSpacing(26);
#else
    hlayout->setSpacing(0);
    hlayout->addSpacing(23);
#endif

    dateWidget = new QComboBox(this);
#ifdef MAC_OSX
    dateWidget->setFixedWidth(121);
#else
    dateWidget->setFixedWidth(120);
#endif
    dateWidget->addItem(tr("All"), All);
    dateWidget->addItem(tr("Today"), Today);
    dateWidget->addItem(tr("Yesterday"), Yesterday);
    dateWidget->addItem(tr("This week"), ThisWeek);
    dateWidget->addItem(tr("Last week"), LastWeek);
    dateWidget->addItem(tr("This month"), ThisMonth);
    dateWidget->addItem(tr("Last month"), LastMonth);
    dateWidget->addItem(tr("This year"), ThisYear);
    dateWidget->addItem(tr("Range..."), Range);
    hlayout->addWidget(dateWidget);

    typeWidget = new QComboBox(this);
#ifdef MAC_OSX
    typeWidget->setFixedWidth(121);
#else
    typeWidget->setFixedWidth(120);
#endif

    typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
    typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
                                        TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther));
    typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
                                  TransactionFilterProxy::TYPE(TransactionRecord::SendToOther));
    typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf));
    typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
    typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other));

    hlayout->addWidget(typeWidget);

    addressWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
    /* Do not move this to the XML file, Qt before 4.7 will choke on it */
    addressWidget->setPlaceholderText(tr("Enter address or label to search"));
#endif
    hlayout->addWidget(addressWidget);

    amountWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
    /* Do not move this to the XML file, Qt before 4.7 will choke on it */
    amountWidget->setPlaceholderText(tr("Min amount"));
#endif
#ifdef MAC_OSX
    amountWidget->setFixedWidth(97);
#else
    amountWidget->setFixedWidth(100);
#endif
    amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this));
    hlayout->addWidget(amountWidget);

    QVBoxLayout *vlayout = new QVBoxLayout(this);
    vlayout->setContentsMargins(0,0,0,0);
    vlayout->setSpacing(0);

    QTableView *view = new QTableView(this);
    vlayout->addLayout(hlayout);
    vlayout->addWidget(createDateRangeWidget());
    //view->setFixedHeight(360);
    vlayout->addWidget(view);
    
    QTableView *viewT = new QTableView(this);
    viewT->setFixedHeight(26);
    vlayout->addWidget(viewT);
    vlayout->setSpacing(0);
    int width = view->verticalScrollBar()->sizeHint().width();
     //Cover scroll bar width with spacing
#ifdef MAC_OSX
    hlayout->addSpacing(width+2);
#else
    hlayout->addSpacing(width);
#endif
    // Always show scroll bar
    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    view->setTabKeyNavigation(false);
    view->setContextMenuPolicy(Qt::CustomContextMenu);
    reportView = view;
    reportViewT=viewT;

//.........这里部分代码省略.........
开发者ID:d5000,项目名称:slimcoin,代码行数:101,代码来源:reportview.cpp

示例2: QWidget


//.........这里部分代码省略.........
    layoutCreationEvent->addLayout(layoutCreationEvent7);
    layoutCreationEvent->addLayout(layoutCreationEvent8);
    layoutCreationEvent->addLayout(layoutCreationEvent9);
    pageTacheComposite->setLayout(layoutCreationEvent);

    //imbrication onglets niveau2 + layout principal pageSaisie
    ongletsNiveau2->addTab(pageCreationprojet, "Projet");
    ongletsNiveau2->addTab(pageTacheUnitaire, "Tâche unitaire");
    ongletsNiveau2->addTab(pageTacheComposite, "Tâche composite");
    layoutPageSaisiePrincipal->addWidget(gBProjetTV);
    layoutPageSaisiePrincipal->addWidget(supportOngletsCreation);

    //page Affichage/////////////////////////////////////////////////////////////////////////////////////////////////////

    layoutPageAffichagePrincipal = new QVBoxLayout;

    //En tete (gestion semaine suivante/precedente
    layoutHautAgenda = new QHBoxLayout;
    dateReferenceAgenda = new QDate(QDate::currentDate());
    jourActuel = new QPushButton(constructionMessageSemaineAgenda(dateReferenceAgenda));
    jourActuel->setEnabled(false);
    bSemainePrecedente = new QPushButton("Semaine precedent");
    bSemaineSuivante = new QPushButton("Semaine suivant");

    layoutHautAgenda->addWidget(bSemainePrecedente);
    layoutHautAgenda->addWidget(jourActuel);
    layoutHautAgenda->addWidget(bSemaineSuivante);

    QStandardItemModel *modelAgenda = new QStandardItemModel(60, 7);
    QTableView *vueAgenda = new QTableView;
    vueAgenda->setEditTriggers(QAbstractItemView::NoEditTriggers);
    vueAgenda->setModel(modelAgenda);
    vueAgenda->setFixedWidth(1157);
    vueAgenda->setFixedHeight(625);
    vueAgenda->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
    vueAgenda->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
    vueAgenda->setSelectionMode(QAbstractItemView::SingleSelection);

    //===========
    vueAgenda->setGridStyle(Qt::DashDotLine);

    miseAJourTableau(*modelAgenda); //, *vueAgenda);

    itemCol0 = new QStandardItem(chaineJoursHeader(1, dateReferenceAgenda->addDays(1-dateReferenceAgenda->dayOfWeek()).day(), dateReferenceAgenda->month()));
    itemCol1 = new QStandardItem(chaineJoursHeader(2, dateReferenceAgenda->addDays(2-dateReferenceAgenda->dayOfWeek()).day(), dateReferenceAgenda->month()));
    itemCol2 = new QStandardItem(chaineJoursHeader(3, dateReferenceAgenda->addDays(3-dateReferenceAgenda->dayOfWeek()).day(), dateReferenceAgenda->month()));
    itemCol3 = new QStandardItem(chaineJoursHeader(4, dateReferenceAgenda->addDays(4-dateReferenceAgenda->dayOfWeek()).day(), dateReferenceAgenda->month()));
    itemCol4 = new QStandardItem(chaineJoursHeader(5, dateReferenceAgenda->addDays(5-dateReferenceAgenda->dayOfWeek()).day(), dateReferenceAgenda->month()));
    itemCol5 = new QStandardItem(chaineJoursHeader(6, dateReferenceAgenda->addDays(6-dateReferenceAgenda->dayOfWeek()).day(), dateReferenceAgenda->month()));
    itemCol6 = new QStandardItem(chaineJoursHeader(7, dateReferenceAgenda->addDays(7-dateReferenceAgenda->dayOfWeek()).day(), dateReferenceAgenda->month()));

    modelAgenda->setHorizontalHeaderItem(0, itemCol0);
    modelAgenda->setHorizontalHeaderItem(1, itemCol1);
    modelAgenda->setHorizontalHeaderItem(2, itemCol2);
    modelAgenda->setHorizontalHeaderItem(3, itemCol3);
    modelAgenda->setHorizontalHeaderItem(4, itemCol4);
    modelAgenda->setHorizontalHeaderItem(5, itemCol5);
    modelAgenda->setHorizontalHeaderItem(6, itemCol6);

    QStringList headerVTableau;
    for(unsigned int i=7; i<22; i++)
    {
        headerVTableau << QString::number(i)+"h00";
        for(unsigned int j=1; j<4; j++)
        {
            headerVTableau << "";
开发者ID:TerisseNicolas,项目名称:LO21-Calendar,代码行数:67,代码来源:fenetregraphique.cpp


注:本文中的QTableView::setFixedHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。