~ubuntu-branches/ubuntu/raring/konversation/raring-proposed

« back to all changes in this revision

Viewing changes to src/dcc/whiteboardtoolbar.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2010-05-24 11:33:21 UTC
  • mfrom: (2.2.13 sid)
  • Revision ID: james.westby@ubuntu.com-20100524113321-b9txnlnyl0ojuy9u
Tags: 1.3~beta1-1ubuntu1
* Merge from Debian Unstable, remaining changes:
  - Add kubuntu_01_default_channels.diff, disable debian_channel.diff
  - Keep message indicator patches, libindicator-dev build-dep
  - Use the Kubuntu docpath (/usr/share/doc/kde)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  This program is free software; you can redistribute it and/or modify
 
3
  it under the terms of the GNU General Public License as published by
 
4
  the Free Software Foundation; either version 2 of the License, or
 
5
  (at your option) any later version.
 
6
*/
 
7
 
 
8
/*
 
9
  Copyright (C) 2009 Bernd Buschinski <b.buschinski@web.de>
 
10
*/
 
11
 
 
12
#include "whiteboardtoolbar.h"
 
13
 
 
14
#include <QHBoxLayout>
 
15
#include <QLayout>
 
16
#include <QDir>
 
17
#include <QImageWriter>
 
18
#include <QPainter>
 
19
 
 
20
#include <KPushButton>
 
21
#include <KUrl>
 
22
#include <KFileDialog>
 
23
#include <KIcon>
 
24
#include <KDebug>
 
25
 
 
26
#include "whiteboardfontchooser.h"
 
27
 
 
28
namespace Konversation
 
29
{
 
30
    namespace DCC
 
31
    {
 
32
        WhiteBoardToolBar::WhiteBoardToolBar(QWidget* parent)
 
33
            : QWidget(parent),
 
34
              m_lineWidthPixmap(20, 20),
 
35
              m_textType(SimpleText),
 
36
              m_fontDialog(0)
 
37
        {
 
38
            setupUi(this);
 
39
 
 
40
            m_clearPushButton->setIcon(KIcon("document-edit"));
 
41
            m_clearPushButton->setToolTip(i18n("Clear Image"));
 
42
            m_savePushButton->setIcon(KIcon("document-save"));
 
43
            m_savePushButton->setToolTip(i18n("Save As.."));
 
44
 
 
45
            m_pencilPushButton->setIcon(KIcon("draw-freehand"));
 
46
            m_pencilPushButton->setToolTip(i18n("Freehand Drawing"));
 
47
            m_pencilPushButton->setFlat(true);
 
48
            m_toggleButtonHash.insert(m_pencilPushButton, WhiteBoardGlobals::Pencil);
 
49
            m_pencilPushButton->setChecked(true);
 
50
 
 
51
            m_linePushButton->setIcon(KIcon("draw-line"));
 
52
            m_linePushButton->setToolTip(i18n("Draw a straight line"));
 
53
            m_linePushButton->setFlat(true);
 
54
            m_toggleButtonHash.insert(m_linePushButton, WhiteBoardGlobals::Line);
 
55
 
 
56
            m_rectanglePushButton->setIcon(KIcon("draw-rectangle"));
 
57
            m_rectanglePushButton->setToolTip(i18n("Draw a rectangle"));
 
58
            m_rectanglePushButton->setFlat(true);
 
59
            m_toggleButtonHash.insert(m_rectanglePushButton, WhiteBoardGlobals::Rectangle);
 
60
            m_toggleButtonHash.insert(m_rectanglePushButton, WhiteBoardGlobals::FilledRectangle);
 
61
 
 
62
            m_ellipsePushButton->setIcon(KIcon("draw-circle"));
 
63
            m_ellipsePushButton->setToolTip(i18n("Draw an ellipse"));
 
64
            m_ellipsePushButton->setFlat(true);
 
65
            m_toggleButtonHash.insert(m_ellipsePushButton, WhiteBoardGlobals::Ellipse);
 
66
            m_toggleButtonHash.insert(m_ellipsePushButton, WhiteBoardGlobals::FilledEllipse);
 
67
 
 
68
            m_textPushButton->setIcon(KIcon("draw-text"));
 
69
            m_textPushButton->setToolTip(i18n("Draw text"));
 
70
            m_textPushButton->setFlat(true);
 
71
            m_toggleButtonHash.insert(m_textPushButton, WhiteBoardGlobals::Text);
 
72
 
 
73
            m_selectionPushButton->setEnabled(false); // it has no function in current whiteboard
 
74
            m_selectionPushButton->setIcon(KIcon("select-rectangular"));
 
75
            m_selectionPushButton->setToolTip(i18nc("dcc whiteboard selection tool", "Selection"));
 
76
            m_selectionPushButton->setFlat(true);
 
77
            m_toggleButtonHash.insert(m_selectionPushButton, WhiteBoardGlobals::Selection);
 
78
 
 
79
            m_eraserPushButton->setIcon(KIcon("draw-eraser"));
 
80
            m_eraserPushButton->setToolTip(i18n("Eraser"));
 
81
            m_eraserPushButton->setFlat(true);
 
82
            m_toggleButtonHash.insert(m_eraserPushButton, WhiteBoardGlobals::Eraser);
 
83
 
 
84
            m_fillPushButton->setIcon(KIcon("fill-color"));
 
85
            m_fillPushButton->setToolTip(i18n("Fill a contiguous area with the foreground color"));
 
86
            m_fillPushButton->setFlat(true);
 
87
            m_toggleButtonHash.insert(m_fillPushButton, WhiteBoardGlobals::FloodFill);
 
88
 
 
89
            m_arrowPushButton->setIcon(KIcon("draw-arrow-forward"));
 
90
            m_arrowPushButton->setToolTip(i18n("Draw an arrow"));
 
91
            m_arrowPushButton->setFlat(true);
 
92
            m_toggleButtonHash.insert(m_arrowPushButton, WhiteBoardGlobals::Arrow);
 
93
 
 
94
            m_lineWidthSlider->setMaximum(WhiteBoardGlobals::MaxPenWidth);
 
95
 
 
96
            connectToggleButtons();
 
97
 
 
98
            //foreward colorchooser signals
 
99
            connect(m_colorChooser, SIGNAL(colorsSwapped(const QColor&,const QColor&)),
 
100
                    this, SIGNAL(colorsSwapped(const QColor&,const QColor&)));
 
101
            connect(m_colorChooser, SIGNAL(foregroundColorChanged(const QColor&)),
 
102
                    this, SIGNAL(foregroundColorChanged(const QColor&)));
 
103
            connect(m_colorChooser, SIGNAL(backgroundColorChanged(const QColor&)),
 
104
                    this, SIGNAL(backgroundColorChanged(const QColor&)));
 
105
 
 
106
            connect(m_lineWidthSlider, SIGNAL(valueChanged(int)),
 
107
                    this, SIGNAL(lineWidthChanged(int)));
 
108
            connect(m_lineWidthSlider, SIGNAL(valueChanged(int)),
 
109
                    this, SLOT(updateLineWidthPixmap(int)));
 
110
 
 
111
            connect(m_clearPushButton, SIGNAL(clicked()), this, SLOT(clearClicked()));
 
112
            connect(m_savePushButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
 
113
 
 
114
            setFormOptionVisible(false);
 
115
            setLineWidthVisible(true);
 
116
            updateLineWidthPixmap(1);
 
117
        }
 
118
 
 
119
        WhiteBoardToolBar::~WhiteBoardToolBar()
 
120
        {
 
121
            delete m_fontDialog;
 
122
        }
 
123
 
 
124
        QColor WhiteBoardToolBar::foregroundColor() const
 
125
        {
 
126
            return m_colorChooser->foregroundColor();
 
127
        }
 
128
 
 
129
        QColor WhiteBoardToolBar::backgroundColor() const
 
130
        {
 
131
            return m_colorChooser->backgroundColor();
 
132
        }
 
133
 
 
134
        void WhiteBoardToolBar::disableTool(WhiteBoardGlobals::WhiteBoardTool tool)
 
135
        {
 
136
            KPushButton* button = m_toggleButtonHash.key(tool);
 
137
            if (button)
 
138
            {
 
139
                button->setEnabled(false);
 
140
            }
 
141
            else
 
142
            {
 
143
                kDebug() << "unhandled tool:" << tool;
 
144
            }
 
145
        }
 
146
 
 
147
        void WhiteBoardToolBar::enableTool(WhiteBoardGlobals::WhiteBoardTool tool)
 
148
        {
 
149
            KPushButton* button = m_toggleButtonHash.key(tool);
 
150
            if (button)
 
151
            {
 
152
                button->setEnabled(true);
 
153
            }
 
154
            else
 
155
            {
 
156
                kDebug() << "unhandled tool:" << tool;
 
157
            }
 
158
        }
 
159
 
 
160
        void WhiteBoardToolBar::setSupportedTextType(WhiteBoardToolBar::TextType textType)
 
161
        {
 
162
            m_textType = textType;
 
163
            if (m_textType == WhiteBoardToolBar::ExtentedText)
 
164
            {
 
165
                if (m_fontDialog)
 
166
                {
 
167
                    return;
 
168
                }
 
169
                m_fontDialog = new WhiteBoardFontChooser(this);
 
170
                connect(m_fontDialog, SIGNAL(fontChanged(const QFont&)),
 
171
                        this, SIGNAL(fontChanged(QFont)));
 
172
            }
 
173
            else
 
174
            {
 
175
                if (m_fontDialog)
 
176
                {
 
177
                    disconnect(m_fontDialog, 0, 0, 0);
 
178
                    delete m_fontDialog;
 
179
                    m_fontDialog = 0;
 
180
                }
 
181
            }
 
182
        }
 
183
 
 
184
        WhiteBoardToolBar::TextType WhiteBoardToolBar::textType() const
 
185
        {
 
186
            return m_textType;
 
187
        }
 
188
 
 
189
        void WhiteBoardToolBar::connectToggleButtons()
 
190
        {
 
191
            kDebug();
 
192
            connect(m_pencilPushButton, SIGNAL(toggled(bool)), this, SLOT(pencilToggled(bool)));
 
193
            connect(m_linePushButton, SIGNAL(toggled(bool)), this, SLOT(lineToggled(bool)));
 
194
            connect(m_rectanglePushButton, SIGNAL(toggled(bool)), this, SLOT(rectangleToggled(bool)));
 
195
            connect(m_ellipsePushButton, SIGNAL(toggled(bool)), this, SLOT(ellipseToggled(bool)));
 
196
            connect(m_textPushButton, SIGNAL(toggled(bool)), this, SLOT(textToggled(bool)));
 
197
            connect(m_selectionPushButton, SIGNAL(toggled(bool)), this, SLOT(selectionToggled(bool)));
 
198
            connect(m_eraserPushButton, SIGNAL(toggled(bool)), this, SLOT(eraseToggled(bool)));
 
199
            connect(m_fillPushButton, SIGNAL(toggled(bool)), this, SLOT(fillToggled(bool)));
 
200
            connect(m_arrowPushButton, SIGNAL(toggled(bool)), this, SLOT(arrowToggled(bool)));
 
201
        }
 
202
 
 
203
        void WhiteBoardToolBar::disconnectToggleButtons()
 
204
        {
 
205
            kDebug();
 
206
            disconnect(m_pencilPushButton, 0, 0, 0);
 
207
            disconnect(m_linePushButton, 0, 0, 0);
 
208
            disconnect(m_rectanglePushButton, 0, 0, 0);
 
209
            disconnect(m_ellipsePushButton, 0, 0, 0);
 
210
            disconnect(m_textPushButton, 0, 0, 0);
 
211
            disconnect(m_selectionPushButton, 0, 0, 0);
 
212
            disconnect(m_eraserPushButton, 0, 0, 0);
 
213
            disconnect(m_fillPushButton, 0, 0, 0);
 
214
            disconnect(m_arrowPushButton, 0, 0, 0);
 
215
        }
 
216
 
 
217
        void WhiteBoardToolBar::clearClicked()
 
218
        {
 
219
            //TODO ask for confirm
 
220
            emit clear();
 
221
        }
 
222
 
 
223
        void WhiteBoardToolBar::saveClicked()
 
224
        {
 
225
            QPointer<KFileDialog> fileDialog = new KFileDialog(KUrl(QDir::homePath()), "*.png\n*.jpg", this);
 
226
            fileDialog->setCaption(i18n("Save Image"));
 
227
            fileDialog->setOperationMode(KFileDialog::Saving);
 
228
            fileDialog->setMode(KFile::File);
 
229
            int ret = fileDialog->exec();
 
230
 
 
231
            if (ret == KDialog::Accepted && fileDialog)
 
232
            {
 
233
                kDebug() << fileDialog->selectedFile();
 
234
                emit save(fileDialog->selectedFile());
 
235
            }
 
236
            delete fileDialog;
 
237
        }
 
238
 
 
239
        void WhiteBoardToolBar::arrowToggled (bool checked)
 
240
        {
 
241
            handleToggleButton(m_arrowPushButton, checked, WhiteBoardGlobals::Arrow);
 
242
            setLineWidthVisible(true);
 
243
            setFormOptionVisible(false);
 
244
            setFontDialogVisible(false);
 
245
        }
 
246
 
 
247
        void WhiteBoardToolBar::ellipseToggled(bool checked)
 
248
        {
 
249
            handleToggleButton(m_ellipsePushButton, checked, WhiteBoardGlobals::Ellipse);
 
250
            setLineWidthVisible(true);
 
251
            setFormOptionVisible(true);
 
252
            fillFormOptionList(Ellipse);
 
253
            setFontDialogVisible(false);
 
254
        }
 
255
 
 
256
        void WhiteBoardToolBar::eraseToggled(bool checked)
 
257
        {
 
258
            handleToggleButton(m_eraserPushButton, checked, WhiteBoardGlobals::Eraser);
 
259
            setLineWidthVisible(true);
 
260
            setFormOptionVisible(false);
 
261
            setFontDialogVisible(false);
 
262
        }
 
263
 
 
264
        void WhiteBoardToolBar::fillToggled(bool checked)
 
265
        {
 
266
            handleToggleButton(m_fillPushButton, checked, WhiteBoardGlobals::FloodFill);
 
267
            setLineWidthVisible(false);
 
268
            setFormOptionVisible(false);
 
269
            setFontDialogVisible(false);
 
270
        }
 
271
 
 
272
        void WhiteBoardToolBar::lineToggled(bool checked)
 
273
        {
 
274
            handleToggleButton(m_linePushButton, checked, WhiteBoardGlobals::Line);
 
275
            setLineWidthVisible(true);
 
276
            setFormOptionVisible(false);
 
277
            setFontDialogVisible(false);
 
278
        }
 
279
 
 
280
        void WhiteBoardToolBar::pencilToggled(bool checked)
 
281
        {
 
282
            handleToggleButton(m_pencilPushButton, checked, WhiteBoardGlobals::Pencil);
 
283
            setLineWidthVisible(true);
 
284
            setFormOptionVisible(false);
 
285
            setFontDialogVisible(false);
 
286
        }
 
287
 
 
288
        void WhiteBoardToolBar::rectangleToggled(bool checked)
 
289
        {
 
290
            handleToggleButton(m_rectanglePushButton, checked, WhiteBoardGlobals::Rectangle);
 
291
            setLineWidthVisible(true);
 
292
            setFormOptionVisible(true);
 
293
            fillFormOptionList(Rectangle);
 
294
            setFontDialogVisible(false);
 
295
        }
 
296
 
 
297
        void WhiteBoardToolBar::selectionToggled(bool checked)
 
298
        {
 
299
            handleToggleButton(m_selectionPushButton, checked, WhiteBoardGlobals::Selection);
 
300
            setLineWidthVisible(false);
 
301
            setFormOptionVisible(false);
 
302
            setFontDialogVisible(false);
 
303
        }
 
304
 
 
305
        void WhiteBoardToolBar::textToggled(bool checked)
 
306
        {
 
307
            if (textType() == WhiteBoardToolBar::SimpleText)
 
308
            {
 
309
                handleToggleButton(m_textPushButton, checked, WhiteBoardGlobals::Text);
 
310
            }
 
311
            else
 
312
            {
 
313
                handleToggleButton(m_textPushButton, checked, WhiteBoardGlobals::TextExtended);
 
314
            }
 
315
            setLineWidthVisible(false);
 
316
            setFormOptionVisible(false);
 
317
            setFontDialogVisible(true);
 
318
        }
 
319
 
 
320
        void WhiteBoardToolBar::handleToggleButton(KPushButton* button, bool checked, Konversation::DCC::WhiteBoardGlobals::WhiteBoardTool tool)
 
321
        {
 
322
            disconnectToggleButtons();
 
323
            kDebug() << "tool:" << tool << "checked:" << checked;
 
324
            if (checked)
 
325
            {
 
326
                unCheckOtherButtons(button);
 
327
                emit toolChanged(tool);
 
328
            }
 
329
            else
 
330
            {
 
331
                // don't uncheck the button
 
332
                button->setChecked(true);
 
333
            }
 
334
            connectToggleButtons();
 
335
        }
 
336
 
 
337
        void WhiteBoardToolBar::unCheckOtherButtons(KPushButton* button)
 
338
        {
 
339
            foreach (KPushButton* pushButton, m_toggleButtonHash.keys())
 
340
            {
 
341
                if (pushButton != button && pushButton->isChecked())
 
342
                {
 
343
                    pushButton->setChecked(false);
 
344
                    return;
 
345
                }
 
346
            }
 
347
        }
 
348
 
 
349
        void WhiteBoardToolBar::updateLineWidthPixmap(int lineWidth)
 
350
        {
 
351
            if (m_lineWidthLabel->width() != m_lineWidthPixmap.width()-2 ||
 
352
                m_lineWidthLabel->height() != m_lineWidthPixmap.height())
 
353
            {
 
354
                m_lineWidthPixmap = QPixmap(m_lineWidthLabel->width()-2, m_lineWidthLabel->height());
 
355
            }
 
356
            //hm.. really white? or is transparent better?
 
357
            m_lineWidthPixmap.fill(Qt::white);
 
358
 
 
359
            QPainter tPaint(&m_lineWidthPixmap);
 
360
            tPaint.setPen(QPen(Qt::black, lineWidth));
 
361
            tPaint.drawLine(0, m_lineWidthPixmap.height()/2, m_lineWidthPixmap.width(), m_lineWidthPixmap.height()/2);
 
362
            tPaint.end();
 
363
            m_lineWidthLabel->setPixmap(m_lineWidthPixmap);
 
364
        }
 
365
 
 
366
        void WhiteBoardToolBar::formSelectionChanged()
 
367
        {
 
368
            // kDebug();
 
369
            QList<QListWidgetItem *> selectList = m_formOptionListWidget->selectedItems();
 
370
            const int selectedRow = m_formOptionListWidget->row(selectList.first());
 
371
            if (selectedRow == 0)
 
372
            {
 
373
                if (m_rectanglePushButton->isChecked())
 
374
                {
 
375
                    kDebug() << "emit rectangle";
 
376
                    emit toolChanged(WhiteBoardGlobals::Rectangle);
 
377
                }
 
378
                else if (m_ellipsePushButton->isChecked())
 
379
                {
 
380
                    kDebug() << "emit ellipse";
 
381
                    emit toolChanged(WhiteBoardGlobals::Ellipse);
 
382
                }
 
383
            }
 
384
            else if (selectedRow == 1)
 
385
            {
 
386
                if (m_rectanglePushButton->isChecked())
 
387
                {
 
388
                    kDebug() << "emit filledrectangle";
 
389
                    emit toolChanged(WhiteBoardGlobals::FilledRectangle);
 
390
                }
 
391
                else if (m_ellipsePushButton->isChecked())
 
392
                {
 
393
                    kDebug() << "emit filledellipse";
 
394
                    emit toolChanged(WhiteBoardGlobals::FilledEllipse);
 
395
                }
 
396
            }
 
397
        }
 
398
 
 
399
        void WhiteBoardToolBar::setLineWidthVisible(bool visible)
 
400
        {
 
401
            m_lineWidthFrame->setVisible(visible);
 
402
        }
 
403
 
 
404
        void WhiteBoardToolBar::setFormOptionVisible(bool visible)
 
405
        {
 
406
            m_formOptionListWidget->setVisible(visible);
 
407
        }
 
408
 
 
409
        void WhiteBoardToolBar::setFontDialogVisible(bool visible)
 
410
        {
 
411
            if (m_textType == WhiteBoardToolBar::ExtentedText && m_fontDialog)
 
412
            {
 
413
                if (visible)
 
414
                    m_fontDialog->show();
 
415
                else
 
416
                    m_fontDialog->hide();
 
417
            }
 
418
        }
 
419
 
 
420
        void WhiteBoardToolBar::fillFormOptionList(FormOption form)
 
421
        {
 
422
            disconnect(m_formOptionListWidget, 0, 0, 0);
 
423
            m_formOptionListWidget->clear();
 
424
            const int width = m_formOptionListWidget->contentsRect().width() - m_formOptionListWidget->lineWidth()*4 - 3;
 
425
            const int drawHeight = 20 - 2;
 
426
            const int widthLayoutOffset = 2;
 
427
            const QSize sizeHint(width, 20);
 
428
            // kDebug() << "wanted width" << width;
 
429
            // kDebug() << "actual width" << m_formOptionListWidget->contentsRect().width();
 
430
            switch (form)
 
431
            {
 
432
                case Rectangle:
 
433
                {
 
434
                    if (m_rectanglePixmap.width() != width ||
 
435
                        m_rectanglePixmap.height() != 20)
 
436
                    {
 
437
                        m_rectanglePixmap = QPixmap(width, 20);
 
438
                        m_rectanglePixmap.fill(Qt::transparent);
 
439
                        m_filledRectanglePixmap = QPixmap(width, 20);
 
440
                        m_filledRectanglePixmap.fill(Qt::transparent);
 
441
                        QPainter tPaint(&m_rectanglePixmap);
 
442
                        tPaint.drawRect(0, 0, width-widthLayoutOffset, drawHeight);
 
443
                        tPaint.end();
 
444
                        tPaint.begin(&m_filledRectanglePixmap);
 
445
                        tPaint.setBrush(Qt::black);
 
446
                        tPaint.drawRect(0, 0, width-widthLayoutOffset, drawHeight);
 
447
                        tPaint.end();
 
448
                    }
 
449
                    QListWidgetItem *tRectangle = new QListWidgetItem("", m_formOptionListWidget, QListWidgetItem::UserType +1);
 
450
                    tRectangle->setData(Qt::DecorationRole, QVariant(m_rectanglePixmap));
 
451
                    tRectangle->setSizeHint(sizeHint);
 
452
 
 
453
                    QListWidgetItem *tFilledRectangle = new QListWidgetItem("", m_formOptionListWidget, QListWidgetItem::UserType +1);
 
454
                    tFilledRectangle->setData(Qt::DecorationRole, QVariant(m_filledRectanglePixmap));
 
455
                    tFilledRectangle->setSizeHint(sizeHint);
 
456
 
 
457
                    tRectangle->setSelected(true);
 
458
                    break;
 
459
                }
 
460
                case Ellipse:
 
461
                {
 
462
                    if (m_ellipsePixmap.width() != width ||
 
463
                        m_ellipsePixmap.height() != 20)
 
464
                    {
 
465
                        m_ellipsePixmap = QPixmap(width, 20);
 
466
                        m_ellipsePixmap.fill(Qt::transparent);
 
467
                        m_filledEllipsePixmap = QPixmap(width, 20);
 
468
                        m_filledEllipsePixmap.fill(Qt::transparent);
 
469
                        QPainter tPaint(&m_ellipsePixmap);
 
470
                        tPaint.drawEllipse(0, 0, width-widthLayoutOffset, drawHeight);
 
471
                        tPaint.end();
 
472
                        tPaint.begin(&m_filledEllipsePixmap);
 
473
                        tPaint.setBrush(Qt::black);
 
474
                        tPaint.drawEllipse(0, 0, width-widthLayoutOffset, drawHeight);
 
475
                        tPaint.end();
 
476
                    }
 
477
                    QListWidgetItem *tEllipse = new QListWidgetItem("", m_formOptionListWidget, QListWidgetItem::UserType +1);
 
478
                    tEllipse->setData(Qt::DecorationRole, QVariant(m_ellipsePixmap));
 
479
                    tEllipse->setSizeHint(sizeHint);
 
480
 
 
481
                    QListWidgetItem *tFilledEllipse = new QListWidgetItem("", m_formOptionListWidget, QListWidgetItem::UserType +1);
 
482
                    tFilledEllipse->setData(Qt::DecorationRole, QVariant(m_filledEllipsePixmap));
 
483
                    tFilledEllipse->setSizeHint(sizeHint);
 
484
 
 
485
                    tEllipse->setSelected(true);
 
486
                    break;
 
487
                }
 
488
            }
 
489
            connect(m_formOptionListWidget, SIGNAL(itemSelectionChanged()),
 
490
                    this, SLOT(formSelectionChanged()));
 
491
        }
 
492
    }
 
493
}