コード例 #1
0
void FancyLineEdit::setButtonPixmap(Side side, const QPixmap &buttonPixmap)
{
    d->m_iconbutton[side]->setPixmap(buttonPixmap);
    updateMargins();
    updateButtonPositions();
    update();
}
コード例 #2
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void SearchLineEdit::setButtonPixmap(Side side, const QPixmap& buttonPixmap)
{
  d->m_IconButtons[side]->setPixmap(buttonPixmap);
  updateMargins();
  updateButtonPositions();
  update();
}
コード例 #3
0
void FancyLineEdit::setButtonVisible(Side side, bool visible)
{
    m_d->m_iconbutton[side]->setVisible(visible);
    m_d->m_iconEnabled[side] = visible;
    updateMargins();
    updateButtonPositions();
}
コード例 #4
0
ファイル: katetabbar.cpp プロジェクト: benpope82/kate
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;
}
コード例 #5
0
ファイル: fancylineedit.cpp プロジェクト: choenig/qt-creator
void FancyLineEdit::setButtonIcon(Side side, const QIcon &icon)
{
    d->m_iconbutton[side]->setIcon(icon);
    updateMargins();
    updateButtonPositions();
    update();
}
コード例 #6
0
ファイル: katetabbar.cpp プロジェクト: benpope82/kate
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++;
}
コード例 #7
0
void FancyLineEdit::resizeEvent(QResizeEvent *)
{
    updateButtonPositions();
}
コード例 #8
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void SearchLineEdit::resizeEvent(QResizeEvent*)
{
  updateButtonPositions();
}