Skip to content

Commit

Permalink
BUG: Call setLayoutOrientation method in the widget init
Browse files Browse the repository at this point in the history
  • Loading branch information
Punzo committed Jun 29, 2023
1 parent 61447f7 commit 8de0638
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Libs/Widgets/ctkErrorLogWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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));
Expand Down
6 changes: 4 additions & 2 deletions Libs/Widgets/ctkErrorLogWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 8de0638

Please sign in to comment.