1 #ifndef CLUSTERDIALOG_H
2 #define CLUSTERDIALOG_H
13 #ifdef CLUSTERDIALOG_MODELESS
15 void preview(
unsigned int k );
16 void cluster(
unsigned int k );
23 m_clusterSpinBox =
new QSpinBox;
24 m_clusterSpinBox->setRange( 2, 23 );
25 m_clusterSpinBox->setValue( 5 );
27 QLabel* clusterLabel =
new QLabel( tr(
"Number of clusters") );
28 clusterLabel->setBuddy( m_clusterSpinBox );
30 #ifdef CLUSTERDIALOG_MODELESS
31 QPushButton* previewBut =
new QPushButton( tr(
"Preview") );
32 QPushButton* applyBut =
new QPushButton( tr(
"Apply") );
34 QPushButton* abortBut =
new QPushButton( tr(
"Cancel") );
36 QPushButton* doneBut =
new QPushButton( tr(
"Done") );
37 doneBut->setDefault(
true );
40 QHBoxLayout* clusterLayout =
new QHBoxLayout;
41 clusterLayout->addWidget( clusterLabel );
42 clusterLayout->addWidget( m_clusterSpinBox );
44 #ifdef CLUSTERDIALOG_MODELESS
45 QVBoxLayout* butLayout =
new QVBoxLayout;
46 butLayout->addWidget( previewBut );
47 butLayout->addWidget( applyBut );
50 QHBoxLayout* doneLayout =
new QHBoxLayout;
51 doneLayout->addStretch( 3 );
52 #ifndef CLUSTERDIALOG_MODELESS
53 doneLayout->addWidget( abortBut );
55 doneLayout->addWidget( doneBut );
57 QVBoxLayout* layout =
new QVBoxLayout;
58 layout->addLayout( clusterLayout );
59 #ifdef CLUSTERDIALOG_MODELESS
60 layout->addLayout( butLayout );
62 layout->addLayout( doneLayout );
65 setWindowTitle( tr(
"Cluster Events") );
66 setFixedSize( sizeHint() );
69 #ifdef CLUSTERDIALOG_MODELESS
70 connect( previewBut, SIGNAL(clicked()),
this, SLOT(preview()));
71 connect( applyBut, SIGNAL(clicked()),
this, SLOT(apply()) );
73 connect( abortBut, SIGNAL(clicked()),
this, SLOT(reject()) );
75 connect( doneBut, SIGNAL(clicked()),
this, SLOT(accept()) );
78 #ifdef CLUSTERDIALOG_MODELESS
82 emit cluster( (
unsigned int)m_clusterSpinBox->value() );
87 emit preview( (
unsigned int)m_clusterSpinBox->value() );
91 unsigned int getNumClusters()
const {
return (
unsigned int)m_clusterSpinBox->value(); }
95 QSpinBox* m_clusterSpinBox;
98 #endif // CLUSTERDIALOG_H
unsigned int getNumClusters() const
Definition: ClusterDialog.h:91
ClusterDialog(QWidget *parent=0)
Definition: ClusterDialog.h:20
Definition: ClusterDialog.h:9