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())); }
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); }
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(); }
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()); }
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*))); }
//-------------------- DocumentTreeView::DocumentTreeView( QWidget *parent ) : TreeViewBase( parent ) { // header()->setContextMenuPolicy( Qt::CustomContextMenu ); setStretchLastSection( false ); DocumentItemModel *m = new DocumentItemModel(); setModel( m ); setRootIsDecorated ( false ); setSelectionBehavior( QAbstractItemView::SelectRows ); setSelectionMode( QAbstractItemView::SingleSelection ); createItemDelegates( m ); setAcceptDrops( true ); setDropIndicatorShown( true ); connect( selectionModel(), SIGNAL( selectionChanged ( const QItemSelection&, const QItemSelection& ) ), SLOT( slotSelectionChanged( const QItemSelection& ) ) ); }
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(); }
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 }
WordTree::WordTree(QWidget* parent) : QTreeWidget(parent), m_active_item(0), m_hebrew(false), m_trie(0) { setColumnCount(3); hideColumn(2); header()->setStretchLastSection(false); header()->setSectionResizeMode(0, QHeaderView::Stretch); header()->setSectionResizeMode(1, QHeaderView::Fixed); header()->hide(); setColumnWidth(1, 22); setIconSize(QSize(16,16)); setMouseTracking(true); setRootIsDecorated(false); setSortingEnabled(true); sortByColumn(0, Qt::AscendingOrder); setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); connect(this, &QTreeWidget::itemClicked, this, &WordTree::onItemClicked); }
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; }
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; }
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)) ); }
QgsColorSchemeList::QgsColorSchemeList( QWidget *parent , QgsColorScheme *scheme, const QString context, const QColor baseColor ) : QTreeView( parent ) , mScheme( scheme ) { mModel = new QgsColorSchemeModel( scheme, context, baseColor, this ); //for testing: //new ModelTest( mModel, this ); setModel( mModel ); mSwatchDelegate = new QgsColorSwatchDelegate( this ); setItemDelegateForColumn( 0, mSwatchDelegate ); setRootIsDecorated( false ); setSelectionMode( QAbstractItemView::ExtendedSelection ); setSelectionBehavior( QAbstractItemView::SelectRows ); setDragEnabled( true ); setAcceptDrops( true ); setDragDropMode( QTreeView::DragDrop ); setDropIndicatorShown( true ); setDefaultDropAction( Qt::MoveAction ); }
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); }
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))); }
/////////////// 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); }
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; }
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 }
PropertyEditor::PropertyEditor(QWidget * parent, const char * name) : KListView(parent, name) , m_items(101, false) , justClickedItem(false) , m_currentEditor(0) { m_items.setAutoDelete(false); addColumn(i18n("Property")); addColumn(i18n("Value")); m_topItem = 0; m_editItem = 0; connect(this, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(slotClicked(QListViewItem *))); connect(this, SIGNAL(currentChanged(QListViewItem *)), this, SLOT(slotCurrentChanged(QListViewItem *))); connect(this, SIGNAL(expanded(QListViewItem *)), this, SLOT(slotExpanded(QListViewItem *))); connect(this, SIGNAL(collapsed(QListViewItem *)), this, SLOT(slotCollapsed(QListViewItem *))); connect(header(), SIGNAL(sizeChange(int, int, int)), this, SLOT(slotColumnSizeChanged(int, int, int))); connect(header(), SIGNAL(clicked(int)), this, SLOT(moveEditor())); connect(header(), SIGNAL(sectionHandleDoubleClicked(int)), this, SLOT(slotColumnSizeChanged(int))); m_defaults = new KPushButton(viewport()); m_defaults->setFocusPolicy(QWidget::NoFocus); setFocusPolicy(QWidget::ClickFocus); m_defaults->setPixmap(SmallIcon("undo")); QToolTip::add(m_defaults, i18n("Undo changes")); m_defaults->hide(); connect(m_defaults, SIGNAL(clicked()), this, SLOT(resetItem())); setRootIsDecorated(false); setShowSortIndicator(false); setTooltipColumn(0); setSorting(0); setItemMargin(2); setResizeMode(QListView::LastColumn); header()->setMovingEnabled(false); setTreeStepSize(0); m_baseRowHeight = QFontMetrics(font()).height() + itemMargin() * 2; }
BasicMibView::BasicMibView (QWidget * parent) : QTreeWidget(parent) { // Set some properties for the TreeView header()->hide(); setSortingEnabled( false ); setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOn ); header()->setSortIndicatorShown( false ); setLineWidth( 2 ); setAllColumnsShowFocus( false ); setFrameShape(QFrame::WinPanel); setFrameShadow(QFrame::Plain); setRootIsDecorated( true ); // Create context menu actions expandAct = new QAction(tr("Expand"), this); expandAct->setIcon(QIcon(":/images/expand.png")); connect(expandAct, SIGNAL(triggered()), this, SLOT(ExpandFromNode())); collapseAct = new QAction(tr("Collapse"), this); collapseAct->setIcon(QIcon(":/images/collapse.png")); connect(collapseAct, SIGNAL(triggered()), this, SLOT(CollapseFromNode())); findAct = new QAction(tr("Find"), this); connect(findAct, SIGNAL(triggered()), this, SLOT(FindFromNode())); // Connect some signals connect( this, SIGNAL( itemExpanded( QTreeWidgetItem * ) ), this, SLOT( ExpandNode( QTreeWidgetItem * ) ) ); connect( this, SIGNAL( itemCollapsed( QTreeWidgetItem * ) ), this, SLOT( CollapseNode( QTreeWidgetItem * ) ) ); connect( this, SIGNAL( currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem * ) ), this, SLOT( SelectedNode( QTreeWidgetItem *, QTreeWidgetItem * ) ) ); // Force initial refresh isdirty = 1; find_string = ""; find_last = model()->index(0, 0, QModelIndex()); find_back = false; find_cs = false; find_word = false; }
BaseTreeView::BaseTreeView(QWidget *parent, const char *name) : KFileTreeView(parent, name), fileInfoDlg(0), m_saveOpenFolder(false), m_openWithMenu(0L), m_openWithMenuId(-1) { m_parent = parent; QToolTip::remove(viewport()); // remove the tooltip from QListView m_tooltip = new BaseTreeViewToolTip(viewport(), this); setFrameStyle( Panel | Sunken ); setRootIsDecorated(true); setSorting(0); setLineWidth(2); setFullWidth(true); setShowSortIndicator(true); setFocusPolicy(QWidget::ClickFocus); setShowFolderOpenPixmap(false); connect(this, SIGNAL(returnPressed(QListViewItem *)), this, SLOT(slotReturnPressed(QListViewItem *))); connect(this, SIGNAL(dropped(QWidget *, QDropEvent *, KURL::List&, KURL&)), this, SLOT(slotDropped(QWidget *, QDropEvent *, KURL::List&, KURL&))); connect(this, SIGNAL(itemRenamed(QListViewItem*, const QString &, int )), this, SLOT(slotRenameItem(QListViewItem*, const QString &, int ))); connect(this, SIGNAL(executed(QListViewItem *)), this, SLOT(slotSelectFile(QListViewItem *))); connect(this, SIGNAL(openFile(const KURL &)), quantaApp, SLOT(slotFileOpen(const KURL &))); connect(this, SIGNAL(openImage(const KURL &)), quantaApp, SLOT(slotImageOpen(const KURL &))); connect(this, SIGNAL(closeFile(const KURL &)), quantaApp, SLOT(slotFileClose(const KURL &))); connect(this, SIGNAL(insertTag(const KURL &, DirInfo)), quantaApp, SLOT(slotInsertTag(const KURL &, DirInfo))); }
QtChatListWindow::QtChatListWindow(UIEventStream *uiEventStream, SettingsProvider* settings, QWidget* parent) : QTreeView(parent) { eventStream_ = uiEventStream; settings_ = settings;; bookmarksEnabled_ = false; model_ = new ChatListModel(); setModel(model_); delegate_ = new ChatListDelegate(settings_->getSetting(QtUISettingConstants::COMPACT_ROSTER)); setItemDelegate(delegate_); setHeaderHidden(true); #ifdef SWIFT_PLATFORM_MACOSX setAlternatingRowColors(true); #endif expandAll(); setAnimated(true); setIndentation(0); setRootIsDecorated(true); setupContextMenus(); connect(this, SIGNAL(activated(const QModelIndex&)), this, SLOT(handleItemActivated(const QModelIndex&))); connect(this, SIGNAL(clicked(const QModelIndex&)), this, SLOT(handleClicked(const QModelIndex&))); settings_->onSettingChanged.connect(boost::bind(&QtChatListWindow::handleSettingChanged, this, _1)); }
CallView::CallView(bool showCallers, TraceItemView* parentView, QWidget* parent) : QTreeWidget(parent), TraceItemView(parentView) { _showCallers = showCallers; setColumnCount(4); _headerLabels << tr( "Cost" ) << tr( "Cost 2" ) << tr( "Count" ) << ((_showCallers) ? tr( "Caller" ) : tr( "Callee" )); setHeaderLabels(_headerLabels); // forbid scaling icon pixmaps to smaller size setIconSize(QSize(99,99)); setAllColumnsShowFocus(true); setRootIsDecorated(false); // 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))); }
FileList::FileList( QWidget * parent): TreeViewPopupMenu(parent) { setRootIsDecorated(false); // for sort setSortingEnabled(true); qDebug("root cur_dir_ : %s", cur_dir_.toAscii().data() ); //cur_dir_ = ROOT_PATH; #ifdef Q_OS_WIN cur_dir_=""; #else cur_dir_=QDIR_SEPARATOR; #endif list_first_layer_dir(); #if 0 for (int i = 0; i < file_info_list.size(); ++i) { if ( file_info_list.at(i).fileName() =="." || file_info_list.at(i).fileName()=="..") { continue; } FileListWidgetItem *fi = new FileListWidgetItem (this); fi->setText(0, file_info_list.at(i).absoluteFilePath() ); fi->set_real_str(file_info_list.at(i).absoluteFilePath() ); } #endif connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)) , this, SLOT(change_dir(QTreeWidgetItem *,int) ) ); change_title_to_cur_path(); CREATE_ACTIONS(rename_, "rename", s_rename ); CREATE_ACTIONS(cd_parent_dir_, "cd parent dir", s_cd_parent_dir); }
ThreadsWindow::ThreadsWindow(QWidget *parent) : QTreeView(parent) { QAction *act = debuggerCore()->action(UseAlternatingRowColors); setAttribute(Qt::WA_MacShowFocusRect, false); setFrameStyle(QFrame::NoFrame); setWindowTitle(tr("Thread")); setAlternatingRowColors(act->isChecked()); setRootIsDecorated(false); setIconSize(QSize(10, 10)); header()->setDefaultAlignment(Qt::AlignLeft); connect(this, SIGNAL(activated(QModelIndex)), SLOT(rowActivated(QModelIndex))); connect(act, SIGNAL(toggled(bool)), SLOT(setAlternatingRowColorsHelper(bool))); connect(debuggerCore()->action(AlwaysAdjustThreadsColumnWidths), SIGNAL(toggled(bool)), SLOT(setAlwaysResizeColumnsToContents(bool))); }
PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf ) : QTreeWidget( p ), p_intf(_p_intf) { setFrameStyle( QFrame::NoFrame ); viewport()->setAutoFillBackground( false ); setIconSize( QSize( 24,24 ) ); setIndentation( 12 ); header()->hide(); setRootIsDecorated( true ); setAlternatingRowColors( false ); podcastsParent = NULL; podcastsParentId = -1; viewport()->setAcceptDrops(true); setDropIndicatorShown(true); invisibleRootItem()->setFlags( invisibleRootItem()->flags() & ~Qt::ItemIsDropEnabled ); 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(); CONNECT( this, itemActivated( QTreeWidgetItem *, int ), this, setSource( QTreeWidgetItem *) ); CONNECT( this, itemClicked( 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() ) ); }
BaseWindow::BaseWindow(QWidget *parent) : QTreeView(parent) { QAction *act = debuggerCore()->action(UseAlternatingRowColors); setAttribute(Qt::WA_MacShowFocusRect, false); setFrameStyle(QFrame::NoFrame); setAlternatingRowColors(act->isChecked()); setRootIsDecorated(false); setIconSize(QSize(10, 10)); setSelectionMode(QAbstractItemView::ExtendedSelection); setUniformRowHeights(true); header()->setDefaultAlignment(Qt::AlignLeft); connect(act, SIGNAL(toggled(bool)), SLOT(setAlternatingRowColorsHelper(bool))); connect(this, SIGNAL(activated(QModelIndex)), SLOT(rowActivatedHelper(QModelIndex))); m_adjustColumnsAction = new QAction(tr("Adjust Column Widths to Contents"), 0); m_alwaysAdjustColumnsAction = 0; }
SnippetWidget::SnippetWidget(KMComposerEditorNg *editor, KActionCollection *actionCollection, QWidget *parent) : QTreeView(parent) { header()->hide(); setAcceptDrops(true); setDragEnabled(true); setRootIsDecorated(true); setAlternatingRowColors(true); mSnippetsManager = new MailCommon::SnippetsManager(actionCollection, this, this); mSnippetsManager->setEditor(editor, "insertPlainText", SIGNAL(insertSnippet())); setModel(mSnippetsManager->model()); setSelectionModel(mSnippetsManager->selectionModel()); connect(this, &QAbstractItemView::activated, mSnippetsManager->editSnippetAction(), &QAction::trigger); connect(mSnippetsManager->model(), &QAbstractItemModel::rowsInserted, this, &QTreeView::expandAll); connect(mSnippetsManager->model(), &QAbstractItemModel::rowsRemoved, this, &QTreeView::expandAll); expandAll(); }
cHpiViewResource::cHpiViewResource( QWidget *parent, const char* name ) : QListView( parent, name ) { setRootIsDecorated( true ); addColumn( "Resource", 300 ); addColumn( "Type", 100 ); // resources m_resource = new cHpiResourceRoot( this, "Resources" ); m_resource->discoverResources(); m_resource_timer = new QTimer( this ); connect( m_resource_timer, SIGNAL( timeout() ), SLOT( resourceTimeout() ) ); m_resource_timer->start( 10000 ); // events m_event = new cHpiEventRoot( this, "Events" ); m_event->getEvents( m_resource ); m_event_timer = new QTimer( this ); connect( m_event_timer, SIGNAL( timeout() ), SLOT( eventTimeout() ) ); m_event_timer->start( 1000 ); }
void FeedsView::setupAppearance() { // Setup column resize strategies. header()->setSectionResizeMode(FDS_MODEL_TITLE_INDEX, QHeaderView::Stretch); header()->setSectionResizeMode(FDS_MODEL_COUNTS_INDEX, QHeaderView::ResizeToContents); setUniformRowHeights(true); setAnimated(true); setSortingEnabled(true); setItemsExpandable(true); setExpandsOnDoubleClick(true); setEditTriggers(QAbstractItemView::NoEditTriggers); setIndentation(FEEDS_VIEW_INDENTATION); setAcceptDrops(false); setDragEnabled(true); setDropIndicatorShown(true); setDragDropMode(QAbstractItemView::InternalMove); setAllColumnsShowFocus(false); setRootIsDecorated(false); setSelectionMode(QAbstractItemView::SingleSelection); setItemDelegate(new StyledItemDelegateWithoutFocus(this)); header()->setStretchLastSection(false); header()->setSortIndicatorShown(false); }