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


C++ setAlternatingRowColors函数代码示例

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


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

示例1: QTreeView

/**
 * @brief Creates an empty strings tree view.
 * @param parent The parent object or nullptr.
 */
StringsTreeView::StringsTreeView(QWidget* parent) :
  QTreeView(parent),
  model(nullptr) {

  setSelectionMode(QAbstractItemView::SingleSelection);
  setAlternatingRowColors(true);

  create_action = new QAction(
        QIcon(":/images/icon_add.png"), tr("New string..."), this);
  connect(create_action, SIGNAL(triggered()),
          this, SIGNAL(create_string_requested()));
  addAction(create_action);

  duplicate_action = new QAction(
        QIcon(":/images/icon_copy.png"), tr("Duplicate string(s)..."), this);
  connect(duplicate_action, SIGNAL(triggered()),
          this, SIGNAL(duplicate_string_requested()));
  addAction(duplicate_action);

  set_key_action = new QAction(
        QIcon(":/images/icon_rename.png"), tr("Change key..."), this);
  set_key_action->setShortcut(tr("F2"));
  set_key_action->setShortcutContext(Qt::WidgetShortcut);
  connect(set_key_action, SIGNAL(triggered()),
          this, SIGNAL(set_string_key_requested()));
  addAction(set_key_action);

  delete_action = new QAction(
        QIcon(":/images/icon_delete.png"), tr("Delete..."), this);
  delete_action->setShortcut(QKeySequence::Delete);
  delete_action->setShortcutContext(Qt::WidgetShortcut);
  connect(delete_action, SIGNAL(triggered()),
          this, SIGNAL(delete_string_requested()));
  addAction(delete_action);
}
开发者ID:MORTAL2000,项目名称:solarus-quest-editor,代码行数:39,代码来源:strings_tree_view.cpp

示例2: setAlternatingRowColors

void ProcessView::updateView()
{
    setAlternatingRowColors(true);
    resizeColumnToContents(0);
    setColumnWidth(1, 50);
    setColumnWidth(2, 50);
}
开发者ID:OlafKolditz,项目名称:ogs,代码行数:7,代码来源:ProcessView.cpp

示例3: QTableView

DatabaseView::DatabaseView(QWidget *parent) :
    QTableView(parent)
{
    setContextMenuPolicy(Qt::ActionsContextMenu);
    setAlternatingRowColors( true );
    setEditTriggers( QAbstractItemView::DoubleClicked
                     | QAbstractItemView::EditKeyPressed );

    QAction* editTagsAction = new QAction( this );
    addAction( editTagsAction );
    editTagsAction->setText(tr("Edit Tags"));
    editTagsAction->setShortcut(QKeySequence("Ctrl+T"));
    editTagsAction->setIcon(QIcon(":/oldIcons/oldIcons/tag-2.png"));
    connect(editTagsAction, &QAction::triggered, [this]()
    {
        QModelIndexList list = selectionModel()->selectedIndexes();
        if (!list.isEmpty())
        {
            Taggable* t = objectAt(list.first());
            if (t != 0)
            {
                TagDialog d(t->tags(), this);
                if (d.exec() == QDialog::Accepted)
                {
                    app().pushCommand( new EditTagsCommand( t, d.tags() ) );
                }
            }
        }

    });
}
开发者ID:Pfeil,项目名称:CAN2,代码行数:31,代码来源:databaseview.cpp

示例4: setHeader

views::treeView::treeView(QWidget *parent,QString name)
        :QTreeView(parent),_ratingColumn(-1),_playOnDoubleCl(true)
{
    setHeader(new treeViewHeader(this));
    setUniformRowHeights(true);
    setAlternatingRowColors(false);
    
    delegate=new treeViewDelegate(this);
    setItemDelegate(delegate);

    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setSelectionBehavior(QAbstractItemView::SelectRows);

    setDragEnabled(true);
    setDragDropMode( QAbstractItemView::DragDrop );
    setRootIsDecorated(false);
    setSortingEnabled (true);

    setMouseTracking(true);

    if (!name.isEmpty() )
    {
        setObjectName(name);
        readSettings();
    }
    setEditTriggers(QAbstractItemView::SelectedClicked);
	
	setExpandsOnDoubleClick(false);
	connect(this, SIGNAL(clicked(const QModelIndex &)), this, SLOT(itemClicked(const QModelIndex &)) );
}
开发者ID:tavu,项目名称:karakaxa,代码行数:30,代码来源:treeView.cpp

示例5: QTableWidget

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()));
}
开发者ID:qkthings,项目名称:qkwidget,代码行数:34,代码来源:ptablewidget.cpp

示例6: QTableWidget

caTable::caTable(QWidget *parent) : QTableWidget(parent)

{
    setPrecisionMode(Channel);
    setLimitsMode(Channel);
    setPrecision(0);
    setMinValue(0.0);
    setMaxValue(1.0);
    for(int i=0; i< MaxRows; i++) {
        setFormat(i, 1);
        for(int j=0; j< MaxCols; j++) tableItem[i][j] = (QTableWidgetItem*) 0;
    }

    thisItemFont = this->font();

    setColorMode(Static);
    setAlternatingRowColors(true);
    setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
    setEditTriggers(QTableWidget::NoEditTriggers);
    verticalHeader()->setDefaultSectionSize(20);
    horizontalHeader()->setResizeMode(QHeaderView::Stretch);

    defaultForeColor = palette().foreground().color();

    createActions();
    addAction(copyAct);

    connect(this, SIGNAL( cellDoubleClicked (int, int) ), this, SLOT(celldoubleclicked( int, int ) ) );
    //connect(this, SIGNAL( cellClicked (int, int) ), this, SLOT(cellclicked( int, int ) ) );
}
开发者ID:SLAC-Advanced-Control-Systems,项目名称:caqtdm,代码行数:30,代码来源:catable.cpp

示例7: setEditTriggers

void PropertyBrowser::initView()
{
    setEditTriggers(QAbstractItemView::AllEditTriggers);
    setAlternatingRowColors(true);
    setUniformRowHeights(true);
    setTabKeyNavigation(true);
}
开发者ID:Tobias1595,项目名称:libzeug,代码行数:7,代码来源:PropertyBrowser.cpp

示例8: m_map

ObjectInspectorTable::ObjectInspectorTable(Map *map)
    : m_map(map), m_graphicsObjectEditor(0)
{

    QStringList tableHeadersLabel;
    tableHeadersLabel << "Nom" << "Type";
    setColumnCount(2);
    setHeaderLabels(tableHeadersLabel);

    setAlternatingRowColors(true);

    setAnimated(true);

    setSelectionMode(QAbstractItemView::ExtendedSelection);

    clear();
    addDefaultLayout();

    connect(this, SIGNAL(itemSelectionChanged()), SLOT(selectionUpdated()));
    connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), SLOT(itemWasDoubleClicked(QTreeWidgetItem*,int)));

    // connexion pour gérer les layouts
    connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), SLOT(LayoutItemModified(QTreeWidgetItem*,int)));

    setDragDropMode(QAbstractItemView::DragDrop);
}
开发者ID:BastienCramillet,项目名称:SGC,代码行数:26,代码来源:ObjectInspectorTable.cpp

示例9: QListView

  EngineListView::EngineListView( GLWidget *glWidget, QWidget *parent ) : QListView(parent), d(new EngineListViewPrivate)
  {
    d->glWidget = glWidget;

    EngineItemModel *m = new EngineItemModel(d->glWidget, this);

    if(model())
    {
      delete model();
    }

		// This should sort the engine names for user views
		// It should also update dynamically as people edit names
		// Somehow it doesn't work right from the start!
		QSortFilterProxyModel *sortModel = new QSortFilterProxyModel(this);
		sortModel->setSourceModel(m);
    setModel(sortModel);
		sortModel->setSortCaseSensitivity(Qt::CaseInsensitive);
		sortModel->setSortLocaleAware(true);
		sortModel->setDynamicSortFilter(true);
		sortModel->sort(0, Qt::AscendingOrder);
		
    connect(this, SIGNAL(clicked(QModelIndex)),
        this, SLOT(selectEngine(QModelIndex)));
		// This might work for having the proxy model emit the signal, but let's keep it as-is
    connect(m, SIGNAL(dataChanged(QModelIndex, QModelIndex)),
        glWidget, SLOT(update()));
        
    // improves display performance
    setUniformItemSizes(true);
    setAlternatingRowColors(true); // looks better
  }
开发者ID:cniehaus,项目名称:avogadro,代码行数:32,代码来源:enginelistview.cpp

示例10: QTreeView

SubtitleComponentView::SubtitleComponentView(QWidget *parent)
: QTreeView(parent), d(new Data) {
	d->model = 0;
	d->autoScroll = false;
	setAlternatingRowColors(true);
	setRootIsDecorated(false);
}
开发者ID:akhilo,项目名称:cmplayer,代码行数:7,代码来源:subtitlemodel.cpp

示例11: QTreeView

FooPlaylistWidget::FooPlaylistWidget(const QString& name, const QUuid& uuid, QWidget *parent) : QTreeView(parent)
{
	playlistName = name;
	playlistUuid = uuid;

	setSelectionMode(QAbstractItemView::ExtendedSelection);
	setSelectionBehavior(QAbstractItemView::SelectRows);
	setSortingEnabled(false);
	setIndentation(0);
	setAlternatingRowColors(true);
	// For drag and drop files, QAbstractItemView::DragDrop doesn't work (why?)
	setAcceptDrops(true);
	setDragDropMode(QAbstractItemView::InternalMove);
	setDragEnabled(true);
	viewport()->setAcceptDrops(true);
	setDropIndicatorShown(true);
	// Context Menu
	setContextMenuPolicy(Qt::CustomContextMenu);
	setItemsExpandable(false);
	setRootIsDecorated(false);

	connect(this, SIGNAL (customContextMenuRequested (const QPoint &)), this, SLOT (contextMenuRequested (const QPoint &)));

// 	QStringList l;
// 	l << tr("File");
// 	setHeaderLabels(l);
//
// 	// TODO Remove and add something normal
// 	Filters << ".mp3"  << ".wma" << ".mp4" << ".mpg" << ".mpeg" << ".m4a";
// 	Filters << ".flac" << ".ogg" << ".wav" << ".3gp" << ".ac3" << ".aac";

	// TODO .m3u .m4u
}
开发者ID:matthewpl,项目名称:fooaudio,代码行数:33,代码来源:fooplaylistwidget.cpp

示例12: QTreeView

QgsLocatorOptionsWidget::QgsLocatorOptionsWidget( QgsLocatorWidget *locator, QWidget *parent )
  : QTreeView( parent )
  , mLocatorWidget( locator )
  , mLocator( locator->locator() )
{

  mModel = new QgsLocatorFiltersModel( mLocator, this );
  setModel( mModel );

  header()->setStretchLastSection( false );
  header()->setSectionResizeMode( QgsLocatorFiltersModel::Name, QHeaderView::Stretch );

  setEditTriggers( QAbstractItemView::AllEditTriggers );
  setAlternatingRowColors( true );
  setSelectionMode( QAbstractItemView::NoSelection );

  // add the config button
  for ( int row = 0; row < mModel->rowCount(); ++row )
  {
    QModelIndex index = mModel->index( row, QgsLocatorFiltersModel::Config );
    QWidget *bt = mModel->configButton( index, this );
    if ( bt )
    {
      setIndexWidget( index, bt );
    }
  }
}
开发者ID:AlisterH,项目名称:Quantum-GIS,代码行数:27,代码来源:qgslocatoroptionswidget.cpp

示例13: QTreeView

KNMusicStoreAlbumTreeView::KNMusicStoreAlbumTreeView(QWidget *parent) :
    QTreeView(parent),
    m_mouseAnime(new QTimeLine(200, this))
{
    //Set properties.
    setAllColumnsShowFocus(true);
    setAlternatingRowColors(false); //We will use our own alternating drawing.
    setContentsMargins(0, 0, 0, 0);
    setFrameShape(QFrame::NoFrame);
    setIndentation(0);
    setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
    setSelectionBehavior(QAbstractItemView::SelectRows);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setUniformRowHeights(true);
    setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);

    //Configure the time line.
    m_mouseAnime->setEasingCurve(QEasingCurve::OutCubic);
    m_mouseAnime->setUpdateInterval(10);
    //Link the time line.
    connect(m_mouseAnime, &QTimeLine::frameChanged,
            this, &KNMusicStoreAlbumTreeView::onActionMouseInOut);

    //Initial the sense header.
    KNMouseSenseHeader *header=new KNMouseSenseHeader(this);
    header->setSectionsMovable(false);
    header->setSectionsClickable(false);
    header->setFixedHeight(38);
    setHeader(header);

    //Link with theme manager.
    connect(knTheme, &KNThemeManager::themeChange,
            this, &KNMusicStoreAlbumTreeView::onActionThemeUpdate);
}
开发者ID:ZhenZinian,项目名称:Mu,代码行数:34,代码来源:knmusicstorealbumtreeview.cpp

示例14: QTableView

CMSCoffeeUserTableView::CMSCoffeeUserTableView(CMSCoffeeUserModel* model,
                                               QWidget *parent) :
    QTableView(parent),
    userModel_(model)
{
    setModel(userModel_);
    setAlternatingRowColors(true);
    setMinimumWidth(450);
    setMinimumHeight(400);

    setColumnWidth(0, 300);
    setColumnWidth(1, 50);
    setColumnWidth(2, 90);
    setColumnWidth(3, 90);

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
    horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
    horizontalHeader()->setResizeMode(1, QHeaderView::Fixed);
    horizontalHeader()->setResizeMode(2, QHeaderView::Fixed);
    horizontalHeader()->setResizeMode(3, QHeaderView::Fixed);
#else
    horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
    horizontalHeader()->setSectionResizeMode(1, QHeaderView::Fixed);
    horizontalHeader()->setSectionResizeMode(2, QHeaderView::Fixed);
    horizontalHeader()->setSectionResizeMode(3, QHeaderView::Fixed);
#endif

    setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
}
开发者ID:Negusbuk,项目名称:CMSCoffee,代码行数:29,代码来源:cmscoffeeusertableview.cpp

示例15: _column_config

DbTable::DbTable(list<ColumnConfig> cc,const litesql::Expr & expr,Wt::WContainerWidget * parent):
    Wt::Ext::TableView(parent),
    _column_config(cc),
    _sql(sql) {
    setBorder(false);
    model=new DbTableModel(cc,expr,parent);
    setModel(model);
    setAlternatingRowColors(true);
    resizeColumnsToContents(true);
    setHighlightMouseOver(true);
    setSelectionBehavior(Wt::SelectRows);
    setSelectionMode(Wt::SingleSelection);
    std::list<ColumnConfig>::iterator confit=cc.begin();
    for(int a=0; confit!=cc.end(); confit++, a++) {
//          enableColumnHiding(a, true);
//          setColumnSortable(a, true);
        setColumnWidth(a,(*confit).getWidth());
    }
    _clickCount=0;
    cellClicked().connect(SLOT(this,DbTable::itemSelected));
    doubleClickTimer=new Wt::WTimer(this);
    doubleClickTimer->setInterval(200);
    doubleClickTimer->timeout().connect(SLOT(this, DbTable::emitClickCount));

}
开发者ID:psychobob666,项目名称:MediaEncodingCluster,代码行数:25,代码来源:DbTable.cpp


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