From 8de0638d68ae7c19a4bd3647e99922ff16606e82 Mon Sep 17 00:00:00 2001 From: Davide Punzo Date: Thu, 29 Jun 2023 15:41:21 +0200 Subject: [PATCH] BUG: Call setLayoutOrientation method in the widget init --- Libs/Widgets/ctkErrorLogWidget.cpp | 4 +++- Libs/Widgets/ctkErrorLogWidget.h | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Libs/Widgets/ctkErrorLogWidget.cpp b/Libs/Widgets/ctkErrorLogWidget.cpp index 20614c128f..7cad419831 100644 --- a/Libs/Widgets/ctkErrorLogWidget.cpp +++ b/Libs/Widgets/ctkErrorLogWidget.cpp @@ -55,7 +55,7 @@ class ctkErrorLogWidgetPrivate : public Ui_ctkErrorLogWidget ctkErrorLogWidgetPrivate::ctkErrorLogWidgetPrivate(ctkErrorLogWidget& object) : q_ptr(&object) { - this->LayoutOrientation = Qt::Orientation::Vertical; + this->LayoutOrientation = Qt::Orientation::Horizontal; this->ErrorButtonFilter = ctkErrorLogLevel::Error | ctkErrorLogLevel::Critical | ctkErrorLogLevel::Fatal; this->WarningButtonFilter = ctkErrorLogLevel::Warning; this->InfoButtonFilter = ctkErrorLogLevel::Info | ctkErrorLogLevel::Debug | ctkErrorLogLevel::Trace | ctkErrorLogLevel::Status; @@ -66,6 +66,8 @@ void ctkErrorLogWidgetPrivate::init() { Q_Q(ctkErrorLogWidget); + q->setLayoutOrientation(Qt::Orientation::Vertical); + // this->ShowAllEntryButton->setIcon(); this->ShowErrorEntryButton->setIcon(q->style()->standardIcon(QStyle::SP_MessageBoxCritical)); this->ShowWarningEntryButton->setIcon(q->style()->standardIcon(QStyle::SP_MessageBoxWarning)); diff --git a/Libs/Widgets/ctkErrorLogWidget.h b/Libs/Widgets/ctkErrorLogWidget.h index ff5743499b..cb86bfe07f 100644 --- a/Libs/Widgets/ctkErrorLogWidget.h +++ b/Libs/Widgets/ctkErrorLogWidget.h @@ -37,6 +37,7 @@ class QModelIndex; class CTK_WIDGETS_EXPORT ctkErrorLogWidget : public QWidget { Q_OBJECT + Q_PROPERTY(Qt::Orientation layoutOrientation READ layoutOrientation WRITE setLayoutOrientation) public: typedef QWidget Superclass; explicit ctkErrorLogWidget(QWidget* parentWidget = 0); @@ -51,10 +52,11 @@ class CTK_WIDGETS_EXPORT ctkErrorLogWidget : public QWidget /// This property describes how the list of errors and error description are organized. /// The orientation must be Qt::Horizontal (the default) or Qt::Vertical. - Q_INVOKABLE void setLayoutOrientation(Qt::Orientation orientation); - Q_INVOKABLE Qt::Orientation layoutOrientation() const; + Qt::Orientation layoutOrientation() const; public Q_SLOTS: + void setLayoutOrientation(Qt::Orientation orientation); + void setAllEntriesVisible(bool visibility = true); void setErrorEntriesVisible(bool visibility);