//---------------------------------------------------------------------------------------- OfsTreeWidget::OfsTreeWidget(QWidget *parent, unsigned int capabilities, QStringList initialSelection) : QTreeWidget(parent), mCapabilities(capabilities) { mSelectedItems = initialSelection; mRecycleBinParent = NULL; setColumnCount(1); setHeaderHidden(true); setSelectionMode(QAbstractItemView::ExtendedSelection); setSelectionBehavior(QAbstractItemView::SelectItems); setContextMenuPolicy(Qt::CustomContextMenu); setDragDropOverwriteMode(false); setAutoScroll(true); if(capabilities & CAP_ALLOW_DROPS) setDragDropMode(QAbstractItemView::DragDrop); mUnknownFileIcon = mOgitorMainWindow->mIconProvider.icon(QFileIconProvider::File); mFile = Ogitors::OgitorsRoot::getSingletonPtr()->GetProjectFile(); mFile->addTrigger(this, OFS::_OfsBase::CLBK_CREATE, &triggerCallback); mFile->addTrigger(this, OFS::_OfsBase::CLBK_DELETE, &triggerCallback); refreshWidget(); mAddFilesThread = new AddFilesThread(); mExtractorThread = new ExtractorThread(); connect(mAddFilesThread, SIGNAL(finished()), this, SLOT(threadFinished())); connect(mExtractorThread, SIGNAL(finished()), this, SLOT(threadFinished())); }
ViewListTreeWidget::ViewListTreeWidget( QWidget *parent ) : QTreeWidget( parent ) { setWhatsThis( i18nc( "@info:whatsthis", "<para>This is the list of available views and editors.</para>" "<para>You can configure the list by using the context menu:" "<list>" "<item>Rename categories or views</item>" "<item>Configure. Move, remove, rename or edit tool tip for categories or views</item>" "<item>Insert categories and views</item>" "</list></para>" ) ); header() ->hide(); setRootIsDecorated( false ); setItemDelegate( new ViewCategoryDelegate( this, this ) ); setItemsExpandable( true ); setSelectionMode( QAbstractItemView::SingleSelection ); setDragDropMode( QAbstractItemView::InternalMove ); //setContextMenuPolicy( Qt::ActionsContextMenu ); connect( this, SIGNAL( itemPressed( QTreeWidgetItem*, int ) ), SLOT( handleMousePress( QTreeWidgetItem* ) ) ); }
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); }
WAnalysisLibraryTableView::WAnalysisLibraryTableView(QWidget* parent, ConfigObject<ConfigValue>* pConfig, TrackCollection* pTrackCollection) : WTrackTableView(parent, pConfig, pTrackCollection) { setDragDropMode(QAbstractItemView::DragOnly); setDragEnabled(true); //Always enable drag for now (until we have a model that doesn't support this.) }
FileListView::FileListView() : currentSelectionAction(QItemSelectionModel::NoUpdate), isSearchMode(false) { searchEdit = new SearchLineEdit(this); searchEdit->setVisible(isSearchMode); searchEdit->setFocusPolicy(Qt::ClickFocus); setDragDropMode(QAbstractItemView::DragDrop); //setDropIndicatorShown(true); //setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); //viewport()->setStyleSheet("background-color: white;"); //setStyleSheet("QTreeView::item { padding: 6px 14px 0px 14px; }"); // QPalette pal = palette(); // pal.setColor(QPalette::AlternateBase, QColor(248, 248, 248)); // setPalette(pal); setFrameStyle(QFrame::Plain); setHeader(new FileListHeader(Qt::Horizontal, this)); #ifdef DARK QPalette pal = palette(); pal.setColor(QPalette::Base, QColor(33, 38, 38)); setPalette(pal); #endif }
MovableTableWidget::MovableTableWidget(QWidget *parent) : QTableWidget(parent), m_lineRow(-1) { setSelectionBehavior(QAbstractItemView::SelectRows); setDragDropMode(QAbstractItemView::InternalMove); setDragDropOverwriteMode(false); }
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 }
START_NS ProposalTreeWidget::ProposalTreeWidget(QWidget * p) : QTreeWidget(p), mOverlay(new Overlay(this)), mAddRemoveEnabled(false), mSolutionSelectionMultiple(true) //mSolutionDelegate(new SolutionCheckDelegate(this) ) { setDragEnabled(true); setDragDropMode(InternalMove); viewport()->setAcceptDrops(true); setDropIndicatorShown(true); setSelectionMode(SingleSelection); setEditTriggers(AllEditTriggers); // maintain order accordingly to ColumnId, ColumnProposalText, etc. setHeaderLabels( QStringList() << tr("Id") << tr("Text") << tr("Solution") ); setRootIsDecorated(false); setWordWrap(true); overlay()->setText( tr("Right click to add new proposal") ); connect(this, SIGNAL(itemSelectionChanged()),this, SLOT(onSelectionChange())); connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(onItemChange(QTreeWidgetItem*,int))); connect(this,SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onClicked(QTreeWidgetItem*,int))); }
CCollectionView::CCollectionView(QWidget * parent) : QTreeView(parent){ setAcceptDrops(true); viewport()->setAcceptDrops(true); setDragDropMode(QAbstractItemView::DragDrop); setDropIndicatorShown(true); setSelectionMode(QAbstractItemView::ExtendedSelection); }
SceneTree::SceneTree(QWidget *parent /*= 0*/) : QTreeView(parent) , skipTreeSelectionProcessing(false) { treeModel = new SceneTreeModel(); setModel(treeModel); treeDelegate = new SceneTreeDelegate(); setItemDelegate(treeDelegate); setDragDropMode(QAbstractItemView::InternalMove); setDragEnabled(true); setAcceptDrops(true); setDropIndicatorShown(true); setContextMenuPolicy(Qt::CustomContextMenu); // scene signals QObject::connect(SceneSignals::Instance(), SIGNAL(Activated(SceneEditor2 *)), this, SLOT(SceneActivated(SceneEditor2 *))); QObject::connect(SceneSignals::Instance(), SIGNAL(Deactivated(SceneEditor2 *)), this, SLOT(SceneDeactivated(SceneEditor2 *))); QObject::connect(SceneSignals::Instance(), SIGNAL(Selected(SceneEditor2 *, DAVA::Entity *)), this, SLOT(EntitySelected(SceneEditor2 *, DAVA::Entity *))); QObject::connect(SceneSignals::Instance(), SIGNAL(Deselected(SceneEditor2 *, DAVA::Entity *)), this, SLOT(EntityDeselected(SceneEditor2 *, DAVA::Entity *))); // this widget signals QObject::connect(selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, SLOT(TreeSelectionChanged(const QItemSelection &, const QItemSelection &))); QObject::connect(this, SIGNAL(clicked(const QModelIndex &)), this, SLOT(TreeItemClicked(const QModelIndex &))); QObject::connect(this, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(TreeItemDoubleClicked(const QModelIndex &))); QObject::connect(this, SIGNAL(collapsed(const QModelIndex &)), this, SLOT(TreeItemCollapsed(const QModelIndex &))); QObject::connect(this, SIGNAL(expanded(const QModelIndex &)), this, SLOT(TreeItemExpanded(const QModelIndex &))); QObject::connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowContextMenu(const QPoint&))); }
akuTreeWidget::akuTreeWidget(QWidget *parent) : QTreeWidget(parent) { setDragEnabled(false); setDragDropOverwriteMode(false); setDragDropMode(QAbstractItemView::NoDragDrop); setAlternatingRowColors(true); setSelectionMode(QAbstractItemView::ExtendedSelection); setAutoExpandDelay(-1); setRootIsDecorated(true); setUniformRowHeights(false); setSortingEnabled(true); setAnimated(true); setAllColumnsShowFocus(true); headerItem()->setText(0, i18n("File Name", 0)); headerItem()->setText(1, i18n("Size", 0)); headerItem()->setText(2, i18n("Packed Size", 0)); headerItem()->setText(3, i18n("Ratio", 0)); headerItem()->setText(4, i18n("Modified", 0)); headerItem()->setText(5, i18n("Attributes", 0)); headerItem()->setText(6, i18n("CRC", 0)); headerItem()->setText(7, i18n("Method", 0)); headerItem()->setText(8, i18n("Version", 0)); headerItem()->setText(9, i18n("MIME Type", 0)); headerItem()->setText(10,""); headerItem()->setIcon(10,KIcon("document-properties")); headerItem()->setToolTip(10, i18n("Status: a key is shown if the file is crypted")); header() -> moveSection(10,0); header() -> setResizeMode(10,QHeaderView::ResizeToContents); header() -> setResizeMode(4,QHeaderView::ResizeToContents); setupActions(); }
K3b::DataDirTreeView::DataDirTreeView( K3b::View* view, K3b::DataDoc* doc, QWidget* parent ) : QTreeView( parent ), m_view(view) { d = new Private(); setSelectionMode(QAbstractItemView::SingleSelection); // setRootIsDecorated( false ); setDragDropMode( QAbstractItemView::DragDrop ); setDropIndicatorShown( true ); setDragEnabled(true); setAcceptDrops( true ); header()->hide(); m_doc = doc; d->model = new K3b::DataProjectModel( doc, this ); //d->model->setListOnlyDirs( true ); setModel( d->model ); for ( int i = K3b::DataProjectModel::TypeColumn; i < K3b::DataProjectModel::NumColumns; ++i ) { hideColumn( i ); } connect( d->model, SIGNAL(addUrlsRequested(KUrl::List,K3b::DirItem*)), SLOT(slotAddUrlsRequested(KUrl::List,K3b::DirItem*)) ); connect( d->model, SIGNAL(moveItemsRequested(QList<K3b::DataItem*>,K3b::DirItem*)), SLOT(slotMoveItemsRequested(QList<K3b::DataItem*>,K3b::DirItem*)) ); connect( selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(slotSelectionChanged(QItemSelection,QItemSelection)) ); }
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); }
ComposerAttachmentsList::ComposerAttachmentsList(QWidget *parent): QListView(parent), m_dragging(false), m_dragInside(false), m_composer(0) { setMouseTracking( true ); setAcceptDrops(true); setDragDropMode( DragDrop ); setDragDropOverwriteMode( false ); setDragEnabled(true); setDropIndicatorShown(false); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); m_actionSendInline = new QAction(tr("Send Inline"), this); m_actionSendInline->setCheckable(true); connect(m_actionSendInline, SIGNAL(triggered(bool)), this, SLOT(slotToggledContentDispositionInline(bool))); addAction(m_actionSendInline); m_actionRename = new QAction(tr("Rename..."), this); connect(m_actionRename, SIGNAL(triggered()), this, SLOT(slotRenameAttachment())); addAction(m_actionRename); m_actionRemoveAttachment = new QAction(tr("Remove"), this); connect(m_actionRemoveAttachment, SIGNAL(triggered()), this, SLOT(slotRemoveAttachment())); addAction(m_actionRemoveAttachment); connect(this, SIGNAL(itemDroppedOut()), this, SLOT(slotRemoveAttachment())); connect(this, SIGNAL(clicked(QModelIndex)), this, SLOT(onCurrentChanged())); connect(this, SIGNAL(activated(QModelIndex)), this, SLOT(onCurrentChanged())); }
TableView::TableView(QWidget* parent) : QTableView(parent) { setAcceptDrops(true); setDragDropMode(QAbstractItemView::DropOnly); setDropIndicatorShown(true); }
ProgressTreeView::ProgressTreeView( QWidget* parent ) : QTreeView( parent ) { s_instance = this; //FIXME: should assert when s_instance gets written and it wasn't nullptr setFrameShape( QFrame::NoFrame ); setContentsMargins( 0, 0, 0, 0 ); setHeaderHidden( true ); setRootIsDecorated( true ); setExpandsOnDoubleClick( true ); setSelectionMode( QAbstractItemView::NoSelection ); setDragDropMode( QAbstractItemView::NoDragDrop ); setAcceptDrops( false ); setUniformRowHeights( false ); setIndentation( 0 ); setSortingEnabled( false ); m_delegate = new ProgressTreeDelegate( this ); setItemDelegate( m_delegate ); QPalette plt = palette(); plt.setColor( QPalette::Base, Calamares::Branding::instance()-> styleString( Calamares::Branding::SidebarBackground ) ); setPalette( plt ); }
void ThumbnailsView::setDragDrop() { viewport()->setAcceptDrops(true);; setDragEnabled(true); setDropIndicatorShown(true); setDragDropMode(QAbstractItemView::DragDrop); }
FeedListWidget::FeedListWidget(QWidget *parent) : QTreeWidget(parent) { setContextMenuPolicy(Qt::CustomContextMenu); setDragDropMode(QAbstractItemView::InternalMove); setSelectionMode(QAbstractItemView::ExtendedSelection); setColumnCount(1); headerItem()->setText(0, tr("RSS feeds")); connect(RSS::Session::instance(), &RSS::Session::itemAdded, this, &FeedListWidget::handleItemAdded); connect(RSS::Session::instance(), &RSS::Session::feedStateChanged, this, &FeedListWidget::handleFeedStateChanged); connect(RSS::Session::instance(), &RSS::Session::feedIconLoaded, this, &FeedListWidget::handleFeedIconLoaded); connect(RSS::Session::instance(), &RSS::Session::itemPathChanged, this, &FeedListWidget::handleItemPathChanged); connect(RSS::Session::instance(), &RSS::Session::itemAboutToBeRemoved, this, &FeedListWidget::handleItemAboutToBeRemoved); m_rssToTreeItemMapping[RSS::Session::instance()->rootFolder()] = invisibleRootItem(); m_unreadStickyItem = new QTreeWidgetItem(this); m_unreadStickyItem->setData(0, Qt::UserRole, reinterpret_cast<quintptr>(RSS::Session::instance()->rootFolder())); m_unreadStickyItem->setText(0, tr("Unread (%1)").arg(RSS::Session::instance()->rootFolder()->unreadCount())); m_unreadStickyItem->setData(0, Qt::DecorationRole, GuiIconProvider::instance()->getIcon("mail-folder-inbox")); connect(RSS::Session::instance()->rootFolder(), &RSS::Item::unreadCountChanged, this, &FeedListWidget::handleItemUnreadCountChanged); setSortingEnabled(false); fill(nullptr, RSS::Session::instance()->rootFolder()); setSortingEnabled(true); // setCurrentItem(m_unreadStickyItem); }
void Pageview::allowMove (bool allow) { setSelectionMode (ExtendedSelection); setDropIndicatorShown (false); setDragDropMode (allow ? InternalMove : NoDragDrop); setDragEnabled (allow); }
ConnectionsTreeWidget::ConnectionsTreeWidget() { setDragDropMode(QAbstractItemView::InternalMove); setSelectionMode(QAbstractItemView::SingleSelection); setDragEnabled(true); setAcceptDrops(true); }
DeviceExplorerView::DeviceExplorerView(QWidget* parent) : QTreeView(parent), m_hasProxy(false) { setAllColumnsShowFocus(true); setSelectionBehavior(QAbstractItemView::SelectRows); setSelectionMode(QAbstractItemView::ExtendedSelection); header()->setContextMenuPolicy(Qt::CustomContextMenu); connect( header(), &QWidget::customContextMenuRequested, this, &DeviceExplorerView::headerMenuRequested); header()->setMaximumHeight(20); //- Drag'n Drop. setDragEnabled(true); setAcceptDrops(true); setUniformRowHeights(true); setDragDropMode(QAbstractItemView::DragDrop); setDropIndicatorShown(true); setDefaultDropAction(Qt::MoveAction); setDragDropOverwriteMode(false); QFile f(":/DeviceExplorer.qss"); if (f.open(QFile::ReadOnly)) setStyleSheet(f.readAll()); }
/*! Create a new scenario view widget. */ ScenarioTree::ScenarioTree(QWidget *parent) : QTreeWidget(parent) { QStringList labels; labels << tr("Type") << tr("Name"); //header()->setResizeMode(QHeaderView::ResizeToContents); header()->setResizeMode(QHeaderView::Interactive); header()->setDefaultSectionSize(200); header()->setCascadingSectionResizes(true); 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_scenarioElementIcon.addPixmap(style()->standardPixmap(QStyle::SP_FileIcon)); connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(editItem(QTreeWidgetItem*, int))); connect(this, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(editItemInline(QTreeWidgetItem*, int))); setExpandsOnDoubleClick(false); // Set drag and drop behavior setDragEnabled(true); setAcceptDrops(true); setDragDropMode(QAbstractItemView::DragDrop); setDropIndicatorShown(true); setAlternatingRowColors(true); }
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 &)) ); }
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))); }
SensorBrowserTreeWidget::SensorBrowserTreeWidget( QWidget* parent, KSGRD::SensorManager* sm ) : QTreeView( parent ), mSensorManager( sm ) { mSortFilterProxyModel.setSourceModel(&mSensorBrowserModel); mSortFilterProxyModel.setShowAllChildren(true); setModel(&mSortFilterProxyModel); connect( mSensorManager, SIGNAL(update()), &mSensorBrowserModel, SLOT(update()) ); connect( mSensorManager, SIGNAL(hostAdded(KSGRD::SensorAgent*,QString)), &mSensorBrowserModel, SLOT(hostAdded(KSGRD::SensorAgent*,QString)) ); connect( mSensorManager, SIGNAL(hostConnectionLost(QString)), &mSensorBrowserModel, SLOT(hostRemoved(QString)) ); // connect( mSensorManager, SIGNAL(hostAdded(KSGRD::SensorAgent*,QString)), SLOT(updateView()) ); // connect( mSensorManager, SIGNAL(hostConnectionLost(QString)), SLOT(updateView()) ); connect( &mSortFilterProxyModel, SIGNAL(rowsInserted(QModelIndex,int,int)), SLOT(updateView()) ); setDragDropMode(QAbstractItemView::DragOnly); setUniformRowHeights(true); //setMinimumWidth( 1 ); retranslateUi(); connect( &mSensorBrowserModel, SIGNAL(sensorsAddedToHost(QModelIndex)), this, SLOT(expandItem(QModelIndex))); KSGRD::SensorManagerIterator it( mSensorManager ); while ( it.hasNext() ) { KSGRD::SensorAgent* sensorAgent = it.next().value(); QString hostName = mSensorManager->hostName( sensorAgent ); mSensorBrowserModel.addHost(sensorAgent, hostName); } updateView(); }
ROITreeView::ROITreeView( QWidget* parent ) : QTreeView( parent ), m_draggedIndex( QModelIndex() ) { setDragDropMode( DragDrop ); setDropIndicatorShown(true); setAcceptDrops( true ); }
void ListWidget::dropEvent( QDropEvent *event ) { QListWidget::dropEvent( event ); if ( event->source() != this ) emit itemsDropped(); setDragDropMode( QAbstractItemView::InternalMove ); modified = true; }
QgsBrowserTreeView( QWidget* parent ) : QTreeView( parent ) { setDragDropMode( QTreeView::DragDrop ); // sets also acceptDrops + dragEnabled setSelectionMode( QAbstractItemView::ExtendedSelection ); setContextMenuPolicy( Qt::CustomContextMenu ); setHeaderHidden( true ); setDropIndicatorShown( true ); }
MediaTableView::MediaTableView(QWidget *parent) : QTableView(parent) { setDragDropMode(QAbstractItemView::DragOnly); setSelectionMode(QTableView::ContiguousSelection); verticalHeader()->setVisible(false); horizontalHeader()->setVisible(false); }
KNMusicTreeViewBase::KNMusicTreeViewBase(QWidget *parent) : QTreeView(parent) { //Set properties. setAllColumnsShowFocus(true); setAlternatingRowColors(true); setContentsMargins(0,0,0,0); setDragDropMode(QAbstractItemView::DragOnly); setDropIndicatorShown(true); setFrameShape(QFrame::NoFrame); setIndentation(0); setMouseTracking(true); setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents); setSelectionBehavior(QAbstractItemView::SelectRows); setSelectionMode(QAbstractItemView::ExtendedSelection); setUniformRowHeights(true); setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); //Set scroll bar properties. horizontalScrollBar()->setSingleStep(5); horizontalScrollBar()->setPageStep(5); verticalScrollBar()->setSingleStep(4); verticalScrollBar()->setPageStep(4); //Using frame updater to set palette. onActionMouseInOut(0); //Set animation header. KNMusicTreeViewHeader *header=new KNMusicTreeViewHeader(this); connect(header, &KNMusicTreeViewHeader::requireResizeColumnToContents, this, &KNMusicTreeViewBase::resizeColumnToContents); setHeader(header); //Set delegate. setItemDelegateForColumn(Rating, new KNMusicRatingDelegate(this)); setItemDelegateForColumn(AlbumRating, new KNMusicRatingDelegate(this)); //Initial menu connections. m_soloConnections=new KNConnectionHandler(this); m_multiConnections=new KNConnectionHandler(this); //Initial mouse sense animation. m_mouseIn=new QTimeLine(200, this); configureTimeLine(m_mouseIn); m_mouseIn->setEndFrame(m_maxOpacity); m_mouseOut=new QTimeLine(200, this); configureTimeLine(m_mouseOut); m_mouseOut->setEndFrame(0); //Initial reacts. connect(this, &KNMusicTreeViewBase::activated, this, &KNMusicTreeViewBase::playIndex); //Initial actions. initialActions(); }