LocationBar::LocationBar(QupZilla* mainClass) : LineEdit(mainClass) , p_QupZilla(mainClass) , m_webView(0) , m_pasteAndGoAction(0) , m_clearAction(0) , m_holdingAlt(false) , m_loadProgress(0) , m_progressVisible(false) , m_forceLineEditPaintEvent(false) { setObjectName("locationbar"); setDragEnabled(true); m_bookmarkIcon = new BookmarkIcon(p_QupZilla); m_goIcon = new GoIcon(this); m_rssIcon = new RssIcon(this); m_rssIcon->setToolTip(tr("Add RSS from this page...")); m_siteIcon = new SiteIcon(this); DownIcon* down = new DownIcon(this); ////RTL Support ////if we don't add 'm_siteIcon' by following code, then we should use suitable padding-left value //// but then, when typing RTL text the layout dynamically changed and within RTL layout direction //// padding-left is equivalent to padding-right and vice versa, and because style sheet is //// not changed dynamically this create padding problems. addWidget(m_siteIcon, LineEdit::LeftSide); addWidget(m_goIcon, LineEdit::RightSide); addWidget(m_bookmarkIcon, LineEdit::RightSide); addWidget(m_rssIcon, LineEdit::RightSide); addWidget(down, LineEdit::RightSide); m_completer.setLocationBar(this); connect(&m_completer, SIGNAL(showCompletion(QString)), this, SLOT(showCompletion(QString))); connect(&m_completer, SIGNAL(completionActivated()), this, SLOT(urlEnter())); connect(this, SIGNAL(textEdited(QString)), this, SLOT(textEdit())); connect(m_siteIcon, SIGNAL(clicked()), this, SLOT(showSiteInfo())); connect(m_goIcon, SIGNAL(clicked(QPoint)), this, SLOT(urlEnter())); connect(m_rssIcon, SIGNAL(clicked(QPoint)), this, SLOT(rssIconClicked())); connect(m_bookmarkIcon, SIGNAL(clicked(QPoint)), this, SLOT(bookmarkIconClicked())); connect(down, SIGNAL(clicked(QPoint)), this, SLOT(showMostVisited())); connect(mApp->searchEnginesManager(), SIGNAL(activeEngineChanged()), this, SLOT(updatePlaceHolderText())); connect(mApp->searchEnginesManager(), SIGNAL(defaultEngineChanged()), this, SLOT(updatePlaceHolderText())); connect(mApp, SIGNAL(message(Qz::AppMessageType, bool)), SLOT(onMessage(Qz::AppMessageType, bool))); loadSettings(); clearIcon(); updatePlaceHolderText(); }
void QuickLauncher::loadConfig() { DEBUGSTR << "QuickLauncher::loadConfig()" << endl << flush; //TDEConfig *c = config(); //c->setGroup("General"); setConserveSpace(m_settings->conserveSpace()); setDragEnabled(m_settings->dragEnabled()); /*DEBUGSTR << " IconDim="<<m_iconDim << endl << flush; DEBUGSTR << " ConserveSpace=" << (m_manager->conserveSpace()) << endl << flush; DEBUGSTR << " DragEnabled=" << isDragEnabled() << endl << flush;*/ TQStringList volatileButtons = m_settings->volatileButtons(); TQStringList urls = m_settings->buttons(); if (m_settings->showDesktopEnabled()) { if (!urls.contains("SPECIAL_BUTTON__SHOW_DESKTOP")) urls.prepend("SPECIAL_BUTTON__SHOW_DESKTOP"); } else { if (urls.contains("SPECIAL_BUTTON__SHOW_DESKTOP")) urls.remove("SPECIAL_BUTTON__SHOW_DESKTOP"); } kdDebug() << "GetButtons " << urls.join("/") << endl; TQStringList::Iterator iter(urls.begin()); int n = 0; while (iter != urls.end()) { TQString url = *iter; addApp(url, n, false); ++iter; ++n; } // Restore sticky state for (n=0; n<int(m_buttons->size()); ++n) { QuickButton* button = (*m_buttons)[n]; if (volatileButtons.contains(button->menuId()) == false) { button->setSticky(true); } button->setDynamicModeEnabled(m_settings->autoAdjustEnabled()); } m_popularity->readConfig(m_settings); m_popularity->setHistoryHorizon(m_settings->historyHorizon()/100.0); TQStringList serviceNames = m_settings->serviceNames(); TQValueList<int> insPos = m_settings->serviceInspos(); for (int n=std::min(serviceNames.size(),insPos.size())-1; n>=0; --n) { m_appOrdering[serviceNames[n]] = insPos[n]; } }
QueueList::QueueList( QWidget *parent, const char *name ) : KListView( parent, name ) { addColumn( i18n("Name") ); setResizeMode( QListView::LastColumn ); setSelectionMode( QListView::Extended ); setSorting( -1 ); setAcceptDrops( true ); setDragEnabled( true ); setDropVisualizer( true ); //the visualizer (a line marker) is drawn when dragging over tracks setDropVisualizerWidth( 3 ); }
ListView() : m_sType( Seed::Undefined ) { UnicornWidget::paintItBlack( this ); QPalette p = palette(); p.setColor( QPalette::Text, QColor( 0xb0b0b0 ) ); setPalette( p ); setAlternatingRowColors( true ); setAttribute( Qt::WA_MacShowFocusRect, false ); setDragEnabled( true ); }
ListView::ListView(QWidget *parent) : QListView(parent) , menu(0) { setDragEnabled(true); setContextMenuPolicy(Qt::NoContextMenu); setDragDropMode(QAbstractItemView::DragOnly); setSelectionMode(QAbstractItemView::ExtendedSelection); setAlternatingRowColors(false); setUniformItemSizes(true); setAttribute(Qt::WA_MouseTracking); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(showCustomContextMenu(const QPoint &))); }
EntityList::EntityList(QWidget *parent) : QListWidget(parent) { setSelectionMode(QAbstractItemView::SingleSelection); setDragEnabled(true); connect(qApp, SIGNAL(load()), SLOT(load())); connect(qApp, SIGNAL(unload()), SLOT(unload())); if (application().is_loaded()) { load(); } }
QStandardItem *ConversationData::makeContextItem(ConversationContext *context, bool editable) { auto item = new QStandardItem(); item->setData(context->id(), IDData); item->setText(context->label()); item->setEditable(editable); item->setDragEnabled(editable); item->setDropEnabled(editable); return item; }
dragTarget::dragTarget (dragSource *source, QWidget *parent ) : QTreeWidget ( parent ) { //let's initialize the dropIndicator indicator = new QWidget(viewport()); indicator -> setAutoFillBackground(true); QPalette pale = indicator -> palette(); pale.setColor(QPalette::Base, Qt::blue); indicator -> setPalette(pale); hideIndicator(); //let's initialize some pointers... sourceView = source; scrollUpTimer = new QTimer(); scrollDownTimer = new QTimer(); indicatorToRestore = NULL; //setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); //...and some list settings subLevel = false; setAcceptDrops ( true ); setDragEnabled ( true ); setAutoScroll(true); setDragDropMode ( QAbstractItemView::DragDrop ); setColumnCount ( 4 ); setHeaderLabels ( QStringList() <<tr ( "Item" ) <<tr ( "Path" ) <<tr ( "MimeType" ) <<tr ( "Size" ) ); header() -> moveSection ( 3,1 ); setColumnWidth ( 0,170 ); setDropIndicatorShown ( true ); //setAnimated ( true ); newFolder = new QAction ( tr ( "New Folder" ), this ); newFolder -> setIcon ( KIcon ( "folder-new" ) ); //newFolder -> setShortcut(QKeySequence(tr("Ctrl+A"))); //this -> addAction(newFolder); delItem = new QAction ( tr ( "Delete Item" ), this ); delItem -> setIcon ( KIcon ( "edit-delete" ) ); //delItem -> setShortcut(QKeySequence(tr("Del"))); //TODO check! //this -> addAction(delItem); //this-> setContextMenuPolicy(Qt::DefaultContextMenu); //se non imposto defaultcontextmenu non posso reimplementare la gestione del contextmenu //creo il menu menu = new QMenu ( tr ( "Options" ),this ); menu -> addAction ( newFolder ); menu -> addAction ( delItem ); connect ( newFolder, SIGNAL ( triggered() ), this, SLOT ( createNewFolder() ) ); connect ( delItem, SIGNAL ( triggered() ), this, SLOT ( deleteItem() ) ); delItem -> setEnabled ( false ); setItemsExpandable ( true ); setSelectionMode(QAbstractItemView::ExtendedSelection); //setSelectionMode(QAbstractItemView::ExtendedSelection); //inizialmente viene gestita solo la selezione singola }
LiveListWidget::LiveListWidget(QWidget *parent) : QListWidget(parent) { setAcceptDrops(true); setDragEnabled(true); setDragDropMode(QAbstractItemView::InternalMove); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); QFile qss("../QConnect/livelistwidget.css"); qss.open(QFile::ReadOnly); setStyleSheet(qss.readAll()); qss.close(); }
SearchListView::SearchListView(SearchFilter* filter, QWidget* parent, const char* name) : QTreeWidget(parent), mFilter(filter), mN(0) { QStringList headers; headers << QString::null << tr("User") << tr("Filename") << tr("Size") << tr("Speed") << tr("Queued") << tr("Imm.") << tr("Length") << tr("Bitrate") << tr("Path") << QString::null; setHeaderLabels(headers); setSortingEnabled(false); header()->setClickable(true); setRootIsDecorated(false); setSelectionMode(QAbstractItemView::ExtendedSelection); setAllColumnsShowFocus(true); setColumnWidth ( 0, 30 ); setColumnWidth ( 1, 100 ); setColumnWidth ( 2, 250 ); setColumnWidth ( 3, 100 ); setColumnWidth ( 4, 100 ); setColumnWidth ( 5, 75 ); setColumnWidth ( 6, 30 ); setColumnWidth ( 7, 75 ); setColumnWidth ( 8, 75 ); setColumnWidth ( 9, 150 ); setColumnWidth ( 10, 250 ); setColumnWidth ( 11, 0 ); mPopupMenu = new QMenu(this); QAction * ActionDownloadFiles, * ActionDownloadFilesTo, * ActionDownloadFolders; ActionDownloadFiles = new QAction(tr("Download file(s)"), this); connect(ActionDownloadFiles, SIGNAL(triggered()), this, SLOT(downloadFiles())); mPopupMenu->addAction(ActionDownloadFiles); ActionDownloadFilesTo = new QAction(tr("Download file(s) to..."), this); connect(ActionDownloadFilesTo, SIGNAL(triggered()), this, SLOT(downloadFilesTo())); mPopupMenu->addAction(ActionDownloadFilesTo); ActionDownloadFolders = new QAction(tr("Download selected folder(s)"), this); connect(ActionDownloadFolders, SIGNAL(triggered()), this, SLOT(downloadFolders())); mPopupMenu->addAction(ActionDownloadFolders); mPopupMenu->addSeparator(); mUsersMenu = mPopupMenu->addMenu(tr("Users")); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(slotContextMenu(const QPoint&))); connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), SLOT(slotActivate(QTreeWidgetItem*, int))); connect(this, SIGNAL(itemActivated(QTreeWidgetItem*, int)), SLOT(slotActivate(QTreeWidgetItem*, int))); connect(header(), SIGNAL(sectionClicked(int)), this, SLOT(headerClicked(int))); setDragEnabled(true); }
FolderModelItem::FolderModelItem( const QString & text ) : BaseModelItem( text ) { // QIcon icon; // icon.addPixmap( qApp->style()->standardPixmap( QStyle::SP_DirClosedIcon ), QIcon::Normal, QIcon::Off ); // icon.addPixmap( qApp->style()->standardPixmap( QStyle::SP_DirOpenIcon ), QIcon::Normal, QIcon::On ); // setIcon( icon ); setIcon( QIcon( ":/folder" ) ); setType( FOLDER ); setDropEnabled( true ); setDragEnabled( true ); setEditable( true ); }
PageSelectWidget::PageSelectWidget(QWidget *parent) : QListWidget(parent) { setSelectionRectVisible(false); setViewMode(IconMode); setSpacing(2); setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); setWordWrap(true); setDragEnabled(NoDragDrop); setEditTriggers(NoEditTriggers); setTextElideMode(Qt::ElideNone); setItemDelegate(new PageSelectWidgetItemDelegate(this)); }
ContactListItem::ContactListItem(const QString& groupName) { m_group = 0; m_contact = 0; setText(groupName); setEditable(false); setDragEnabled(false); setDropEnabled(false); /*QFont f = font(); f.setPointSize(9); setFont(f);*/ }
SearchEditorTreeView::SearchEditorTreeView(QWidget *parent) : QTreeView(parent) { setDragEnabled(true); setAcceptDrops(false); setDropIndicatorShown(true); setDragDropMode(QAbstractItemView::InternalMove); setAutoScroll(true); setSelectionMode(QAbstractItemView::ExtendedSelection); setSelectionBehavior(QAbstractItemView::SelectRows); setSortingEnabled(false); setTabKeyNavigation(true); setAutoExpandDelay(200); }
TreeView::TreeView( bool controlCenter, KActionCollection *ac, QWidget *parent, const char *name ) : K3ListView(parent), m_ac(ac), m_rmb(0), m_clipboard(0), m_clipboardFolderInfo(0), m_clipboardEntryInfo(0), m_controlCenter(controlCenter), m_layoutDirty(false) { setObjectName(name); setFrameStyle(QFrame::WinPanel | QFrame::Sunken); setAllColumnsShowFocus(true); setRootIsDecorated(true); setSorting(-1); setAcceptDrops(true); setDropVisualizer(true); setDragEnabled(true); setMinimumWidth(240); addColumn(""); header()->hide(); connect(this, SIGNAL(dropped(QDropEvent*, Q3ListViewItem*, Q3ListViewItem*)), SLOT(slotDropped(QDropEvent*, Q3ListViewItem*, Q3ListViewItem*))); connect(this, SIGNAL(clicked( Q3ListViewItem* )), SLOT(itemSelected( Q3ListViewItem* ))); connect(this,SIGNAL(selectionChanged ( Q3ListViewItem * )), SLOT(itemSelected( Q3ListViewItem* ))); connect(this, SIGNAL(rightButtonPressed(Q3ListViewItem*, const QPoint&, int)), SLOT(slotRMBPressed(Q3ListViewItem*, const QPoint&))); // connect actions connect(m_ac->action("newitem"), SIGNAL(activated()), SLOT(newitem())); connect(m_ac->action("newsubmenu"), SIGNAL(activated()), SLOT(newsubmenu())); if (m_ac->action("newsep")) connect(m_ac->action("newsep"), SIGNAL(activated()), SLOT(newsep())); m_menuFile = new MenuFile( KStandardDirs::locateLocal("xdgconf-menu", "applications-kmenuedit.menu")); m_rootFolder = new MenuFolderInfo; m_separator = new MenuSeparatorInfo; m_drag = 0; // Read menu format configuration information KSharedConfig::Ptr pConfig = KSharedConfig::openConfig("kickerrc"); KConfigGroup cg(pConfig, "menus"); m_detailedMenuEntries = cg.readEntry("DetailedMenuEntries", true); if (m_detailedMenuEntries) { m_detailedEntriesNamesFirst = cg.readEntry("DetailedEntriesNamesFirst", false); } }
QSceneGraphTreeView::QSceneGraphTreeView(QWidget *parent) : QTreeView(parent), sceneGraphModel(NULL) { sceneGraphModel = new SceneGraphModel(); sceneGraphModel->SetScene(NULL); setDragDropMode(QAbstractItemView::InternalMove); setDragEnabled(true); setAcceptDrops(true); setDropIndicatorShown(true); ConnectToSignals(); }
void toResultTableView::setup(bool readable, bool numberColumn, bool editable) { Statistics = NULL; Menu = NULL; ReadAll = false; Filter = NULL; VisibleColumns = 0; ReadableColumns = readable; NumberColumn = numberColumn; ColumnsResized = false; Ready = false; Finished = false; Working = new toWorkingWidget(this); connect(Working, SIGNAL(stop()), this, SLOT(slotStop())); Working->hide(); // hide by default createActions(); setSelectionBehavior(QAbstractItemView::SelectItems); setSelectionMode(QAbstractItemView::ContiguousSelection); setAlternatingRowColors(true); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(slotDisplayMenu(const QPoint &))); connect(horizontalHeader(), SIGNAL(sectionResized(int, int, int)), this, SLOT(slotColumnWasResized(int, int, int))); connect(this, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotHandleDoubleClick(const QModelIndex &))); setDragEnabled(true); setDropIndicatorShown(true); // this is my dirty hack to prevent fetchMore being called on the // model during a horizontal scroll. // this would be one great way to fix it, but as of this time it's // prioritized low and not scheduled for a fix: // https://bugreports.qt-project.org/browse/QTBUG-9988 disconnect(QTableView::horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(horizontalScrollbarValueChanged(int))); }
AnimationListWidget::AnimationListWidget(QWidget *parent): ListWidget(parent) { setDropIndicatorShown(false); setMovement(Static); setDefaultDropAction(Qt::IgnoreAction); setEditTriggers(DoubleClicked | EditKeyPressed); setDragDropMode(DragOnly); setDragEnabled(true); setAcceptDrops(false); setSortingEnabled(true); createActions(); connect( m_addToPlaylistAction, &QAction::triggered, this, &AnimationListWidget::addSelectedItemsToPlaylist); }
AlbumTreeView::AlbumTreeView(QWidget* const parent, Flags flags) : AbstractCheckableAlbumTreeView(parent, flags) { setDragEnabled(true); setAcceptDrops(true); setAutoScroll(false); // Workaround for bug 400960 setRootIsDecorated(false); setDropIndicatorShown(false); setAutoExpandDelay(AUTOEXPANDDELAY); if (flags & CreateDefaultModel) { setAlbumModel(new AlbumModel(AlbumModel::IncludeRootAlbum, this)); } }
PlListView::PlListView( PLModel *model, QWidget *parent ) : QListView( parent ) { setModel( model ); setViewMode( QListView::ListMode ); setUniformItemSizes( true ); setSelectionMode( QAbstractItemView::ExtendedSelection ); setAlternatingRowColors( true ); setDragEnabled(true); setAcceptDrops( true ); setDropIndicatorShown(true); PlListViewItemDelegate *delegate = new PlListViewItemDelegate( this ); setItemDelegate( delegate ); setAttribute( Qt::WA_MacShowFocusRect, false ); }
/** Initializes the view of this widget. */ void CSearchResultView::initView() { setToolTip(tr("Search result of the selected work")); setHeaderLabel(tr("Results")); setDragEnabled(true); setRootIsDecorated( false ); setSelectionMode(QAbstractItemView::ExtendedSelection); //setup the popup menu m_popup = new QMenu(this); m_actions.copyMenu = new QMenu(tr("Copy..."), m_popup); m_actions.copyMenu->setIcon(CResMgr::searchdialog::result::foundItems::copyMenu::icon()); m_actions.copy.result = new QAction(tr("Reference only"), this); BT_CONNECT(m_actions.copy.result, SIGNAL(triggered()), this, SLOT(copyItems())); m_actions.copyMenu->addAction(m_actions.copy.result); m_actions.copy.resultWithText = new QAction(tr("Reference with text"), this); BT_CONNECT(m_actions.copy.resultWithText, SIGNAL(triggered()), this, SLOT(copyItemsWithText())); m_actions.copyMenu->addAction(m_actions.copy.resultWithText); m_popup->addMenu(m_actions.copyMenu); m_actions.saveMenu = new QMenu(tr("Save..."), m_popup); m_actions.saveMenu->setIcon(CResMgr::searchdialog::result::foundItems::saveMenu::icon()); m_actions.save.result = new QAction(tr("Reference only"), this); BT_CONNECT(m_actions.save.result, SIGNAL(triggered()), this, SLOT(saveItems()) ); m_actions.saveMenu->addAction(m_actions.save.result); m_actions.save.resultWithText = new QAction(tr("Reference with text"), this); m_actions.saveMenu->addAction(m_actions.save.resultWithText); BT_CONNECT(m_actions.save.resultWithText, SIGNAL(triggered()), this, SLOT(saveItemsWithText())); m_popup->addMenu(m_actions.saveMenu); m_actions.printMenu = new QMenu(tr("Print..."), m_popup); m_actions.printMenu->setIcon(CResMgr::searchdialog::result::foundItems::printMenu::icon()); m_actions.print.result = new QAction(tr("Reference with text"), this); BT_CONNECT(m_actions.print.result, SIGNAL(triggered()), this, SLOT(printItems())); m_actions.printMenu->addAction(m_actions.print.result); m_popup->addMenu(m_actions.printMenu); }
CGroupListView::CGroupListView(QWidget *parent, CGroupList *model) : QTreeView(parent) { setModel(model); setItemDelegate(new CGroupListViewDelegate(this)); sortByColumn(COL_GROUP_NAME, Qt::AscendingOrder); setSelectionMode(QAbstractItemView::SingleSelection); setSortingEnabled(true); setAllColumnsShowFocus(true); setAlternatingRowColors(true); setAcceptDrops(true); setDragDropMode(QAbstractItemView::DropOnly); setDropIndicatorShown(true); setDragEnabled(false); header()->setSortIndicatorShown(true); setRootIsDecorated(false); itsMenu=new QMenu(this); itsDeleteAct=itsMenu->addAction(QIcon::fromTheme("list-remove"), i18n("Remove"), this, SIGNAL(del())); itsMenu->addSeparator(); itsEnableAct=itsMenu->addAction(QIcon::fromTheme("enablefont"), i18n("Enable"), this, SIGNAL(enable())); itsDisableAct=itsMenu->addAction(QIcon::fromTheme("disablefont"), i18n("Disable"), this, SIGNAL(disable())); itsMenu->addSeparator(); itsRenameAct=itsMenu->addAction(QIcon::fromTheme("edit-rename"), i18n("Rename..."), this, SLOT(rename())); if(!Misc::app(KFI_PRINTER).isEmpty()) { itsMenu->addSeparator(); itsPrintAct=itsMenu->addAction(QIcon::fromTheme("document-print"), i18n("Print..."), this, SIGNAL(print())); } else itsPrintAct=0L; itsMenu->addSeparator(); itsExportAct=itsMenu->addAction(QIcon::fromTheme("document-export"), i18n("Export..."), this, SIGNAL(zip())); setWhatsThis(model->whatsThis()); header()->setWhatsThis(whatsThis()); connect(this, SIGNAL(addFamilies(QModelIndex,QSet<QString>)), model, SLOT(addToGroup(QModelIndex,QSet<QString>))); connect(this, SIGNAL(removeFamilies(QModelIndex,QSet<QString>)), model, SLOT(removeFromGroup(QModelIndex,QSet<QString>))); }
MusicListView::MusicListView(QWidget *parent) : ListView(parent), d_ptr(new MusicListViewPrivate(this)) { Q_D(MusicListView); DThemeManager::instance()->registerWidget(this); setObjectName("MusicListView"); d->model = new MusiclistModel(0, 1, this); setModel(d->model); d->delegate = new MusicItemDelegate; setItemDelegate(d->delegate); setDragEnabled(true); viewport()->setAcceptDrops(true); setDropIndicatorShown(true); setDragDropOverwriteMode(false); setVerticalScrollMode(QAbstractItemView::ScrollPerItem); setHorizontalScrollMode(QAbstractItemView::ScrollPerItem); setDefaultDropAction(Qt::MoveAction); setDragDropMode(QAbstractItemView::InternalMove); setMovement(QListView::Free); setSelectionMode(QListView::ExtendedSelection); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setEditTriggers(QAbstractItemView::NoEditTriggers); setSelectionBehavior(QAbstractItemView::SelectRows); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, &MusicListView::customContextMenuRequested, this, &MusicListView::requestCustomContextMenu); connect(this, &MusicListView::doubleClicked, this, [ = ](const QModelIndex & index) { MetaPtr meta = d->model->meta(index); Q_EMIT playMedia(meta); }); // For debug // connect(selectionModel(), &QItemSelectionModel::selectionChanged, // this, [ = ](const QItemSelection & /*selected*/, const QItemSelection & deselected) { // if (!deselected.isEmpty()) { // qDebug() << "cancel" << deselected; // } // }); }
WebSearchBar::WebSearchBar(BrowserWindow* window) : LineEdit(window) , m_window(window) , m_reloadingEngines(false) { setObjectName("websearchbar"); setDragEnabled(true); m_buttonSearch = new WebSearchBar_Button(this); m_boxSearchType = new ButtonWithMenu(this); m_boxSearchType->setObjectName("websearchbar-searchprovider-comobobox"); // RTL Support // If we don't add 'm_boxSearchType' by following code, then we should use suitable padding-left value // but then, when typing RTL text the layout dynamically changed and within RTL layout direction // padding-left is equivalent to padding-right and vice versa, and because style sheet is // not changed dynamically this create padding problems. addWidget(m_boxSearchType, LineEdit::LeftSide); addWidget(m_buttonSearch, LineEdit::RightSide); connect(m_buttonSearch, SIGNAL(clicked(QPoint)), this, SLOT(search())); connect(m_buttonSearch, SIGNAL(middleClicked(QPoint)), this, SLOT(searchInNewTab())); connect(m_boxSearchType, SIGNAL(activeItemChanged(ButtonWithMenu::Item)), this, SLOT(searchChanged(ButtonWithMenu::Item))); setWidgetSpacing(0); m_searchManager = mApp->searchEnginesManager(); connect(m_boxSearchType->menu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShowMenu())); m_completer = new QCompleter(this); m_completer->setCompletionMode(QCompleter::UnfilteredPopupCompletion); m_completerModel = new QStringListModel(this); m_completer->setModel(m_completerModel); m_completer->popup()->setMinimumHeight(90); setCompleter(m_completer); m_openSearchEngine = new OpenSearchEngine(this); m_openSearchEngine->setNetworkAccessManager(mApp->networkManager()); connect(m_openSearchEngine, SIGNAL(suggestions(QStringList)), this, SLOT(addSuggestions(QStringList))); connect(this, SIGNAL(textEdited(QString)), m_openSearchEngine, SLOT(requestSuggestions(QString))); editAction(PasteAndGo)->setText(tr("Paste And &Search")); editAction(PasteAndGo)->setIcon(QIcon::fromTheme(QSL("edit-paste"))); connect(editAction(PasteAndGo), SIGNAL(triggered()), this, SLOT(pasteAndGo())); QTimer::singleShot(0, this, SLOT(setupEngines())); }
void TB_PokeChoice::init() { verticalHeader()->setDefaultSectionSize(22); setSelectionBehavior(QAbstractItemView::SelectRows); setSelectionMode(QAbstractItemView::SingleSelection); setShowGrid(false); verticalHeader()->hide(); horizontalHeader()->setDefaultSectionSize(40); horizontalHeader()->setStretchLastSection(true); setDragEnabled(true); setDragDropMode(QAbstractItemView::DragOnly); connect(this, SIGNAL(activated(QModelIndex)), SLOT(activatedCell(QModelIndex))); }
WatchTreeView::WatchTreeView(WatchType type) : m_type(type), m_sliderPosition(0) { setObjectName(QLatin1String("WatchWindow")); m_grabbing = false; setWindowTitle(tr("Locals and Expressions")); setIndentation(indentation() * 9/10); setUniformRowHeights(true); setItemDelegate(new WatchDelegate(this)); setDragEnabled(true); setAcceptDrops(true); setDropIndicatorShown(true); connect(this, &QTreeView::expanded, this, &WatchTreeView::expandNode); connect(this, &QTreeView::collapsed, this, &WatchTreeView::collapseNode); }
EffectsListWidget::EffectsListWidget(QWidget *parent) : QTreeWidget(parent) { setColumnCount(1); setDragEnabled(true); setAcceptDrops(false); setHeaderHidden(true); setFrameShape(QFrame::NoFrame); setAutoFillBackground(false); setRootIsDecorated(true); setIndentation(10); //setSelectionMode(QAbstractItemView::ExtendedSelection); setDragDropMode(QAbstractItemView::DragOnly); updatePalette(); connect(this, &EffectsListWidget::activated, this, &EffectsListWidget::slotExpandItem); }
WLibrarySidebar::WLibrarySidebar(QWidget* parent) : QTreeView(parent), WBaseWidget(this) { //Set some properties setHeaderHidden(true); setSelectionMode(QAbstractItemView::SingleSelection); //Drag and drop setup setDragEnabled(false); setDragDropMode(QAbstractItemView::DragDrop); setDropIndicatorShown(true); setAcceptDrops(true); setAutoScroll(true); header()->setStretchLastSection(false); header()->setResizeMode(QHeaderView::ResizeToContents); header()->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); }
KNCollectionView::KNCollectionView(QWidget *parent, const char *name) : KFolderTree(parent, name), mActiveItem(0), mPopup(0) { setDragEnabled(true); addAcceptableDropMimetype("x-knode-drag/article", false); addAcceptableDropMimetype("x-knode-drag/folder", true); addColumn(i18n("Name"), 162); setDropHighlighter(true); // popup menu to enable/disable unread and total columns header()->setClickEnabled(true); header()->installEventFilter(this); mPopup = new KPopupMenu(this); mPopup->insertTitle(i18n("View Columns")); mPopup->setCheckable(true); mUnreadPop = mPopup->insertItem(i18n("Unread Column"), this, SLOT(toggleUnreadColumn())); mTotalPop = mPopup->insertItem(i18n("Total Column"), this, SLOT(toggleTotalColumn())); // add unread and total columns if necessary readConfig(); // load accounts and folders reloadAccounts(); reloadFolders(); // connect to the account manager KNAccountManager *am = knGlobals.accountManager(); connect(am, SIGNAL(accountAdded(KNNntpAccount *)), SLOT(addAccount(KNNntpAccount *))); connect(am, SIGNAL(accountRemoved(KNNntpAccount *)), SLOT(removeAccount(KNNntpAccount *))); connect(am, SIGNAL(accountModified(KNNntpAccount *)), SLOT(updateAccount(KNNntpAccount *))); // connect to the group manager KNGroupManager *gm = knGlobals.groupManager(); connect(gm, SIGNAL(groupAdded(KNGroup *)), SLOT(addGroup(KNGroup *))); connect(gm, SIGNAL(groupRemoved(KNGroup *)), SLOT(removeGroup(KNGroup *))); connect(gm, SIGNAL(groupUpdated(KNGroup *)), SLOT(updateGroup(KNGroup *))); // connect to the folder manager KNFolderManager *fm = knGlobals.folderManager(); connect(fm, SIGNAL(folderAdded(KNFolder *)), SLOT(addPendingFolders())); connect(fm, SIGNAL(folderRemoved(KNFolder *)), SLOT(removeFolder(KNFolder *))); connect(fm, SIGNAL(folderActivated(KNFolder *)), SLOT(activateFolder(KNFolder *))); installEventFilter(this); }
QueueListView::QueueListView(QWidget* parent) : QTreeWidget(parent), d(new QueueListViewPriv) { setIconSize(QSize(d->iconSize, d->iconSize)); setSelectionMode(QAbstractItemView::ExtendedSelection); setWhatsThis(i18n("This is the list of images to batch process.")); setAcceptDrops(true); viewport()->setAcceptDrops(true); setDropIndicatorShown(true); setDragEnabled(true); viewport()->setMouseTracking(true); setSortingEnabled(false); setAllColumnsShowFocus(true); setRootIsDecorated(false); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setColumnCount(3); setContextMenuPolicy(Qt::CustomContextMenu); QStringList titles; titles.append(i18n("Thumbnail")); titles.append(i18n("File Name")); titles.append(i18n("Target")); setHeaderLabels(titles); header()->setResizeMode(0, QHeaderView::ResizeToContents); header()->setResizeMode(1, QHeaderView::Stretch); header()->setResizeMode(2, QHeaderView::Stretch); d->toolTip = new QueueToolTip(this); d->toolTipTimer = new QTimer(this); // ----------------------------------------------------------- connect(DatabaseAccess::databaseWatch(), SIGNAL(collectionImageChange(const CollectionImageChangeset&)), this, SLOT(slotCollectionImageChange(const CollectionImageChangeset&)), Qt::QueuedConnection); connect(d->thumbLoadThread, SIGNAL(signalThumbnailLoaded(const LoadingDescription&, const QPixmap&)), this, SLOT(slotThumbnailLoaded(const LoadingDescription&, const QPixmap&))); connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(slotContextMenu())); connect(d->toolTipTimer, SIGNAL(timeout()), this, SLOT(slotToolTip())); }