RibbonGallery Class
RibbonGallery class represents the gallery control. More...
Header: | #include <RibbonGallery> |
Inherits: | RibbonScrollArea |
Public Functions
RibbonGallery(QWidget *parent = Q_NULL) | |
virtual | ~RibbonGallery() override |
bool | autoWidth() const |
int | checkedIndex() const |
RibbonGalleryItem * | checkedItem() const |
int | columnCount() const |
RibbonGalleryGroup * | galleryGroup() const |
QRect | getDrawItemRect(int index) |
QRect | getItemsRect() const |
void | hideSelection() |
int | hitTestItem(QPoint point, QRect *rect = Q_NULL) const |
bool | isBorderVisible() const |
bool | isItemSelected() const |
bool | isLabelsVisible() const |
bool | isResizable() const |
bool | isTransparent() const |
virtual QMargins | margins() const |
int | maximumColumnCount() const |
int | minimumColumnCount() const |
OfficePopupMenu * | popupMenu() const |
int | rowCount() const |
Qt::ScrollBarPolicy | scrollBarPolicy() const |
int | selectedItem() const |
void | setAutoWidth(bool width) |
void | setBorderVisible(bool visible) |
void | setCheckedIndex(int index) |
void | setCheckedItem(const RibbonGalleryItem *item) |
void | setColumnCount(int count) |
void | setGalleryGroup(RibbonGalleryGroup *group) |
void | setLabelsVisible(bool showLabels) |
void | setMaximumColumnCount(int count) |
void | setMinimumColumnCount(int count) |
QAction * | setPopupMenu(OfficePopupMenu *popupMenu) |
void | setRowCount(int row) |
void | setScrollBarPolicy(Qt::ScrollBarPolicy policy) |
void | setSelectedItem(int index) |
void | setTransparent(bool transparent = true) |
Reimplemented Public Functions
virtual QSize | minimumSizeHint() const override |
virtual QSize | sizeHint() const override |
Signals
void | currentItemChanged(RibbonGalleryItem *current, RibbonGalleryItem *previous) |
void | itemClicked(RibbonGalleryItem *item) |
void | itemClicking(RibbonGalleryItem *item, bool &handled) |
void | itemPressed(RibbonGalleryItem *item) |
Reimplemented Protected Functions
virtual bool | event(QEvent *event) override |
virtual void | focusOutEvent(QFocusEvent *event) override |
virtual void | keyPressEvent(QKeyEvent *event) override |
virtual void | leaveEvent(QEvent *event) override |
virtual void | mouseMoveEvent(QMouseEvent *event) override |
virtual void | mousePressEvent(QMouseEvent *event) override |
virtual void | mouseReleaseEvent(QMouseEvent *event) override |
virtual void | paintEvent(QPaintEvent *event) override |
virtual void | resizeEvent(QResizeEvent *event) override |
virtual void | wheelEvent(QWheelEvent *event) override |
Detailed Description
Member Function Documentation
RibbonGallery::RibbonGallery(QWidget *parent = Q_NULL)
Constructs RibbonGallery object with the given parent.
[override virtual noexcept]
RibbonGallery::~RibbonGallery()
Destructor of the RibbonGallery object.
int RibbonGallery::checkedIndex() const
Returns chcked item index in the gallery.
See also setCheckedIndex().
RibbonGalleryItem *RibbonGallery::checkedItem() const
Returs the reference to the RibbonGalleryItem object of the chcked item in the gallery. See int getCheckedIndex();
See also setCheckedItem().
int RibbonGallery::columnCount() const
Returns a current count of column in the ribbon gallery.
See also setColumnCount().
[signal]
void RibbonGallery::currentItemChanged(RibbonGalleryItem *current, RibbonGalleryItem *previous)
Signal throws when the current item was changed. previous - reference to the previous selected item. current the reference to the current selected item.
[override virtual protected]
bool RibbonGallery::event(QEvent *event)
Reimplements: RibbonScrollArea::event(QEvent *e).
[override virtual protected]
void RibbonGallery::focusOutEvent(QFocusEvent *event)
Reimplements: QWidget::focusOutEvent(QFocusEvent *event).
RibbonGalleryGroup *RibbonGallery::galleryGroup() const
Returns reference to the RibbonGalleryGroup object.
See also setGalleryGroup().
QRect RibbonGallery::getDrawItemRect(int index)
Returns the bounded rectangle of the item by the given index.
QRect RibbonGallery::getItemsRect() const
Returns the united boundary of all elements within the galleries.
void RibbonGallery::hideSelection()
Hide all selection of the gallery's item.
int RibbonGallery::hitTestItem(QPoint point, QRect *rect = Q_NULL) const
Returns the index of the item by given mouse point. If rect is not Q_NULL it will contain the rectangle the gallery's item.
bool RibbonGallery::isBorderVisible() const
Returns the visibility of the border around the gallery. By default the border is not visible.
Note: Getter function for property borderVisible.
bool RibbonGallery::isItemSelected() const
Returns whether selected items in the gallery.
bool RibbonGallery::isResizable() const
Returns possibility to resize.
Note: Getter function for property resizable.
[signal]
void RibbonGallery::itemClicked(RibbonGalleryItem *item)
Signal throws when you click on the item in the gallery.
[signal]
void RibbonGallery::itemClicking(RibbonGalleryItem *item, bool &handled)
Signal throws when user is clicking on the item in the gallery. item - the reference to the clicking item. handled - the flag to prevent of closing the gallery popup. If handled is true then the gallery popup will not be closed. By default it is false.
[signal]
void RibbonGallery::itemPressed(RibbonGalleryItem *item)
Signal throws when you press mouse button on the item in the gallery.
[override virtual protected]
void RibbonGallery::keyPressEvent(QKeyEvent *event)
Reimplements: QAbstractScrollArea::keyPressEvent(QKeyEvent *e).
[override virtual protected]
void RibbonGallery::leaveEvent(QEvent *event)
Reimplements: QWidget::leaveEvent(QEvent *event).
[virtual]
QMargins RibbonGallery::margins() const
Returns the bounds of gallery in the rectangle form.
int RibbonGallery::maximumColumnCount() const
Returns a maximum count of column in the ribbon gallery.
Note: Getter function for property maximumColumnCount.
See also setMaximumColumnCount().
int RibbonGallery::minimumColumnCount() const
Returns a minimum count of column in the ribbon gallery.
Note: Getter function for property minimumColumnCount.
See also setMinimumColumnCount().
[override virtual]
QSize RibbonGallery::minimumSizeHint() const
Reimplements: QAbstractScrollArea::minimumSizeHint() const.
[override virtual protected]
void RibbonGallery::mouseMoveEvent(QMouseEvent *event)
Reimplements: QAbstractScrollArea::mouseMoveEvent(QMouseEvent *e).
[override virtual protected]
void RibbonGallery::mousePressEvent(QMouseEvent *event)
Reimplements: QAbstractScrollArea::mousePressEvent(QMouseEvent *e).
[override virtual protected]
void RibbonGallery::mouseReleaseEvent(QMouseEvent *event)
Reimplements: QAbstractScrollArea::mouseReleaseEvent(QMouseEvent *e).
[override virtual protected]
void RibbonGallery::paintEvent(QPaintEvent *event)
Reimplements: RibbonScrollArea::paintEvent(QPaintEvent *event).
OfficePopupMenu *RibbonGallery::popupMenu() const
Returns gallery's popup menu.
See also setPopupMenu().
[override virtual protected]
void RibbonGallery::resizeEvent(QResizeEvent *event)
Reimplements: QAbstractScrollArea::resizeEvent(QResizeEvent *event).
int RibbonGallery::rowCount() const
Returns a current count of row in the ribbon gallery.
See also setRowCount().
Qt::ScrollBarPolicy RibbonGallery::scrollBarPolicy() const
Returns policy of the scrollbars.
Note: Getter function for property scrollBarPolicy.
See also setScrollBarPolicy().
int RibbonGallery::selectedItem() const
Returns the index of the selected element in the gallery.
See also setSelectedItem().
void RibbonGallery::setBorderVisible(bool visible)
Sets the visibility of the border around the gallery to \visible
.
Note: Setter function for property borderVisible.
See also isBorderVisible().
void RibbonGallery::setCheckedIndex(int index)
Sets checked item with the given index.
See also checkedIndex().
void RibbonGallery::setCheckedItem(const RibbonGalleryItem *item)
Sets checked item with the given reference to the RibbonGalleryItem object. See setCheckedIndex(int index).
See also checkedItem().
void RibbonGallery::setColumnCount(int count)
Assigns a current count of column in the ribbon gallery.
See also columnCount().
void RibbonGallery::setGalleryGroup(RibbonGalleryGroup *group)
Sets group for the gallery. group - is a pointer to the elements group.
See also galleryGroup().
void RibbonGallery::setMaximumColumnCount(int count)
Assigns a maximum count of column in the ribbon gallery.
Note: Setter function for property maximumColumnCount.
See also maximumColumnCount().
void RibbonGallery::setMinimumColumnCount(int count)
Assigns a minimum count of column in the ribbon gallery.
Note: Setter function for property minimumColumnCount.
See also minimumColumnCount().
QAction *RibbonGallery::setPopupMenu(OfficePopupMenu *popupMenu)
Sets popup menu for the gallery.
See also popupMenu().
void RibbonGallery::setRowCount(int row)
Assigns a current count of row in the ribbon gallery.
See also rowCount().
void RibbonGallery::setScrollBarPolicy(Qt::ScrollBarPolicy policy)
Sets policy of the scrollbars.
Note: Setter function for property scrollBarPolicy.
See also scrollBarPolicy().
void RibbonGallery::setSelectedItem(int index)
Sets the selected element in the gallery by its index.
See also selectedItem().
[override virtual]
QSize RibbonGallery::sizeHint() const
Reimplements: QAbstractScrollArea::sizeHint() const.
[override virtual protected]
void RibbonGallery::wheelEvent(QWheelEvent *event)
Reimplements: QAbstractScrollArea::wheelEvent(QWheelEvent *e).