本文整理汇总了C++中setColumnCount函数的典型用法代码示例。如果您正苦于以下问题:C++ setColumnCount函数的具体用法?C++ setColumnCount怎么用?C++ setColumnCount使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setColumnCount函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QTableWidget
VariableListWidget::VariableListWidget(const VariableList & variableList,
QWidget *parent)
: QTableWidget(parent)
{
// constructor of variable table
// make variable table
setRowCount(0);
setColumnCount(0);
setColumnCount(2);
// set headers for columns
QTableWidgetItem *nameItem = new QTableWidgetItem;
QTableWidgetItem *varItem = new QTableWidgetItem;
nameItem->setText(tr("Variable List:"));
varItem->setText(tr("Value:"));
setHorizontalHeaderItem(0,nameItem);
setHorizontalHeaderItem(1,varItem);
setSortingEnabled(false);
// control geometry
setMinimumWidth(300);
horizontalHeader()->setResizeMode(QHeaderView::Stretch);
// fill list
updateList(variableList);
// add connections
connect(this,SIGNAL(itemActivated(QTableWidgetItem*)),
this,SLOT(itemValue(QTableWidgetItem*)));
}
开发者ID:clay-matt,项目名称:Fn,代码行数:33,代码来源:VariableListWidget.cpp
示例2: tr
void Foundlist::runQuery( const QString &query, const QString &category )
{
QStringList labels;
labels
<< tr("Category")
<< tr("ID")
<< tr("Track")
<< tr("Title")
<< tr("Playtime")
#if INCLUDE_EXT
<< tr("Ext")
#endif
;
if( !mQuery.isFinished() )
{
mQuery.stop();
mQuery.wait();
}
clear();
#if INCLUDE_EXT
setColumnCount( 6 );
#else
setColumnCount( 5 );
#endif
setRowCount( 0 );
setHorizontalHeaderLabels( labels );
mQuery.setQuery( query, category );
mQuery.start();
}
开发者ID:SvOlli,项目名称:SLART,代码行数:32,代码来源:Foundlist.cpp
示例3: clear
void Table::setMaskType(PolyEdit::Shape type)
{
isReady = false;
clear();
mMask->clear();
switch (type)
{
case PolyEdit::Polygon:
{
setColumnCount(2);
setRowCount(1);
setHorizontalHeaderItem(0, new Cell("X"));
setHorizontalHeaderItem(1, new Cell("Y"));
break;
}
case PolyEdit::Circle:
{
setColumnCount(1);
setRowCount(3);
setHorizontalHeaderItem(0, new Cell("Circle"));
setVerticalHeaderItem(0,new Cell("X"));
setVerticalHeaderItem(1,new Cell("Y"));
setVerticalHeaderItem(2,new Cell("Radius"));
break;
}
case PolyEdit::Box:
{
setColumnCount(1);
setRowCount(4);
setHorizontalHeaderItem(0, new Cell("Box"));
setVerticalHeaderItem(0,new Cell("Left"));
setVerticalHeaderItem(1,new Cell("Top"));
setVerticalHeaderItem(2,new Cell("Width"));
setVerticalHeaderItem(3,new Cell("Height"));
break;
}
case PolyEdit::Invalid:
{
break;
}
}
clearContents();
mType = type;
horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
mMask->setType(type);
isReady = true;
}
开发者ID:fundies,项目名称:PolyEditQT,代码行数:53,代码来源:table.cpp
示例4: removeRows
void MatrixModel::setDimensions(int rows, int cols) {
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
if (rows < d_rows) { // first remove rows (faster)
removeRows(rows, d_rows - rows);
setColumnCount(cols);
} else {
setColumnCount(cols);
if (rows > d_rows)
insertRows(d_rows, rows - d_rows);
}
QApplication::restoreOverrideCursor();
}
开发者ID:rosswhitfield,项目名称:mantid,代码行数:14,代码来源:MatrixModel.cpp
示例5: QTreeWidget
CoverageView::CoverageView(bool showCallers, TraceItemView* parentView, QWidget* parent)
: QTreeWidget(parent), TraceItemView(parentView)
{
_showCallers = showCallers;
QStringList labels;
labels << tr( "Incl." );
if (_showCallers) {
setColumnCount(4);
labels << tr( "Distance" ),
labels << tr( "Called" ),
labels << tr( "Caller" );
}
else {
setColumnCount(5);
labels << tr( "Self" ),
labels << tr( "Distance" ),
labels << tr( "Calling" ),
labels << tr( "Callee" );
}
setHeaderLabels(labels);
// forbid scaling icon pixmaps to smaller size
setIconSize(QSize(99,99));
setAllColumnsShowFocus(true);
setRootIsDecorated(false);
setUniformRowHeights(true);
// sorting will be enabled after refresh()
sortByColumn(0, Qt::DescendingOrder);
setMinimumHeight(50);
this->setWhatsThis( whatsThis() );
connect( this,
SIGNAL( currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
SLOT( selectedSlot(QTreeWidgetItem*,QTreeWidgetItem*) ) );
setContextMenuPolicy(Qt::CustomContextMenu);
connect( this,
SIGNAL(customContextMenuRequested(const QPoint &) ),
SLOT(context(const QPoint &)));
connect(this,
SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
SLOT(activatedSlot(QTreeWidgetItem*,int)));
connect(header(), SIGNAL(sectionClicked(int)),
this, SLOT(headerClicked(int)));
}
开发者ID:DeepCV,项目名称:kcachegrind,代码行数:49,代码来源:coverageview.cpp
示例6: setRowCount
void Spreadsheet::clear()
{
setRowCount(0);
setColumnCount(0);
setRowCount(RowCount);
setColumnCount(ColumnCount);
for (int i = 0; i < ColumnCount; ++i) {
QTableWidgetItem *item = new QTableWidgetItem;
item->setText(QString(QChar('A' + i)));
setHorizontalHeaderItem(i, item);
}
setCurrentCell(0, 0);
}
开发者ID:bwarfield,项目名称:WarfieldBrian_CIS17B_48941,代码行数:15,代码来源:spreadsheet.cpp
示例7: QStandardItemModel
/**************************** QgsGrassModuleInputModel ****************************/
QgsGrassModuleInputModel::QgsGrassModuleInputModel( QObject *parent )
: QStandardItemModel( parent )
, mWatcher( 0 )
{
setColumnCount( 1 );
reload();
QString locationPath = QgsGrass::getDefaultLocationPath();
mWatcher = new QFileSystemWatcher( this );
mWatcher->addPath( locationPath );
// Watching all dirs in loacation because a dir may become a mapset later, when WIND is created
//QStringList mapsets = QgsGrass::mapsets( QgsGrass::getDefaultGisdbase(), QgsGrass::getDefaultLocation() );
QStringList dirNames = locationDirNames();
foreach ( QString dirName, dirNames )
{
QString dirPath = locationPath + "/" + dirName;
// Watch the dir in any case, WIND mabe created later
mWatcher->addPath( dirPath );
foreach ( QString watchedDir, watchedDirs() )
{
watch( dirPath + "/" + watchedDir );
}
开发者ID:sogis,项目名称:Quantum-GIS,代码行数:26,代码来源:qgsgrassmoduleinput.cpp
示例8: setColumnCount
CodeViewWidget::CodeViewWidget()
{
setColumnCount(5);
setShowGrid(false);
setContextMenuPolicy(Qt::CustomContextMenu);
setSelectionMode(QAbstractItemView::SingleSelection);
setSelectionBehavior(QAbstractItemView::SelectRows);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
for (int i = 0; i < columnCount(); i++)
{
horizontalHeader()->setSectionResizeMode(i, QHeaderView::Fixed);
}
verticalHeader()->hide();
horizontalHeader()->hide();
horizontalHeader()->setStretchLastSection(true);
setFont(Settings::Instance().GetDebugFont());
Update();
connect(this, &CodeViewWidget::customContextMenuRequested, this, &CodeViewWidget::OnContextMenu);
connect(this, &CodeViewWidget::itemSelectionChanged, this, &CodeViewWidget::OnSelectionChanged);
connect(&Settings::Instance(), &Settings::DebugFontChanged, this, &QWidget::setFont);
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this] {
m_address = PC;
Update();
});
connect(&Settings::Instance(), &Settings::ThemeChanged, this, &CodeViewWidget::Update);
}
开发者ID:MerryMage,项目名称:dolphin,代码行数:33,代码来源:CodeViewWidget.cpp
示例9: QTreeWidget
AssignedListView::AssignedListView(QWidget* const parent)
: QTreeWidget(parent)
{
setSelectionMode(QAbstractItemView::SingleSelection);
setWhatsThis(i18n("This is the list of batch tools assigned."));
setIconSize(QSize(ICONSIZE, ICONSIZE));
setDragEnabled(true);
setAcceptDrops(true);
viewport()->setAcceptDrops(true);
setDropIndicatorShown(true);
setContextMenuPolicy(Qt::CustomContextMenu);
setSortingEnabled(false);
setAllColumnsShowFocus(true);
setRootIsDecorated(false);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setColumnCount(2);
setHeaderHidden(true);
header()->setSectionResizeMode(QHeaderView::ResizeToContents);
connect(this, SIGNAL(itemSelectionChanged()),
this, SLOT(slotSelectionChanged()));
connect(this, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(slotContextMenu()));
}
开发者ID:KDE,项目名称:digikam,代码行数:27,代码来源:assignedlist.cpp
示例10: QWidget
ObjectTableWidget::ObjectTableWidget(unsigned button_conf, bool conf_exclusion, QWidget *parent): QWidget(parent)
{
setupUi(this);
connect(move_down_tb, SIGNAL(clicked(bool)), this, SLOT(moveRows(void)));
connect(move_up_tb, SIGNAL(clicked(bool)), this, SLOT(moveRows(void)));
connect(move_first_tb, SIGNAL(clicked(bool)), this, SLOT(moveRows(void)));
connect(move_last_tb, SIGNAL(clicked(bool)), this, SLOT(moveRows(void)));
connect(add_tb, SIGNAL(clicked(bool)), this, SLOT(addRow(void)));
connect(remove_tb, SIGNAL(clicked(bool)), this, SLOT(removeRow(void)));
connect(edit_tb, SIGNAL(clicked(bool)), this, SLOT(editRow(void)));
connect(update_tb, SIGNAL(clicked(bool)), this, SLOT(updateRow(void)));
connect(remove_all_tb, SIGNAL(clicked(bool)), this, SLOT(removeRows(void)));
connect(table_tbw, SIGNAL(cellClicked(int,int)), this, SLOT(setButtonsEnabled(void)));
connect(table_tbw, SIGNAL(cellActivated(int,int)), this, SLOT(setButtonsEnabled(void)));
connect(table_tbw, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(editRow(void)));
connect(table_tbw, SIGNAL(itemSelectionChanged(void)), this, SLOT(setButtonsEnabled(void)));
connect(table_tbw, SIGNAL(itemSelectionChanged(void)), this, SLOT(emitRowSelected(void)));
this->conf_exclusion=conf_exclusion;
setButtonConfiguration(button_conf);
setColumnCount(1);
add_tb->setToolTip(add_tb->toolTip() + QString(" (%1)").arg(add_tb->shortcut().toString()));
remove_tb->setToolTip(remove_tb->toolTip() + QString(" (%1)").arg(remove_tb->shortcut().toString()));
remove_all_tb->setToolTip(remove_all_tb->toolTip() + QString(" (%1)").arg(remove_all_tb->shortcut().toString()));
update_tb->setToolTip(update_tb->toolTip() + QString(" (%1)").arg(update_tb->shortcut().toString()));
edit_tb->setToolTip(edit_tb->toolTip() + QString(" (%1)").arg(edit_tb->shortcut().toString()));
move_last_tb->setToolTip(move_last_tb->toolTip() + QString(" (%1)").arg(move_last_tb->shortcut().toString()));
move_first_tb->setToolTip(move_first_tb->toolTip() + QString(" (%1)").arg(move_first_tb->shortcut().toString()));
move_up_tb->setToolTip(move_up_tb->toolTip() + QString(" (%1)").arg(move_up_tb->shortcut().toString()));
move_down_tb->setToolTip(move_down_tb->toolTip() + QString(" (%1)").arg(move_down_tb->shortcut().toString()));
}
开发者ID:bgalok,项目名称:pgmodeler,代码行数:33,代码来源:objecttablewidget.cpp
示例11: KviTalTableWidget
FileTransferWidget::FileTransferWidget(QWidget * pParent)
: KviTalTableWidget(pParent)
{
//hide the header
verticalHeader()->hide();
//hide cells grids
setShowGrid(false);
//disable cell content editing
setEditTriggers(QAbstractItemView::NoEditTriggers);
//select one row at once
setSelectionBehavior(QAbstractItemView::SelectRows);
setSelectionMode(QAbstractItemView::SingleSelection);
//prepare columns
setColumnCount(3);
QStringList colHeaders;
colHeaders << __tr2qs_ctx("Type", "filetransferwindow")
<< __tr2qs_ctx("Information", "filetransferwindow")
<< __tr2qs_ctx("Progress", "filetransferwindow");
setHorizontalHeaderLabels(colHeaders);
//default column widths
setColumnWidth(0, FILETRANSFERW_CELLSIZE);
horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);
horizontalHeader()->setSectionResizeMode(1, QHeaderView::Interactive);
setColumnWidth(1, 500);
horizontalHeader()->setStretchLastSection(true);
//focus policy
setFocusPolicy(Qt::NoFocus);
viewport()->setFocusPolicy(Qt::NoFocus);
}
开发者ID:IceN9ne,项目名称:KVIrc,代码行数:32,代码来源:FileTransferWindow.cpp
示例12: QTreeWidget
ProgressTree2::ProgressTree2(QWidget *parent) :
QTreeWidget(parent)
{
this->autoExpandNodes = false;
setColumnCount(5);
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(timerTimeout()));
timer->start(1000);
this->monitoredJobLastChanged = 0;
setColumnWidth(0, 500);
setColumnWidth(1, 100);
setColumnWidth(2, 100);
setColumnWidth(3, 200);
setColumnWidth(4, 100);
header()->setStretchLastSection(false);
QStringList hls;
hls.append(QObject::tr("Task / Step"));
hls.append(QObject::tr("Elapsed time"));
hls.append(QObject::tr("Remaining time"));
hls.append(QObject::tr("Progress"));
hls.append(QObject::tr(""));
setHeaderLabels(hls);
}
开发者ID:benpope82,项目名称:npackd-cpp,代码行数:27,代码来源:progresstree2.cpp
示例13: QTableWidget
AdvancedSettings::AdvancedSettings(QWidget *parent)
: QTableWidget(parent)
{
// column
setColumnCount(COL_COUNT);
QStringList header = {tr("Setting"), tr("Value", "Value set for this setting")};
setHorizontalHeaderLabels(header);
// row
setRowCount(ROW_COUNT);
verticalHeader()->setVisible(false);
// etc.
setAlternatingRowColors(true);
setSelectionMode(QAbstractItemView::NoSelection);
setEditTriggers(QAbstractItemView::NoEditTriggers);
// Signals
connect(&spinBoxCache, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged)
, this, &AdvancedSettings::updateCacheSpinSuffix);
connect(&comboBoxInterface, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged)
, this, &AdvancedSettings::updateInterfaceAddressCombo);
connect(&spinBoxSaveResumeDataInterval, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged)
, this, &AdvancedSettings::updateSaveResumeDataIntervalSuffix);
// Load settings
loadAdvancedSettings();
resizeColumnToContents(0);
horizontalHeader()->setStretchLastSection(true);
}
开发者ID:paolo-sz,项目名称:qBittorrent,代码行数:26,代码来源:advancedsettings.cpp
示例14: setColumnCount
void CrosswordGrid::setPuzzle( AcrossLitePuzzle* puzzle )
{
m_puzzle = puzzle;
m_focusOrientation = FocusHorizontal;
setColumnCount( m_puzzle->nColumns() );
setRowCount( m_puzzle->nRows() );
int colWidth = 20;
int rowHeight = 20;
for( int row = 0; row < rowCount(); row++ )
{
for( int col = 0; col < columnCount(); col++ )
{
CrosswordCell* cell = new CrosswordCell();
cell->setSolution( m_puzzle->solutionCell( col, row ) );
cell->setShowCorrectness( false );
cell->setGuess( m_puzzle->diagramCell( col, row ) );
cell->setNumber( m_puzzle->cellNumber( col, row ) );
cell->showNumber( true );
colWidth = cell->sizeHint().width();
rowHeight = cell->sizeHint().height();
setItem( row, col, cell );
}
}
for( int col = 0; col < columnCount(); col++ )
setColumnWidth( col, colWidth );
for( int row = 0; row < rowCount(); row++ )
setColumnWidth( row, rowHeight );
}
开发者ID:sebr,项目名称:crossie,代码行数:33,代码来源:CrosswordGrid.cpp
示例15: setColumnCount
MgEventsView::MgEventsView(QWidget * parent):QTableWidget(parent)
{
setColumnCount(3);
QStringList labels;
labels<<"Type"<<"Name"<<"Event";
setHorizontalHeaderLabels(labels);
}
开发者ID:kaabimg,项目名称:MgLibrary,代码行数:7,代码来源:mgeventsview.cpp
示例16: QTreeWidget
MenuBarTree::MenuBarTree(TFilePath & path, QWidget* parent)
: QTreeWidget(parent)
, m_path(path)
{
setObjectName("SolidLineFrame");
setAlternatingRowColors(true);
setDragEnabled(true);
setDropIndicatorShown(true);
setDefaultDropAction(Qt::MoveAction);
setDragDropMode(QAbstractItemView::DragDrop);
setColumnCount(1);
header()->close();
/*- m_pathが存在するならファイルから読み込む。無ければテンプレートを読み込む -*/
TFilePath fp;
if (TFileStatus(path).isWritable())
fp = m_path;
else
{
fp = m_path.withParentDir(ToonzFolder::getTemplateModuleDir());
if (!TFileStatus(path).isReadable())
fp = ToonzFolder::getTemplateModuleDir() + "menubar_template.xml";
}
loadMenuTree(fp);
}
开发者ID:CroW-CZ,项目名称:opentoonz,代码行数:27,代码来源:menubarpopup.cpp
示例17: QTreeWidget
JobListView::JobListView(const HostInfoManager* manager,
QWidget* parent,
const char* name)
: QTreeWidget(parent),
m_hostInfoManager(manager),
m_numberOfFilePathParts(2),
m_expireDuration(-1),
m_expireTimer(new QTimer(this))
{
setObjectName(QLatin1String(name));
qApp->setStyleSheet("QTreeView::branch { border-image: none; image: none }");
QStringList headers;
headers << tr("ID") << tr("Filename") << tr("Client") << tr("Server")
<< tr("State") << tr("Real") << tr("User") << tr("Faults")
<< tr("Size In") << tr("Size Out");
setHeaderLabels(headers);
const int nHeaders = headers.count();
setColumnCount(nHeaders);
// Auto adjust columns according to their content
QHeaderView* headerView = header();
for (int i = 0; i < nHeaders; ++i)
headerView->setResizeMode(i, QHeaderView::ResizeToContents);
headerView->setStretchLastSection(false);
setAllColumnsShowFocus(true);
setSortingEnabled(true);
sortByColumn(JobColumnID, Qt::DescendingOrder);
connect(m_expireTimer, SIGNAL(timeout()), this, SLOT(slotExpireFinishedJobs()));
}
开发者ID:lizardo,项目名称:Iceberg,代码行数:34,代码来源:joblistview.cpp
示例18: QTreeWidget
PlayListView::PlayListView(QWidget *parent, const char *name)
: QTreeWidget(parent)
{
this->setObjectName( name );
// addColumn(tr("Title"));
// addColumn(tr("File name"));
setColumnCount( 2 );
setHeaderLabels( QStringList() << tr("Title") << tr("File name") );
setAllColumnsShowFocus(true);
setSelectionBehavior( QAbstractItemView::SelectRows );
setSelectionMode( QAbstractItemView::SingleSelection );
setDropIndicatorShown(true);
setDragEnabled(true);
setAcceptDrops(true);
//setDragDropMode( QAbstractItemView::NoDragDrop );
//setDragDropMode(QAbstractItemView::InternalMove);
/*
setShowToolTips(true); //&&& disabled a few property inits
setShowSortIndicator(true);
setItemsMovable(true);
setSorting(-1);
*/
}
开发者ID:UIKit0,项目名称:rosegarden,代码行数:28,代码来源:PlayListView.cpp
示例19: QTableWidget
KColorCells::KColorCells( QWidget *parent, int rows, int cols )
: QTableWidget( parent ), d( new KColorCellsPrivate( this ) )
{
setItemDelegate( new KColorCellsItemDelegate( this ) );
setFrameShape( QFrame::NoFrame );
d->shade = true;
setRowCount( rows );
setColumnCount( cols );
verticalHeader()->hide();
horizontalHeader()->hide();
d->selected = -1;
d->inMouse = false;
// Drag'n'Drop
setAcceptDrops( true );
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
viewport()->setBackgroundRole( QPalette::Background );
setBackgroundRole( QPalette::Background );
setSelectionMode( QAbstractItemView::SingleSelection );
setDragEnabled( false );
}
开发者ID:Ramblurr,项目名称:PietCreator,代码行数:28,代码来源:KColorCells.cpp
示例20: qDeleteAll
void MusicDownloadTableWidget::clearAllItems()
{
qDeleteAll(m_items);
m_items.clear();
MusicAbstractTableWidget::clear();
setColumnCount(1);
}
开发者ID:jinting6949,项目名称:TTKMusicplayer,代码行数:7,代码来源:musicdownloadwidget.cpp
注:本文中的setColumnCount函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论