1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-19 18:26:34 +01:00

src/tools folder

This commit is contained in:
nowrep 2011-03-03 15:24:59 +01:00
parent 22aca9c81c
commit 300c4094ae
9 changed files with 139 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,6 +1,6 @@
build
DEBIAN
tools
tools_
src0.9.4
src0.9.5
src0.9.6

View File

@ -0,0 +1,18 @@
#include "clickablelabel.h"
ClickableLabel::ClickableLabel(QWidget *parent) :
QLabel(parent)
{
}
void ClickableLabel::mousePressEvent(QMouseEvent *ev)
{
if (ev->button() == Qt::LeftButton)
emit clicked(ev->globalPos());
}
void ClickableLabel::mouseDoubleClickEvent(QMouseEvent *ev)
{
if (ev->button() == Qt::LeftButton)
emit clicked(ev->globalPos());
}

View File

@ -0,0 +1,22 @@
#ifndef CLICKABLELABEL_H
#define CLICKABLELABEL_H
#include <QLabel>
#include <QMouseEvent>
class ClickableLabel : public QLabel
{
Q_OBJECT
public:
explicit ClickableLabel(QWidget *parent = 0);
signals:
void clicked(QPoint);
private:
void mousePressEvent(QMouseEvent *ev);
void mouseDoubleClickEvent(QMouseEvent *ev);
};
#endif // CLICKABLELABEL_H

14
src/tools/frame.cpp Normal file
View File

@ -0,0 +1,14 @@
#include "frame.h"
Frame::Frame(QWidget *parent) :
QFrame(parent)
{
}
void Frame::mousePressEvent(QMouseEvent *event)
{
//If we proccess mouse events, then menu from bookmarkswidget
//is going to close() with clicking in free space
Q_UNUSED(event)
event->accept();
}

22
src/tools/frame.h Normal file
View File

@ -0,0 +1,22 @@
#ifndef FRAME_H
#define FRAME_H
#include <QFrame>
#include <QMouseEvent>
class Frame : public QFrame
{
Q_OBJECT
public:
explicit Frame(QWidget *parent = 0);
signals:
public slots:
private:
void mousePressEvent(QMouseEvent *event);
};
#endif // FRAME_H

View File

@ -0,0 +1,6 @@
#include "notification.h"
Notification::Notification(QWidget *parent) :
QWidget(parent)
{
}

18
src/tools/notification.h Normal file
View File

@ -0,0 +1,18 @@
#ifndef NOTIFICATION_H
#define NOTIFICATION_H
#include <QWidget>
class Notification : public QWidget
{
Q_OBJECT
public:
explicit Notification(QWidget *parent = 0);
signals:
public slots:
};
#endif // NOTIFICATION_H

14
src/tools/treewidget.cpp Normal file
View File

@ -0,0 +1,14 @@
#include "treewidget.h"
TreeWidget::TreeWidget(QWidget *parent) :
QTreeWidget(parent)
{
}
void TreeWidget::mousePressEvent(QMouseEvent *event)
{
if (event->modifiers() == Qt::ControlModifier)
emit itemControlClicked(itemAt(event->pos()));
QTreeWidget::mousePressEvent(event);
}

24
src/tools/treewidget.h Normal file
View File

@ -0,0 +1,24 @@
#ifndef BOOKMARKSTREEWIDGET_H
#define BOOKMARKSTREEWIDGET_H
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QMouseEvent>
class TreeWidget : public QTreeWidget
{
Q_OBJECT
public:
explicit TreeWidget(QWidget *parent = 0);
signals:
void itemControlClicked(QTreeWidgetItem *item);
public slots:
private:
void mousePressEvent(QMouseEvent *event);
};
#endif // BOOKMARKSTREEWIDGET_H