marble
RouteItemDelegate.cpp
Go to the documentation of this file.
20 void RouteItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
28 paintContext.palette.setColor( QPalette::Text, styleOption.palette.color( QPalette::Active, QPalette::HighlightedText ) );
101 QSize RouteItemDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex& index ) const
106 doc.setTextWidth( qMax( 128, m_view->contentsRect().width() - m_previewSize - buttonWidth( option ) ) );
108 return QSize( qMax( 256, qRound( m_previewSize + buttonWidth( option ) + doc.size().width() + m_margin * 2 ) ),
115 bool RouteItemDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index )
178 m_buttonWidth = 2 * m_iconSize + qMax( qMax( openWidth, downloadWidth ), qMax( cacheWidth, cloudWidth ) );
184 QStyleOptionButton RouteItemDelegate::button( Element element, const QStyleOptionViewItem &option ) const
242 QPoint const thirdColumn = QPoint( option.rect.width() - width - option.decorationSize.width(), firstColumn.y() );
246 return QRect( secondColumn, QSize( thirdColumn.x() - secondColumn.x(), option.rect.height() ) );
252 QSize buttonSize = QApplication::style()->sizeFromContents( QStyle::CT_PushButton, &optionButton, size );
261 QSize buttonSize = QApplication::style()->sizeFromContents( QStyle::CT_PushButton, &optionButton, size );
278 QSize buttonSize = QApplication::style()->sizeFromContents( QStyle::CT_PushButton, &optionButton, size );
void setDownloadingItem(const QPersistentModelIndex &index)
Marks the route at given index as being downloaded.
Definition: CloudRouteModel.cpp:125
QSize size() const
Type type() const
Definition: CloudRouteModel.h:25
RouteItemDelegate(QListView *view, CloudRouteModel *model)
Definition: RouteItemDelegate.cpp:10
QRect contentsRect() const
void removeFromCacheButtonClicked(QString timestamp)
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: RouteItemDelegate.cpp:20
void save()
T value() const
int height() const
void deleteButtonClicked(QString timestamp)
QString tr(const char *sourceText, const char *disambiguation, int n)
int x() const
int y() const
QPixmap pixmap(const QSize &size, Mode mode, State state) const
virtual bool event(QEvent *e)
void openButtonClicked(QString timestamp)
QString number(int n, int base)
Definition: tools/osm-addresses/OsmParser.h:40
void downloadButtonClicked(QString timestamp)
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
void setWidth(int width)
QAbstractTextDocumentLayout * documentLayout() const
bool contains(const QPoint &point, bool proper) const
void uploadToCloudButtonClicked(QString timestamp)
void setDefaultFont(const QFont &font)
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: RouteItemDelegate.cpp:101
void restore()
void setTextWidth(qreal width)
int width() const
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
Definition: RouteItemDelegate.cpp:115
void setClipRect(const QRectF &rectangle, Qt::ClipOperation operation)
qint64 totalSize() const
Total size of the item currently being downloaded.
Definition: CloudRouteModel.cpp:135
QVariant data(int role) const
QStyle * style()
virtual void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const =0
qint64 downloadedSize() const
Returns how much of the route are downloaded as bytes.
Definition: CloudRouteModel.cpp:140
int height() const
QPoint topLeft() const
int column() const
bool toBool() const
void translate(const QPointF &offset)
void setHtml(const QString &html)
virtual void draw(QPainter *painter, const PaintContext &context)=0
const QPoint & pos() const
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QString toString() const
virtual QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget) const =0
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.