Commit 72489b9e authored by Jarosław Staniek's avatar Jarosław Staniek
Browse files

compiles; test app does not crash (but does not refresh)

svn path=/trunk/koffice/; revision=546073
parent 304249a3
......@@ -994,7 +994,7 @@ Editor::setSorting( int column, bool ascending )
{
if (d->set && d->set->groupNames().count()>1) //do not sort when groups are present (maybe reenable this later?)
return;
KListView::setSorting( column, ascending );
K3ListView::setSorting( column, ascending );
updateEditorGeometry();
updateGroupLabelsPosition();
repaintContents();
......
......@@ -193,7 +193,7 @@ EditorItem::EditorItem(EditorItem *parent, const QString &text)
}
EditorItem::EditorItem(EditorItem *parent, EditorItem *after, const QString &text)
: KListViewItem(parent, after, text)
: K3ListViewItem(parent, after, text)
{
d = new EditorItemPrivate();
d->property = 0;
......@@ -466,6 +466,10 @@ void EditorGroupItem::init(const QString &icon)
void
EditorGroupItem::paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int /*align*/)
{
Q_UNUSED(p);
Q_UNUSED(cg);
Q_UNUSED(column);
Q_UNUSED(width);
//no need to draw anything since there's a label on top of it
// p->fillRect(0, 0, width, height(), cg.base());
......@@ -485,7 +489,6 @@ EditorGroupItem::paintCell(QPainter *p, const QColorGroup & cg, int column, int
p->setFont(font);
p->setBrush(cg.highlight());
//p->setPen(cg.highlightedText());
/*
#ifdef QT_ONLY
QListViewItem::paintCell(p, cg, column, width, align);
#else
......@@ -504,8 +507,10 @@ EditorGroupItem::setup()
}
int
EditorGroupItem::compare( QListViewItem *i, int col, bool ascending ) const
EditorGroupItem::compare( Q3ListViewItem *i, int col, bool ascending ) const
{
Q_UNUSED(col);
Q_UNUSED(ascending);
if (dynamic_cast<EditorGroupItem*>(i)) {
return m_sortOrder
- dynamic_cast<EditorGroupItem*>(i)->m_sortOrder;
......
......@@ -42,6 +42,7 @@ class EditorItemPrivate;
class Property;
class Editor;
class GroupWidget;
class QListViewItem;
/*! \brief Item for a single property displayed within Editor object.
\author Cedric Pasteur <cedric.pasteur@free.fr>
......@@ -110,7 +111,7 @@ class EditorGroupItem : public EditorItem
/*! Reimplemented from K3ListViewItem to draw custom contents. */
virtual void paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align);
virtual void setup();
virtual int compare( QListViewItem *i, int col, bool ascending ) const;
virtual int compare( Q3ListViewItem *i, int col, bool ascending ) const;
GroupWidget *m_label;
int m_sortOrder;
......
......@@ -169,7 +169,7 @@ PixmapEdit::selectPixmapFileName()
#else
KUrl url( KFileDialog::getImageOpenURL(
":lastVisitedImagePath", this, caption) );
QString fileName = url.isLocalFile() ? url.path() : url.prettyUrl();
QString fileName = url.isLocalFile() ? url.path() : url.prettyURL();
//! @todo download the file if remote, then set fileName properly
#endif
......
......@@ -49,7 +49,10 @@ IntSpinBox::IntSpinBox(int lower, int upper, int step, int value, int base, IntE
installEventFilter(lineEdit());
installEventFilter(this);
QObjectList spinwidgets = queryList( "QAbstractSpinBox", 0, false, true );
QAbstractSpinBox* spin = static_cast<QAbstractSpinBox*>(spinwidgets.first());
#ifndef Q_WS_WIN
#warning TODO: fix for Qt4
#endif
QAbstractSpinBox* spin = spinwidgets.isEmpty() ? 0 : static_cast<QAbstractSpinBox*>(spinwidgets.first());
if (spin)
spin->installEventFilter(this);
}
......@@ -152,7 +155,10 @@ void
IntEdit::updateSpinWidgets()
{
QObjectList spinwidgets = queryList( "QAbstractSpinBox", 0, false, true );
QAbstractSpinBox* spin = static_cast<QAbstractSpinBox*>(spinwidgets.first());
#ifndef Q_WS_WIN
#warning TODO: fix for Qt4
#endif
QAbstractSpinBox* spin = spinwidgets.isEmpty() ? 0 : static_cast<QAbstractSpinBox*>(spinwidgets.first());
if (spin) {
spin->setReadOnly(isReadOnly());
}
......@@ -178,7 +184,10 @@ DoubleSpinBox::DoubleSpinBox (double lower, double upper, double step, double va
installEventFilter(lineEdit());
installEventFilter(this);
QObjectList spinwidgets = queryList( "QAbstractSpinBox", 0, false, true );
QAbstractSpinBox* spin = static_cast<QAbstractSpinBox*>(spinwidgets.first());
#ifndef Q_WS_WIN
#warning TODO: fix for Qt4
#endif
QAbstractSpinBox* spin = spinwidgets.isEmpty() ? 0 : static_cast<QAbstractSpinBox*>(spinwidgets.first());
if (spin)
spin->installEventFilter(this);
}
......@@ -298,7 +307,10 @@ void
DoubleEdit::updateSpinWidgets()
{
QObjectList spinwidgets = queryList( "QAbstractSpinBox", 0, false, true );
QAbstractSpinBox* spin = static_cast<QAbstractSpinBox*>(spinwidgets.first());
#ifndef Q_WS_WIN
#warning TODO: fix for Qt4
#endif
QAbstractSpinBox* spin = spinwidgets.isEmpty() ? 0 : static_cast<QAbstractSpinBox*>(spinwidgets.first());
if (spin) {
spin->setReadOnly(isReadOnly());
}
......
......@@ -83,7 +83,7 @@ URLEdit::setValue(const QVariant &value, bool emitChange)
#ifdef QT_ONLY
m_edit->setText(value.toString());
#else
m_edit->setUrl(value.toString());
m_edit->setURL(value.toString());
#endif
m_edit->blockSignals(false);
if (emitChange)
......
......@@ -57,7 +57,9 @@ class SetPrivate
//groups of properties:
// list of group name: (list of property names)
StringListMap propertiesOfGroup;
Q3ValueList<QByteArray> groupNames;
QMap<QByteArray, QString> groupDescriptions;
QMap<QByteArray, QString> groupIcons;
// map of property: group
QMap<Property*, QByteArray> groupForProperty;
......@@ -289,7 +291,7 @@ Set::setGroupDescription(const QByteArray &group, const QString desc)
}
QString
Set::groupDescription(const QByteArray &group)
Set::groupDescription(const QByteArray &group) const
{
if(d->groupDescriptions.contains(group))
return d->groupDescriptions[group];
......
......@@ -161,7 +161,7 @@ class KOPROPERTY_EXPORT Set : public QObject
/*! \return a list of all property names. The order is the same as the order
of creation. */
const Q3ValueList<QByteArray>& propertyNamesForGroup(const QCString &group) const;
const Q3ValueList<QByteArray>& propertyNamesForGroup(const QByteArray &group) const;
/*! Used by property editor to preserve previous selection when this set
is assigned again. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment