K3b::VideoDVDRippingView::VideoDVDRippingView( QWidget* parent ) : K3b::MediaContentsView( true, K3b::Medium::ContentVideoDVD, K3b::Device::MEDIA_DVD_ALL, K3b::Device::STATE_INCOMPLETE|K3b::Device::STATE_COMPLETE, parent ), d( new Private ) { // toolbox // ---------------------------------------------------------------------------------- d->toolBox = new KToolBar( mainWidget() ); KUrlLabel* showFilesLabel = new KUrlLabel( d->toolBox ); showFilesLabel->setContentsMargins( style()->pixelMetric( QStyle::PM_LayoutLeftMargin ), 0, style()->pixelMetric( QStyle::PM_LayoutRightMargin ), 0 ); showFilesLabel->setText( i18n("Show files") ); showFilesLabel->setWhatsThis( i18n("Shows plain Video DVD vob files from the DVD " "(including decryption) for further processing with another application") ); connect( showFilesLabel, SIGNAL(leftClickedUrl()), this, SLOT(slotShowFiles()) ); d->labelLength = new QLabel( d->toolBox ); d->labelLength->setAlignment( Qt::AlignVCenter | Qt::AlignRight ); d->labelLength->setContentsMargins( style()->pixelMetric( QStyle::PM_LayoutLeftMargin ), 0, style()->pixelMetric( QStyle::PM_LayoutRightMargin ), 0 ); d->delegate = new VideoDVDTitleDelegate( this ); d->model = new VideoDVDTitleModel( this ); // the title view // ---------------------------------------------------------------------------------- d->view = new QTreeView( mainWidget() ); d->view->setItemDelegate( d->delegate ); d->view->setSelectionMode( QAbstractItemView::ExtendedSelection ); d->view->setModel( d->model ); d->view->setRootIsDecorated( false ); d->view->header()->setResizeMode( QHeaderView::ResizeToContents ); d->view->setContextMenuPolicy( Qt::CustomContextMenu ); d->view->installEventFilter( this ); connect( d->view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu(QPoint)) ); // general layout // ---------------------------------------------------------------------------------- QVBoxLayout* mainGrid = new QVBoxLayout( mainWidget() ); mainGrid->addWidget( d->toolBox ); mainGrid->addWidget( d->view ); mainGrid->setContentsMargins( 0, 0, 0, 0 ); mainGrid->setSpacing( 0 ); setLeftPixmap( K3b::Theme::MEDIA_LEFT ); setRightPixmap( K3b::Theme::MEDIA_VIDEO ); initActions(); d->toolBox->addAction( actionCollection()->action("start_rip") ); d->toolBox->addSeparator(); d->toolBox->addWidget( showFilesLabel ); d->toolBox->addAction( new KToolBarSpacerAction( d->toolBox ) ); d->toolBox->addWidget( d->labelLength ); }
AssignedListView::AssignedListView(QWidget* const parent) : QTreeWidget(parent) { setSelectionMode(QAbstractItemView::SingleSelection); setWhatsThis(i18n("This is the list of batch tools assigned.")); setIconSize(QSize(ICONSIZE, ICONSIZE)); setDragEnabled(true); setAcceptDrops(true); viewport()->setAcceptDrops(true); setDropIndicatorShown(true); setContextMenuPolicy(Qt::CustomContextMenu); setSortingEnabled(false); setAllColumnsShowFocus(true); setRootIsDecorated(false); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setColumnCount(2); setHeaderHidden(true); header()->setSectionResizeMode(QHeaderView::ResizeToContents); connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged())); connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu())); }
EnfuseStackList::EnfuseStackList(QWidget* const parent) : QTreeWidget(parent), d(new Private) { d->progressTimer = new QTimer(this); setContextMenuPolicy(Qt::CustomContextMenu); setIconSize(QSize(64, 64)); setSelectionMode(QAbstractItemView::SingleSelection); setSortingEnabled(false); setAllColumnsShowFocus(true); setRootIsDecorated(false); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setColumnCount(3); setHeaderHidden(false); setDragEnabled(false); header()->setSectionResizeMode(QHeaderView::Stretch); QStringList labels; labels.append( i18nc("@title:column Saving checkbox", "Include during Saving") ); labels.append( i18nc("@title:column Output file name", "Output") ); labels.append( i18nc("@title:column Source file names", "Selected Inputs") ); setHeaderLabels(labels); connect(this, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(slotItemClicked(QTreeWidgetItem*))); connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu(QPoint))); connect(d->progressTimer, SIGNAL(timeout()), this, SLOT(slotProgressTimerDone())); }
void ToolBar::initTabs(){ tabbar = new QTabBar(parentWidget()); tabbar->setObjectName("arenaTabbar"); tabbar->setTabsClosable(WBGET(WB_APP_TBAR_SHOW_CL_BTNS)); tabbar->setDocumentMode(true); tabbar->setMovable(true); tabbar->setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab); tabbar->setExpanding(false); tabbar->setContextMenuPolicy(Qt::CustomContextMenu); tabbar->setSizePolicy(QSizePolicy::Expanding, tabbar->sizePolicy().verticalPolicy()); tabbar->setAcceptDrops(true); tabbar->installEventFilter(this); shortcuts << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_1), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_2), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_3), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_4), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_5), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_6), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_7), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_8), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_9), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_0), parentWidget())); for (const auto &s : shortcuts){ s->setContext(Qt::ApplicationShortcut); connect(s, SIGNAL(activated()), this, SLOT(slotShorcuts())); } connect(tabbar, SIGNAL(currentChanged(int)), this, SLOT(slotIndexChanged(int))); connect(tabbar, SIGNAL(tabMoved(int,int)), this, SLOT(slotTabMoved(int,int))); connect(tabbar, SIGNAL(tabCloseRequested(int)), this, SLOT(slotClose(int))); connect(tabbar, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu(QPoint))); connect(ArenaWidgetManager::getInstance(), SIGNAL(added(ArenaWidget*)), this, SLOT(insertWidget(ArenaWidget*))); connect(ArenaWidgetManager::getInstance(), SIGNAL(removed(ArenaWidget*)), this, SLOT(removeWidget(ArenaWidget*))); connect(ArenaWidgetManager::getInstance(), SIGNAL(activated(ArenaWidget*)), this, SLOT(mapped(ArenaWidget*))); connect(ArenaWidgetManager::getInstance(), SIGNAL(updated(ArenaWidget*)), this, SLOT(updated(ArenaWidget*))); connect(ArenaWidgetManager::getInstance(), SIGNAL(toggled(ArenaWidget*)), this, SLOT(toggled(ArenaWidget*))); connect(GlobalTimer::getInstance(), SIGNAL(second()), this, SLOT(redraw())); addWidget(tabbar); }
BookmarkList::BookmarkList( Okular::Document *document, QWidget *parent ) : QWidget( parent ), m_document( document ), m_currentDocumentItem( 0 ) { QVBoxLayout *mainlay = new QVBoxLayout( this ); mainlay->setMargin( 0 ); mainlay->setSpacing( 6 ); m_searchLine = new KTreeWidgetSearchLine( this ); mainlay->addWidget( m_searchLine ); m_tree = new QTreeWidget( this ); mainlay->addWidget( m_tree ); QStringList cols; cols.append( "Bookmarks" ); m_tree->setContextMenuPolicy( Qt::CustomContextMenu ); m_tree->setHeaderLabels( cols ); m_tree->setSortingEnabled( false ); m_tree->setRootIsDecorated( true ); m_tree->setAlternatingRowColors( true ); m_tree->setItemDelegate( new PageItemDelegate( m_tree ) ); m_tree->header()->hide(); m_tree->setSelectionBehavior( QAbstractItemView::SelectRows ); m_tree->setEditTriggers( QAbstractItemView::EditKeyPressed ); connect( m_tree, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(slotExecuted(QTreeWidgetItem*)) ); connect( m_tree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu(QPoint)) ); m_searchLine->addTreeWidget( m_tree ); QToolBar * bookmarkController = new QToolBar( this ); mainlay->addWidget( bookmarkController ); bookmarkController->setObjectName( QLatin1String( "BookmarkControlBar" ) ); // change toolbar appearance bookmarkController->setIconSize( QSize( 16, 16 ) ); bookmarkController->setMovable( false ); QSizePolicy sp = bookmarkController->sizePolicy(); sp.setVerticalPolicy( QSizePolicy::Minimum ); bookmarkController->setSizePolicy( sp ); // insert a togglebutton [show only bookmarks in the current document] m_showBoomarkOnlyAction = bookmarkController->addAction( KIcon( "bookmarks" ), i18n( "Current document only" ) ); m_showBoomarkOnlyAction->setCheckable( true ); connect( m_showBoomarkOnlyAction, SIGNAL(toggled(bool)), this, SLOT(slotFilterBookmarks(bool)) ); connect( m_document->bookmarkManager(), SIGNAL(bookmarksChanged(KUrl)), this, SLOT(slotBookmarksChanged(KUrl)) ); rebuildTree( m_showBoomarkOnlyAction->isChecked() ); }
QueuedUsers::QueuedUsers(){ setupUi(this); setUnload(false); model = new QueuedUsersModel(this); treeView_USERS->setModel(model); treeView_USERS->setContextMenuPolicy(Qt::CustomContextMenu); treeView_USERS->header()->restoreState(WVGET("queued-users/headerstate", QByteArray()).toByteArray()); connect(this, SIGNAL(coreWaitingAddFile(VarMap)), this, SLOT(slotWaitingAddFile(VarMap)), Qt::QueuedConnection); connect(this, SIGNAL(coreWaitingRemoved(VarMap)), this, SLOT(slotWaitingRemoved(VarMap)), Qt::QueuedConnection); connect(treeView_USERS, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu())); UploadManager::getInstance()->addListener(this); ArenaWidget::setState( ArenaWidget::Flags(ArenaWidget::state() | ArenaWidget::Singleton | ArenaWidget::Hidden) ); }
<< (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_6), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_7), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_8), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_9), parentWidget())) << (new QShortcut(QKeySequence(Qt::ALT + Qt::Key_0), parentWidget())); foreach (QShortcut *s, shortcuts){ s->setContext(Qt::ApplicationShortcut); connect(s, SIGNAL(activated()), this, SLOT(slotShorcuts())); } connect(tabbar, SIGNAL(currentChanged(int)), this, SLOT(slotIndexChanged(int))); connect(tabbar, SIGNAL(tabMoved(int,int)), this, SLOT(slotTabMoved(int,int))); connect(tabbar, SIGNAL(tabCloseRequested(int)), this, SLOT(slotClose(int))); connect(tabbar, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu(QPoint))); addWidget(tabbar); } void ToolBar::insertWidget(ArenaWidget *awgt){ if (!awgt || !awgt->getWidget() || map.contains(awgt)) return; int index = tabbar->addTab(awgt->getPixmap(), awgt->getArenaShortTitle().left(32)); if (index >= 0){ map.insert(awgt, index); if (tabbar->isHidden()) tabbar->show();