Commit de74c9b7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port deprecated method

parent de38a8b0
......@@ -64,7 +64,7 @@ class PaletteLayout: public QLayout
{
public:
PaletteLayout(QWidget *parent, int margin = 0, int spacing = -1)
: QLayout(parent) { setMargin(margin); setSpacing(spacing); resetCache(); }
: QLayout(parent) { setContentsMargins(margin, margin, margin, margin); setSpacing(spacing); resetCache(); }
PaletteLayout(int spacing = -1) { setSpacing(spacing); resetCache(); }
~PaletteLayout() { QLayoutItem *item; while ((item = takeAt(0))) delete item; }
......
......@@ -36,8 +36,8 @@ public:
explicit MessageFrame(QWidget* parent = 0);
int showMessage(Type type, const QString& text, Flags flags = 0);
int changeMessage(int id, Type type, const QString& text, Flags flags = 0);
int showMessage(Type type, const QString& text, Flags flags = {});
int changeMessage(int id, Type type, const QString& text, Flags flags = {});
void closeMessage(int id);
signals:
......
......@@ -77,7 +77,7 @@ protected:
/** Show creation status message. If flags do not contains CloseButton and CloseTimer than it is
* treated as persistent status message (and will replace previous status message, if any).
* In flags contains CloseButton or CloseTimer than it is treated as additional message */
void showMessage(MessageFrame::Type type, const QString& text, MessageFrame::Flags flags = 0);
void showMessage(MessageFrame::Type type, const QString& text, MessageFrame::Flags flags = {});
/** Close last persistent status message */
void closeMessage();
......
......@@ -144,7 +144,7 @@ public:
* \note Set flags to UndoNoMerge in order to disable merging this
* command with previous on undo history and avoid changing of command order */
void setProperty(StepCore::Object* object, const StepCore::MetaProperty* property,
const QVariant& value, UndoFlags flags = 0);
const QVariant& value, UndoFlags flags = {});
/** Modify object property.
* \param object object to modify
......@@ -155,7 +155,7 @@ public:
* \note Set flags to UndoNoMerge in order to disable merging this
* command with previous on undo history and avoid changing of command order */
void setProperty(StepCore::Object* object, const QString& propertyName,
const QVariant& value, UndoFlags flags = 0) {
const QVariant& value, UndoFlags flags = {}) {
setProperty(object, object->metaObject()->property(propertyName), value, flags);
}
......@@ -172,7 +172,7 @@ public:
QString formatProperty(const StepCore::Object* object,
const StepCore::Object* objectErrors,
const StepCore::MetaProperty* property,
FormatFlags flags = 0) const;
FormatFlags flags = {}) const;
// Tooltip
/** Generate standard tooltip for object given by index */
......
......@@ -579,7 +579,6 @@ WorldGraphicsView::WorldGraphicsView(WorldScene* worldScene, QWidget* parent)
setDragMode(QGraphicsView::RubberBandDrag);
//setDragMode(QGraphicsView::ScrollHandDrag);
setResizeAnchor(QGraphicsView::AnchorViewCenter);
setOptimizationFlags(QGraphicsView::DontClipPainter/* | QGraphicsView::DontSavePainterState*/);
#ifdef __GNUC__
#warning Check paint() for all items to preserve painter state
#warning Use NoViewportUpdate and manual updating here !
......@@ -683,14 +682,14 @@ void WorldGraphicsView::mouseReleaseEvent(QMouseEvent* e)
void WorldGraphicsView::wheelEvent(QWheelEvent* e)
{
if (e->modifiers() == Qt::ControlModifier) {
if (e->orientation() != Qt::Vertical) {
if (e->angleDelta().y() == 0) {
e->ignore();
return;
}
QGraphicsView::ViewportAnchor anchor = transformationAnchor();
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
if (e->delta() > 0) {
if (e->angleDelta().y() > 0) {
zoomIn();
}
else {
......
......@@ -124,7 +124,7 @@ public slots:
* \param text message text
* \param flags message flags
* \return message id of the created message */
int showMessage(MessageFrame::Type type, const QString& text, MessageFrame::Flags flags = 0) {
int showMessage(MessageFrame::Type type, const QString& text, MessageFrame::Flags flags = {}) {
return _messageFrame->showMessage(type, text, flags);
}
/** Changed existing message
......@@ -133,7 +133,7 @@ public slots:
* \param text message text
* \param flags message flags
* \return new message id */
int changeMessage(int id, MessageFrame::Type type, const QString& text, MessageFrame::Flags flags = 0) {
int changeMessage(int id, MessageFrame::Type type, const QString& text, MessageFrame::Flags flags = {}) {
return _messageFrame->changeMessage(id, type, text, flags);
}
/** Close message
......
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