File indexing completed on 2025-02-02 14:20:11
0001 /* 0002 SPDX-FileCopyrightText: 1997 Michael Roth <mroth@wirlweb.de> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KSEPARATOR_H 0008 #define KSEPARATOR_H 0009 0010 #include <QFrame> 0011 #include <kwidgetsaddons_export.h> 0012 #include <memory> 0013 0014 /** 0015 * @class KSeparator kseparator.h KSeparator 0016 * 0017 * Standard horizontal or vertical separator. 0018 * 0019 * \image html kseparator-horizontal.png "KSeparator Widget with horizontal orientation" 0020 * \image html kseparator-vertical.png "KSeparator Widget with vertical orientation" 0021 * 0022 * @author Michael Roth <mroth@wirlweb.de> 0023 */ 0024 class KWIDGETSADDONS_EXPORT KSeparator : public QFrame 0025 { 0026 Q_OBJECT 0027 Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) 0028 0029 public: 0030 /** 0031 * Constructor. 0032 * @param parent parent object. 0033 * @param f extra QWidget flags. 0034 */ 0035 explicit KSeparator(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 0036 0037 /** 0038 * Constructor. 0039 * @param orientation Set the orientation of the separator. 0040 * Possible values are Horizontal or Vertical. 0041 * @param parent parent object. 0042 * @param f extra QWidget flags. 0043 */ 0044 explicit KSeparator(Qt::Orientation orientation, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 0045 0046 ~KSeparator() override; 0047 0048 /** 0049 * Returns the orientation of the separator. 0050 * @return int Possible values Horizontal or Vertical. 0051 */ 0052 Qt::Orientation orientation() const; 0053 0054 /** 0055 * Set the orientation of the separator to @p orientation 0056 * 0057 * @param orientation Possible values are Vertical and Horizontal. 0058 */ 0059 void setOrientation(Qt::Orientation orientation); 0060 0061 private: 0062 std::unique_ptr<class KSeparatorPrivate> const d; 0063 }; 0064 0065 #endif // KSEPARATOR_H