~schumski-deactivatedaccount-deactivatedaccount/k3b/master

« back to all changes in this revision

Viewing changes to libk3b/tools/k3bpushbutton.h

  • Committer: Sebastian Trueg
  • Date: 2009-02-22 22:39:42 UTC
  • Revision ID: git-v1:6dd604da258355f5620f2f59e0ddb7c52e625553
I finally did it: I moved all K3b classes into the K3b namespace. Now this might sound like completely useless (and it actually is, too)
but I like it better this way and it also forced me to look at nearly each source file to fix the things that my crude scripting skills
did not catch properly.
And on the way I also cleaned up the code, used QFlags a few more times and introduced some d-pointers.

svn path=/trunk/extragear/multimedia/k3b/; revision=930262

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
 
1
/*
2
2
 *
3
3
 * Copyright (C) 2004-2007 Sebastian Trueg <trueg@k3b.org>
4
4
 *
18
18
 
19
19
#include <kpushbutton.h>
20
20
#include "k3b_export.h"
21
 
//Added by qt3to4:
22
 
#include <QEvent>
23
 
#include <QMenu>
24
 
 
25
 
/**
26
 
 * A pushbutton with delayed popu pmenu support just like the KToolBarButton
27
 
 */
28
 
class LIBK3B_EXPORT K3bPushButton : public KPushButton
29
 
{
30
 
 Q_OBJECT
31
 
 
32
 
 public:
33
 
  /**
34
 
   * Default constructor.
35
 
   */
36
 
  K3bPushButton( QWidget* parent = 0 );
37
 
 
38
 
  /**
39
 
   * Constructor, that sets the button-text to @p text
40
 
   */
41
 
  K3bPushButton( const QString& text, QWidget* parent = 0 );
42
 
 
43
 
  /**
44
 
   * Constructor, that sets an icon and the button-text to @p text
45
 
   */
46
 
/*   K3bPushButton( const QIcon& icon, const QString& text, */
 
21
 
 
22
class QMenu;
 
23
class QEvent;
 
24
 
 
25
namespace K3b {
 
26
    /**
 
27
     * A pushbutton with delayed popu pmenu support just like the KToolBarButton
 
28
     */
 
29
    class LIBK3B_EXPORT PushButton : public KPushButton
 
30
    {
 
31
        Q_OBJECT
 
32
 
 
33
    public:
 
34
        /**
 
35
         * Default constructor.
 
36
         */
 
37
        PushButton( QWidget* parent = 0 );
 
38
 
 
39
        /**
 
40
         * Constructor, that sets the button-text to @p text
 
41
         */
 
42
        PushButton( const QString& text, QWidget* parent = 0 );
 
43
 
 
44
        /**
 
45
         * Constructor, that sets an icon and the button-text to @p text
 
46
         */
 
47
/*   PushButton( const QIcon& icon, const QString& text, */
47
48
/*               QWidget* parent = 0 ); */
48
49
 
49
 
  /**
50
 
   * Constructor that takes a KGuiItem for the text, the icon, the tooltip
51
 
   * and the what's this help
52
 
   */
53
 
  K3bPushButton( const KGuiItem& item, QWidget* parent = 0 );
54
 
 
55
 
  /**
56
 
   * Destructs the button.
57
 
   */
58
 
  ~K3bPushButton();
59
 
 
60
 
  /**
61
 
   * The popup menu will show if the button is pressed down for about half a second
62
 
   * or if the mouse is moved while pressed just like the KToolBarButton.
63
 
   */
64
 
  void setDelayedPopupMenu( QMenu* );
65
 
 
66
 
 protected:
67
 
  virtual bool eventFilter( QObject*, QEvent* );
68
 
 
69
 
 private Q_SLOTS:
70
 
  void slotDelayedPopup();
71
 
 
72
 
 private:
73
 
  class Private;
74
 
  Private* d;
75
 
};
 
50
        /**
 
51
         * Constructor that takes a KGuiItem for the text, the icon, the tooltip
 
52
         * and the what's this help
 
53
         */
 
54
        PushButton( const KGuiItem& item, QWidget* parent = 0 );
 
55
 
 
56
        /**
 
57
         * Destructs the button.
 
58
         */
 
59
        ~PushButton();
 
60
 
 
61
        /**
 
62
         * The popup menu will show if the button is pressed down for about half a second
 
63
         * or if the mouse is moved while pressed just like the KToolBarButton.
 
64
         */
 
65
        void setDelayedPopupMenu( QMenu* );
 
66
 
 
67
    protected:
 
68
        virtual bool eventFilter( QObject*, QEvent* );
 
69
 
 
70
    private Q_SLOTS:
 
71
        void slotDelayedPopup();
 
72
 
 
73
    private:
 
74
        class Private;
 
75
        Private* d;
 
76
    };
 
77
}
76
78
 
77
79
#endif