• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ resizeColumnToContents函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中resizeColumnToContents函数的典型用法代码示例。如果您正苦于以下问题:C++ resizeColumnToContents函数的具体用法?C++ resizeColumnToContents怎么用?C++ resizeColumnToContents使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: resizeColumnToContents

void StackTreeView::setModel(QAbstractItemModel *model)
{
    BaseTreeView::setModel(model);
    resizeColumnToContents(StackLevelColumn);
    resizeColumnToContents(StackLineNumberColumn);
    showAddressColumn(action(UseAddressInStackView)->isChecked());
}
开发者ID:Gardenya,项目名称:qtcreator,代码行数:7,代码来源:stackwindow.cpp


示例2: resizeColumnToContents

void KFindTreeView::resizeToContents()
{
    resizeColumnToContents( 0 );
    resizeColumnToContents( 1 );
    resizeColumnToContents( 2 );
    resizeColumnToContents( 3 );
}
开发者ID:luyikei,项目名称:kde-baseapps,代码行数:7,代码来源:kfindtreeview.cpp


示例3: topLevelItem

void ArchiveList::updateArchives(QList<Archive *> archivesOrig)
{
    QSet<QString> expandedLanguages;
    QSet<QString> knownLanguages;
    QSet<ArchiveID> expandedItems;

    for (int i = 0; i < topLevelItemCount(); i ++) {
        QTreeWidgetItem *langItem = topLevelItem(i);
        const QString &lang = langItem->text(0);
        if (langItem->isExpanded())
            expandedLanguages += lang;
        knownLanguages += lang;
        for (int j = 0; j < langItem->childCount(); j ++) {
            QTreeWidgetItem *dateItem = langItem->child(j);
            if (dateItem->isExpanded())
                expandedItems += ArchiveID(lang, dateItem->text(0));
        }
    }

    clear();

    QList<Archive *> archives(archivesOrig);
    qSort(archives.begin(), archives.end(), Archive::comparePointers);

    QTreeWidgetItem *topItem(0);
    QString lastLanguage;

    foreach (Archive *a, archives) {
        if (lastLanguage != a->getLanguage() || a->getLanguage().isEmpty()) {
            lastLanguage = a->getLanguage();
            topItem = new QTreeWidgetItem(this, QStringList() << lastLanguage);
            addTopLevelItem(topItem);
            if (expandedLanguages.contains(lastLanguage))
                topItem->setExpanded(true);
        }
        QTreeWidgetItem *item = new QTreeWidgetItem(topItem);
        item->setText(0, a->getDate());

        if (expandedItems.contains(a->getID()))
            item->setExpanded(true);

        if (qobject_cast<DownloadableArchive *>(a)) {
            fillDownloadableArchiveItem(static_cast<DownloadableArchive *>(a), item);
        } else if (qobject_cast<PartialArchive *>(a)) {
            if (!knownLanguages.contains(a->getLanguage()))
                topItem->setExpanded(true);
            fillPartialArchiveItem(static_cast<PartialArchive *>(a), item);
        } else if (qobject_cast<LocalArchive *>(a)) {
            if (!knownLanguages.contains(a->getLanguage()))
                topItem->setExpanded(true);
            fillLocalArchiveItem(static_cast<LocalArchive *>(a), item);
        }
    }
    resizeColumnToContents(0);
    resizeColumnToContents(1);
    resizeColumnToContents(2);
    resizeColumnToContents(3);
}
开发者ID:Iktwo,项目名称:evopedia,代码行数:58,代码来源:archivelist.cpp


示例4: resizeColumnToContents

void ThreadsWindow::setModel(QAbstractItemModel *model)
{
    BaseWindow::setModel(model);
    resizeColumnToContents(ThreadData::IdColumn);
    resizeColumnToContents(ThreadData::LineColumn);
    resizeColumnToContents(ThreadData::NameColumn);
    resizeColumnToContents(ThreadData::StateColumn);
    resizeColumnToContents(ThreadData::TargetIdColumn);
}
开发者ID:hdweiss,项目名称:qt-creator-visualizer,代码行数:9,代码来源:threadswindow.cpp


示例5: setItemExpanded

void ScTreeWidget::handleMousePress(QTreeWidgetItem *item)
{
    if (item == 0)
        return;
    if (item->parent() == 0)
    {
        if (item->isDisabled())
        {
            setItemExpanded(item, false);
            return;
        }
        int wide = 0;
        int tops = topLevelItemCount();
        if (m_toolbox_mode)
        {
            for (int t = 0; t < tops; t++)
            {
                setItemExpanded(topLevelItem(t), false);
            }
            setCurrentItem(item);
            setItemExpanded(item, true);
            if (item->childCount() != 0)
            {
                QTreeWidgetItem *child = item->child(0);
                if (child != 0)
                    wide = itemWidget(child, 0)->minimumSizeHint().width()+5;
            }
            if (wide != 0)
                setColumnWidth(0, wide);
            else
                resizeColumnToContents(0);
        }
        else
        {
            setItemExpanded(item, !isItemExpanded(item));
            for (int t = 0; t < tops; t++)
            {
                QTreeWidgetItem *top = topLevelItem(t);
                if (isItemExpanded(top))
                {
                    if (top->childCount() != 0)
                    {
                        QTreeWidgetItem *child = top->child(0);
                        if (child != 0)
                            wide = qMax(wide, itemWidget(child, 0)->minimumSizeHint().width()+5);
                    }
                }
            }
        }
        if (wide != 0)
            setColumnWidth(0, wide);
        else
            resizeColumnToContents(0);
        emit currentChanged2(indexOfTopLevelItem(item));
    }
}
开发者ID:gyuris,项目名称:scribus,代码行数:56,代码来源:sctreewidget.cpp


示例6: resizeColumnToContents

void  CommitTableWidget::refresh()
// ----------------------------------------------------------------------------
//    Reload the commit history from the model
// ----------------------------------------------------------------------------
{
    table->refresh();

    resizeColumnToContents(0);  // ID
    resizeColumnToContents(1);  // Date
    resizeColumnToContents(2);  // Author
}
开发者ID:ronotono,项目名称:tao-3D,代码行数:11,代码来源:commit_table_widget.cpp


示例7: selectionModel

    void PipelineTreeWidget::update(const std::vector<DataContainer*>& dataContainers, const std::vector<AbstractPipeline*>& pipelines) {
        // clear selection before setting the new data or we will encounter random crashes...
        selectionModel()->clear();

        _treeModel->setData(dataContainers, pipelines);
        expandAll();
        resizeColumnToContents(0);
        resizeColumnToContents(1);
        resizeColumnToContents(2);

        // The widget's size hint might have changed, notify the layout
        updateGeometry();
    }
开发者ID:tusharuiit,项目名称:2014-2015_HiwiMedicalXTTVisualization,代码行数:13,代码来源:pipelinetreewidget.cpp


示例8: setModel

 /* TODO This looses the current expanded tree's.
  * Needs to update the model rahter than replace it.
  */
void XmlTree::update ( const KMimeType::Ptr mime,  const QDomDocument& doc ) {
    setModel ( 0 );
    if ( m_treeModel )
        delete m_treeModel;
    if ( mime->is ( "application/xsd" ) )
        m_treeModel = new XsdDocumentModel();
    else
        m_treeModel = new XmlDocumentModel();
    m_treeModel->update ( doc );
    setModel ( m_treeModel );
    expandToDepth ( 0 );
    resizeColumnToContents ( 0 );
    resizeColumnToContents ( 1 );
}
开发者ID:KDE,项目名称:kdev-xml,代码行数:17,代码来源:xmltree.cpp


示例9: qDebug

void TransferListWidget::hidePriorityColumn(bool hide)
{
    qDebug("hidePriorityColumn(%d)", hide);
    setColumnHidden(TorrentModel::TR_PRIORITY, hide);
    if (!hide && !columnWidth(TorrentModel::TR_PRIORITY))
        resizeColumnToContents(TorrentModel::TR_PRIORITY);
}
开发者ID:DoumanAsh,项目名称:qBittorrent,代码行数:7,代码来源:transferlistwidget.cpp


示例10: QTreeWidget

InterfaceTree::InterfaceTree(QWidget *parent) :
    QTreeWidget(parent)
#ifdef HAVE_LIBPCAP
    ,stat_cache_(NULL)
    ,stat_timer_(NULL)
#endif // HAVE_LIBPCAP
{
    QTreeWidgetItem *ti;

    qRegisterMetaType< PointList >("PointList");

    header()->setVisible(false);
    setRootIsDecorated(false);
    setUniformRowHeights(true);
    /* Seems to have no effect, still the default value (2) is being used, as it
     * was set in the .ui file. But better safe, then sorry. */
    resetColumnCount();
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setAccessibleName(tr("Welcome screen list"));

    setItemDelegateForColumn(IFTREE_COL_STATS, new SparkLineDelegate(this));
    setDisabled(true);

    ti = new QTreeWidgetItem();
    ti->setText(IFTREE_COL_NAME, tr("Waiting for startup%1").arg(UTF8_HORIZONTAL_ELLIPSIS));
    addTopLevelItem(ti);
    resizeColumnToContents(IFTREE_COL_NAME);

    connect(wsApp, SIGNAL(appInitialized()), this, SLOT(getInterfaceList()));
    connect(wsApp, SIGNAL(localInterfaceListChanged()), this, SLOT(interfaceListChanged()));
    connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelectedInterfaces()));
}
开发者ID:velichkov,项目名称:wireshark,代码行数:32,代码来源:interface_tree.cpp


示例11: qMax

void NavigableTableView::resizeTableRows() {

  if (!model())
    return;

  int top = qMax(0, verticalHeader()->visualIndexAt(0));
  int bottom = verticalHeader()->visualIndexAt(viewport()->height());

  if (bottom == -1 || (bottom+10) >= model()->rowCount()) {
    bottom = model()->rowCount() - 1;
  }
  else {
    bottom += 10;
  }

  int left = qMax(0, horizontalHeader()->visualIndexAt(0));
  int right = horizontalHeader()->visualIndexAt(viewport()->width());

  if (right < 0) right = model()->columnCount();

  for (int i = top ; i <= bottom ; ++i)
    resizeRowToContents(i);

  for (int i = left ; i <= right ; ++i)
    resizeColumnToContents(i);

}
开发者ID:mneumann,项目名称:tulip,代码行数:27,代码来源:navigabletableview.cpp


示例12: resizeColumnToContents

void UnspentTxOutView::update()
{
    QTreeView::update();
    for (int i = 0; i < model->columnCount(); i++) {
        resizeColumnToContents(i);
    }
}
开发者ID:AndreV84,项目名称:mSIGNA,代码行数:7,代码来源:unspenttxoutview.cpp


示例13: resizeColumnToContents

void MovableTableWidget::resizeColumnsToContents()
{
  for (int i = 0; i < columnCount(); ++i)
  {
    resizeColumnToContents(i);
  }
}
开发者ID:gijskant,项目名称:mcrl2-pmc,代码行数:7,代码来源:movabletablewidget.cpp


示例14: QTreeWidget

QTreeWidget *ConnectionPropertiesPanel::makePortListWidget(QWidget *parent, const GraphConnectionEndpoint &ep, std::map<QTreeWidgetItem *, QString> &itemToKey)
{
    //create list widget
    auto listWidget = new QTreeWidget(parent);
    listWidget->setColumnCount(1);
    listWidget->setHeaderLabels(QStringList(QString("%1[%2]").arg(ep.getObj()->getId(), ep.getKey().id)));

    //query the signal/slot ports
    QStringList portKeys;
    auto block = dynamic_cast<GraphBlock *>(ep.getObj().data());
    if (block != nullptr) switch(ep.getConnectableAttrs().direction)
    {
    case GRAPH_CONN_SLOT: portKeys = block->getSlotPorts(); break;
    case GRAPH_CONN_SIGNAL: portKeys = block->getSignalPorts(); break;
    default: break;
    }

    //populate
    if (portKeys.empty())
    {
        auto item = new QTreeWidgetItem(listWidget, QStringList(_conn->getKeyName(ep.getKey().id, ep)));
        itemToKey[item] = ep.getKey().id;
        listWidget->addTopLevelItem(item);
    }
    else for (const auto &portKey : portKeys)
    {
        auto item = new QTreeWidgetItem(listWidget, QStringList(_conn->getKeyName(portKey, ep)));
        itemToKey[item] = portKey;
        listWidget->addTopLevelItem(item);
    }
    listWidget->resizeColumnToContents(0);

    //return new widget
    return listWidget;
}
开发者ID:m0x72,项目名称:pothos,代码行数:35,代码来源:ConnectionPropertiesPanel.cpp


示例15: QTreeView

BtTreeView::BtTreeView(QWidget *parent, BtTreeModel::TypeMasks type) :
   QTreeView(parent)
{
   // Set some global properties that all the kids will use.
   setAllColumnsShowFocus(true);
   setContextMenuPolicy(Qt::CustomContextMenu);
   setRootIsDecorated(false);

   setDragEnabled(true);
   setAcceptDrops(true);
   setDropIndicatorShown(true);
   setSelectionMode(QAbstractItemView::ExtendedSelection);

   _type = type;
   _model = new BtTreeModel(this, _type);
   filter = new BtTreeFilterProxyModel(this, _type);
   filter->setSourceModel(_model);
   setModel(filter);
   filter->setDynamicSortFilter(true);
   
   setExpanded(findElement(0), true);
   setSortingEnabled(true);
   sortByColumn(0,Qt::AscendingOrder);
   resizeColumnToContents(0);

   // and one wee connection
   connect( _model, SIGNAL(expandFolder(BtTreeModel::TypeMasks, QModelIndex)), this, SLOT(expandFolder(BtTreeModel::TypeMasks, QModelIndex)));
}
开发者ID:MaximilienMartin,项目名称:brewtarget,代码行数:28,代码来源:BtTreeView.cpp


示例16: ActionEditorWidget

WaitEditorWidget::WaitEditorWidget(QWidget *parent) :
    ActionEditorWidget(parent)
{
    mWaitTypeWidget = new QComboBox(this);
    mWaitTypeWidget->addItem(tr("Timed"));
    mWaitTypeWidget->addItem(tr("Until mouse button is clicked"));
    mWaitTypeWidget->addItem(tr("Forever"));

    mSkipBox = new QCheckBox(this);
    mTimeSpin = new QDoubleSpinBox(this);
    mTimeSpin->setValue(1);
    mTimeSpin->setSingleStep(0.1);
    mTimeSpin->setMaximum(3600);

    beginGroup(tr("Wait"));
    appendRow(tr("Type"), mWaitTypeWidget);
    appendRow(tr("Time (sec)"), mTimeSpin);
    appendRow(tr("Allow skipping"), mSkipBox);
    endGroup();

    resizeColumnToContents(0);

    mCurrentAction = 0;

    connect(mWaitTypeWidget, SIGNAL(currentIndexChanged(int)), this, SLOT(onCurrentIndexChanged(int)));
    connect(mTimeSpin, SIGNAL(valueChanged(double)), this, SLOT(onTimeChanged(double)));
    connect(mSkipBox, SIGNAL(clicked(bool)), this, SLOT(onSkipBoxClicked(bool)));
}
开发者ID:daodaoliang,项目名称:moonriver,代码行数:28,代码来源:wait_editor_widget.cpp


示例17: columnCount

void KeyValuesTable::AdjustColumnCount(bool isReadOnly)
{
    int colCount = isReadOnly ? 2 : 3;
    int currentCount = columnCount();

    for(int current = currentCount - 1; current  > -1; current--)
        removeColumn(0);

    for(int current(0); current < colCount ; current++)
    {
        insertColumn(current);
        //horizontalHeader()-> setLabel(current, colNames[current]);
        QTableWidgetItem * item = horizontalHeaderItem(current);
        if(!item)
         {
            item = new QTableWidgetItem();
            setHorizontalHeaderItem(current, item);
        }
         horizontalHeaderItem(current)->setText(colNames[current]);
    }

    setColumnStretchable(1, true);

    if(!isReadOnly)
    {

        setColumnStretchable(2, false);
        resizeColumnToContents(2);
    }
    horizontalHeader()->setSectionResizeMode(0, QHeaderView::Interactive);
    horizontalHeader()->setSectionResizeMode(1, QHeaderView::Interactive);

}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:33,代码来源:KeyValueTable.cpp


示例18: entry

bool TreeView::createNewEntry(const std::string& name,
                              const osg::ref_ptr<osg::Node> node,
                              const bool& enableNode,
                              const bool& showNode,
                              d3DisplayItem* myParent)
{
    // create the entry for the item model
    d3DisplayItem* entry( new d3DisplayItem(name, node) );
    entry->setEnabled(enableNode);

    // add this entry to the item model
    m_mutex.lock();
    myParent->appendRow(entry);

    // set to accomodate this width
    resizeColumnToContents(0);

    // add the node to the osg tree
    m_pOsgWidget->lock();
    myParent->getNode()->asGroup()->addChild(node);
    m_pOsgWidget->unlock();
    if ( not showNode )
    {
        entry->setCheckState(Qt::Unchecked);
        clicked(m_pModel->indexFromItem(entry));
    }
    m_mutex.unlock();

    return true;
};
开发者ID:theidealist,项目名称:developerDebugDisplay,代码行数:30,代码来源:TreeView.cpp


示例19: slotActivate

void DisassembleWidget::showEvent(QShowEvent*)
{
    slotActivate(true);

    for (int i = 0; i < model()->columnCount(); ++i)
        resizeColumnToContents(i);
}
开发者ID:portaloffreedom,项目名称:kdev-golang-plugin,代码行数:7,代码来源:disassemblewidget.cpp


示例20: QTreeWidget

InterfaceTree::InterfaceTree(QWidget *parent) :
    QTreeWidget(parent)
#ifdef HAVE_LIBPCAP
    ,stat_cache_(NULL)
    ,stat_timer_(NULL)
#endif // HAVE_LIBPCAP
{
    QTreeWidgetItem *ti;

    header()->setVisible(false);
    setRootIsDecorated(false);
    setUniformRowHeights(true);
    setColumnCount(2);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setAccessibleName(tr("Welcome screen list"));

    setItemDelegateForColumn(1, new SparkLineDelegate());
    setDisabled(true);

    ti = new QTreeWidgetItem();
    ti->setText(0, tr("Waiting for startup" UTF8_HORIZONTAL_ELLIPSIS));
    addTopLevelItem(ti);
    resizeColumnToContents(0);

    connect(wsApp, SIGNAL(appInitialized()), this, SLOT(getInterfaceList()));
    connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelectedInterfaces()));
}
开发者ID:lubing521,项目名称:wireshark,代码行数:27,代码来源:interface_tree.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ resizeImage函数代码示例发布时间:2022-05-30
下一篇:
C++ resize函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap