本文整理汇总了C++中setIndentation函数的典型用法代码示例。如果您正苦于以下问题:C++ setIndentation函数的具体用法?C++ setIndentation怎么用?C++ setIndentation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setIndentation函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setIndentation
void CategoryFilterWidget::callUpdateGeometry()
{
if (!BitTorrent::Session::instance()->isSubcategoriesEnabled())
setIndentation(0);
else
setIndentation(m_defaultIndentation);
updateGeometry();
}
示例2: QTreeWidget
PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf )
: QTreeWidget( p ), p_intf(_p_intf)
{
/* Properties */
setFrameStyle( QFrame::NoFrame );
setAttribute( Qt::WA_MacShowFocusRect, false );
viewport()->setAutoFillBackground( false );
setIconSize( QSize( 24,24 ) );
setIndentation( 12 );
setHeaderHidden( true );
setRootIsDecorated( true );
setAlternatingRowColors( false );
/* drops */
viewport()->setAcceptDrops(true);
setDropIndicatorShown(true);
invisibleRootItem()->setFlags( invisibleRootItem()->flags() & ~Qt::ItemIsDropEnabled );
#ifdef Q_OS_MAC
setAutoFillBackground( true );
QPalette palette;
palette.setColor( QPalette::Window, QColor(209,215,226) );
setPalette( palette );
#endif
setMinimumHeight( 120 );
/* Podcasts */
podcastsParent = NULL;
podcastsParentId = -1;
/* Podcast connects */
CONNECT( THEMIM, playlistItemAppended( int, int ),
this, plItemAdded( int, int ) );
CONNECT( THEMIM, playlistItemRemoved( int ),
this, plItemRemoved( int ) );
DCONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
this, inputItemUpdate( input_item_t * ) );
createItems();
setRootIsDecorated( false );
setIndentation( 5 );
/* Expand at least to show level 2 */
for ( int i = 0; i < topLevelItemCount(); i++ )
expandItem( topLevelItem( i ) );
/***
* We need to react to both clicks and activation (enter-key) here.
* We use curItem to avoid rebuilding twice.
* See QStyle::SH_ItemView_ActivateItemOnSingleClick
***/
curItem = NULL;
CONNECT( this, itemActivated( QTreeWidgetItem *, int ),
this, setSource( QTreeWidgetItem *) );
CONNECT( this, itemClicked( QTreeWidgetItem *, int ),
this, setSource( QTreeWidgetItem *) );
}
示例3: setIndentation
void DGameTree::SetViewStyle(GameListStyle newStyle)
{
if (newStyle == STYLE_LIST)
{
m_current_style = STYLE_LIST;
setIndentation(0);
RebuildTree();
}
else
{
m_current_style = STYLE_TREE;
setIndentation(20);
RebuildTree();
}
}
示例4: 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
}
示例5: QTreeView
CategoryFilterWidget::CategoryFilterWidget(QWidget *parent)
: QTreeView(parent)
{
auto *proxyModel = new CategoryFilterProxyModel(this);
proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
proxyModel->setSourceModel(new CategoryFilterModel(this));
setModel(proxyModel);
setFrameShape(QFrame::NoFrame);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
setUniformRowHeights(true);
setHeaderHidden(true);
setIconSize(Utils::Gui::smallIconSize());
#ifdef Q_OS_MAC
setAttribute(Qt::WA_MacShowFocusRect, false);
#endif
m_defaultIndentation = indentation();
if (!BitTorrent::Session::instance()->isSubcategoriesEnabled())
setIndentation(0);
setContextMenuPolicy(Qt::CustomContextMenu);
sortByColumn(0, Qt::AscendingOrder);
setCurrentIndex(model()->index(0, 0));
connect(this, &QTreeView::collapsed, this, &CategoryFilterWidget::callUpdateGeometry);
connect(this, &QTreeView::expanded, this, &CategoryFilterWidget::callUpdateGeometry);
connect(this, &QWidget::customContextMenuRequested, this, &CategoryFilterWidget::showMenu);
connect(selectionModel(), &QItemSelectionModel::currentRowChanged
, this, &CategoryFilterWidget::onCurrentRowChanged);
connect(model(), &QAbstractItemModel::modelReset, this, &CategoryFilterWidget::callUpdateGeometry);
}
示例6: QTreeView
ItemViewWidget::ItemViewWidget(QWidget *parent) : QTreeView(parent),
m_headerWidget(new HeaderViewWidget(Qt::Horizontal, this)),
m_model(NULL),
m_viewMode(ListViewMode),
m_sortOrder(Qt::AscendingOrder),
m_sortColumn(-1),
m_dragRow(-1),
m_dropRow(-1),
m_canGatherExpanded(false),
m_isModified(false),
m_isInitialized(false)
{
m_treeIndentation = indentation();
optionChanged(QLatin1String("Interface/ShowScrollBars"), SettingsManager::getValue(QLatin1String("Interface/ShowScrollBars")));
setHeader(m_headerWidget);
setItemDelegate(new ItemDelegate(true, this));
setIndentation(0);
setAllColumnsShowFocus(true);
m_filterRoles.insert(Qt::DisplayRole);
viewport()->setAcceptDrops(true);
connect(SettingsManager::getInstance(), SIGNAL(valueChanged(QString,QVariant)), this, SLOT(optionChanged(QString,QVariant)));
connect(this, SIGNAL(sortChanged(int,Qt::SortOrder)), m_headerWidget, SLOT(setSort(int,Qt::SortOrder)));
connect(m_headerWidget, SIGNAL(sortChanged(int,Qt::SortOrder)), this, SLOT(setSort(int,Qt::SortOrder)));
connect(m_headerWidget, SIGNAL(columnVisibilityChanged(int,bool)), this, SLOT(setColumnVisibility(int,bool)));
connect(m_headerWidget, SIGNAL(sectionMoved(int,int,int)), this, SLOT(saveState()));
}
示例7: QTreeWidget
Bookmarks::Bookmarks(QWidget* parent)
: QTreeWidget(parent)
{
setLayoutDirection(Qt::RightToLeft);
setTextElideMode(Qt::ElideMiddle);
#ifdef Q_OS_WIN
setIndentation(10);
#endif
QStringList labels;
labels << tr("Title") << tr("Comments");
#if QT_VERSION < 0x050000
header()->setResizeMode(QHeaderView::Interactive);
#else
header()->setSectionResizeMode(QHeaderView::Interactive);
#endif
setHeaderLabels(labels);
m_folderIcon.addPixmap(style()->standardPixmap(QStyle::SP_DirClosedIcon),
QIcon::Normal, QIcon::Off);
m_folderIcon.addPixmap(style()->standardPixmap(QStyle::SP_DirOpenIcon),
QIcon::Normal, QIcon::On);
m_bookmarkIcon.addPixmap(QPixmap(ICON_PATH + "/bookmark-on.png"));
setAlternatingRowColors(true);
connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(doubleClicked(QTreeWidgetItem*,int)));
}
示例8: 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);
}
示例9: TreeViewTouch
NickView::NickView(QWidget *parent)
: TreeViewTouch(parent)
{
setIndentation(10);
header()->hide();
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setSortingEnabled(true);
sortByColumn(0, Qt::AscendingOrder);
setContextMenuPolicy(Qt::CustomContextMenu);
setSelectionMode(QAbstractItemView::ExtendedSelection);
// // breaks with Qt 4.8
// if(QString("4.8.0") > qVersion()) // FIXME breaks with Qt versions >= 4.10!
setAnimated(true);
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(showContextMenu(const QPoint &)));
#if defined Q_OS_MACOS || defined Q_OS_WIN
// afaik this is better on Mac and Windows
connect(this, SIGNAL(activated(QModelIndex)), SLOT(startQuery(QModelIndex)));
#else
connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(startQuery(QModelIndex)));
#endif
}
示例10: ExpandingTree
KateCompletionTree::KateCompletionTree(KateCompletionWidget *parent)
: ExpandingTree(parent)
{
m_scrollingEnabled = true;
header()->hide();
setRootIsDecorated(false);
setIndentation(0);
setFrameStyle(QFrame::NoFrame);
setAllColumnsShowFocus(true);
setAlternatingRowColors(true);
//We need ScrollPerItem, because ScrollPerPixel is too slow with a very large competion-list(see KDevelop).
setVerticalScrollMode(QAbstractItemView::ScrollPerItem);
m_resizeTimer = new QTimer(this);
m_resizeTimer->setSingleShot(true);
connect(m_resizeTimer, SIGNAL(timeout()), this, SLOT(resizeColumnsSlot()));
// Provide custom highlighting to completion entries
setItemDelegate(new KateCompletionDelegate(widget()->model(), widget()));
// make sure we adapt to size changes when the model got reset
// this is important for delayed creation of groups, without this
// the first column would never get resized to the correct size
connect(widget()->model(), &QAbstractItemModel::modelReset,
this, &KateCompletionTree::scheduleUpdate);
// Prevent user from expanding / collapsing with the mouse
setItemsExpandable(false);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
示例11: QTreeView
RepoTreeView::RepoTreeView(QWidget *parent)
: QTreeView(parent)
{
header()->hide();
createActions();
// We draw the indicator ourselves
setIndentation(0);
// We handle the click oursevles
setExpandsOnDoubleClick(false);
connect(this, SIGNAL(clicked(const QModelIndex&)),
this, SLOT(onItemClicked(const QModelIndex&)));
connect(this, SIGNAL(doubleClicked(const QModelIndex&)),
this, SLOT(onItemDoubleClicked(const QModelIndex&)));
#ifdef Q_WS_MAC
this->setAttribute(Qt::WA_MacShowFocusRect, 0);
#endif
loadExpandedCategries();
connect(qApp, SIGNAL(aboutToQuit()),
this, SLOT(saveExpandedCategries()));
connect(seafApplet->accountManager(), SIGNAL(beforeAccountChanged()),
this, SLOT(saveExpandedCategries()));
connect(seafApplet->accountManager(), SIGNAL(accountsChanged()),
this, SLOT(loadExpandedCategries()));
}
示例12: TreeView
START_NS
ModelViewReadOnly::ModelViewReadOnly(QWidget * parent):
TreeView(parent)
{
setHeaderHidden(true);
//header()->setResizeMode(QHeaderView::Stretch);
setRootIsDecorated(false);
setIndentation(0);
setExpandsOnDoubleClick(true);
setItemDelegateForColumn(0, new ModelTreeDelegate());
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setSelectionMode( SingleSelection );
setSelectionBehavior(SelectRows);
// we disable the provided dnd features,
// as we use a proprietary solution
setDragDropMode(QAbstractItemView::DragDrop);
setDragEnabled(true);
setAcceptDrops(false);
overlay()->setText(tr("Please load a model"));
connect(this, SIGNAL(clicked(QModelIndex)), this, SLOT(__clicked(QModelIndex)));
}
示例13: QTreeWidget
PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf )
: QTreeWidget( p ), p_intf(_p_intf)
{
setIconSize( QSize( 24,24 ) );
// view->setAlternatingRowColors( true );
setIndentation( 10 );
header()->hide();
setRootIsDecorated( false );
// model = new PLModel( THEPL, p_intf, THEPL->p_root_category, 1, this );
// view->setModel( model );
viewport()->setAcceptDrops(true);
setDropIndicatorShown(true);
invisibleRootItem()->setFlags( invisibleRootItem()->flags() & ~Qt::ItemIsDropEnabled );
createItems();
CONNECT( this, itemActivated( QTreeWidgetItem *, int ),
this, setSource( QTreeWidgetItem *) );
/* I believe this is unnecessary, seeing
QStyle::SH_ItemView_ActivateItemOnSingleClick
CONNECT( view, itemClicked( QTreeWidgetItem *, int ),
this, setSource( QTreeWidgetItem *) ); */
/* select the first item */
// view->setCurrentIndex( model->index( 0, 0, QModelIndex() ) );
}
示例14: QTreeView
/*!
* \brief SimulationOutputTree::SimulationOutputTree
* \param pSimulationOutputWidget
*/
SimulationOutputTree::SimulationOutputTree(SimulationOutputWidget *pSimulationOutputWidget)
: QTreeView(pSimulationOutputWidget), mpSimulationOutputWidget(pSimulationOutputWidget)
{
setItemDelegate(new ItemDelegate(this, true));
setTextElideMode(Qt::ElideNone);
setIndentation(Helper::treeIndentation);
setExpandsOnDoubleClick(false);
setHeaderHidden(true);
setMouseTracking(true); /* important for Debug more links. */
setSelectionMode(QAbstractItemView::ExtendedSelection);
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(showContextMenu(QPoint)));
connect(header(), SIGNAL(sectionResized(int,int,int)), SLOT(callLayoutChanged(int,int,int)));
// create actions
mpSelectAllAction = new QAction(tr("Select All"), this);
mpSelectAllAction->setShortcut(QKeySequence("Ctrl+a"));
mpSelectAllAction->setStatusTip(tr("Selects all the Messages"));
connect(mpSelectAllAction, SIGNAL(triggered()), SLOT(selectAllMessages()));
mpCopyAction = new QAction(QIcon(":/Resources/icons/copy.svg"), Helper::copy, this);
mpCopyAction->setShortcut(QKeySequence("Ctrl+c"));
mpCopyAction->setStatusTip(tr("Copy the Message"));
connect(mpCopyAction, SIGNAL(triggered()), SLOT(copyMessages()));
mpExpandAllAction = new QAction(Helper::expandAll, this);
mpExpandAllAction->setStatusTip(tr("Copy the Message"));
connect(mpExpandAllAction, SIGNAL(triggered()), SLOT(expandAll()));
mpCollapseAllAction = new QAction(Helper::collapseAll, this);
mpCollapseAllAction->setStatusTip(tr("Copy the Message"));
connect(mpCollapseAllAction, SIGNAL(triggered()), SLOT(collapseAll()));
}
示例15: QTreeView
MsgListView::MsgListView(QWidget *parent): QTreeView(parent), m_autoActivateAfterKeyNavigation(true), m_autoResizeSections(true)
{
connect(header(), SIGNAL(geometriesChanged()), this, SLOT(slotFixSize()));
connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(slotExpandWholeSubtree(QModelIndex)));
connect(header(), SIGNAL(sectionCountChanged(int,int)), this, SLOT(slotSectionCountChanged()));
header()->setContextMenuPolicy(Qt::ActionsContextMenu);
headerFieldsMapper = new QSignalMapper(this);
connect(headerFieldsMapper, SIGNAL(mapped(int)), this, SLOT(slotHeaderSectionVisibilityToggled(int)));
setUniformRowHeights(true);
setAllColumnsShowFocus(true);
setSelectionMode(ExtendedSelection);
setDragEnabled(true);
setRootIsDecorated(false);
// Some subthreads might be huuuuuuuuuuge, so prevent indenting them too heavily
setIndentation(15);
setSortingEnabled(true);
// By default, we don't do any sorting
header()->setSortIndicator(-1, Qt::AscendingOrder);
m_naviActivationTimer = new QTimer(this);
m_naviActivationTimer->setSingleShot(true);
connect (m_naviActivationTimer, SIGNAL(timeout()), SLOT(slotCurrentActivated()));
}