author | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
commit | b6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff) | |
tree | d3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /libqtaux | |
parent | 0d59c780513da78033f4d9040475dee9db0256d4 (diff) | |
download | opie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2 |
applied the patch generated by the optimize_connect script from
TT.
-rw-r--r-- | libqtaux/ocolorbutton.cpp | 2 | ||||
-rw-r--r-- | libqtaux/ocolorpopupmenu.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libqtaux/ocolorbutton.cpp b/libqtaux/ocolorbutton.cpp index fd3f963..9e41d93 100644 --- a/libqtaux/ocolorbutton.cpp +++ b/libqtaux/ocolorbutton.cpp | |||
@@ -38,49 +38,49 @@ | |||
38 | using namespace Opie; | 38 | using namespace Opie; |
39 | 39 | ||
40 | struct OColorButtonPrivate | 40 | struct OColorButtonPrivate |
41 | { | 41 | { |
42 | QPopupMenu *m_menu; | 42 | QPopupMenu *m_menu; |
43 | QColor m_color; | 43 | QColor m_color; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * This concstructs a Color Button with @param color as the start color | 47 | * This concstructs a Color Button with @param color as the start color |
48 | * It'll use a OColorPopupMenu internally | 48 | * It'll use a OColorPopupMenu internally |
49 | * | 49 | * |
50 | * @param parent The parent of the Color Button | 50 | * @param parent The parent of the Color Button |
51 | * @param color The color from where to start on | 51 | * @param color The color from where to start on |
52 | * @param name @see QObject | 52 | * @param name @see QObject |
53 | */ | 53 | */ |
54 | OColorButton::OColorButton ( QWidget *parent, const QColor &color, const char *name ) | 54 | OColorButton::OColorButton ( QWidget *parent, const QColor &color, const char *name ) |
55 | : QPushButton ( parent, name ) | 55 | : QPushButton ( parent, name ) |
56 | { | 56 | { |
57 | d = new OColorButtonPrivate; | 57 | d = new OColorButtonPrivate; |
58 | 58 | ||
59 | d-> m_menu = new OColorPopupMenu ( color, 0, 0 ); | 59 | d-> m_menu = new OColorPopupMenu ( color, 0, 0 ); |
60 | setPopup ( d-> m_menu ); | 60 | setPopup ( d-> m_menu ); |
61 | //setPopupDelay ( 0 ); | 61 | //setPopupDelay ( 0 ); |
62 | connect ( d-> m_menu, SIGNAL( colorSelected ( const QColor & )), this, SLOT( updateColor ( const QColor & ))); | 62 | connect ( d-> m_menu, SIGNAL( colorSelected(const QColor&)), this, SLOT( updateColor(const QColor&))); |
63 | 63 | ||
64 | updateColor ( color ); | 64 | updateColor ( color ); |
65 | 65 | ||
66 | QSize s = sizeHint ( ) + QSize ( 12, 0 ); | 66 | QSize s = sizeHint ( ) + QSize ( 12, 0 ); |
67 | setMinimumSize ( s ); | 67 | setMinimumSize ( s ); |
68 | setMaximumSize ( s. width ( ) * 2, s. height ( )); | 68 | setMaximumSize ( s. width ( ) * 2, s. height ( )); |
69 | } | 69 | } |
70 | 70 | ||
71 | /** | 71 | /** |
72 | * This destructs the object | 72 | * This destructs the object |
73 | */ | 73 | */ |
74 | OColorButton::~OColorButton ( ) | 74 | OColorButton::~OColorButton ( ) |
75 | { | 75 | { |
76 | delete d; | 76 | delete d; |
77 | } | 77 | } |
78 | 78 | ||
79 | /** | 79 | /** |
80 | * @return Returns the current color of the button | 80 | * @return Returns the current color of the button |
81 | */ | 81 | */ |
82 | QColor OColorButton::color ( ) const | 82 | QColor OColorButton::color ( ) const |
83 | { | 83 | { |
84 | return d-> m_color; | 84 | return d-> m_color; |
85 | } | 85 | } |
86 | 86 | ||
diff --git a/libqtaux/ocolorpopupmenu.cpp b/libqtaux/ocolorpopupmenu.cpp index c5b2b88..4da2a0e 100644 --- a/libqtaux/ocolorpopupmenu.cpp +++ b/libqtaux/ocolorpopupmenu.cpp | |||
@@ -134,42 +134,42 @@ OColorPopupMenu::OColorPopupMenu( const QColor& color, QWidget* parent, const ch | |||
134 | addColor(QColor(0, 64, 128), 4, 1); | 134 | addColor(QColor(0, 64, 128), 4, 1); |
135 | addColor(QColor(0, 0, 128), 4, 2); | 135 | addColor(QColor(0, 0, 128), 4, 2); |
136 | addColor(QColor(64, 0, 128), 4, 3); | 136 | addColor(QColor(64, 0, 128), 4, 3); |
137 | addColor(QColor(128, 0, 128), 4, 4); | 137 | addColor(QColor(128, 0, 128), 4, 4); |
138 | addColor(QColor(128, 0, 64), 4, 5); | 138 | addColor(QColor(128, 0, 64), 4, 5); |
139 | 139 | ||
140 | insertItem( colorPanel ); | 140 | insertItem( colorPanel ); |
141 | insertSeparator(); | 141 | insertSeparator(); |
142 | insertItem(tr("More"),this,SLOT( moreColorClicked())); | 142 | insertItem(tr("More"),this,SLOT( moreColorClicked())); |
143 | /* | 143 | /* |
144 | QAction* chooseColorAction = new QAction( tr( "More" ), tr( "More..." ), 0, colorPanel, "More" ); | 144 | QAction* chooseColorAction = new QAction( tr( "More" ), tr( "More..." ), 0, colorPanel, "More" ); |
145 | connect( chooseColorAction, SIGNAL( activated() ), this, SLOT( moreColorClicked() ) ); | 145 | connect( chooseColorAction, SIGNAL( activated() ), this, SLOT( moreColorClicked() ) ); |
146 | chooseColorAction->addTo( this ); | 146 | chooseColorAction->addTo( this ); |
147 | */ | 147 | */ |
148 | activateItemAt( 0 ); | 148 | activateItemAt( 0 ); |
149 | } | 149 | } |
150 | 150 | ||
151 | OColorPopupMenu::~OColorPopupMenu() | 151 | OColorPopupMenu::~OColorPopupMenu() |
152 | { | 152 | { |
153 | } | 153 | } |
154 | 154 | ||
155 | void OColorPopupMenu::addColor( const QColor& color, int row, int col ) | 155 | void OColorPopupMenu::addColor( const QColor& color, int row, int col ) |
156 | { | 156 | { |
157 | OColorPanelButton* panelButton = new OColorPanelButton( color, colorPanel ); | 157 | OColorPanelButton* panelButton = new OColorPanelButton( color, colorPanel ); |
158 | connect( panelButton, SIGNAL( selected( const QColor& ) ), this, SLOT( buttonSelected( const QColor& ) ) ); | 158 | connect( panelButton, SIGNAL( selected(const QColor&) ), this, SLOT( buttonSelected(const QColor&) ) ); |
159 | colorLayout->addWidget( panelButton, row, col ); | 159 | colorLayout->addWidget( panelButton, row, col ); |
160 | } | 160 | } |
161 | 161 | ||
162 | void OColorPopupMenu::buttonSelected( const QColor& color ) | 162 | void OColorPopupMenu::buttonSelected( const QColor& color ) |
163 | { | 163 | { |
164 | m_color = color; | 164 | m_color = color; |
165 | emit colorSelected( color ); | 165 | emit colorSelected( color ); |
166 | hide(); | 166 | hide(); |
167 | } | 167 | } |
168 | 168 | ||
169 | void OColorPopupMenu::moreColorClicked() | 169 | void OColorPopupMenu::moreColorClicked() |
170 | { | 170 | { |
171 | QColor color = QColorDialog::getColor( m_color ); | 171 | QColor color = QColorDialog::getColor( m_color ); |
172 | m_color = color; | 172 | m_color = color; |
173 | emit colorSelected( color ); | 173 | emit colorSelected( color ); |
174 | hide(); | 174 | hide(); |
175 | } | 175 | } |