diff --git a/generators/kimgio/generator_kimgio.cpp b/generators/kimgio/generator_kimgio.cpp index 3972ab66f..8d02487fb 100644 --- a/generators/kimgio/generator_kimgio.cpp +++ b/generators/kimgio/generator_kimgio.cpp @@ -61,7 +61,7 @@ KIMGIOGenerator::KIMGIOGenerator( QObject *parent, const QVariantList &args ) setComponentData( *ownComponentData() ); setXMLFile( "gui.rc" ); - KAction * kimgio_test = new KAction( this ); + QAction * kimgio_test = new QAction( this ); kimgio_test->setText( "Image test" ); kimgio_test->setIcon( QIcon::fromTheme( "smiley" ) ); connect( kimgio_test, SIGNAL(triggered(bool)), this, SLOT(slotTest()) ); diff --git a/part.cpp b/part.cpp index a41d9dc9d..94a8769d7 100644 --- a/part.cpp +++ b/part.cpp @@ -652,7 +652,7 @@ void Part::setupViewerActions() prefs->setText( i18n( "Configure Viewer..." ) ); } - KAction * genPrefs = new KAction( ac ); + QAction * genPrefs = new QAction( ac ); ac->addAction("options_configure_generators", genPrefs); if ( m_embedMode == ViewerWidgetMode ) { @@ -691,7 +691,7 @@ void Part::setupViewerActions() m_aboutBackend->setEnabled( false ); connect(m_aboutBackend, SIGNAL(triggered()), this, SLOT(slotAboutBackend())); - KAction *reload = ac->add( "file_reload" ); + QAction *reload = ac->add( "file_reload" ); reload->setText( i18n( "Reloa&d" ) ); reload->setIcon( QIcon::fromTheme( "view-refresh" ) ); reload->setWhatsThis( i18n( "Reload the current document from disk." ) ); @@ -704,7 +704,8 @@ void Part::setupViewerActions() m_closeFindBar->setShortcut( QKeySequence(Qt::Key_Escape) ); m_closeFindBar->setEnabled( false ); - KAction *pageno = new KAction( i18n( "Page Number" ), ac ); + QWidgetAction *pageno = new QWidgetAction( ac ); + pageno->setText( i18n( "Page Number" ) ); pageno->setDefaultWidget( m_pageNumberTool ); ac->addAction( "page_number", pageno ); } @@ -724,7 +725,7 @@ void Part::setViewerShortcuts() m_beginningOfDocument->setShortcut( QKeySequence( Qt::CTRL + Qt::ALT + Qt::Key_Home ) ); m_endOfDocument->setShortcut( QKeySequence( Qt::CTRL + Qt::ALT + Qt::Key_End ) ); - KAction *action = static_cast( ac->action( "file_reload" ) ); + QAction *action = static_cast( ac->action( "file_reload" ) ); if( action ) action->setShortcuts( QList() << QKeySequence( Qt::ALT + Qt::Key_F5 ) ); } @@ -812,17 +813,17 @@ void Part::setupActions() drawingAction->setIcon( QIcon::fromTheme( "draw-freehand" ) ); drawingAction->setEnabled( false ); - KAction *eraseDrawingAction = new KAction( i18n( "Erase Drawings" ), ac ); + QAction *eraseDrawingAction = new QAction( i18n( "Erase Drawings" ), ac ); ac->addAction( "presentation_erase_drawings", eraseDrawingAction ); eraseDrawingAction->setIcon( QIcon::fromTheme( "draw-eraser" ) ); eraseDrawingAction->setEnabled( false ); - KAction *configureAnnotations = new KAction( i18n( "Configure Annotations..." ), ac ); + QAction *configureAnnotations = new QAction( i18n( "Configure Annotations..." ), ac ); ac->addAction( "options_configure_annotations", configureAnnotations ); configureAnnotations->setIcon( QIcon::fromTheme( "configure" ) ); connect(configureAnnotations, SIGNAL(triggered()), this, SLOT(slotAnnotationPreferences())); - KAction *playPauseAction = new KAction( i18n( "Play/Pause Presentation" ), ac ); + QAction *playPauseAction = new QAction( i18n( "Play/Pause Presentation" ), ac ); ac->addAction( "presentation_play_pause", playPauseAction ); playPauseAction->setEnabled( false ); } @@ -2392,13 +2393,13 @@ void Part::slotShowMenu(const Okular::Page *page, const QPoint &point) m_actionsSearched = true; } - KMenu *popup = new KMenu( widget() ); + QMenu *popup = new QMenu( widget() ); QAction *addBookmark = 0; QAction *removeBookmark = 0; QAction *fitPageWidth = 0; if (page) { - popup->addTitle( i18n( "Page %1", page->number() + 1 ) ); + popup->setTitle( i18n( "Page %1", page->number() + 1 ) ); if ( ( !currentPage && m_document->bookmarkManager()->isBookmarked( page->number() ) ) || ( currentPage && m_document->bookmarkManager()->isBookmarked( m_document->viewport() ) ) ) removeBookmark = popup->addAction( QIcon::fromTheme("edit-delete-bookmark"), i18n("Remove Bookmark") ); @@ -2420,7 +2421,7 @@ void Part::slotShowMenu(const Okular::Page *page, const QPoint &point) if ((m_showMenuBarAction && !m_showMenuBarAction->isChecked()) || (m_showFullScreenAction && m_showFullScreenAction->isChecked())) { - popup->addTitle( i18n( "Tools" ) ); + popup->setTitle( i18n( "Tools" ) ); if (m_showMenuBarAction && !m_showMenuBarAction->isChecked()) popup->addAction(m_showMenuBarAction); if (m_showFullScreenAction && m_showFullScreenAction->isChecked()) popup->addAction(m_showFullScreenAction); reallyShow = true; @@ -2896,7 +2897,7 @@ void Part::rebuildBookmarkMenu( bool unplugActions ) if ( m_bookmarkActions.isEmpty() ) { havebookmarks = false; - QAction * a = new KAction( 0 ); + QAction * a = new QAction( 0 ); a->setText( i18n( "No Bookmarks" ) ); a->setEnabled( false ); m_bookmarkActions.append( a ); diff --git a/part.h b/part.h index d47f6c201..70443345c 100644 --- a/part.h +++ b/part.h @@ -48,8 +48,7 @@ class KToggleFullScreenAction; class KSelectAction; class KAboutData; class KTemporaryFile; -class KAction; -class KMenu; +class QAction; namespace KParts { class GUIActivateEvent; } class FindBar; @@ -187,7 +186,7 @@ class OKULAR_PART_EXPORT Part : public KParts::ReadWritePart, public Okular::Doc void slotAddBookmark(); void slotRenameBookmarkFromMenu(); void slotRenameCurrentViewportBookmark(); - void slotAboutToShowContextMenu(KMenu *menu, QAction *action, QMenu *contextMenu); + void slotAboutToShowContextMenu(QMenu *menu, QAction *action, QMenu *contextMenu); void slotPreviousBookmark(); void slotNextBookmark(); void slotFindNext(); diff --git a/ui/annotationpopup.cpp b/ui/annotationpopup.cpp index 5857436cd..0cc008fb1 100644 --- a/ui/annotationpopup.cpp +++ b/ui/annotationpopup.cpp @@ -39,7 +39,7 @@ void AnnotationPopup::exec( const QPoint &point ) if ( mAnnotations.isEmpty() ) return; - KMenu menu( mParent ); + QMenu menu( mParent ); QAction *action = 0; Okular::FileAttachmentAnnotation *fileAttachAnnot = 0; @@ -58,7 +58,7 @@ void AnnotationPopup::exec( const QPoint &point ) const AnnotPagePair &pair = mAnnotations.at(0); - menu.addTitle( i18np( "Annotation", "%1 Annotations", mAnnotations.count() ) ); + menu.setTitle( i18np( "Annotation", "%1 Annotations", mAnnotations.count() ) ); action = menu.addAction( QIcon::fromTheme( "comment" ), i18n( "&Open Pop-up Note" ) ); action->setData( QVariant::fromValue( pair ) ); @@ -95,7 +95,7 @@ void AnnotationPopup::exec( const QPoint &point ) { foreach ( const AnnotPagePair& pair, mAnnotations ) { - menu.addTitle( GuiUtils::captionForAnnotation( pair.annotation ) ); + menu.setTitle( GuiUtils::captionForAnnotation( pair.annotation ) ); action = menu.addAction( QIcon::fromTheme( "comment" ), i18n( "&Open Pop-up Note" ) ); action->setData( QVariant::fromValue( pair ) ); diff --git a/ui/bookmarklist.cpp b/ui/bookmarklist.cpp index 2b3ca14dd..0121befdb 100644 --- a/ui/bookmarklist.cpp +++ b/ui/bookmarklist.cpp @@ -244,7 +244,7 @@ void BookmarkList::contextMenuForBookmarkItem( const QPoint& p, BookmarkItem* bm if ( !bmItem || !bmItem->viewport().isValid() ) return; - KMenu menu( this ); + QMenu menu( this ); QAction * gotobm = menu.addAction( i18n( "Go to This Bookmark" ) ); QAction * editbm = menu.addAction( QIcon::fromTheme( "edit-rename" ), i18n( "Rename Bookmark" ) ); QAction * removebm = menu.addAction( QIcon::fromTheme( "list-remove" ), i18n( "Remove Bookmark" ) ); @@ -269,7 +269,7 @@ void BookmarkList::contextMenuForFileItem( const QPoint& p, FileItem* fItem ) const KUrl itemurl = fItem->data( 0, UrlRole ).value< KUrl >(); const bool thisdoc = itemurl == m_document->currentDocument(); - KMenu menu( this ); + QMenu menu( this ); QAction * open = 0; if ( !thisdoc ) open = menu.addAction( i18nc( "Opens the selected document", "Open Document" ) ); diff --git a/ui/pageview.cpp b/ui/pageview.cpp index cdc725901..70f5c76f2 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -30,12 +30,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -188,16 +188,16 @@ public: QTimer leftClickTimer; // actions - KAction * aRotateClockwise; - KAction * aRotateCounterClockwise; - KAction * aRotateOriginal; + QAction * aRotateClockwise; + QAction * aRotateCounterClockwise; + QAction * aRotateOriginal; KSelectAction * aPageSizes; KToggleAction * aTrimMargins; - KAction * aMouseNormal; - KAction * aMouseSelect; - KAction * aMouseTextSelect; - KAction * aMouseTableSelect; - KAction * aMouseMagnifier; + QAction * aMouseNormal; + QAction * aMouseSelect; + QAction * aMouseTextSelect; + QAction * aMouseTableSelect; + QAction * aMouseMagnifier; KToggleAction * aToggleAnnotator; KSelectAction * aZoom; QAction * aZoomIn; @@ -208,10 +208,10 @@ public: KActionMenu * aViewMode; KToggleAction * aViewContinuous; QAction * aPrevAction; - KAction * aToggleForms; - KAction * aSpeakDoc; - KAction * aSpeakPage; - KAction * aSpeakStop; + QAction * aToggleForms; + QAction * aSpeakDoc; + QAction * aSpeakPage; + QAction * aSpeakStop; KActionCollection * actionCollection; QActionGroup * mouseModeActionGroup; @@ -450,17 +450,17 @@ void PageView::setupViewerActions( KActionCollection * ac ) d->aZoomOut->setShortcut( QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Minus) ); // orientation menu actions - d->aRotateClockwise = new KAction( QIcon::fromTheme( "object-rotate-right" ), i18n( "Rotate &Right" ), this ); + d->aRotateClockwise = new QAction( QIcon::fromTheme( "object-rotate-right" ), i18n( "Rotate &Right" ), this ); d->aRotateClockwise->setIconText( i18nc( "Rotate right", "Right" ) ); ac->addAction( "view_orientation_rotate_cw", d->aRotateClockwise ); d->aRotateClockwise->setEnabled( false ); connect( d->aRotateClockwise, SIGNAL(triggered()), this, SLOT(slotRotateClockwise()) ); - d->aRotateCounterClockwise = new KAction( QIcon::fromTheme( "object-rotate-left" ), i18n( "Rotate &Left" ), this ); + d->aRotateCounterClockwise = new QAction( QIcon::fromTheme( "object-rotate-left" ), i18n( "Rotate &Left" ), this ); d->aRotateCounterClockwise->setIconText( i18nc( "Rotate left", "Left" ) ); ac->addAction( "view_orientation_rotate_ccw", d->aRotateCounterClockwise ); d->aRotateCounterClockwise->setEnabled( false ); connect( d->aRotateCounterClockwise, SIGNAL(triggered()), this, SLOT(slotRotateCounterClockwise()) ); - d->aRotateOriginal = new KAction( i18n( "Original Orientation" ), this ); + d->aRotateOriginal = new QAction( i18n( "Original Orientation" ), this ); ac->addAction( "view_orientation_original", d->aRotateOriginal ); d->aRotateOriginal->setEnabled( false ); connect( d->aRotateOriginal, SIGNAL(triggered()), this, SLOT(slotRotateOriginal()) ); @@ -494,7 +494,8 @@ void PageView::setupViewerActions( KActionCollection * ac ) d->aViewMode->setDelayed( false ); #define ADD_VIEWMODE_ACTION( text, name, id ) \ do { \ - KAction *vm = new KAction( text, d->aViewMode->menu() ); \ + QAction *vm = new QAction( text, this ); \ + vm->setMenu( d->aViewMode->menu() ); \ vm->setCheckable( true ); \ vm->setData( qVariantFromValue( id ) ); \ d->aViewMode->addAction( vm ); \ @@ -502,7 +503,7 @@ do { \ vmGroup->addAction( vm ); \ } while( 0 ) ac->addAction("view_render_mode", d->aViewMode ); - QActionGroup *vmGroup = new QActionGroup( d->aViewMode->menu() ); + QActionGroup *vmGroup = new QActionGroup( this ); //d->aViewMode->menu() ); ADD_VIEWMODE_ACTION( i18n( "Single Page" ), "view_render_mode_single", (int)Okular::Settings::EnumViewMode::Single ); ADD_VIEWMODE_ACTION( i18n( "Facing Pages" ), "view_render_mode_facing", (int)Okular::Settings::EnumViewMode::Facing ); ADD_VIEWMODE_ACTION( i18n( "Facing Pages (Center First Page)" ), "view_render_mode_facing_center_first", (int)Okular::Settings::EnumViewMode::FacingFirstCentered ); @@ -526,7 +527,7 @@ do { \ // Mouse mode actions for viewer mode d->mouseModeActionGroup = new QActionGroup( this ); d->mouseModeActionGroup->setExclusive( true ); - d->aMouseNormal = new KAction( QIcon::fromTheme( "input-mouse" ), i18n( "&Browse Tool" ), this ); + d->aMouseNormal = new QAction( QIcon::fromTheme( "input-mouse" ), i18n( "&Browse Tool" ), this ); ac->addAction("mouse_drag", d->aMouseNormal ); connect( d->aMouseNormal, SIGNAL(triggered()), this, SLOT(slotSetMouseNormal()) ); d->aMouseNormal->setIconText( i18nc( "Browse Tool", "Browse" ) ); @@ -535,7 +536,7 @@ do { \ d->aMouseNormal->setActionGroup( d->mouseModeActionGroup ); d->aMouseNormal->setChecked( Okular::Settings::mouseMode() == Okular::Settings::EnumMouseMode::Browse ); - KAction * mz = new KAction(QIcon::fromTheme( "page-zoom" ), i18n("&Zoom Tool"), this); + QAction * mz = new QAction(QIcon::fromTheme( "page-zoom" ), i18n("&Zoom Tool"), this); ac->addAction("mouse_zoom", mz ); connect( mz, SIGNAL(triggered()), this, SLOT(slotSetMouseZoom()) ); mz->setIconText( i18nc( "Zoom Tool", "Zoom" ) ); @@ -544,7 +545,7 @@ do { \ mz->setActionGroup( d->mouseModeActionGroup ); mz->setChecked( Okular::Settings::mouseMode() == Okular::Settings::EnumMouseMode::Zoom ); - KAction * aToggleChangeColors = new KAction(i18n("&Toggle Change Colors"), this); + QAction * aToggleChangeColors = new QAction(i18n("&Toggle Change Colors"), this); ac->addAction("toggle_change_colors", aToggleChangeColors ); connect( aToggleChangeColors, SIGNAL(triggered()), this, SLOT(slotToggleChangeColors()) ); } @@ -558,7 +559,7 @@ void PageView::setupActions( KActionCollection * ac ) d->aZoomOut->setShortcut( QKeySequence(QKeySequence::ZoomOut) ); // Mouse-Mode actions - d->aMouseSelect = new KAction(QIcon::fromTheme( "select-rectangular" ), i18n("&Selection Tool"), this); + d->aMouseSelect = new QAction(QIcon::fromTheme( "select-rectangular" ), i18n("&Selection Tool"), this); ac->addAction("mouse_select", d->aMouseSelect ); connect( d->aMouseSelect, SIGNAL(triggered()), this, SLOT(slotSetMouseSelect()) ); d->aMouseSelect->setIconText( i18nc( "Select Tool", "Selection" ) ); @@ -567,7 +568,7 @@ void PageView::setupActions( KActionCollection * ac ) d->aMouseSelect->setActionGroup( d->mouseModeActionGroup ); d->aMouseSelect->setChecked( Okular::Settings::mouseMode() == Okular::Settings::EnumMouseMode::RectSelect ); - d->aMouseTextSelect = new KAction(QIcon::fromTheme( "draw-text" ), i18n("&Text Selection Tool"), this); + d->aMouseTextSelect = new QAction(QIcon::fromTheme( "draw-text" ), i18n("&Text Selection Tool"), this); ac->addAction("mouse_textselect", d->aMouseTextSelect ); connect( d->aMouseTextSelect, SIGNAL(triggered()), this, SLOT(slotSetMouseTextSelect()) ); d->aMouseTextSelect->setIconText( i18nc( "Text Selection Tool", "Text Selection" ) ); @@ -576,7 +577,7 @@ void PageView::setupActions( KActionCollection * ac ) d->aMouseTextSelect->setActionGroup( d->mouseModeActionGroup ); d->aMouseTextSelect->setChecked( Okular::Settings::mouseMode() == Okular::Settings::EnumMouseMode::TextSelect ); - d->aMouseTableSelect = new KAction(QIcon::fromTheme( "table" ), i18n("T&able Selection Tool"), this); + d->aMouseTableSelect = new QAction(QIcon::fromTheme( "table" ), i18n("T&able Selection Tool"), this); ac->addAction("mouse_tableselect", d->aMouseTableSelect ); connect( d->aMouseTableSelect, SIGNAL( triggered() ), this, SLOT( slotSetMouseTableSelect() ) ); d->aMouseTableSelect->setIconText( i18nc( "Table Selection Tool", "Table Selection" ) ); @@ -585,7 +586,7 @@ void PageView::setupActions( KActionCollection * ac ) d->aMouseTableSelect->setActionGroup( d->mouseModeActionGroup ); d->aMouseTableSelect->setChecked( Okular::Settings::mouseMode() == Okular::Settings::EnumMouseMode::TableSelect ); - d->aMouseMagnifier = new KAction(QIcon::fromTheme( "document-preview" ), i18n("&Magnifier"), this); + d->aMouseMagnifier = new QAction(QIcon::fromTheme( "document-preview" ), i18n("&Magnifier"), this); ac->addAction("mouse_magnifier", d->aMouseMagnifier ); connect( d->aMouseMagnifier, SIGNAL(triggered()), this, SLOT(slotSetMouseMagnifier()) ); d->aMouseMagnifier->setIconText( i18nc( "Magnifier Tool", "Magnifier" ) ); @@ -607,47 +608,47 @@ void PageView::setupActions( KActionCollection * ac ) ta->addAction( d->aMouseTableSelect ); // speak actions - d->aSpeakDoc = new KAction( QIcon::fromTheme( "text-speak" ), i18n( "Speak Whole Document" ), this ); + d->aSpeakDoc = new QAction( QIcon::fromTheme( "text-speak" ), i18n( "Speak Whole Document" ), this ); ac->addAction( "speak_document", d->aSpeakDoc ); d->aSpeakDoc->setEnabled( false ); connect( d->aSpeakDoc, SIGNAL(triggered()), SLOT(slotSpeakDocument()) ); - d->aSpeakPage = new KAction( QIcon::fromTheme( "text-speak" ), i18n( "Speak Current Page" ), this ); + d->aSpeakPage = new QAction( QIcon::fromTheme( "text-speak" ), i18n( "Speak Current Page" ), this ); ac->addAction( "speak_current_page", d->aSpeakPage ); d->aSpeakPage->setEnabled( false ); connect( d->aSpeakPage, SIGNAL(triggered()), SLOT(slotSpeakCurrentPage()) ); - d->aSpeakStop = new KAction( QIcon::fromTheme( "media-playback-stop" ), i18n( "Stop Speaking" ), this ); + d->aSpeakStop = new QAction( QIcon::fromTheme( "media-playback-stop" ), i18n( "Stop Speaking" ), this ); ac->addAction( "speak_stop_all", d->aSpeakStop ); d->aSpeakStop->setEnabled( false ); connect( d->aSpeakStop, SIGNAL(triggered()), SLOT(slotStopSpeaks()) ); // Other actions - KAction * su = new KAction(i18n("Scroll Up"), this); + QAction * su = new QAction(i18n("Scroll Up"), this); ac->addAction("view_scroll_up", su ); connect( su, SIGNAL(triggered()), this, SLOT(slotAutoScrollUp()) ); su->setShortcut( QKeySequence(Qt::SHIFT + Qt::Key_Up) ); addAction(su); - KAction * sd = new KAction(i18n("Scroll Down"), this); + QAction * sd = new QAction(i18n("Scroll Down"), this); ac->addAction("view_scroll_down", sd ); connect( sd, SIGNAL(triggered()), this, SLOT(slotAutoScrollDown()) ); sd->setShortcut( QKeySequence(Qt::SHIFT + Qt::Key_Down) ); addAction(sd); - KAction * spu = new KAction(i18n("Scroll Page Up"), this); + QAction * spu = new QAction(i18n("Scroll Page Up"), this); ac->addAction( "view_scroll_page_up", spu ); connect( spu, SIGNAL(triggered()), this, SLOT(slotScrollUp()) ); spu->setShortcut( QKeySequence(Qt::SHIFT + Qt::Key_Space) ); addAction( spu ); - KAction * spd = new KAction(i18n("Scroll Page Down"), this); + QAction * spd = new QAction(i18n("Scroll Page Down"), this); ac->addAction( "view_scroll_page_down", spd ); connect( spd, SIGNAL(triggered()), this, SLOT(slotScrollDown()) ); spd->setShortcut( QKeySequence(Qt::Key_Space) ); addAction( spd ); - d->aToggleForms = new KAction( this ); + d->aToggleForms = new QAction( this ); ac->addAction( "view_toggle_forms", d->aToggleForms ); connect( d->aToggleForms, SIGNAL(triggered()), this, SLOT(slotToggleForms()) ); d->aToggleForms->setEnabled( false ); @@ -794,7 +795,7 @@ KActionCollection *PageView::actionCollection() const return d->actionCollection; } -KAction *PageView::toggleFormsAction() const +QAction *PageView::toggleFormsAction() const { return d->aToggleForms; } @@ -2421,7 +2422,7 @@ void PageView::mouseReleaseEvent( QMouseEvent * e ) // handle right click over a link const Okular::Action * link = static_cast< const Okular::Action * >( rect->object() ); // creating the menu and its actions - KMenu menu( this ); + QMenu menu( this ); QAction * actProcessLink = menu.addAction( i18n( "Follow This Link" ) ); QAction * actStopSound = 0; if ( link->actionType() == Okular::Action::Sound ) @@ -2573,11 +2574,11 @@ void PageView::mouseReleaseEvent( QMouseEvent * e ) } // popup that ask to copy:text and copy/save:image - KMenu menu( this ); + QMenu menu( this ); QAction *textToClipboard = 0, *speakText = 0, *imageToClipboard = 0, *imageToFile = 0; if ( d->document->supportsSearching() && !selectedText.isEmpty() ) { - menu.addTitle( i18np( "Text (1 character)", "Text (%1 characters)", selectedText.length() ) ); + menu.setTitle( i18np( "Text (1 character)", "Text (%1 characters)", selectedText.length() ) ); textToClipboard = menu.addAction( QIcon::fromTheme("edit-copy"), i18n( "Copy to Clipboard" ) ); bool copyAllowed = d->document->isAllowed( Okular::AllowCopy ); if ( !copyAllowed ) @@ -2592,7 +2593,7 @@ void PageView::mouseReleaseEvent( QMouseEvent * e ) addWebShortcutsMenu( &menu, selectedText ); } } - menu.addTitle( i18n( "Image (%1 by %2 pixels)", selectionRect.width(), selectionRect.height() ) ); + menu.setTitle( i18n( "Image (%1 by %2 pixels)", selectionRect.width(), selectionRect.height() ) ); imageToClipboard = menu.addAction( QIcon::fromTheme("image-x-generic"), i18n( "Copy to Clipboard" ) ); imageToFile = menu.addAction( QIcon::fromTheme("document-save"), i18n( "Save to File..." ) ); QAction *choice = menu.exec( e->globalPos() ); @@ -2832,7 +2833,7 @@ void PageView::mouseReleaseEvent( QMouseEvent * e ) //if there is text selected in the page if (item && (page = item->page())->textSelection()) { - KMenu menu( this ); + QMenu menu( this ); QAction *textToClipboard = menu.addAction( QIcon::fromTheme( "edit-copy" ), i18n( "Copy Text" ) ); QAction *speakText = 0; QAction *httpLink = 0; @@ -4005,7 +4006,7 @@ void PageView::updatePageStep() { verticalScrollBar()->setPageStep( vs.height() * (100 - Okular::Settings::scrollOverlap()) / 100 ); } -void PageView::addWebShortcutsMenu( KMenu * menu, const QString & text ) +void PageView::addWebShortcutsMenu( QMenu * menu, const QString & text ) { #if KDE_IS_VERSION(4,5,70) if ( text.isEmpty() ) @@ -4031,17 +4032,17 @@ void PageView::addWebShortcutsMenu( KMenu * menu, const QString & text ) if ( !searchProviders.isEmpty() ) { - KMenu *webShortcutsMenu = new KMenu( menu ); + QMenu *webShortcutsMenu = new QMenu( menu ); webShortcutsMenu->setIcon( QIcon::fromTheme( "preferences-web-browser-shortcuts" ) ); const QString squeezedText = KStringHandler::rsqueeze( searchText, 21 ); webShortcutsMenu->setTitle( i18n( "Search for '%1' with", squeezedText ) ); - KAction *action = 0; + QAction *action = 0; foreach( const QString &searchProvider, searchProviders ) { - action = new KAction( searchProvider, webShortcutsMenu ); + action = new QAction( searchProvider, webShortcutsMenu ); action->setIcon( QIcon::fromTheme( filterData.iconNameForPreferredSearchProvider( searchProvider ) ) ); action->setData( filterData.queryForPreferredSearchProvider( searchProvider ) ); connect( action, SIGNAL(triggered()), this, SLOT(slotHandleWebShortcutAction()) ); @@ -4050,7 +4051,7 @@ void PageView::addWebShortcutsMenu( KMenu * menu, const QString & text ) webShortcutsMenu->addSeparator(); - action = new KAction( i18n( "Configure Web Shortcuts..." ), webShortcutsMenu ); + action = new QAction( i18n( "Configure Web Shortcuts..." ), webShortcutsMenu ); action->setIcon( QIcon::fromTheme( "configure" ) ); connect( action, SIGNAL(triggered()), this, SLOT(slotConfigureWebShortcuts()) ); webShortcutsMenu->addAction( action ); @@ -4551,7 +4552,7 @@ void PageView::slotShowSizeAllCursor() void PageView::slotHandleWebShortcutAction() { #if KDE_IS_VERSION(4,5,70) - KAction *action = qobject_cast( sender() ); + QAction *action = qobject_cast( sender() ); if (action) { diff --git a/ui/pageview.h b/ui/pageview.h index a8adb2c13..4f423d72a 100644 --- a/ui/pageview.h +++ b/ui/pageview.h @@ -27,9 +27,7 @@ #include "core/observer.h" #include "core/view.h" -class KAction; class KActionCollection; -class KMenu; namespace Okular { class Action; @@ -97,7 +95,7 @@ Q_OBJECT void reparseConfig(); KActionCollection *actionCollection() const; - KAction *toggleFormsAction() const; + QAction *toggleFormsAction() const; int contentAreaWidth() const; int contentAreaHeight() const; @@ -182,7 +180,7 @@ Q_OBJECT void resizeContentArea( const QSize & newSize ); void updatePageStep(); - void addWebShortcutsMenu( KMenu * menu, const QString & text ); + void addWebShortcutsMenu( QMenu * menu, const QString & text ); // used when selecting stuff, makes the view scroll as necessary to keep the mouse inside the view void scrollPosIntoView( const QPoint & pos ); diff --git a/ui/sidebar.cpp b/ui/sidebar.cpp index ba416e1c1..f27aa4140 100644 --- a/ui/sidebar.cpp +++ b/ui/sidebar.cpp @@ -701,8 +701,8 @@ void Sidebar::saveSplitterSize() const void Sidebar::listContextMenu( const QPoint &pos ) { - KMenu menu( this ); - menu.addTitle( i18n( "Okular" ) ); + QMenu menu( this ); + menu.setTitle( i18n( "Okular" ) ); QAction *showTextAct = menu.addAction( i18n( "Show Text" ) ); showTextAct->setCheckable( true ); showTextAct->setChecked( d->sideDelegate->isTextShown() ); diff --git a/ui/toolaction.cpp b/ui/toolaction.cpp index c61092992..86e8412d4 100644 --- a/ui/toolaction.cpp +++ b/ui/toolaction.cpp @@ -16,7 +16,7 @@ #include ToolAction::ToolAction( QObject *parent ) - : KAction( parent ) + : QAction( parent ) { setText( i18n( "Selection Tools" ) ); } diff --git a/ui/toolaction.h b/ui/toolaction.h index 9e6a3c5f0..b438fa62f 100644 --- a/ui/toolaction.h +++ b/ui/toolaction.h @@ -17,7 +17,7 @@ class QToolButton; -class ToolAction : public KAction +class ToolAction : public QAction { Q_OBJECT