Krita Source Code Documentation
Loading...
Searching...
No Matches
Section Class Reference

#include <KoToolBoxLayout_p.h>

+ Inheritance diagram for Section:

Public Types

enum  SeparatorFlag { SeparatorTop = 0x0001 , SeparatorLeft = 0x0008 }
 

Public Member Functions

void addButton (QAbstractButton *button, int priority)
 
QSize iconSize () const
 
QString name () const
 
 Section (QWidget *parent=0)
 
Separators separators () const
 
void setButtonSize (QSize size)
 
void setName (const QString &name)
 
void setOrientation (Qt::Orientation orientation)
 
void setSeparator (Separators separators)
 
int visibleButtonCount () const
 

Private Attributes

SectionLayoutm_layout
 
QString m_name
 
Separators m_separators
 

Detailed Description

Definition at line 137 of file KoToolBoxLayout_p.h.

Member Enumeration Documentation

◆ SeparatorFlag

Enumerator
SeparatorTop 
SeparatorLeft 

Definition at line 140 of file KoToolBoxLayout_p.h.

140 {
141 SeparatorTop = 0x0001,/* SeparatorBottom = 0x0002, SeparatorRight = 0x0004,*/ SeparatorLeft = 0x0008
142 };

Constructor & Destructor Documentation

◆ Section()

Section::Section ( QWidget * parent = 0)
inlineexplicit

Definition at line 144 of file KoToolBoxLayout_p.h.

145 : QWidget(parent),
146 m_layout(new SectionLayout(this))
147 {
148// Re-enable this when we need to debug the section layout again.
149// setAutoFillBackground(true);
150// static int i = 0;
151// switch(i) {
152// case 0:
153// setStyleSheet("background-color:red");
154// break;
155// case 1:
156// setStyleSheet("background-color:blue");
157// break;
158// case 2:
159// setStyleSheet("background-color:green");
160// break;
161// case 3:
162// setStyleSheet("background-color:yellow");
163// break;
164// case 4:
165// setStyleSheet("background-color:white");
166// break;
167// case 5:
168// setStyleSheet("background-color:gray");
169// break;
170// case 6:
171// setStyleSheet("background-color:lime");
172// break;
173// case 7:
174// setStyleSheet("background-color:silver");
175// break;
176// case 8:
177// setStyleSheet("background-color:purple");
178// break;
179// default:
180// setStyleSheet("background-color:maroon");
181// break;
182// }
183// i++;
184
185 }
SectionLayout * m_layout

Member Function Documentation

◆ addButton()

void Section::addButton ( QAbstractButton * button,
int priority )
inline

Definition at line 187 of file KoToolBoxLayout_p.h.

188 {
189 m_layout->addButton(button, priority);
190 }
void addButton(QAbstractButton *button, int priority)
QString button(const QWheelEvent &ev)

References SectionLayout::addButton(), button(), and m_layout.

◆ iconSize()

QSize Section::iconSize ( ) const
inline

Definition at line 208 of file KoToolBoxLayout_p.h.

209 {
210 return m_layout->buttonSize();
211 }
const QSize & buttonSize() const

References SectionLayout::buttonSize(), and m_layout.

◆ name()

QString Section::name ( ) const
inline

Definition at line 198 of file KoToolBoxLayout_p.h.

199 {
200 return m_name;
201 }

References m_name.

◆ separators()

Separators Section::separators ( ) const
inline

Definition at line 228 of file KoToolBoxLayout_p.h.

229 {
230 return m_separators;
231 }
Separators m_separators

References m_separators.

◆ setButtonSize()

void Section::setButtonSize ( QSize size)
inline

Definition at line 203 of file KoToolBoxLayout_p.h.

204 {
205 m_layout->setButtonSize(size);
206 }
void setButtonSize(const QSize size)

References m_layout, and SectionLayout::setButtonSize().

◆ setName()

void Section::setName ( const QString & name)
inline

Definition at line 192 of file KoToolBoxLayout_p.h.

193 {
194 setObjectName(name);
195 m_name = name;
196 }
QString name() const

References m_name, and name().

◆ setOrientation()

void Section::setOrientation ( Qt::Orientation orientation)
inline

Definition at line 233 of file KoToolBoxLayout_p.h.

234 {
235 m_layout->setOrientation(orientation);
236 }
void setOrientation(Qt::Orientation orientation)

References m_layout, and SectionLayout::setOrientation().

◆ setSeparator()

void Section::setSeparator ( Separators separators)
inline

Definition at line 223 of file KoToolBoxLayout_p.h.

224 {
226 }
Separators separators() const

References m_separators, and separators().

◆ visibleButtonCount()

int Section::visibleButtonCount ( ) const
inline

Definition at line 213 of file KoToolBoxLayout_p.h.

214 {
215 int count = 0;
216 for(int i = m_layout->count()-1; i >= 0; --i) {
217 if (! static_cast<QWidgetItem*> (m_layout->itemAt(i))->isEmpty())
218 ++count;
219 }
220 return count;
221 }
QLayoutItem * itemAt(int i) const override
int count() const override

References SectionLayout::count(), SectionLayout::itemAt(), and m_layout.

Member Data Documentation

◆ m_layout

SectionLayout* Section::m_layout
private

Definition at line 241 of file KoToolBoxLayout_p.h.

◆ m_name

QString Section::m_name
private

Definition at line 242 of file KoToolBoxLayout_p.h.

◆ m_separators

Separators Section::m_separators
private

Definition at line 243 of file KoToolBoxLayout_p.h.


The documentation for this class was generated from the following file: