void FancyLineEdit::setButtonPixmap(Side side, const QPixmap &buttonPixmap) { d->m_iconbutton[side]->setPixmap(buttonPixmap); updateMargins(); updateButtonPositions(); update(); }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void SearchLineEdit::setButtonPixmap(Side side, const QPixmap& buttonPixmap) { d->m_IconButtons[side]->setPixmap(buttonPixmap); updateMargins(); updateButtonPositions(); update(); }
void FancyLineEdit::setButtonVisible(Side side, bool visible) { m_d->m_iconbutton[side]->setVisible(visible); m_d->m_iconEnabled[side] = visible; updateMargins(); updateButtonPositions(); }
int KateTabBar::removeTab(int id) { Q_ASSERT(m_idToTab.contains(id)); KateTabButton *tabButton = m_idToTab.value(id, nullptr); if (tabButton == m_activeButton) { m_activeButton = Q_NULLPTR; } const int position = m_tabButtons.indexOf(tabButton); if (position != -1) { m_idToTab.remove(id); m_tabButtons.removeAt(position); } if (tabButton) { // delete the button with deleteLater() because the button itself might // have send a close-request. So the app-execution is still in the // button, a delete tabButton; would lead to a crash. tabButton->hide(); tabButton->deleteLater(); } updateButtonPositions(true); return position; }
void FancyLineEdit::setButtonIcon(Side side, const QIcon &icon) { d->m_iconbutton[side]->setIcon(icon); updateMargins(); updateButtonPositions(); update(); }
int KateTabBar::insertTab(int position, const QString & text) { Q_ASSERT(position <= m_tabButtons.size()); // -1 is append if (position < 0) { position = m_tabButtons.size(); } KateTabButton *tabButton = new KateTabButton(text, this); m_tabButtons.insert(position, tabButton); m_idToTab[m_nextID] = tabButton; connect(tabButton, &KateTabButton::activated, this, &KateTabBar::tabButtonActivated); connect(tabButton, &KateTabButton::closeRequest, this, &KateTabBar::tabButtonCloseRequest); // abort potential keeping of width m_keepTabWidth = false; updateButtonPositions(true); return m_nextID++; }
void FancyLineEdit::resizeEvent(QResizeEvent *) { updateButtonPositions(); }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void SearchLineEdit::resizeEvent(QResizeEvent*) { updateButtonPositions(); }