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

#include <KoToolBoxLayout_p.h>

+ Inheritance diagram for Section:

Public Types

enum  SeparatorFlag { SeparatorNone = 0 , SeparatorTop = (1 << 0) , SeparatorLeft = (1 << 3) }
 

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 setOnset (int onset)
 
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
SeparatorNone 
SeparatorTop 
SeparatorLeft 

Definition at line 140 of file KoToolBoxLayout_p.h.

140 {
141 SeparatorNone = 0,
142 SeparatorTop = (1 << 0),
143 // SeparatorBottom = (1 << 1),
144 // SeparatorRight = (1 << 2),
145 SeparatorLeft = (1 << 3)
146 };

Constructor & Destructor Documentation

◆ Section()

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

Definition at line 148 of file KoToolBoxLayout_p.h.

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

Member Function Documentation

◆ addButton()

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

Definition at line 191 of file KoToolBoxLayout_p.h.

192 {
193 m_layout->addButton(button, priority);
194 }
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 212 of file KoToolBoxLayout_p.h.

213 {
214 return m_layout->buttonSize();
215 }
const QSize & buttonSize() const

References SectionLayout::buttonSize(), and m_layout.

◆ name()

QString Section::name ( ) const
inline

Definition at line 202 of file KoToolBoxLayout_p.h.

203 {
204 return m_name;
205 }

References m_name.

◆ separators()

Separators Section::separators ( ) const
inline

Definition at line 232 of file KoToolBoxLayout_p.h.

233 {
234 return m_separators;
235 }
Separators m_separators

References m_separators.

◆ setButtonSize()

void Section::setButtonSize ( QSize size)
inline

Definition at line 207 of file KoToolBoxLayout_p.h.

208 {
209 m_layout->setButtonSize(size);
210 }
void setButtonSize(const QSize size)

References m_layout, and SectionLayout::setButtonSize().

◆ setName()

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

Definition at line 196 of file KoToolBoxLayout_p.h.

197 {
198 setObjectName(name);
199 m_name = name;
200 }
QString name() const

References m_name, and name().

◆ setOnset()

void Section::setOnset ( int onset)
inline

Definition at line 242 of file KoToolBoxLayout_p.h.

243 {
244 m_layout->setOnset(onset);
245 }
void setOnset(int onset)

References m_layout, and SectionLayout::setOnset().

◆ setOrientation()

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

Definition at line 237 of file KoToolBoxLayout_p.h.

238 {
239 m_layout->setOrientation(orientation);
240 }
void setOrientation(Qt::Orientation orientation)

References m_layout, and SectionLayout::setOrientation().

◆ setSeparator()

void Section::setSeparator ( Separators separators)
inline

Definition at line 227 of file KoToolBoxLayout_p.h.

228 {
230 }
Separators separators() const

References m_separators, and separators().

◆ visibleButtonCount()

int Section::visibleButtonCount ( ) const
inline

Definition at line 217 of file KoToolBoxLayout_p.h.

218 {
219 int count = 0;
220 for(int i = m_layout->count()-1; i >= 0; --i) {
221 if (! static_cast<QWidgetItem*> (m_layout->itemAt(i))->isEmpty())
222 ++count;
223 }
224 return count;
225 }
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 250 of file KoToolBoxLayout_p.h.

◆ m_name

QString Section::m_name
private

Definition at line 251 of file KoToolBoxLayout_p.h.

◆ m_separators

Separators Section::m_separators
private

Definition at line 252 of file KoToolBoxLayout_p.h.


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