From d02648dd6bebd822267247a3da9f530fc165f7d7 Mon Sep 17 00:00:00 2001 From: dmacvicar Date: Mon, 3 Dec 2007 15:59:25 +0000 Subject: [PATCH] ported everything n pkg selector needed to port the rest of the UI git-svn-id: http://svn.opensuse.org/svn/yast/branches/tmp/coolo/qt4-port@42616 e0cc52ee-31ee-0310-8b87-e83c4596d67c --- src/YQOptionalWidgetFactory.cc | 2 -- src/YQUI_core.cc | 13 ++++--- src/YQWidgetFactory.cc | 3 -- src/pkg/YQPackageSelector.cc | 62 +++++++++++++++----------------- src/pkg/YQPackageSelector.h | 26 +++++++------- src/pkg/YQPackageSelectorBase.cc | 21 ++++++----- src/pkg/YQPackageSelectorBase.h | 10 +++--- src/pkg/YQPkgList.cc | 22 ++++++------ src/pkg/YQPkgList.h | 14 ++++---- src/pkg/YQPkgObjList.cc | 38 ++++++++++---------- src/pkg/YQPkgObjList.h | 59 +++++++++++++++--------------- src/pkg/YQPkgPatchList.cc | 23 ++++++------ src/pkg/YQPkgPatchList.h | 8 ++--- 13 files changed, 142 insertions(+), 159 deletions(-) diff --git a/src/YQOptionalWidgetFactory.cc b/src/YQOptionalWidgetFactory.cc index 3d1477e..e716cf1 100644 --- a/src/YQOptionalWidgetFactory.cc +++ b/src/YQOptionalWidgetFactory.cc @@ -16,8 +16,6 @@ /-*/ -#define QT3_SUPPORT - #include "YQOptionalWidgetFactory.h" #include "YQUI.h" #include "YUIException.h" diff --git a/src/YQUI_core.cc b/src/YQUI_core.cc index 9e58fac..7e876ff 100644 --- a/src/YQUI_core.cc +++ b/src/YQUI_core.cc @@ -16,14 +16,13 @@ /-*/ -#define QT3_SUPPORT #include // MAXHOSTNAMELEN #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -173,7 +172,7 @@ void YQUI::init_ui() } } - _main_win->setCaption( title ); + _main_win->setWindowTitle( title ); // Hide the main window for now. The first call to UI::OpenDialog() on an @@ -202,8 +201,8 @@ void YQUI::init_ui() // and make sure there is no corresponding dlclose(). QString qt_lib_name = QString( QTLIBDIR "/libQtGui.so.%1" ).arg( QT_VERSION >> 16 );; - void * qt_lib = dlopen( qt_lib_name.utf8().constData(), RTLD_GLOBAL ); - y2milestone( "Forcing %s open %s", qt_lib_name.utf8().constData(), + void * qt_lib = dlopen( qt_lib_name.toUtf8().constData(), RTLD_GLOBAL ); + y2milestone( "Forcing %s open %s", qt_lib_name.toUtf8().constData(), qt_lib ? "successful" : "failed" ); // Init other stuff diff --git a/src/YQWidgetFactory.cc b/src/YQWidgetFactory.cc index f47c27c..82b97fe 100644 --- a/src/YQWidgetFactory.cc +++ b/src/YQWidgetFactory.cc @@ -16,7 +16,6 @@ /-*/ -#define QT3_SUPPORT #include #include "YQWidgetFactory.h" #include "YQUI.h" @@ -25,10 +24,8 @@ #include - using std::string; - YQWidgetFactory::YQWidgetFactory() : YWidgetFactory() { diff --git a/src/pkg/YQPackageSelector.cc b/src/pkg/YQPackageSelector.cc index 11f085d..d01f1c2 100644 --- a/src/pkg/YQPackageSelector.cc +++ b/src/pkg/YQPackageSelector.cc @@ -28,23 +28,21 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//Added by qt3to4: -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define y2log_component "qt-pkg" #include @@ -206,6 +204,7 @@ YQPackageSelector::YQPackageSelector( YWidget * parent, // Fire up the first dependency check in the main loop. // Don't do this right away - wait until all initializations are finished. QTimer::singleShot( 0, this, SLOT( resolveDependencies() ) ); + } #endif } @@ -611,7 +610,7 @@ YQPackageSelector::addMenus() // File menu // - _fileMenu = new Q3PopupMenu( _menuBar ); + _fileMenu = new QMenu( _menuBar ); Q_CHECK_PTR( _fileMenu ); _menuBar->insertItem( _( "&File" ), _fileMenu ); @@ -630,7 +629,7 @@ YQPackageSelector::addMenus() // View menu // - _viewMenu = new Q3PopupMenu( _menuBar ); + _viewMenu = new QMenu( _menuBar ); Q_CHECK_PTR( _viewMenu ); _menuBar->insertItem( _( "&View" ), _viewMenu ); @@ -655,7 +654,7 @@ YQPackageSelector::addMenus() // Package menu // - _pkgMenu = new Q3PopupMenu( _menuBar ); + _pkgMenu = new QMenu( _menuBar ); Q_CHECK_PTR( _pkgMenu ); _menuBar->insertItem( _( "&Package" ), _pkgMenu ); @@ -673,7 +672,7 @@ YQPackageSelector::addMenus() _pkgList->actionDontInstallSourceRpm->addTo( _pkgMenu ); _pkgMenu->insertSeparator(); - Q3PopupMenu * submenu = _pkgList->addAllInListSubMenu( _pkgMenu ); + QMenu * submenu = _pkgList->addAllInListSubMenu( _pkgMenu ); Q_CHECK_PTR( submenu ); submenu->insertSeparator(); @@ -685,7 +684,7 @@ YQPackageSelector::addMenus() // Submenu for all packages // - submenu = new Q3PopupMenu( _pkgMenu ); + submenu = new QMenu( _pkgMenu ); Q_CHECK_PTR( submenu ); // Translators: Unlike the "all in this list" submenu, this submenu @@ -707,7 +706,7 @@ YQPackageSelector::addMenus() // Patch menu // - _patchMenu = new Q3PopupMenu( _menuBar ); + _patchMenu = new QMenu( _menuBar ); Q_CHECK_PTR( _patchMenu ); _menuBar->insertItem( _( "&Patch" ), _patchMenu ); @@ -729,7 +728,7 @@ YQPackageSelector::addMenus() // Extras menu // - _extrasMenu = new Q3PopupMenu( _menuBar ); + _extrasMenu = new QMenu( _menuBar ); Q_CHECK_PTR( _extrasMenu ); _menuBar->insertItem( _( "&Extras" ), _extrasMenu ); @@ -765,7 +764,7 @@ YQPackageSelector::addMenus() // Help menu // - _helpMenu = new Q3PopupMenu( _menuBar ); + _helpMenu = new QMenu( _menuBar ); Q_CHECK_PTR( _helpMenu ); _menuBar->insertSeparator(); _menuBar->insertItem( _( "&Help" ), _helpMenu ); @@ -916,11 +915,8 @@ YQPackageSelector::makeConnections() // Hotkey to enable "patches" filter view on the fly // - Q3Accel * accel = new Q3Accel( this ); + QShortcut * accel = new QShortcut( Qt::Key_F2, this, SLOT( hotkeyInsertPatchFilterView() ) ); Q_CHECK_PTR( accel ); - accel->connectItem( accel->insertItem( Qt::Key_F2 ), - this, SLOT( hotkeyInsertPatchFilterView() ) ); - // // Update actions just before opening menus @@ -1113,11 +1109,9 @@ YQPackageSelector::pkgExport() void YQPackageSelector::pkgImport() { - QString filename = Q3FileDialog::getOpenFileName( DEFAULT_EXPORT_FILE_NAME, // startsWith - "*.xml+;;*", // filter - this, // parent - 0, // name - _( "Load Package List" ) ); // caption + QString filename = QFileDialog::getOpenFileName( this, _( "Load Package List" ), DEFAULT_EXPORT_FILE_NAME, // startsWi + "*.xml+;;*"// filter + ); if ( ! filename.isEmpty() ) { diff --git a/src/pkg/YQPackageSelector.h b/src/pkg/YQPackageSelector.h index ddccb3e..6fac60c 100644 --- a/src/pkg/YQPackageSelector.h +++ b/src/pkg/YQPackageSelector.h @@ -20,11 +20,9 @@ #ifndef YQPackageSelector_h #define YQPackageSelector_h -#include -#include -//Added by qt3to4: -#include -#include +#include +#include +#include #include #include "YQPackageSelectorBase.h" @@ -33,12 +31,12 @@ class QCheckBox; class QComboBox; class QLabel; -class Q3ListView; -class Q3ProgressBar; +class QListWidget; +class QProgressBar; class QPushButton; class QSplitter; class QTabWidget; -class Q3PopupMenu; +class QMenu; class QMenuBar; class QY2ComboTabWidget; @@ -317,12 +315,12 @@ protected: YQPkgPatchList * _patchList; QMenuBar * _menuBar; - Q3PopupMenu * _fileMenu; - Q3PopupMenu * _viewMenu; - Q3PopupMenu * _pkgMenu; - Q3PopupMenu * _patchMenu; - Q3PopupMenu * _extrasMenu; - Q3PopupMenu * _helpMenu; + QMenu * _fileMenu; + QMenu * _viewMenu; + QMenu * _pkgMenu; + QMenu * _patchMenu; + QMenu * _extrasMenu; + QMenu * _helpMenu; int _viewShowDevelID; int _viewShowDebugInfoID; diff --git a/src/pkg/YQPackageSelectorBase.cc b/src/pkg/YQPackageSelectorBase.cc index df3aedf..de96f39 100644 --- a/src/pkg/YQPackageSelectorBase.cc +++ b/src/pkg/YQPackageSelectorBase.cc @@ -18,14 +18,13 @@ /-*/ -#include -//Added by qt3to4: -#include +#include +#include #define y2log_component "qt-pkg" #include -#include +#include #include "QY2LayoutUtils.h" #include "YQPackageSelectorBase.h" @@ -50,11 +49,16 @@ using std::string; YQPackageSelectorBase::YQPackageSelectorBase( YWidget * parent, long modeFlags ) - : Q3VBox( (QWidget *) parent->widgetRep() ) + : QWidget( (QWidget *) parent->widgetRep() ) , YPackageSelector( parent, modeFlags ) { setWidgetRep( this ); +// QVBoxLayout *layout = new QVBoxLayout; +// layout->addWidget(child1); +// layout->addWidget(child2); +// setLayout(layout); + _showChangesDialog = false; _pkgConflictDialog = 0; _diskUsageList = 0; @@ -68,10 +72,9 @@ YQPackageSelectorBase::YQPackageSelectorBase( YWidget * parent, Q_CHECK_PTR( _pkgConflictDialog ); QString label = _( "Reset &Ignored Dependency Conflicts" ); - _actionResetIgnoredDependencyProblems = new Q3Action( label, // text - label, // menu text - (QKeySequence) 0, // accel - this ); // parent + _actionResetIgnoredDependencyProblems = new QAction( label, this); + _actionResetIgnoredDependencyProblems->setShortcut((QKeySequence) 0); + //_actionResetIgnoredDependencyProblems->setMenuRole(QAction::TextHeuristicRole); Q_CHECK_PTR( _actionResetIgnoredDependencyProblems ); connect( _actionResetIgnoredDependencyProblems, SIGNAL( activated() ), diff --git a/src/pkg/YQPackageSelectorBase.h b/src/pkg/YQPackageSelectorBase.h index 8088e98..2569dbe 100644 --- a/src/pkg/YQPackageSelectorBase.h +++ b/src/pkg/YQPackageSelectorBase.h @@ -20,15 +20,13 @@ #ifndef YQPackageSelectorBase_h #define YQPackageSelectorBase_h -#include -//Added by qt3to4: -#include +#include #include "YPackageSelector.h" #include "YQZypp.h" class QY2ComboTabWidget; -class Q3Action; +class QAction; class YQPkgConflictDialog; class YQPkgDiskUsageList; @@ -37,7 +35,7 @@ class YQPkgDiskUsageList; /** * Abstract base class for package selectors. **/ -class YQPackageSelectorBase : public Q3VBox, public YPackageSelector +class YQPackageSelectorBase : public QWidget, public YPackageSelector { Q_OBJECT @@ -198,7 +196,7 @@ protected: bool _showChangesDialog; YQPkgConflictDialog * _pkgConflictDialog; YQPkgDiskUsageList * _diskUsageList; - Q3Action * _actionResetIgnoredDependencyProblems; + QAction * _actionResetIgnoredDependencyProblems; }; diff --git a/src/pkg/YQPkgList.cc b/src/pkg/YQPkgList.cc index 81b7882..e208fee 100644 --- a/src/pkg/YQPkgList.cc +++ b/src/pkg/YQPkgList.cc @@ -22,10 +22,10 @@ #define y2log_component "qt-pkg" #include -#include -#include -#include -#include +#include +#include +#include +#include #include "utf8.h" @@ -178,12 +178,12 @@ YQPkgList::sizeHint() const void YQPkgList::createSourceRpmContextMenu() { - _sourceRpmContextMenu = new Q3PopupMenu( this ); + _sourceRpmContextMenu = new QMenu( this ); actionInstallSourceRpm->addTo( _sourceRpmContextMenu ); actionDontInstallSourceRpm->addTo( _sourceRpmContextMenu ); - Q3PopupMenu * submenu = new Q3PopupMenu( _sourceRpmContextMenu ); + QMenu * submenu = new QMenu( _sourceRpmContextMenu ); Q_CHECK_PTR( submenu ); _sourceRpmContextMenu->insertItem( _( "&All in This List" ), submenu ); @@ -246,7 +246,7 @@ YQPkgList::setInstallListSourceRpms( bool installSourceRpm ) void YQPkgList::createNotInstalledContextMenu() { - _notInstalledContextMenu = new Q3PopupMenu( this ); + _notInstalledContextMenu = new QMenu( this ); Q_CHECK_PTR( _notInstalledContextMenu ); actionSetCurrentInstall->addTo( _notInstalledContextMenu ); @@ -265,7 +265,7 @@ YQPkgList::createNotInstalledContextMenu() void YQPkgList::createInstalledContextMenu() { - _installedContextMenu = new Q3PopupMenu( this ); + _installedContextMenu = new QMenu( this ); Q_CHECK_PTR( _installedContextMenu ); actionSetCurrentKeepInstalled->addTo( _installedContextMenu ); @@ -281,10 +281,10 @@ YQPkgList::createInstalledContextMenu() } -Q3PopupMenu * -YQPkgList::addAllInListSubMenu( Q3PopupMenu * menu ) +QMenu * +YQPkgList::addAllInListSubMenu( QMenu * menu ) { - Q3PopupMenu * submenu = new Q3PopupMenu( menu ); + QMenu * submenu = new QMenu( menu ); Q_CHECK_PTR( submenu ); actionSetListInstall->addTo( submenu ); diff --git a/src/pkg/YQPkgList.h b/src/pkg/YQPkgList.h index 5c8c6d0..04e9495 100644 --- a/src/pkg/YQPkgList.h +++ b/src/pkg/YQPkgList.h @@ -22,7 +22,7 @@ #include //Added by qt3to4: -#include +#include class YQPkgListItem; @@ -65,7 +65,7 @@ public: * * Reimplemented from YQPkgObjList. **/ - virtual Q3PopupMenu * addAllInListSubMenu( Q3PopupMenu * menu ); + virtual QMenu * addAllInListSubMenu( QMenu * menu ); /** * Returns 'true' if there are any installed packages. @@ -198,15 +198,15 @@ protected: // Data members int _srpmStatusCol; - Q3PopupMenu * _sourceRpmContextMenu; + QMenu * _sourceRpmContextMenu; public: - Q3Action * actionInstallSourceRpm; - Q3Action * actionDontInstallSourceRpm; - Q3Action * actionInstallListSourceRpms; - Q3Action * actionDontInstallListSourceRpms; + QAction * actionInstallSourceRpm; + QAction * actionDontInstallSourceRpm; + QAction * actionInstallListSourceRpms; + QAction * actionDontInstallListSourceRpms; }; diff --git a/src/pkg/YQPkgObjList.cc b/src/pkg/YQPkgObjList.cc index d088e24..fd69de1 100644 --- a/src/pkg/YQPkgObjList.cc +++ b/src/pkg/YQPkgObjList.cc @@ -20,10 +20,10 @@ #define y2log_component "qt-pkg" #include -#include -#include -#include -#include +#include +#include +#include +#include //Added by qt3to4: #include @@ -145,7 +145,7 @@ YQPkgObjList::pkgObjClicked( int button, { updateActions( item ); - Q3PopupMenu * contextMenu = + QMenu * contextMenu = item->selectable()->hasInstalledObj() ? installedContextMenu() : notInstalledContextMenu(); @@ -407,7 +407,7 @@ YQPkgObjList::createActions() -Q3Action * +QAction * YQPkgObjList::createAction( ZyppStatus status, const QString & key, bool enabled ) { return createAction( statusText( status ), @@ -418,7 +418,7 @@ YQPkgObjList::createAction( ZyppStatus status, const QString & key, bool enabled } -Q3Action * +QAction * YQPkgObjList::createAction( const QString & text, const QPixmap & icon, const QPixmap & insensitiveIcon, @@ -440,13 +440,11 @@ YQPkgObjList::createAction( const QString & text, QIcon::Disabled ); } - Q3Action * action = new Q3Action( label, // text - iconSet, // icon set - label, // menu text - 0, // accel key + QAction * action = new QAction( label, // text this ); // parent Q_CHECK_PTR( action ); action->setEnabled( enabled ); + action->setIcon( iconSet ); return action; } @@ -455,7 +453,7 @@ YQPkgObjList::createAction( const QString & text, void YQPkgObjList::createNotInstalledContextMenu() { - _notInstalledContextMenu = new Q3PopupMenu( this ); + _notInstalledContextMenu = new QMenu( this ); Q_CHECK_PTR( _notInstalledContextMenu ); actionSetCurrentInstall->addTo( _notInstalledContextMenu ); @@ -469,7 +467,7 @@ YQPkgObjList::createNotInstalledContextMenu() void YQPkgObjList::createInstalledContextMenu() { - _installedContextMenu = new Q3PopupMenu( this ); + _installedContextMenu = new QMenu( this ); Q_CHECK_PTR( _installedContextMenu ); actionSetCurrentKeepInstalled->addTo( _installedContextMenu ); @@ -480,10 +478,10 @@ YQPkgObjList::createInstalledContextMenu() } -Q3PopupMenu * -YQPkgObjList::addAllInListSubMenu( Q3PopupMenu * menu ) +QMenu * +YQPkgObjList::addAllInListSubMenu( QMenu * menu ) { - Q3PopupMenu * submenu = new Q3PopupMenu( menu ); + QMenu * submenu = new QMenu( menu ); Q_CHECK_PTR( submenu ); actionSetListInstall->addTo( submenu ); @@ -500,7 +498,7 @@ YQPkgObjList::addAllInListSubMenu( Q3PopupMenu * menu ) } -Q3PopupMenu * +QMenu * YQPkgObjList::notInstalledContextMenu() { if ( ! _notInstalledContextMenu ) @@ -510,7 +508,7 @@ YQPkgObjList::notInstalledContextMenu() } -Q3PopupMenu * +QMenu * YQPkgObjList::installedContextMenu() { if ( ! _installedContextMenu ) @@ -829,7 +827,7 @@ YQPkgObjList::exclude( YQPkgObjListItem * item, bool exclude ) if ( parentItem ) parentItem->takeItem( item ); else - Q3ListView::takeItem( item ); + QTreeWidget::takeItem( item ); _excludedItems->add( item, parentItem ); } @@ -843,7 +841,7 @@ YQPkgObjList::exclude( YQPkgObjListItem * item, bool exclude ) if ( oldParent ) oldParent->insertItem( item ); else - Q3ListView::insertItem( item ); + QTreeWidget::insertItem( item ); } } #endif diff --git a/src/pkg/YQPkgObjList.h b/src/pkg/YQPkgObjList.h index 50c0291..54f7fa3 100644 --- a/src/pkg/YQPkgObjList.h +++ b/src/pkg/YQPkgObjList.h @@ -20,11 +20,10 @@ #ifndef YQPkgObjList_h #define YQPkgObjList_h -#include -#include -//Added by qt3to4: -#include -#include +#include +#include +#include +#include #include #include #include @@ -33,8 +32,8 @@ #include class YQPkgObjListItem; -class Q3Action; -class Q3PopupMenu; +class QAction; +class QMenu; using std::string; using std::list; @@ -107,7 +106,7 @@ public: * Add a submenu "All in this list..." to 'menu'. * Returns the newly created submenu. **/ - virtual Q3PopupMenu * addAllInListSubMenu( Q3PopupMenu * menu ); + virtual QMenu * addAllInListSubMenu( QMenu * menu ); /** * Returns the suitable icon for a zypp::ResObject status - the regular @@ -286,13 +285,13 @@ protected: * Returns the context menu for items that are not installed. * Creates the menu upon the first call. **/ - virtual Q3PopupMenu * installedContextMenu(); + virtual QMenu * installedContextMenu(); /** * Returns the context menu for items that are installed. * Creates the menu upon the first call. **/ - virtual Q3PopupMenu * notInstalledContextMenu(); + virtual QMenu * notInstalledContextMenu(); /** * Create the context menu for items that are not installed. @@ -315,7 +314,7 @@ protected: * retrieve the corresponding status icons (both sensitive and insensitive) * and text. 'key' is only a descriptive text, no true accelerator. **/ - Q3Action * createAction( ZyppStatus status, + QAction * createAction( ZyppStatus status, const QString & key = QString::null, bool enabled = false ); @@ -323,7 +322,7 @@ protected: * Low-level: Create an action. * 'key' is only a descriptive text, no true accelerator. **/ - Q3Action * createAction( const QString & text, + QAction * createAction( const QString & text, const QPixmap & icon = QPixmap(), const QPixmap & insensitiveIcon = QPixmap(), const QString & key = QString::null, @@ -349,28 +348,28 @@ protected: ExcludeRuleList _excludeRules; ExcludedItems * _excludedItems; - Q3PopupMenu * _installedContextMenu; - Q3PopupMenu * _notInstalledContextMenu; + QMenu * _installedContextMenu; + QMenu * _notInstalledContextMenu; public: - Q3Action * actionSetCurrentInstall; - Q3Action * actionSetCurrentDontInstall; - Q3Action * actionSetCurrentKeepInstalled; - Q3Action * actionSetCurrentDelete; - Q3Action * actionSetCurrentUpdate; - Q3Action * actionSetCurrentTaboo; - Q3Action * actionSetCurrentProtected; - - Q3Action * actionSetListInstall; - Q3Action * actionSetListDontInstall; - Q3Action * actionSetListKeepInstalled; - Q3Action * actionSetListDelete; - Q3Action * actionSetListUpdate; - Q3Action * actionSetListUpdateForce; - Q3Action * actionSetListTaboo; - Q3Action * actionSetListProtected; + QAction * actionSetCurrentInstall; + QAction * actionSetCurrentDontInstall; + QAction * actionSetCurrentKeepInstalled; + QAction * actionSetCurrentDelete; + QAction * actionSetCurrentUpdate; + QAction * actionSetCurrentTaboo; + QAction * actionSetCurrentProtected; + + QAction * actionSetListInstall; + QAction * actionSetListDontInstall; + QAction * actionSetListKeepInstalled; + QAction * actionSetListDelete; + QAction * actionSetListUpdate; + QAction * actionSetListUpdateForce; + QAction * actionSetListTaboo; + QAction * actionSetListProtected; public: diff --git a/src/pkg/YQPkgPatchList.cc b/src/pkg/YQPkgPatchList.cc index cf26519..fb6ee09 100644 --- a/src/pkg/YQPkgPatchList.cc +++ b/src/pkg/YQPkgPatchList.cc @@ -22,10 +22,9 @@ #define y2log_component "qt-pkg" #include -#include -#include -//Added by qt3to4: -#include +#include +#include +#include #include #include @@ -71,7 +70,7 @@ YQPkgPatchList::YQPkgPatchList( QWidget * parent ) setAllColumnsShowFocus( true ); setColumnAlignment( sizeCol(), Qt::AlignRight ); - connect( this, SIGNAL( selectionChanged ( Q3ListViewItem * ) ), + connect( this, SIGNAL( selectionChanged ( QTreeWidgetItem * ) ), this, SLOT ( filter() ) ); setSorting( categoryCol() ); @@ -356,7 +355,7 @@ YQPkgPatchListItem * YQPkgPatchList::selection() const { #if FIXME - Q3ListViewItem * item = selectedItem(); + QTreeWidgetItem * item = selectedItem(); if ( ! item ) return 0; @@ -371,7 +370,7 @@ YQPkgPatchList::selection() const void YQPkgPatchList::createNotInstalledContextMenu() { - _notInstalledContextMenu = new Q3PopupMenu( this ); + _notInstalledContextMenu = new QMenu( this ); Q_CHECK_PTR( _notInstalledContextMenu ); actionSetCurrentInstall->addTo( _notInstalledContextMenu ); @@ -385,7 +384,7 @@ YQPkgPatchList::createNotInstalledContextMenu() void YQPkgPatchList::createInstalledContextMenu() { - _installedContextMenu = new Q3PopupMenu( this ); + _installedContextMenu = new QMenu( this ); Q_CHECK_PTR( _installedContextMenu ); actionSetCurrentKeepInstalled->addTo( _installedContextMenu ); @@ -401,10 +400,10 @@ YQPkgPatchList::createInstalledContextMenu() } -Q3PopupMenu * -YQPkgPatchList::addAllInListSubMenu( Q3PopupMenu * menu ) +QMenu * +YQPkgPatchList::addAllInListSubMenu( QMenu * menu ) { - Q3PopupMenu * submenu = new Q3PopupMenu( menu ); + QMenu * submenu = new QMenu( menu ); Q_CHECK_PTR( submenu ); actionSetListInstall->addTo( submenu ); @@ -434,7 +433,7 @@ YQPkgPatchList::keyPressEvent( QKeyEvent * event ) #if ! ENABLE_DELETING_PATCHES if ( event->ascii() == '-' ) { - Q3ListViewItem * selectedListViewItem = selectedItem(); + QTreeWidgetItem * selectedListViewItem = currentItem(); if ( selectedListViewItem ) { diff --git a/src/pkg/YQPkgPatchList.h b/src/pkg/YQPkgPatchList.h index dbf3cc9..ef698ed 100644 --- a/src/pkg/YQPkgPatchList.h +++ b/src/pkg/YQPkgPatchList.h @@ -24,9 +24,9 @@ #include "YQPkgObjList.h" #include "YQPkgSelMapper.h" //Added by qt3to4: -#include -#include -#include +#include +#include +#include #define ENABLE_DELETING_PATCHES 1 @@ -140,7 +140,7 @@ public: * * Reimplemented from YQPkgObjList. **/ - virtual Q3PopupMenu * addAllInListSubMenu( Q3PopupMenu * menu ); + virtual QMenu * addAllInListSubMenu( QMenu * menu ); /** * Delayed initialization after the dialog is fully created. -- 2.39.2