branches/kdevelop/3.4
Andras Mantia
amantia at kde.org
Wed May 24 11:39:00 UTC 2006
SVN commit 544287 by amantia:
Remove - IMO - ugly hack.
CCMAIL: kdevelop-devel at kdevelop.org
M +4 -2 lib/widgets/Makefile.am
M +3 -7 lib/widgets/fancylistviewitem.h
M +17 -2 lib/widgets/kcomboview.cpp
M +2 -0 lib/widgets/kcomboview.h
M +1 -1 lib/widgets/qcomboview.h
M +4 -5 parts/classview/classviewwidget.h
M +4 -5 parts/classview/navigator.cpp
M +1 -1 parts/classview/navigator.h
--- branches/kdevelop/3.4/lib/widgets/Makefile.am #544286:544287
@@ -8,11 +8,13 @@
libkdevwidgets_la_SOURCES = flagboxes.cpp qcomboview.cpp klistviewaction.cpp \
kcomboview.cpp resizablecombo.cpp kdevhtmlpart.cpp processlinemaker.cpp \
- processwidget.cpp ksavealldialog.cpp fancyklistviewitem.cpp fancyqlistviewitem.cpp
+ processwidget.cpp ksavealldialog.cpp fancylistviewitem.cpp
+
kdevwidgetsinclude_HEADERS = klistviewaction.h qcomboview.h flagboxes.h \
ksavealldialog.h resizablecombo.h kcomboview.h kdevhtmlpart.h processlinemaker.h \
- processwidget.h fancylistviewitem.h fancyqlistviewitem.h fancyklistviewitem.h
+ processwidget.h fancylistviewitem.h
+
SUBDIRS = propeditor
--- branches/kdevelop/3.4/lib/widgets/fancylistviewitem.h #544286:544287
@@ -130,22 +130,18 @@
Chain m_chain;
};
-#define FancyListViewItemTemplate FANCYLISTVIEWITEM_NEWNAME
-
///does not support multiple column, a "column" represents a part of the real first column
///KListViewItem is only needed for the background-color
///all this is ugly, but templates don't do, and this is still better than code-duplication :)
-class FancyListViewItemTemplate : public FANCYLISTVIEWITEM_BASE
+class FancyListViewItem : public KListViewItem
{
- private:
- typedef FancyListViewItemTemplate Self;
public:
- FancyListViewItemTemplate(TextPaintStyleStore& styles, QListView *parent, const QString &label1, const QString &label2="") : FANCYLISTVIEWITEM_BASE(parent, label1, label2), m_styles(styles) {
+ FancyListViewItem(TextPaintStyleStore& styles, QListView *parent, const QString &label1, const QString &label2="") : KListViewItem(parent, label1, label2), m_styles(styles) {
init(label1, label2);
}
- FancyListViewItemTemplate(TextPaintStyleStore& styles, QListViewItem *parent, const QString &label1, const QString &label2="") : FANCYLISTVIEWITEM_BASE(parent, label1, label2), m_styles(styles) {
+ FancyListViewItem(TextPaintStyleStore& styles, QListViewItem *parent, const QString &label1, const QString &label2="") : KListViewItem(parent, label1, label2), m_styles(styles) {
init(label1, label2);
}
--- branches/kdevelop/3.4/lib/widgets/kcomboview.cpp #544286:544287
@@ -17,15 +17,16 @@
Boston, MA 02111-1307, USA.
*/
#include <klineedit.h>
-#include <qlistview.h>
+#include <klistview.h>
#include <kcompletionbox.h>
+#include <qheader.h>
#include <qmap.h>
#include "kcomboview.h"
KComboView::KComboView( bool rw, int defaultWidth, QWidget* parent, const char* name , CustomCompleter* comp)
- :QComboView(rw, parent, name), m_defaultWidth(defaultWidth), m_comp( comp )
+ :QComboView(rw, parent, name), m_comp( comp ), m_defaultWidth(defaultWidth)
{
if (rw)
{
@@ -83,4 +84,18 @@
m_defaultText = text;
}
+void KComboView::setUpListView()
+{
+ KListView *listView = new KListView( this, "in-combo" );
+ listView->setRootIsDecorated( false );
+ listView->setAllColumnsShowFocus(true);
+ listView->addColumn("");
+ listView->setResizeMode(QListView::LastColumn);
+
+ listView->header()->hide();
+
+ setListView(listView);
+}
+
+
#include "kcomboview.moc"
--- branches/kdevelop/3.4/lib/widgets/kcomboview.h #544286:544287
@@ -70,6 +70,8 @@
int defaultWidth();
private:
+ virtual void setUpListView();
+
CustomCompleter* m_comp;
int m_defaultWidth;
QString m_defaultText;
--- branches/kdevelop/3.4/lib/widgets/qcomboview.h #544286:544287
@@ -150,7 +150,7 @@
void updateMask();
private:
- void setUpListView();
+ virtual void setUpListView();
void setUpLineEdit();
void popDownListView();
void reIndex();
--- branches/kdevelop/3.4/parts/classview/classviewwidget.h #544286:544287
@@ -28,7 +28,7 @@
#include <qmap.h>
#include <qtooltip.h>
#include <codemodel.h>
-#include <fancyklistviewitem.h>
+#include <fancylistviewitem.h>
#include <navigator.h>
using namespace Widgets;
@@ -115,15 +115,14 @@
TextPaintStyleStore m_paintStyles;
};
-class ClassViewItem: public FancyKListViewItem
+class ClassViewItem: public FancyListViewItem
{
private:
- typedef FancyKListViewItem Base;
public:
ClassViewItem( QListView* parent, const QString& text=QString::null )
- : Base( static_cast<ClassViewWidget*>( parent )->m_paintStyles, parent, text ) {}
+ : FancyListViewItem( static_cast<ClassViewWidget*>( parent )->m_paintStyles, parent, text ) {}
ClassViewItem( QListViewItem* parent, const QString& text=QString::null )
- : Base( static_cast<ClassViewWidget*>( parent->listView() )->m_paintStyles, parent, text ) {}
+ : FancyListViewItem( static_cast<ClassViewWidget*>( parent->listView() )->m_paintStyles, parent, text ) {}
virtual const CodeModelItem* model() const { return 0; }
--- branches/kdevelop/3.4/parts/classview/navigator.cpp #544286:544287
@@ -62,21 +62,20 @@
-class FunctionNavItem: public FancyQListViewItem {
+class FunctionNavItem: public FancyListViewItem {
private:
- typedef FancyQListViewItem Base;
public:
enum Type { Declaration, Definition };
FunctionNavItem(TextPaintStyleStore& styles, ClassViewPart *part, QListView *parent, QString name, Type type)
- :Base(styles, parent, name, ""), m_part(part), m_type(type) {}
+ :FancyListViewItem(styles, parent, name, ""), m_part(part), m_type(type) {}
FunctionNavItem(TextPaintStyleStore& styles, ClassViewPart *part, QListViewItem *parent, QString name, Type type)
- :Base(styles, parent, name, ""), m_part(part), m_type(type) {}
+ :FancyListViewItem(styles, parent, name, ""), m_part(part), m_type(type) {}
~FunctionNavItem() {}
virtual void setup()
{
- Base::setup();
+ FancyListViewItem::setup();
setPixmap( 0, UserIcon("CVpublic_meth", KIcon::DefaultState, m_part->instance()) );
}
Type type() { return m_type; }
--- branches/kdevelop/3.4/parts/classview/navigator.h #544286:544287
@@ -23,7 +23,7 @@
#include <qobject.h>
#include <codemodel.h>
#include <qfont.h>
-#include <fancyqlistviewitem.h>
+#include <fancylistviewitem.h>
class TextPaintStyleStore;
class QTimer;
More information about the KDevelop-devel
mailing list