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


C++ setRootIsDecorated函数代码示例

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


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

示例1: QTreeView

HistoryView::HistoryView(QWidget* parent) : QTreeView(parent) {
  header()->setResizeMode(QHeaderView::Stretch);
  setRootIsDecorated(false);

  _model = new HistoryFilterModel(this);
  setModel(_model);
  setCurrentIndex(model()->index(0, 0, QModelIndex()));

  _removeShortcut = new QShortcut(QKeySequence::Delete, this);
  connect(_removeShortcut, SIGNAL(activated()), this, SLOT(removeCurrentItem()));

  _itemMenu = new QMenu(this);

  _openAction = _itemMenu->addAction(QIcon(":/openTab.png"), trUtf8("Open in new tab"));
  connect(_openAction, SIGNAL(triggered()), this, SLOT(addTabToCurrentItem()));

  _removeAction = _itemMenu->addAction(QIcon(":/delete.png"), trUtf8("Delete"));
  connect(_removeAction, SIGNAL(triggered()), this, SLOT(removeCurrentItem()));
}
开发者ID:Allanis,项目名称:SaraWeb,代码行数:19,代码来源:HistoryView.cpp

示例2: setHeaderLabel

void
query_listview::init()
{
  setHeaderLabel(tr("Quick selection"));
  setRootIsDecorated(true);

  fetch_tag_map();
  tags_definition_list tag_list;
  tag_list.fetch();
  tag_node root;
  root.get_child_tags(tag_list);

  // New messages
  query_lvitem* item_new = new query_lvitem(this, tr("Unread messages"));
  m_item_new_all = new query_lvitem(item_new, query_lvitem::new_all, tr("All"));
  m_item_new_untagged = new query_lvitem(item_new, query_lvitem::new_not_tagged, tr("Not tagged"));
  item_new->setExpanded(true);

  create_branch_current(&root);

  // Tagged messages
  // The root is a pseudo-tag with an id=0
  m_item_tags = new query_tag_lvitem(this, query_lvitem::archived_tagged, tr("Archived tagged mail"));

  insert_child_tags(&root, m_item_tags, query_lvitem::archived_tagged, NULL);
  m_item_tags->sortChildren(0, Qt::AscendingOrder);


  m_item_virtfold_sent = new query_lvitem(this, tr("Sent mail"));
  m_item_virtfold_sent->set_type(query_lvitem::virtfold_sent);

  m_item_virtfold_trashcan = new query_lvitem(this, tr("Trashcan"));
  m_item_virtfold_trashcan->set_type(query_lvitem::virtfold_trashcan);

  // User queries
  m_item_user_queries = new query_lvitem(this, tr("User queries"));
  reload_user_queries();

  display_counter(query_lvitem::new_all);
  display_counter(query_lvitem::nonproc_all);
  display_counter(query_lvitem::new_not_tagged);
}
开发者ID:AleksKots,项目名称:Manitou,代码行数:42,代码来源:query_listview.cpp

示例3: QTreeWidget

TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), properties(properties) {
  // Graphical settings
  setRootIsDecorated(false);
  setAllColumnsShowFocus(true);
  setItemsExpandable(false);
  setSelectionMode(QAbstractItemView::ExtendedSelection);
  // Context menu
  setContextMenuPolicy(Qt::CustomContextMenu);
  connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showTrackerListMenu(QPoint)));
  // Set header
  QStringList header;
  header << "#";
  header << tr("URL");
  header << tr("Status");
  header << tr("Peers");
  header << tr("Message");
  setHeaderItem(new QTreeWidgetItem(header));
  dht_item = new QTreeWidgetItem(QStringList() << "" << "** [DHT] **");
  insertTopLevelItem(0, dht_item);
  setRowColor(0, QColor("grey"));
  pex_item = new QTreeWidgetItem(QStringList() << "" << "** [PeX] **");
  insertTopLevelItem(1, pex_item);
  setRowColor(1, QColor("grey"));
  lsd_item = new QTreeWidgetItem(QStringList() << "" << "** [LSD] **");
  insertTopLevelItem(2, lsd_item);
  setRowColor(2, QColor("grey"));
  editHotkey = new QShortcut(QKeySequence("F2"), this, SLOT(editSelectedTracker()), 0, Qt::WidgetShortcut);
  connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(editSelectedTracker()));
  deleteHotkey = new QShortcut(QKeySequence(QKeySequence::Delete), this, SLOT(deleteSelectedTrackers()), 0, Qt::WidgetShortcut);
  copyHotkey = new QShortcut(QKeySequence(Qt::ControlModifier + Qt::Key_C), this, SLOT(copyTrackerUrl()), 0, Qt::WidgetShortcut);

#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
    // This hack fixes reordering of first column with Qt5.
    // https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777
    QTableView unused;
    unused.setVerticalHeader(this->header());
    this->header()->setParent(this);
    unused.setVerticalHeader(new QHeaderView(Qt::Horizontal));
#endif

  loadSettings();
}
开发者ID:Godrod,项目名称:qBittorrent,代码行数:42,代码来源:trackerlist.cpp

示例4: toResultView

toResultStorage::toResultStorage(bool available, QWidget *parent, const char *name)
        : toResultView(false, false, parent, name), AvailableGraph(available)
{
    Unit = toConfigurationSingle::Instance().sizeUnit();
    setAllColumnsShowFocus(true);
    setSortingEnabled(false); // enable it after data fetch
    setRootIsDecorated(true);
    addColumn(tr("Name"));
    addColumn(tr("Status"));
    addColumn(tr("Information"));
    addColumn(tr("Contents"));
    addColumn(tr("Logging"));
    addColumn(tr("Size (%1)").arg(Unit));
    addColumn(tr("Free (%1)").arg(Unit));
    addColumn(tr("Free (%)"));
    addColumn(tr("Autoextend (%1)").arg(Unit));
    if (available)
        addColumn(tr("Used/Free/Autoextend"));
    else
        addColumn(tr("Available"));
    addColumn(tr("Coalesced"));
    addColumn(tr("Max free (%1)").arg(Unit));
    addColumn(tr("Free fragments"));
    setSQLName(tr("toResultStorage"));

    setColumnAlignment(COL_SIZE, Qt::AlignRight);
    setColumnAlignment(COL_FREE_UNIT, Qt::AlignRight);
    setColumnAlignment(COL_FREE_PERCENT, Qt::AlignRight);
    setColumnAlignment(COL_AUTOEXT, Qt::AlignCenter);
    setColumnAlignment(COL_USED_FREE_AUTO, Qt::AlignCenter);
    setColumnAlignment(COL_COALESCED, Qt::AlignRight);
    setColumnAlignment(COL_MAX_FREE, Qt::AlignRight);
    setColumnAlignment(COL_FREE_FRAGMENTS, Qt::AlignRight);

    ShowCoalesced = false;
    OnlyFiles = false;

    Tablespaces = Files = NULL;

    connect(&Poll, SIGNAL(timeout()), this, SLOT(poll()));
    setItemDelegate(new toResultStorageItemDelegate());
}
开发者ID:netrunner-debian-kde-extras,项目名称:tora,代码行数:42,代码来源:toresultstorage.cpp

示例5: QTreeWidget

WidgetBoxTreeWidget::WidgetBoxTreeWidget(QDesignerFormEditorInterface *core, QWidget *parent) :
    QTreeWidget(parent),
    m_core(core),
    m_iconMode(false),
    m_scratchPadDeleteTimer(0)
{
    setFocusPolicy(Qt::NoFocus);
    setIndentation(0);
    setRootIsDecorated(false);
    setColumnCount(1);
    header()->hide();
    header()->setResizeMode(QHeaderView::Stretch);
    setTextElideMode(Qt::ElideMiddle);
    setVerticalScrollMode(ScrollPerPixel);

    setItemDelegate(new SheetDelegate(this, this));

    connect(this, SIGNAL(itemPressed(QTreeWidgetItem*,int)),
            this, SLOT(handleMousePress(QTreeWidgetItem*)));
}
开发者ID:mohdpatah,项目名称:qt,代码行数:20,代码来源:widgetboxtreewidget.cpp

示例6: QTreeWidget

PlayerListWidget::PlayerListWidget(TabSupervisor *_tabSupervisor, AbstractClient *_client, TabGame *_game, QWidget *parent)
	: QTreeWidget(parent), tabSupervisor(_tabSupervisor), client(_client), game(_game), gameStarted(false)
{
	readyIcon = QIcon(":/resources/icon_ready_start.svg");
	notReadyIcon = QIcon(":/resources/icon_not_ready_start.svg");
	concededIcon = QIcon(":/resources/icon_conceded.svg");
	playerIcon = QIcon(":/resources/icon_player.svg");
	spectatorIcon = QIcon(":/resources/icon_spectator.svg");

	itemDelegate = new PlayerListItemDelegate(this);
	setItemDelegate(itemDelegate);
	
	setMinimumHeight(60);
	setIconSize(QSize(20, 15));
	setColumnCount(6);
	setHeaderHidden(true);
	setRootIsDecorated(false);
	header()->setResizeMode(QHeaderView::ResizeToContents);
	retranslateUi();
}
开发者ID:Zors,项目名称:Cockatrice,代码行数:20,代码来源:playerlistwidget.cpp

示例7: QTreeView

ContactListView::ContactListView(QWidget* parent)
: QTreeView(parent)
{
	setUniformRowHeights(false);
	setAlternatingRowColors(true);
	// setLargeIcons(false);
	// setShowIcons(true);
	setRootIsDecorated(false);
	// on Macs Enter key is the default EditKey, so we can't use EditKeyPressed
	setEditTriggers(QAbstractItemView::EditKeyPressed); // lesser evil, otherwise no editing will be possible at all due to Qt bug
	// setEditTriggers(QAbstractItemView::NoEditTriggers);
	setIndentation(5);
	header()->hide();

	// setItemDelegate(new PsiContactListViewDelegate(this));

#ifdef Q_WS_MAC
	setFrameShape(QFrame::NoFrame);
#endif
}
开发者ID:AlekSi,项目名称:Jabbin,代码行数:20,代码来源:contactlistview.cpp

示例8: toResultView

toResultLock::toResultLock(QWidget *parent, const char *name)
    : toResultView(false, false, parent, name)
{
    setAllColumnsShowFocus(true);
    setSorting( -1);
    setRootIsDecorated(true);
    addColumn(tr("Session"));
    addColumn(tr("Schema"));
    addColumn(tr("Osuser"));
    addColumn(tr("Program"));
    addColumn(tr("Type"));
    addColumn(tr("Mode"));
    addColumn(tr("Request"));
    addColumn(tr("Object"));
    addColumn(tr("Grabbed"));
    addColumn(tr("Requested"));
    setSQLName(QString::fromLatin1("toResultLock"));

    Query = NULL;
}
开发者ID:nguyentienlong,项目名称:tora,代码行数:20,代码来源:toresultlock.cpp

示例9: QTreeView

BaseTreeView::BaseTreeView(QWidget *parent)
    : QTreeView(parent)
{
    setAttribute(Qt::WA_MacShowFocusRect, false);
    setFrameStyle(QFrame::NoFrame);
    setRootIsDecorated(false);
    setIconSize(QSize(10, 10));
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setUniformRowHeights(true);

    header()->setDefaultAlignment(Qt::AlignLeft);
    header()->setClickable(true);

    connect(this, SIGNAL(activated(QModelIndex)),
        SLOT(rowActivatedHelper(QModelIndex)));
    connect(header(), SIGNAL(sectionClicked(int)),
        SLOT(headerSectionClicked(int)));

    m_adjustColumnsAction = new QAction(tr("Adjust Column Widths to Contents"), this);
    m_alwaysAdjustColumnsAction = 0;
}
开发者ID:CNOT,项目名称:julia-studio,代码行数:21,代码来源:basetreeview.cpp

示例10: m_appendAction

FileView::FileView( QWidget *parent )
    : Amarok::PrettyTreeView( parent )
    , m_appendAction( 0 )
    , m_loadAction( 0 )
    , m_editAction( 0 )
    , m_moveToTrashAction( 0 )
    , m_deleteAction( 0 )
    , m_pd( 0 )
    , m_ongoingDrag( false )
{
    setFrameStyle( QFrame::NoFrame );
    setItemsExpandable( false );
    setRootIsDecorated( false );
    setAlternatingRowColors( true );
    setUniformRowHeights( true );
    setEditTriggers( EditKeyPressed );

    The::paletteHandler()->updateItemView( this );
    connect( The::paletteHandler(), SIGNAL(newPalette(QPalette)),
                                    SLOT(newPalette(QPalette)) );
}
开发者ID:cancamilo,项目名称:amarok,代码行数:21,代码来源:FileView.cpp

示例11: QListView

CObjectListView::CObjectListView(CSceneGraph &sg, QWidget *parent, const char *name):
	QListView(parent, name), 
	m_pSG(&sg)
{		
    header()->setClickEnabled( TRUE );
    addColumn( "       Name      " );
    addColumn( "  Type " );
	addColumn( " Vertex#" );

    setRootIsDecorated(true);
	setSorting(-1);

	connect(this, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)), 
			this, SLOT(slotDoubleClicked(QListViewItem *, const QPoint &, int)));

	//--------------------------------------
	update(sg);
	//--------------------------------------

    resize(180, 100);
}
开发者ID:nanzhang790,项目名称:View3dn,代码行数:21,代码来源:objectlistview.cpp

示例12: QTreeWidget

MetadataListView::MetadataListView(QWidget* parent)
    : QTreeWidget(parent)
{
    setRootIsDecorated(false);
    setSelectionMode(QAbstractItemView::SingleSelection);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    setAllColumnsShowFocus(true);
    setColumnCount(2);
    header()->setResizeMode(QHeaderView::Stretch);
    header()->hide();

    QStringList labels;
    labels.append( "Name" );        // no i18n here: hidden header
    labels.append( "Value" );       // no i18n here: hidden header
    setHeaderLabels(labels);

    m_parent = dynamic_cast<MetadataWidget*>(parent);

    connect(this, SIGNAL(itemClicked(QTreeWidgetItem*, int)),
            this, SLOT(slotSelectionChanged(QTreeWidgetItem*, int)));
}
开发者ID:UIKit0,项目名称:digikam,代码行数:21,代码来源:metadatalistview.cpp

示例13: QTreeView

/////////////// TableView
TableView::TableView(QWidget* parent)
    : QTreeView(parent)
    , _imp( new TableViewPrivate() )
{
    setSelectionBehavior(QAbstractItemView::SelectRows);
    setRootIsDecorated(false);
    setItemsExpandable(false);

    ///The table model here doesn't support sorting
    setSortingEnabled(false);

    header()->setStretchLastSection(false);
    header()->setFont( QApplication::font() ); // necessary, or the header font will have the default size, not the application font size
    setTextElideMode(Qt::ElideMiddle);
    setEditTriggers(QAbstractItemView::EditKeyPressed | QAbstractItemView::SelectedClicked | QAbstractItemView::DoubleClicked);
    setContextMenuPolicy(Qt::CustomContextMenu);
    setDragDropMode(QAbstractItemView::NoDragDrop);
    setAttribute(Qt::WA_MacShowFocusRect, 0);
    setAcceptDrops(true);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
}
开发者ID:jessezwd,项目名称:Natron,代码行数:22,代码来源:TableModelView.cpp

示例14: QTreeWidget

RestHistoryWidget::RestHistoryWidget(QWidget *parent) :
    QTreeWidget(parent)
{
    QStringList params;
    params << "ID" << "Type" << "URL" << "Response Code" << "Date";
    setHeaderLabels(params);

    setColumnWidth(0,90);
    setColumnWidth(2,500);

    setAlternatingRowColors(true);
    setRootIsDecorated(true);
    setUniformRowHeights(true);
    setAllColumnsShowFocus(true);
    header()->setCascadingSectionResizes(true);
    header()->setHighlightSections(false);
    header()->setStretchLastSection(true);

    setSelectionMode(QAbstractItemView::ExtendedSelection);
    menu = new QMenu;
}
开发者ID:peterkomar,项目名称:qrestclient,代码行数:21,代码来源:resthistorywidget.cpp

示例15: QTreeView

PlacesView::PlacesView(QWidget* parent):
  QTreeView(parent),
  currentPath_(NULL) {
  setRootIsDecorated(false);
  setHeaderHidden(true);
  setIndentation(12);

  connect(this, &QTreeView::clicked, this, &PlacesView::onClicked);
  connect(this, &QTreeView::pressed, this, &PlacesView::onPressed);

  setIconSize(QSize(24, 24));

  // FIXME: we may share this model amont all views
  model_ = new PlacesModel(this);
  setModel(model_);

  QHeaderView* headerView = header();
  headerView->setSectionResizeMode(0, QHeaderView::Stretch);
  headerView->setSectionResizeMode(1, QHeaderView::Fixed);
  headerView->setStretchLastSection(false);
  expandAll();

  // FIXME: is there any better way to make the first column span the whole row?
  setFirstColumnSpanned(0, QModelIndex(), true); // places root
  setFirstColumnSpanned(1, QModelIndex(), true); // devices root
  setFirstColumnSpanned(2, QModelIndex(), true); // bookmarks root

  // the 2nd column is for the eject buttons
  setSelectionBehavior(QAbstractItemView::SelectRows); // FIXME: why this does not work?
  setAllColumnsShowFocus(false);

  setAcceptDrops(true);
  setDragEnabled(true);

  // update the umount button's column width based on icon size
  onIconSizeChanged(iconSize());
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) // this signal requires Qt >= 5.5
  connect(this, &QAbstractItemView::iconSizeChanged, this, &PlacesView::onIconSizeChanged);
#endif
}
开发者ID:rbazaud,项目名称:pcmanfm-qt,代码行数:40,代码来源:placesview.cpp


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