[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdevplatform/5.0] plugins/quickopen: Factor out QuickOpenWidget into own files
From: Kevin Funk <kfunk () kde ! org>
Date: 2016-02-14 23:26:21
Message-ID: E1aV63Z-0002ht-Rz () scm ! kde ! org
[Download RAW message or body]
Git commit 3cbd4d8d52d72c7ca3c4ff6a6b81e06b9b0ff8c3 by Kevin Funk.
Committed on 14/02/2016 at 23:25.
Pushed by kfunk into branch '5.0'.
Factor out QuickOpenWidget into own files
M +3 -10 plugins/quickopen/CMakeLists.txt
M +2 -471 plugins/quickopen/quickopenplugin.cpp
M +1 -80 plugins/quickopen/quickopenplugin.h
A +511 -0 plugins/quickopen/quickopenwidget.cpp [License: LGPL (v2+)]
A +110 -0 plugins/quickopen/quickopenwidget.h [License: LGPL (v2+)]
R +12 -3 plugins/quickopen/quickopenwidget.ui [from: \
plugins/quickopen/quickopen.ui - 093% similarity]
http://commits.kde.org/kdevplatform/3cbd4d8d52d72c7ca3c4ff6a6b81e06b9b0ff8c3
diff --git a/plugins/quickopen/CMakeLists.txt b/plugins/quickopen/CMakeLists.txt
index e580751..2867a4b 100644
--- a/plugins/quickopen/CMakeLists.txt
+++ b/plugins/quickopen/CMakeLists.txt
@@ -1,11 +1,10 @@
add_definitions(-DTRANSLATION_DOMAIN=\"kdevquickopen\")
add_subdirectory( tests )
-########### next target ###############
-
set(kdevquickopen_PART_SRCS
quickopenplugin.cpp
quickopenmodel.cpp
+ quickopenwidget.cpp
projectfilequickopen.cpp
duchainitemquickopen.cpp
declarationlistquickopen.cpp
@@ -16,15 +15,9 @@ set(kdevquickopen_PART_SRCS
expandingtree/expandingtree.cpp
expandingtree/expandingwidgetmodel.cpp
)
-
-set (
- kdevquickopen_UI
- quickopen.ui
+ki18n_wrap_ui(kdevquickopen_PART_SRCS
+ quickopenwidget.ui
)
-
-ki18n_wrap_ui(kdevquickopen_PART_SRCS ${kdevquickopen_UI})
-
qt5_add_resources(kdevquickopen_PART_SRCS kdevquickopen.qrc)
kdevplatform_add_plugin(kdevquickopen JSON kdevquickopen.json SOURCES \
${kdevquickopen_PART_SRCS}) target_link_libraries(kdevquickopen KF5::IconThemes \
KF5::GuiAddons KF5::TextEditor KDev::Language KDev::Interfaces KDev::Project \
KDev::Util)
-
diff --git a/plugins/quickopen/quickopenplugin.cpp \
b/plugins/quickopen/quickopenplugin.cpp index 33797d9..6a557da 100644
--- a/plugins/quickopen/quickopenplugin.cpp
+++ b/plugins/quickopen/quickopenplugin.cpp
@@ -21,6 +21,8 @@
#include "quickopenplugin.h"
+#include "quickopenwidget.h"
+
#include <cassert>
#include <typeinfo>
#include <QTreeView>
@@ -63,7 +65,6 @@
#include <serialization/indexedstring.h>
#include <language/duchain/types/functiontype.h>
-#include "expandingtree/expandingdelegate.h"
#include "ui_quickopen.h"
#include "quickopenmodel.h"
#include "projectfilequickopen.h"
@@ -132,20 +133,6 @@ class StandardQuickOpenWidgetCreator : public \
QuickOpenWidgetCreator { QStringList m_scopes;
};
-class QuickOpenDelegate : public ExpandingDelegate {
- Q_OBJECT
-public:
- QuickOpenDelegate(ExpandingWidgetModel* model, QObject* parent = 0L) : \
ExpandingDelegate(model, parent) {
- }
- QList<QTextLayout::FormatRange> createHighlighting(const QModelIndex& index, \
QStyleOptionViewItem& option) const override {
- QList<QVariant> highlighting = \
index.data(KTextEditor::CodeCompletionModel::CustomHighlight).toList();
- if(!highlighting.isEmpty())
- return highlightingFromVariantList(highlighting);
- return ExpandingDelegate::createHighlighting( index, option );
- }
-
-};
-
class OutlineFilter : public DUChainUtils::DUChainItemFilter {
public:
enum OutlineMode { Functions, FunctionsAndClasses };
@@ -255,462 +242,6 @@ QuickOpenLineEdit* QuickOpenPlugin::createQuickOpenLineWidget()
return new QuickOpenLineEdit(new StandardQuickOpenWidgetCreator(QStringList(), \
QStringList())); }
-void QuickOpenWidget::showStandardButtons(bool show)
-{
- if(show) {
- o.okButton->show();
- o.cancelButton->show();
- }else{
- o.okButton->hide();
- o.cancelButton->hide();
- }
-}
-
-QuickOpenWidget::QuickOpenWidget( QString title, QuickOpenModel* model, const \
QStringList& initialItems, const QStringList& initialScopes, bool listOnly, bool \
noSearchField ) : m_model(model), m_expandedTemporary(false) {
- m_filterTimer.setSingleShot(true);
- connect(&m_filterTimer, &QTimer::timeout, this, &QuickOpenWidget::applyFilter);
-
- Q_UNUSED( title );
- o.setupUi( this );
- o.list->header()->hide();
- o.list->setRootIsDecorated( false );
- o.list->setVerticalScrollMode( QAbstractItemView::ScrollPerItem );
-
- connect(o.list->verticalScrollBar(), &QScrollBar::valueChanged, m_model, \
&QuickOpenModel::placeExpandingWidgets);
-
- o.searchLine->setFocus();
-
- o.list->setItemDelegate( new QuickOpenDelegate( m_model, o.list ) );
-
- if(!listOnly) {
- QStringList allTypes = m_model->allTypes();
- QStringList allScopes = m_model->allScopes();
-
- QMenu* itemsMenu = new QMenu(this);
-
- foreach( const QString &type, allTypes )
- {
- QAction* action = new QAction(type, itemsMenu);
- action->setCheckable(true);
- action->setChecked(initialItems.isEmpty() || initialItems.contains( type ));
- connect( action, &QAction::toggled, this, &QuickOpenWidget::updateProviders, \
Qt::QueuedConnection );
- itemsMenu->addAction(action);
- }
-
- o.itemsButton->setMenu(itemsMenu);
-
- QMenu* scopesMenu = new QMenu(this);
-
- foreach( const QString &scope, allScopes )
- {
- QAction* action = new QAction(scope, scopesMenu);
- action->setCheckable(true);
- action->setChecked(initialScopes.isEmpty() || initialScopes.contains( scope ) \
);
-
- connect( action, &QAction::toggled, this, &QuickOpenWidget::updateProviders, \
Qt::QueuedConnection );
- scopesMenu->addAction(action);
- }
-
- o.scopesButton->setMenu(scopesMenu);
-
- }else{
- o.list->setFocusPolicy(Qt::StrongFocus);
- o.scopesButton->hide();
- o.itemsButton->hide();
- o.label->hide();
- o.label_2->hide();
- }
-
- showSearchField(!noSearchField);
-
- o.okButton->hide();
- o.cancelButton->hide();
-
- o.searchLine->installEventFilter( this );
- o.list->installEventFilter( this );
- o.list->setFocusPolicy(Qt::NoFocus);
- o.scopesButton->setFocusPolicy(Qt::NoFocus);
- o.itemsButton->setFocusPolicy(Qt::NoFocus);
-
- connect( o.searchLine, &QLineEdit::textChanged, this, \
&QuickOpenWidget::textChanged );
-
- connect( o.list, &ExpandingTree::doubleClicked, this, \
&QuickOpenWidget::doubleClicked );
-
- connect(o.okButton, &QPushButton::clicked, this, &QuickOpenWidget::accept);
- connect(o.okButton, &QPushButton::clicked, this, &QuickOpenWidget::ready);
- connect(o.cancelButton, &QPushButton::clicked, this, &QuickOpenWidget::ready);
-
- updateProviders();
- updateTimerInterval(true);
-
-// no need to call this, it's done by updateProviders already
-// m_model->restart();
-}
-
-void QuickOpenWidget::updateTimerInterval(bool cheapFilterChange)
-{
- const int MAX_ITEMS = 10000;
- if ( cheapFilterChange && m_model->rowCount(QModelIndex()) < MAX_ITEMS ) {
- // cheap change and there are currently just a few items,
- // so apply filter instantly
- m_filterTimer.setInterval(0);
- } else if ( m_model->unfilteredRowCount() < MAX_ITEMS ) {
- // not a cheap change, but there are generally
- // just a few items in the list: apply filter instantly
- m_filterTimer.setInterval(0);
- } else {
- // otherwise use a timer to prevent sluggishness while typing
- m_filterTimer.setInterval(300);
- }
-}
-
-void QuickOpenWidget::showEvent(QShowEvent* e)
-{
- QWidget::showEvent(e);
-
- // The column width only has an effect _after_ the widget has been shown
- o.list->setColumnWidth( 0, 20 );
-}
-
-void QuickOpenWidget::setAlternativeSearchField(QLineEdit* alterantiveSearchField)
-{
- o.searchLine = alterantiveSearchField;
- o.searchLine->installEventFilter( this );
- connect( o.searchLine, &QLineEdit::textChanged, this, \
&QuickOpenWidget::textChanged );
-}
-
-
-void QuickOpenWidget::showSearchField(bool b)
-{
- if(b){
- o.searchLine->show();
- o.searchLabel->show();
- }else{
- o.searchLine->hide();
- o.searchLabel->hide();
- }
-}
-
-void QuickOpenWidget::prepareShow()
-{
- o.list->setModel( 0 );
- o.list->setVerticalScrollMode(QAbstractItemView::ScrollPerItem);
- m_model->setTreeView( o.list );
- o.list->setModel( m_model );
-
- m_filterTimer.stop();
- m_filter = QString();
-
- if (!m_preselectedText.isEmpty())
- {
- o.searchLine->setText(m_preselectedText);
- o.searchLine->selectAll();
- }
-
- m_model->restart(false);
-
- connect( o.list->selectionModel(), &QItemSelectionModel::currentRowChanged,
- this, &QuickOpenWidget::callRowSelected );
- connect( o.list->selectionModel(), &QItemSelectionModel::selectionChanged,
- this, &QuickOpenWidget::callRowSelected );
-}
-
-void QuickOpenWidgetDialog::run() {
- m_widget->prepareShow();
- m_dialog->show();
-}
-
-QuickOpenWidget::~QuickOpenWidget() {
- m_model->setTreeView( 0 );
-}
-
-
-QuickOpenWidgetDialog::QuickOpenWidgetDialog(QString title, QuickOpenModel* model, \
const QStringList& initialItems, const QStringList& initialScopes, bool listOnly, \
bool noSearchField)
-{
- m_widget = new QuickOpenWidget(title, model, initialItems, initialScopes, \
listOnly, noSearchField);
- // the QMenu might close on esc and we want to close the whole dialog then
- connect( m_widget, &QuickOpenWidget::aboutToHide, this, \
&QuickOpenWidgetDialog::deleteLater );
-
- m_dialog = new QDialog( ICore::self()->uiController()->activeMainWindow() );
- m_dialog->resize(QSize(800, 400));
-
- m_dialog->setWindowTitle(title);
- QVBoxLayout* layout = new QVBoxLayout(m_dialog);
- layout->addWidget(m_widget);
- m_widget->showStandardButtons(true);
- connect(m_widget, &QuickOpenWidget::ready, m_dialog, &QDialog::close);
- connect( m_dialog, &QDialog::accepted, m_widget, &QuickOpenWidget::accept );
-}
-
-
-QuickOpenWidgetDialog::~QuickOpenWidgetDialog()
-{
- delete m_dialog;
-}
-
-void QuickOpenWidget::setPreselectedText(const QString& text)
-{
- m_preselectedText = text;
-}
-
-void QuickOpenWidget::updateProviders() {
- if(QAction* action = qobject_cast<QAction*>(sender())) {
- QMenu* menu = qobject_cast<QMenu*>(action->parentWidget());
- if(menu) {
- menu->show();
- menu->setActiveAction(action);
- }
- }
-
- QStringList checkedItems;
-
- if(o.itemsButton->menu()) {
-
- foreach( QObject* obj, o.itemsButton->menu()->children() ) {
- QAction* box = qobject_cast<QAction*>( obj );
- if( box ) {
- if( box->isChecked() )
- checkedItems << box->text().remove('&');
- }
- }
- o.itemsButton->setText(checkedItems.join(QStringLiteral(", ")));
- }
-
- QStringList checkedScopes;
-
- if(o.scopesButton->menu()) {
-
- foreach( QObject* obj, o.scopesButton->menu()->children() ) {
- QAction* box = qobject_cast<QAction*>( obj );
- if( box ) {
- if( box->isChecked() )
- checkedScopes << box->text().remove('&');
- }
- }
-
- o.scopesButton->setText(checkedScopes.join(QStringLiteral(", ")));
- }
-
- emit itemsChanged( checkedItems );
- emit scopesChanged( checkedScopes );
- m_model->enableProviders( checkedItems, checkedScopes );
-}
-
-void QuickOpenWidget::textChanged( const QString& str )
-{
- // "cheap" when something was just appended to the current filter
- updateTimerInterval(str.startsWith(m_filter));
- m_filter = str;
- m_filterTimer.start();
-}
-
-void QuickOpenWidget::applyFilter()
-{
- m_model->textChanged( m_filter );
-
- QModelIndex currentIndex = m_model->index(0, 0, QModelIndex());
- o.list->selectionModel()->setCurrentIndex( currentIndex, \
QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows | \
QItemSelectionModel::Current );
-
- callRowSelected();
-}
-
-void QuickOpenWidget::callRowSelected() {
- QModelIndex currentIndex = o.list->selectionModel()->currentIndex();
- if( currentIndex.isValid() )
- m_model->rowSelected( currentIndex );
- else
- qCDebug(PLUGIN_QUICKOPEN) << "current index is not valid";
-}
-
-void QuickOpenWidget::accept() {
- QString filterText = o.searchLine->text();
- m_model->execute( o.list->currentIndex(), filterText );
-}
-
-void QuickOpenWidget::doubleClicked ( const QModelIndex & index ) {
- // crash guard: https://bugs.kde.org/show_bug.cgi?id=297178
- o.list->setCurrentIndex(index);
- QMetaObject::invokeMethod(this, "accept", Qt::QueuedConnection);
- QMetaObject::invokeMethod(this, "ready", Qt::QueuedConnection);
-}
-
-void QuickOpenWidget::avoidMenuAltFocus() {
- // send an invalid key event to the main menu bar. The menu bar will
- // stop listening when observing another key than ALT between the press
- // and the release.
- QKeyEvent event1(QEvent::KeyPress, 0, Qt::NoModifier);
- QApplication::sendEvent(ICore::self()->uiController()->activeMainWindow()->menuBar(), \
&event1);
- QKeyEvent event2(QEvent::KeyRelease, 0, Qt::NoModifier);
- QApplication::sendEvent(ICore::self()->uiController()->activeMainWindow()->menuBar(), \
&event2);
-}
-
-bool QuickOpenWidget::eventFilter ( QObject * watched, QEvent * event )
-{
- QKeyEvent *keyEvent = dynamic_cast<QKeyEvent*>(event);
-
- if( event->type() == QEvent::KeyRelease ) {
- if(keyEvent->key() == Qt::Key_Alt) {
- if((m_expandedTemporary && m_altDownTime.msecsTo( QTime::currentTime() ) > \
300) || (!m_expandedTemporary && m_altDownTime.msecsTo( QTime::currentTime() ) < 300 \
&& m_hadNoCommandSinceAlt)) {
- //Unexpand the item
- QModelIndex row = o.list->selectionModel()->currentIndex();
- if( row.isValid() ) {
- row = row.sibling( row.row(), 0 );
- if(m_model->isExpanded( row ))
- m_model->setExpanded( row, false );
- }
- }
- m_expandedTemporary = false;
- }
- }
-
- if( event->type() == QEvent::KeyPress ) {
- m_hadNoCommandSinceAlt = false;
- if(keyEvent->key() == Qt::Key_Alt) {
- avoidMenuAltFocus();
- m_hadNoCommandSinceAlt = true;
- //Expand
- QModelIndex row = o.list->selectionModel()->currentIndex();
- if( row.isValid() ) {
- row = row.sibling( row.row(), 0 );
- m_altDownTime = QTime::currentTime();
- if(!m_model->isExpanded( row )) {
- m_expandedTemporary = true;
- m_model->setExpanded( row, true );
- }
- }
- }
-
- switch( keyEvent->key() ) {
- case Qt::Key_Tab:
- if ( keyEvent->modifiers() == Qt::NoModifier ) {
- // Tab should work just like Down
- QCoreApplication::sendEvent(o.list, new QKeyEvent(QEvent::KeyPress, \
Qt::Key_Down, Qt::NoModifier));
- QCoreApplication::sendEvent(o.list, new QKeyEvent(QEvent::KeyRelease, \
Qt::Key_Down, Qt::NoModifier));
- return true;
- }
- break;
- case Qt::Key_Backtab:
- if ( keyEvent->modifiers() == Qt::ShiftModifier ) {
- // Shift + Tab should work just like Up
- QCoreApplication::sendEvent(o.list, new QKeyEvent(QEvent::KeyPress, \
Qt::Key_Up, Qt::NoModifier));
- QCoreApplication::sendEvent(o.list, new QKeyEvent(QEvent::KeyRelease, \
Qt::Key_Up, Qt::NoModifier));
- return true;
- }
- break;
- case Qt::Key_Down:
- case Qt::Key_Up:
- {
- if( keyEvent->modifiers() == Qt::AltModifier ) {
- QWidget* w = \
m_model->expandingWidget(o.list->selectionModel()->currentIndex());
- if( KDevelop::QuickOpenEmbeddedWidgetInterface* interface =
- dynamic_cast<KDevelop::QuickOpenEmbeddedWidgetInterface*>( w ) ){
- if( keyEvent->key() == Qt::Key_Down )
- interface->down();
- else
- interface->up();
- return true;
- }
- return false;
- }
- }
- case Qt::Key_PageUp:
- case Qt::Key_PageDown:
- if(watched == o.list )
- return false;
- QApplication::sendEvent( o.list, event );
- //callRowSelected();
- return true;
-
- case Qt::Key_Left: {
- //Expand/unexpand
- if( keyEvent->modifiers() == Qt::AltModifier ) {
- //Eventually Send action to the widget
- QWidget* w = \
m_model->expandingWidget(o.list->selectionModel()->currentIndex());
- if( KDevelop::QuickOpenEmbeddedWidgetInterface* interface =
- dynamic_cast<KDevelop::QuickOpenEmbeddedWidgetInterface*>( w ) ){
- interface->previous();
- return true;
- }
- } else {
- QModelIndex row = o.list->selectionModel()->currentIndex();
- if( row.isValid() ) {
- row = row.sibling( row.row(), 0 );
-
- if( m_model->isExpanded( row ) ) {
- m_model->setExpanded( row, false );
- return true;
- }
- }
- }
- return false;
- }
- case Qt::Key_Right: {
- //Expand/unexpand
- if( keyEvent->modifiers() == Qt::AltModifier ) {
- //Eventually Send action to the widget
- QWidget* w = \
m_model->expandingWidget(o.list->selectionModel()->currentIndex());
- if( KDevelop::QuickOpenEmbeddedWidgetInterface* interface =
- dynamic_cast<KDevelop::QuickOpenEmbeddedWidgetInterface*>( w ) ){
- interface->next();
- return true;
- }
- } else {
- QModelIndex row = o.list->selectionModel()->currentIndex();
- if( row.isValid() ) {
- row = row.sibling( row.row(), 0 );
-
- if( !m_model->isExpanded( row ) ) {
- m_model->setExpanded( row, true );
- return true;
- }
- }
- }
- return false;
- }
- case Qt::Key_Return:
- case Qt::Key_Enter: {
- if (m_filterTimer.isActive()) {
- m_filterTimer.stop();
- applyFilter();
- }
- if( keyEvent->modifiers() == Qt::AltModifier ) {
- //Eventually Send action to the widget
- QWidget* w = \
m_model->expandingWidget(o.list->selectionModel()->currentIndex());
- if( KDevelop::QuickOpenEmbeddedWidgetInterface* interface =
- dynamic_cast<KDevelop::QuickOpenEmbeddedWidgetInterface*>( w ) ){
- interface->accept();
- return true;
- }
- } else {
- QString filterText = o.searchLine->text();
-
- //Safety: Track whether this object is deleted. When execute() is called, \
a dialog may be opened,
- //which kills the quickopen widget.
- QPointer<QObject> stillExists(this);
-
- if( m_model->execute( o.list->currentIndex(), filterText ) ) {
-
- if(!stillExists)
- return true;
-
- if(!(keyEvent->modifiers() & Qt::ShiftModifier))
- emit ready();
- } else {
- //Maybe the filter-text was changed:
- if( filterText != o.searchLine->text() ) {
- o.searchLine->setText( filterText );
- }
- }
- }
- return true;
- }
- }
- }
-
- return false;
-}
-
-
QuickOpenLineEdit* QuickOpenPlugin::quickOpenLine(QString name)
{
QList< QuickOpenLineEdit* > lines = \
ICore::self()->uiController()->activeMainWindow()->findChildren<QuickOpenLineEdit*>(name);
diff --git a/plugins/quickopen/quickopenplugin.h \
b/plugins/quickopen/quickopenplugin.h index 914a8b1..b2b2792 100644
--- a/plugins/quickopen/quickopenplugin.h
+++ b/plugins/quickopen/quickopenplugin.h
@@ -22,19 +22,14 @@
#ifndef KDEVPLATFORM_PLUGIN_QUICKOPENPLUGIN_H
#define KDEVPLATFORM_PLUGIN_QUICKOPENPLUGIN_H
-#include <QtCore/QVariant>
-#include <QtCore/QTimer>
+#include <QVariant>
#include <QPointer>
-#include <QMenu>
-#include <QTime>
#include <interfaces/iplugin.h>
#include <language/interfaces/iquickopen.h>
#include <language/interfaces/quickopendataprovider.h>
-#include "ui_quickopen.h"
-
class QAction;
namespace KTextEditor {
@@ -137,80 +132,6 @@ private:
QAction* m_quickOpenDefinition;
};
-///Will delete itself once the dialog is closed, so use QPointer when referencing it \
permanently
-class QuickOpenWidget : public QMenu {
- Q_OBJECT
- public:
- /**
- * @param initialItems List of items that should initially be enabled in the \
quickopen-list. If empty, all are enabled.
- * @param initialScopes List of scopes that should initially be enabled in the \
quickopen-list. If empty, all are enabled.
- * @param listOnly when this is true, the given items will be listed, but all \
filtering using checkboxes is disabled.
- * @param noSearchFied when this is true, no search-line is shown.
- * */
- QuickOpenWidget( QString title, QuickOpenModel* model, const QStringList& \
initialItems, const QStringList& initialScopes, bool listOnly = false, bool \
noSearchField = false );
- ~QuickOpenWidget() override;
- void setPreselectedText(const QString &text);
- void prepareShow();
-
- void setAlternativeSearchField(QLineEdit* alterantiveSearchField);
-
- //Shows OK + Cancel. By default they are hidden
- void showStandardButtons(bool show);
- void showSearchField(bool show);
-
- signals:
- void scopesChanged( const QStringList& scopes );
- void itemsChanged( const QStringList& scopes );
- void ready();
-
- private slots:
- void callRowSelected();
-
- void updateTimerInterval( bool cheapFilterChange );
-
- void accept();
- void textChanged( const QString& str );
- void updateProviders();
- void doubleClicked ( const QModelIndex & index );
-
- void applyFilter();
-
- private:
- void showEvent(QShowEvent *) override;
-
- bool eventFilter ( QObject * watched, QEvent * event ) override;
-
- void avoidMenuAltFocus();
-
- QuickOpenModel* m_model;
- bool m_expandedTemporary, m_hadNoCommandSinceAlt;
- QTime m_altDownTime;
- QString m_preselectedText;
- QTimer m_filterTimer;
- QString m_filter;
- public:
- Ui::QuickOpen o;
-
- friend class QuickOpenWidgetDialog;
- friend class QuickOpenPlugin;
- friend class QuickOpenLineEdit;
-};
-
-class QuickOpenWidgetDialog : public QObject {
- Q_OBJECT
- public:
- QuickOpenWidgetDialog( QString title, QuickOpenModel* model, const QStringList& \
initialItems, const QStringList& initialScopes, bool listOnly = false, bool \
noSearchField = false );
- ~QuickOpenWidgetDialog() override;
- ///Shows the dialog
- void run();
- QuickOpenWidget* widget() const {
- return m_widget;
- }
- private:
- QDialog* m_dialog; //Warning: m_dialog is also the parent
- QuickOpenWidget* m_widget;
-};
-
class QuickOpenWidgetCreator;
class QuickOpenLineEdit : public KDevelop::IQuickOpenLine {
diff --git a/plugins/quickopen/quickopenwidget.cpp \
b/plugins/quickopen/quickopenwidget.cpp new file mode 100644
index 0000000..f66cbaa
--- /dev/null
+++ b/plugins/quickopen/quickopenwidget.cpp
@@ -0,0 +1,511 @@
+/*
+ * This file is part of KDevelop
+ *
+ * Copyright 2007 David Nolden <david.nolden.kdevelop@art-master.de>
+ * Copyright 2016 Kevin Funk <kfunk@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "quickopenwidget.h"
+#include <KParts/MainWindow>
+#include "debug.h"
+
+#include "expandingtree/expandingdelegate.h"
+#include "quickopenmodel.h"
+
+#include <icore.h>
+#include <iuicontroller.h>
+
+#include <QDialog>
+#include <QMenuBar>
+#include <QKeyEvent>
+#include <QScrollBar>
+
+#include <KTextEditor/CodeCompletionModel>
+
+using namespace KDevelop;
+
+class QuickOpenDelegate : public ExpandingDelegate {
+ Q_OBJECT
+public:
+ QuickOpenDelegate(ExpandingWidgetModel* model, QObject* parent = 0L) : \
ExpandingDelegate(model, parent) { + }
+ QList<QTextLayout::FormatRange> createHighlighting(const QModelIndex& index, \
QStyleOptionViewItem& option) const override { + QList<QVariant> highlighting = \
index.data(KTextEditor::CodeCompletionModel::CustomHighlight).toList(); + \
if(!highlighting.isEmpty()) + return highlightingFromVariantList(highlighting);
+ return ExpandingDelegate::createHighlighting( index, option );
+ }
+
+};
+
+QuickOpenWidget::QuickOpenWidget( QString title, QuickOpenModel* model, const \
QStringList& initialItems, const QStringList& initialScopes, bool listOnly, bool \
noSearchField ) : m_model(model), m_expandedTemporary(false) { + \
m_filterTimer.setSingleShot(true); + connect(&m_filterTimer, &QTimer::timeout, this, \
&QuickOpenWidget::applyFilter); +
+ Q_UNUSED( title );
+ o.setupUi( this );
+ o.list->header()->hide();
+ o.list->setRootIsDecorated( false );
+ o.list->setVerticalScrollMode( QAbstractItemView::ScrollPerItem );
+
+ connect(o.list->verticalScrollBar(), &QScrollBar::valueChanged, m_model, \
&QuickOpenModel::placeExpandingWidgets); +
+ o.searchLine->setFocus();
+
+ o.list->setItemDelegate( new QuickOpenDelegate( m_model, o.list ) );
+
+ if(!listOnly) {
+ QStringList allTypes = m_model->allTypes();
+ QStringList allScopes = m_model->allScopes();
+
+ QMenu* itemsMenu = new QMenu(this);
+
+ foreach( const QString &type, allTypes )
+ {
+ QAction* action = new QAction(type, itemsMenu);
+ action->setCheckable(true);
+ action->setChecked(initialItems.isEmpty() || initialItems.contains( type ));
+ connect( action, &QAction::toggled, this, &QuickOpenWidget::updateProviders, \
Qt::QueuedConnection ); + itemsMenu->addAction(action);
+ }
+
+ o.itemsButton->setMenu(itemsMenu);
+
+ QMenu* scopesMenu = new QMenu(this);
+
+ foreach( const QString &scope, allScopes )
+ {
+ QAction* action = new QAction(scope, scopesMenu);
+ action->setCheckable(true);
+ action->setChecked(initialScopes.isEmpty() || initialScopes.contains( scope ) \
); +
+ connect( action, &QAction::toggled, this, &QuickOpenWidget::updateProviders, \
Qt::QueuedConnection ); + scopesMenu->addAction(action);
+ }
+
+ o.scopesButton->setMenu(scopesMenu);
+
+ }else{
+ o.list->setFocusPolicy(Qt::StrongFocus);
+ o.scopesButton->hide();
+ o.itemsButton->hide();
+ o.label->hide();
+ o.label_2->hide();
+ }
+
+ showSearchField(!noSearchField);
+
+ o.okButton->hide();
+ o.cancelButton->hide();
+
+ o.searchLine->installEventFilter( this );
+ o.list->installEventFilter( this );
+ o.list->setFocusPolicy(Qt::NoFocus);
+ o.scopesButton->setFocusPolicy(Qt::NoFocus);
+ o.itemsButton->setFocusPolicy(Qt::NoFocus);
+
+ connect( o.searchLine, &QLineEdit::textChanged, this, \
&QuickOpenWidget::textChanged ); +
+ connect( o.list, &ExpandingTree::doubleClicked, this, \
&QuickOpenWidget::doubleClicked ); +
+ connect(o.okButton, &QPushButton::clicked, this, &QuickOpenWidget::accept);
+ connect(o.okButton, &QPushButton::clicked, this, &QuickOpenWidget::ready);
+ connect(o.cancelButton, &QPushButton::clicked, this, &QuickOpenWidget::ready);
+
+ updateProviders();
+ updateTimerInterval(true);
+
+// no need to call this, it's done by updateProviders already
+// m_model->restart();
+}
+
+void QuickOpenWidget::showStandardButtons(bool show)
+{
+ if(show) {
+ o.okButton->show();
+ o.cancelButton->show();
+ }else{
+ o.okButton->hide();
+ o.cancelButton->hide();
+ }
+}
+
+void QuickOpenWidget::updateTimerInterval(bool cheapFilterChange)
+{
+ const int MAX_ITEMS = 10000;
+ if ( cheapFilterChange && m_model->rowCount(QModelIndex()) < MAX_ITEMS ) {
+ // cheap change and there are currently just a few items,
+ // so apply filter instantly
+ m_filterTimer.setInterval(0);
+ } else if ( m_model->unfilteredRowCount() < MAX_ITEMS ) {
+ // not a cheap change, but there are generally
+ // just a few items in the list: apply filter instantly
+ m_filterTimer.setInterval(0);
+ } else {
+ // otherwise use a timer to prevent sluggishness while typing
+ m_filterTimer.setInterval(300);
+ }
+}
+
+void QuickOpenWidget::showEvent(QShowEvent* e)
+{
+ QWidget::showEvent(e);
+
+ // The column width only has an effect _after_ the widget has been shown
+ o.list->setColumnWidth( 0, 20 );
+}
+
+void QuickOpenWidget::setAlternativeSearchField(QLineEdit* alterantiveSearchField)
+{
+ o.searchLine = alterantiveSearchField;
+ o.searchLine->installEventFilter( this );
+ connect( o.searchLine, &QLineEdit::textChanged, this, \
&QuickOpenWidget::textChanged ); +}
+
+
+void QuickOpenWidget::showSearchField(bool b)
+{
+ if(b){
+ o.searchLine->show();
+ o.searchLabel->show();
+ }else{
+ o.searchLine->hide();
+ o.searchLabel->hide();
+ }
+}
+
+void QuickOpenWidget::prepareShow()
+{
+ o.list->setModel( 0 );
+ o.list->setVerticalScrollMode(QAbstractItemView::ScrollPerItem);
+ m_model->setTreeView( o.list );
+ o.list->setModel( m_model );
+
+ m_filterTimer.stop();
+ m_filter = QString();
+
+ if (!m_preselectedText.isEmpty())
+ {
+ o.searchLine->setText(m_preselectedText);
+ o.searchLine->selectAll();
+ }
+
+ m_model->restart(false);
+
+ connect( o.list->selectionModel(), &QItemSelectionModel::currentRowChanged,
+ this, &QuickOpenWidget::callRowSelected );
+ connect( o.list->selectionModel(), &QItemSelectionModel::selectionChanged,
+ this, &QuickOpenWidget::callRowSelected );
+}
+
+void QuickOpenWidgetDialog::run() {
+ m_widget->prepareShow();
+ m_dialog->show();
+}
+
+QuickOpenWidget::~QuickOpenWidget() {
+ m_model->setTreeView( 0 );
+}
+
+
+QuickOpenWidgetDialog::QuickOpenWidgetDialog(QString title, QuickOpenModel* model, \
const QStringList& initialItems, const QStringList& initialScopes, bool listOnly, \
bool noSearchField) +{
+ m_widget = new QuickOpenWidget(title, model, initialItems, initialScopes, \
listOnly, noSearchField); + // the QMenu might close on esc and we want to close the \
whole dialog then + connect( m_widget, &QuickOpenWidget::aboutToHide, this, \
&QuickOpenWidgetDialog::deleteLater ); +
+ m_dialog = new QDialog( ICore::self()->uiController()->activeMainWindow() );
+ m_dialog->resize(QSize(800, 400));
+
+ m_dialog->setWindowTitle(title);
+ QVBoxLayout* layout = new QVBoxLayout(m_dialog);
+ layout->addWidget(m_widget);
+ m_widget->showStandardButtons(true);
+ connect(m_widget, &QuickOpenWidget::ready, m_dialog, &QDialog::close);
+ connect( m_dialog, &QDialog::accepted, m_widget, &QuickOpenWidget::accept );
+}
+
+
+QuickOpenWidgetDialog::~QuickOpenWidgetDialog()
+{
+ delete m_dialog;
+}
+
+void QuickOpenWidget::setPreselectedText(const QString& text)
+{
+ m_preselectedText = text;
+}
+
+void QuickOpenWidget::updateProviders() {
+ if(QAction* action = qobject_cast<QAction*>(sender())) {
+ QMenu* menu = qobject_cast<QMenu*>(action->parentWidget());
+ if(menu) {
+ menu->show();
+ menu->setActiveAction(action);
+ }
+ }
+
+ QStringList checkedItems;
+
+ if(o.itemsButton->menu()) {
+
+ foreach( QObject* obj, o.itemsButton->menu()->children() ) {
+ QAction* box = qobject_cast<QAction*>( obj );
+ if( box ) {
+ if( box->isChecked() )
+ checkedItems << box->text().remove('&');
+ }
+ }
+ o.itemsButton->setText(checkedItems.join(QStringLiteral(", ")));
+ }
+
+ QStringList checkedScopes;
+
+ if(o.scopesButton->menu()) {
+
+ foreach( QObject* obj, o.scopesButton->menu()->children() ) {
+ QAction* box = qobject_cast<QAction*>( obj );
+ if( box ) {
+ if( box->isChecked() )
+ checkedScopes << box->text().remove('&');
+ }
+ }
+
+ o.scopesButton->setText(checkedScopes.join(QStringLiteral(", ")));
+ }
+
+ emit itemsChanged( checkedItems );
+ emit scopesChanged( checkedScopes );
+ m_model->enableProviders( checkedItems, checkedScopes );
+}
+
+void QuickOpenWidget::textChanged( const QString& str )
+{
+ // "cheap" when something was just appended to the current filter
+ updateTimerInterval(str.startsWith(m_filter));
+ m_filter = str;
+ m_filterTimer.start();
+}
+
+void QuickOpenWidget::applyFilter()
+{
+ m_model->textChanged( m_filter );
+
+ QModelIndex currentIndex = m_model->index(0, 0, QModelIndex());
+ o.list->selectionModel()->setCurrentIndex( currentIndex, \
QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows | \
QItemSelectionModel::Current ); +
+ callRowSelected();
+}
+
+void QuickOpenWidget::callRowSelected() {
+ QModelIndex currentIndex = o.list->selectionModel()->currentIndex();
+ if( currentIndex.isValid() )
+ m_model->rowSelected( currentIndex );
+ else
+ qCDebug(PLUGIN_QUICKOPEN) << "current index is not valid";
+}
+
+void QuickOpenWidget::accept() {
+ QString filterText = o.searchLine->text();
+ m_model->execute( o.list->currentIndex(), filterText );
+}
+
+void QuickOpenWidget::doubleClicked ( const QModelIndex & index ) {
+ // crash guard: https://bugs.kde.org/show_bug.cgi?id=297178
+ o.list->setCurrentIndex(index);
+ QMetaObject::invokeMethod(this, "accept", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, "ready", Qt::QueuedConnection);
+}
+
+void QuickOpenWidget::avoidMenuAltFocus() {
+ // send an invalid key event to the main menu bar. The menu bar will
+ // stop listening when observing another key than ALT between the press
+ // and the release.
+ QKeyEvent event1(QEvent::KeyPress, 0, Qt::NoModifier);
+ QApplication::sendEvent(ICore::self()->uiController()->activeMainWindow()->menuBar(), \
&event1); + QKeyEvent event2(QEvent::KeyRelease, 0, Qt::NoModifier);
+ QApplication::sendEvent(ICore::self()->uiController()->activeMainWindow()->menuBar(), \
&event2); +}
+
+bool QuickOpenWidget::eventFilter ( QObject * watched, QEvent * event )
+{
+ QKeyEvent *keyEvent = dynamic_cast<QKeyEvent*>(event);
+
+ if( event->type() == QEvent::KeyRelease ) {
+ if(keyEvent->key() == Qt::Key_Alt) {
+ if((m_expandedTemporary && m_altDownTime.msecsTo( QTime::currentTime() ) > \
300) || (!m_expandedTemporary && m_altDownTime.msecsTo( QTime::currentTime() ) < 300 \
&& m_hadNoCommandSinceAlt)) { + //Unexpand the item
+ QModelIndex row = o.list->selectionModel()->currentIndex();
+ if( row.isValid() ) {
+ row = row.sibling( row.row(), 0 );
+ if(m_model->isExpanded( row ))
+ m_model->setExpanded( row, false );
+ }
+ }
+ m_expandedTemporary = false;
+ }
+ }
+
+ if( event->type() == QEvent::KeyPress ) {
+ m_hadNoCommandSinceAlt = false;
+ if(keyEvent->key() == Qt::Key_Alt) {
+ avoidMenuAltFocus();
+ m_hadNoCommandSinceAlt = true;
+ //Expand
+ QModelIndex row = o.list->selectionModel()->currentIndex();
+ if( row.isValid() ) {
+ row = row.sibling( row.row(), 0 );
+ m_altDownTime = QTime::currentTime();
+ if(!m_model->isExpanded( row )) {
+ m_expandedTemporary = true;
+ m_model->setExpanded( row, true );
+ }
+ }
+ }
+
+ switch( keyEvent->key() ) {
+ case Qt::Key_Tab:
+ if ( keyEvent->modifiers() == Qt::NoModifier ) {
+ // Tab should work just like Down
+ QCoreApplication::sendEvent(o.list, new QKeyEvent(QEvent::KeyPress, \
Qt::Key_Down, Qt::NoModifier)); + QCoreApplication::sendEvent(o.list, new \
QKeyEvent(QEvent::KeyRelease, Qt::Key_Down, Qt::NoModifier)); + return true;
+ }
+ break;
+ case Qt::Key_Backtab:
+ if ( keyEvent->modifiers() == Qt::ShiftModifier ) {
+ // Shift + Tab should work just like Up
+ QCoreApplication::sendEvent(o.list, new QKeyEvent(QEvent::KeyPress, \
Qt::Key_Up, Qt::NoModifier)); + QCoreApplication::sendEvent(o.list, new \
QKeyEvent(QEvent::KeyRelease, Qt::Key_Up, Qt::NoModifier)); + return true;
+ }
+ break;
+ case Qt::Key_Down:
+ case Qt::Key_Up:
+ {
+ if( keyEvent->modifiers() == Qt::AltModifier ) {
+ QWidget* w = \
m_model->expandingWidget(o.list->selectionModel()->currentIndex()); + if( \
KDevelop::QuickOpenEmbeddedWidgetInterface* interface = + \
dynamic_cast<KDevelop::QuickOpenEmbeddedWidgetInterface*>( w ) ){ + if( \
keyEvent->key() == Qt::Key_Down ) + interface->down();
+ else
+ interface->up();
+ return true;
+ }
+ return false;
+ }
+ }
+ case Qt::Key_PageUp:
+ case Qt::Key_PageDown:
+ if(watched == o.list )
+ return false;
+ QApplication::sendEvent( o.list, event );
+ //callRowSelected();
+ return true;
+
+ case Qt::Key_Left: {
+ //Expand/unexpand
+ if( keyEvent->modifiers() == Qt::AltModifier ) {
+ //Eventually Send action to the widget
+ QWidget* w = \
m_model->expandingWidget(o.list->selectionModel()->currentIndex()); + if( \
KDevelop::QuickOpenEmbeddedWidgetInterface* interface = + \
dynamic_cast<KDevelop::QuickOpenEmbeddedWidgetInterface*>( w ) ){ + \
interface->previous(); + return true;
+ }
+ } else {
+ QModelIndex row = o.list->selectionModel()->currentIndex();
+ if( row.isValid() ) {
+ row = row.sibling( row.row(), 0 );
+
+ if( m_model->isExpanded( row ) ) {
+ m_model->setExpanded( row, false );
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ case Qt::Key_Right: {
+ //Expand/unexpand
+ if( keyEvent->modifiers() == Qt::AltModifier ) {
+ //Eventually Send action to the widget
+ QWidget* w = \
m_model->expandingWidget(o.list->selectionModel()->currentIndex()); + if( \
KDevelop::QuickOpenEmbeddedWidgetInterface* interface = + \
dynamic_cast<KDevelop::QuickOpenEmbeddedWidgetInterface*>( w ) ){ + \
interface->next(); + return true;
+ }
+ } else {
+ QModelIndex row = o.list->selectionModel()->currentIndex();
+ if( row.isValid() ) {
+ row = row.sibling( row.row(), 0 );
+
+ if( !m_model->isExpanded( row ) ) {
+ m_model->setExpanded( row, true );
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ case Qt::Key_Return:
+ case Qt::Key_Enter: {
+ if (m_filterTimer.isActive()) {
+ m_filterTimer.stop();
+ applyFilter();
+ }
+ if( keyEvent->modifiers() == Qt::AltModifier ) {
+ //Eventually Send action to the widget
+ QWidget* w = \
m_model->expandingWidget(o.list->selectionModel()->currentIndex()); + if( \
KDevelop::QuickOpenEmbeddedWidgetInterface* interface = + \
dynamic_cast<KDevelop::QuickOpenEmbeddedWidgetInterface*>( w ) ){ + \
interface->accept(); + return true;
+ }
+ } else {
+ QString filterText = o.searchLine->text();
+
+ //Safety: Track whether this object is deleted. When execute() is called, \
a dialog may be opened, + //which kills the quickopen widget.
+ QPointer<QObject> stillExists(this);
+
+ if( m_model->execute( o.list->currentIndex(), filterText ) ) {
+
+ if(!stillExists)
+ return true;
+
+ if(!(keyEvent->modifiers() & Qt::ShiftModifier))
+ emit ready();
+ } else {
+ //Maybe the filter-text was changed:
+ if( filterText != o.searchLine->text() ) {
+ o.searchLine->setText( filterText );
+ }
+ }
+ }
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+#include "quickopenwidget.moc"
diff --git a/plugins/quickopen/quickopenwidget.h \
b/plugins/quickopen/quickopenwidget.h new file mode 100644
index 0000000..4371529
--- /dev/null
+++ b/plugins/quickopen/quickopenwidget.h
@@ -0,0 +1,110 @@
+/*
+ * This file is part of KDevelop
+ *
+ * Copyright 2007 David Nolden <david.nolden.kdevelop@art-master.de>
+ * Copyright 2016 Kevin Funk <kfunk@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef KDEVPLATFORM_PLUGIN_QUICKOPENWIDGET_H
+#define KDEVPLATFORM_PLUGIN_QUICKOPENWIDGET_H
+
+#include "ui_quickopenwidget.h"
+
+#include <QMenu>
+#include <QTime>
+#include <QTimer>
+
+class QuickOpenModel;
+
+class QLineEdit;
+
+///Will delete itself once the dialog is closed, so use QPointer when referencing it \
permanently +class QuickOpenWidget : public QMenu {
+ Q_OBJECT
+ public:
+ /**
+ * @param initialItems List of items that should initially be enabled in the \
quickopen-list. If empty, all are enabled. + * @param initialScopes List of scopes \
that should initially be enabled in the quickopen-list. If empty, all are enabled. + \
* @param listOnly when this is true, the given items will be listed, but all \
filtering using checkboxes is disabled. + * @param noSearchFied when this is true, \
no search-line is shown. + * */
+ QuickOpenWidget( QString title, QuickOpenModel* model, const QStringList& \
initialItems, const QStringList& initialScopes, bool listOnly = false, bool \
noSearchField = false ); + ~QuickOpenWidget() override;
+ void setPreselectedText(const QString &text);
+ void prepareShow();
+
+ void setAlternativeSearchField(QLineEdit* alterantiveSearchField);
+
+ //Shows OK + Cancel. By default they are hidden
+ void showStandardButtons(bool show);
+ void showSearchField(bool show);
+
+ signals:
+ void scopesChanged( const QStringList& scopes );
+ void itemsChanged( const QStringList& scopes );
+ void ready();
+
+ private slots:
+ void callRowSelected();
+
+ void updateTimerInterval( bool cheapFilterChange );
+
+ void accept();
+ void textChanged( const QString& str );
+ void updateProviders();
+ void doubleClicked ( const QModelIndex & index );
+
+ void applyFilter();
+
+ private:
+ void showEvent(QShowEvent *) override;
+
+ bool eventFilter ( QObject * watched, QEvent * event ) override;
+
+ void avoidMenuAltFocus();
+
+ QuickOpenModel* m_model;
+ bool m_expandedTemporary, m_hadNoCommandSinceAlt;
+ QTime m_altDownTime;
+ QString m_preselectedText;
+ QTimer m_filterTimer;
+ QString m_filter;
+ public:
+ Ui::QuickOpenWidget o;
+
+ friend class QuickOpenWidgetDialog;
+ friend class QuickOpenPlugin;
+ friend class QuickOpenLineEdit;
+};
+
+class QuickOpenWidgetDialog : public QObject {
+ Q_OBJECT
+ public:
+ QuickOpenWidgetDialog( QString title, QuickOpenModel* model, const QStringList& \
initialItems, const QStringList& initialScopes, bool listOnly = false, bool \
noSearchField = false ); + ~QuickOpenWidgetDialog() override;
+ ///Shows the dialog
+ void run();
+ QuickOpenWidget* widget() const {
+ return m_widget;
+ }
+ private:
+ QDialog* m_dialog; //Warning: m_dialog is also the parent
+ QuickOpenWidget* m_widget;
+};
+
+#endif
diff --git a/plugins/quickopen/quickopen.ui b/plugins/quickopen/quickopenwidget.ui
similarity index 93%
rename from plugins/quickopen/quickopen.ui
rename to plugins/quickopen/quickopenwidget.ui
index 23fa7af..08e3e78 100644
--- a/plugins/quickopen/quickopen.ui
+++ b/plugins/quickopen/quickopenwidget.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>QuickOpen</class>
- <widget class="QWidget" name="QuickOpen">
+ <class>QuickOpenWidget</class>
+ <widget class="QWidget" name="QuickOpenWidget">
<property name="geometry">
<rect>
<x>0</x>
@@ -14,7 +14,16 @@
<string>Quick Open</string>
</property>
<layout class="QGridLayout" name="gridLayout">
- <property name="margin">
+ <property name="leftMargin">
+ <number>2</number>
+ </property>
+ <property name="topMargin">
+ <number>2</number>
+ </property>
+ <property name="rightMargin">
+ <number>2</number>
+ </property>
+ <property name="bottomMargin">
<number>2</number>
</property>
<item row="0" column="0">
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic