1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge branch 'pr1763'

This commit is contained in:
tux3 2015-06-03 02:10:37 +02:00
commit a086e6d7b1
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
2 changed files with 32 additions and 0 deletions

View File

@ -154,3 +154,33 @@ void EmoticonsWidget::mouseReleaseEvent(QMouseEvent *ev)
void EmoticonsWidget::mousePressEvent(QMouseEvent*)
{
}
void EmoticonsWidget::wheelEvent (QWheelEvent *e)
{
if (e->orientation() == Qt::Vertical)
{
if (e->delta() < 0 )
{
stack.setCurrentIndex(stack.currentIndex()+1);
}
else
{
stack.setCurrentIndex(stack.currentIndex()-1);
}
emit PageButtonsUpdate();
}
}
void EmoticonsWidget::PageButtonsUpdate()
{
QList<QRadioButton*> pageButtons = this->findChildren<QRadioButton*>(QString());
QRadioButton *t_pageButton;
foreach (t_pageButton,pageButtons)
{
if ( t_pageButton->property("pageIndex").toInt()==stack.currentIndex())
t_pageButton->setChecked(true);
else
t_pageButton->setChecked(false);
}
}

View File

@ -31,10 +31,12 @@ signals:
private slots:
void onSmileyClicked();
void onPageButtonClicked();
void PageButtonsUpdate();
protected:
virtual void mouseReleaseEvent(QMouseEvent *ev);
virtual void mousePressEvent(QMouseEvent *ev);
virtual void wheelEvent(QWheelEvent * event) override;
private:
QStackedWidget stack;