mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Accept a const QWidget* in RichResource functions
This commit is contained in:
@@ -132,7 +132,7 @@ QString ConfigFilePath(const QString &filename)
|
||||
return QDir::cleanPath(dir.absoluteFilePath(filename));
|
||||
}
|
||||
|
||||
ICaptureContext *getCaptureContext(QWidget *widget)
|
||||
ICaptureContext *getCaptureContext(const QWidget *widget)
|
||||
{
|
||||
void *ctxptr = NULL;
|
||||
|
||||
|
||||
@@ -1794,4 +1794,4 @@ This may return ``None`` if no capture context can be found.
|
||||
:return: The capture context associated with this widget, if one unambiguously exists.
|
||||
:rtype: CaptureContext
|
||||
)");
|
||||
ICaptureContext *getCaptureContext(QWidget *widget);
|
||||
ICaptureContext *getCaptureContext(const QWidget *widget);
|
||||
@@ -79,7 +79,7 @@ struct RichResourceText
|
||||
// cache the context once we've obtained it.
|
||||
ICaptureContext *ctxptr = NULL;
|
||||
|
||||
void cacheDocument(QWidget *widget)
|
||||
void cacheDocument(const QWidget *widget)
|
||||
{
|
||||
if(!ctxptr)
|
||||
ctxptr = getCaptureContext(widget);
|
||||
@@ -216,7 +216,7 @@ bool RichResourceTextCheck(const QVariant &var)
|
||||
return var.userType() == qMetaTypeId<RichResourceTextPtr>();
|
||||
}
|
||||
|
||||
void RichResourceTextPaint(QWidget *owner, QPainter *painter, QRect rect, QFont font,
|
||||
void RichResourceTextPaint(const QWidget *owner, QPainter *painter, QRect rect, QFont font,
|
||||
QPalette palette, bool mouseOver, QPoint mousePos, const QVariant &var)
|
||||
{
|
||||
RichResourceTextPtr linkedText = var.value<RichResourceTextPtr>();
|
||||
@@ -280,7 +280,7 @@ void RichResourceTextPaint(QWidget *owner, QPainter *painter, QRect rect, QFont
|
||||
}
|
||||
}
|
||||
|
||||
int RichResourceTextWidthHint(QWidget *owner, const QVariant &var)
|
||||
int RichResourceTextWidthHint(const QWidget *owner, const QVariant &var)
|
||||
{
|
||||
RichResourceTextPtr linkedText = var.value<RichResourceTextPtr>();
|
||||
|
||||
@@ -289,7 +289,8 @@ int RichResourceTextWidthHint(QWidget *owner, const QVariant &var)
|
||||
return linkedText->doc.idealWidth();
|
||||
}
|
||||
|
||||
bool RichResourceTextMouseEvent(QWidget *owner, const QVariant &var, QRect rect, QMouseEvent *event)
|
||||
bool RichResourceTextMouseEvent(const QWidget *owner, const QVariant &var, QRect rect,
|
||||
QMouseEvent *event)
|
||||
{
|
||||
// only process clicks or moves
|
||||
if(event->type() != QEvent::MouseButtonRelease && event->type() != QEvent::MouseMove)
|
||||
|
||||
@@ -133,17 +133,18 @@ void RichResourceTextInitialise(QVariant &var);
|
||||
bool RichResourceTextCheck(const QVariant &var);
|
||||
|
||||
// paint the given variant containing rich text with the given parameters.
|
||||
void RichResourceTextPaint(QWidget *owner, QPainter *painter, QRect rect, QFont font,
|
||||
void RichResourceTextPaint(const QWidget *owner, QPainter *painter, QRect rect, QFont font,
|
||||
QPalette palette, bool mouseOver, QPoint mousePos, const QVariant &var);
|
||||
|
||||
// gives the width for a size hint for the rich text (since it might be larger than the original
|
||||
// text)
|
||||
int RichResourceTextWidthHint(QWidget *owner, const QVariant &var);
|
||||
int RichResourceTextWidthHint(const QWidget *owner, const QVariant &var);
|
||||
|
||||
// handle a mouse event on some rich resource text.
|
||||
// returns true if the event is processed - for mouse move events, this means that the mouse is over
|
||||
// a resource link (which can be used to change the cursor to a pointing hand, for example).
|
||||
bool RichResourceTextMouseEvent(QWidget *owner, const QVariant &var, QRect rect, QMouseEvent *event);
|
||||
bool RichResourceTextMouseEvent(const QWidget *owner, const QVariant &var, QRect rect,
|
||||
QMouseEvent *event);
|
||||
|
||||
// register runtime conversions for custom Qt metatypes
|
||||
void RegisterMetatypeConversions();
|
||||
|
||||
Reference in New Issue
Block a user