summaryrefslogtreecommitdiff
path: root/examples
Unidiff
Diffstat (limited to 'examples') (more/less context) (ignore whitespace changes)
-rw-r--r--examples/main-tab/simple.cpp2
-rw-r--r--examples/simple-pim/simple.cpp16
2 files changed, 9 insertions, 9 deletions
diff --git a/examples/main-tab/simple.cpp b/examples/main-tab/simple.cpp
index 69dd00f..c5a6d5a 100644
--- a/examples/main-tab/simple.cpp
+++ b/examples/main-tab/simple.cpp
@@ -31,25 +31,25 @@ OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
31MainWindow::MainWindow(QWidget *parent, const char* name, WFlags fl ) 31MainWindow::MainWindow(QWidget *parent, const char* name, WFlags fl )
32 : QMainWindow( parent, name, fl ) { 32 : QMainWindow( parent, name, fl ) {
33 setCaption(tr("My MainWindow") ); 33 setCaption(tr("My MainWindow") );
34 34
35 initUI(); 35 initUI();
36 36
37 37
38 /* 38 /*
39 * Tab widget as central 39 * Tab widget as central
40 */ 40 */
41 OTabWidget *tab = new OTabWidget(this); 41 OTabWidget *tab = new OTabWidget(this);
42 connect(tab, SIGNAL(currentChanged(QWidget*) ), 42 connect(tab, SIGNAL(currentChanged(QWidget*) ),
43 this, SLOT( slotCurrentChanged( QWidget* ) ) ); 43 this, SLOT( slotCurrentChanged(QWidget*) ) );
44 setCentralWidget( tab ); 44 setCentralWidget( tab );
45 45
46 Simple1 *simple1 = new Simple1( this ); 46 Simple1 *simple1 = new Simple1( this );
47 tab->addTab( simple1, "new", tr("Simple1") ); 47 tab->addTab( simple1, "new", tr("Simple1") );
48 tab->setCurrentTab( tr("Simple1") ); 48 tab->setCurrentTab( tr("Simple1") );
49 49
50 Simple2 *simple2 = new Simple2( this ); 50 Simple2 *simple2 = new Simple2( this );
51 tab->addTab( simple2, "trash", tr("Simple2") ); 51 tab->addTab( simple2, "trash", tr("Simple2") );
52 52
53 m_oldCurrent = simple1; 53 m_oldCurrent = simple1;
54 54
55 connect(m_fire, SIGNAL(activated() ), 55 connect(m_fire, SIGNAL(activated() ),
diff --git a/examples/simple-pim/simple.cpp b/examples/simple-pim/simple.cpp
index 3e9fcd3..029e71b 100644
--- a/examples/simple-pim/simple.cpp
+++ b/examples/simple-pim/simple.cpp
@@ -70,28 +70,28 @@ MainWindow::MainWindow(QWidget *parent, const char* name, WFlags fl )
70 this, SLOT(slotShow() ) ); 70 this, SLOT(slotShow() ) );
71 71
72 /* 72 /*
73 * We will change the date 73 * We will change the date
74 */ 74 */
75 connect(m_dateAction, SIGNAL(activated() ), 75 connect(m_dateAction, SIGNAL(activated() ),
76 this, SLOT(slotDate() ) ); 76 this, SLOT(slotDate() ) );
77 77
78 /* 78 /*
79 * connect the show signal of the PIMListView 79 * connect the show signal of the PIMListView
80 * to a slot to show a dialog 80 * to a slot to show a dialog
81 */ 81 */
82 connect(m_todoView, SIGNAL(showRecord(const OPimRecord& ) ), 82 connect(m_todoView, SIGNAL(showRecord(const OPimRecord&) ),
83 this, SLOT(slotShowRecord(const OPimRecord& ) ) ); 83 this, SLOT(slotShowRecord(const OPimRecord&) ) );
84 connect(m_dateView, SIGNAL(showRecord(const OPimRecord& ) ), 84 connect(m_dateView, SIGNAL(showRecord(const OPimRecord&) ),
85 this, SLOT(slotShowRecord(const OPimRecord& ) ) ); 85 this, SLOT(slotShowRecord(const OPimRecord&) ) );
86 86
87 /* 87 /*
88 * Now comes the important lines of code for this example 88 * Now comes the important lines of code for this example
89 * We do not directly call load but delay loading until 89 * We do not directly call load but delay loading until
90 * all Events are dispatches and handled. 90 * all Events are dispatches and handled.
91 * SO we will load once our window is mapped to screen 91 * SO we will load once our window is mapped to screen
92 * to achieve that we use a QTimer::singleShot 92 * to achieve that we use a QTimer::singleShot
93 * After 10 milli seconds the timer fires and on TimerEvent 93 * After 10 milli seconds the timer fires and on TimerEvent
94 * out slot slotLoad will be called 94 * out slot slotLoad will be called
95 * Remember this a Constructor to construct your object and not 95 * Remember this a Constructor to construct your object and not
96 * to load 96 * to load
97 */ 97 */
@@ -180,26 +180,26 @@ void MainWindow::slotLoad() {
180 !QCopChannel::isRegistered("QPE/Application/datebook") ) { 180 !QCopChannel::isRegistered("QPE/Application/datebook") ) {
181 m_db.load(); 181 m_db.load();
182 m_tb.load(); 182 m_tb.load();
183 return slotLoadForDay( QDate::currentDate() ); 183 return slotLoadForDay( QDate::currentDate() );
184 } 184 }
185 185
186 /* 186 /*
187 * prepare our answer machine the QCopChannel 187 * prepare our answer machine the QCopChannel
188 * QPE/Desktop will send "flushDone(QString)" when 188 * QPE/Desktop will send "flushDone(QString)" when
189 * the flush is done it emits a signal on receive 189 * the flush is done it emits a signal on receive
190 */ 190 */
191 m_desktopChannel = new QCopChannel("QPE/Desktop"); 191 m_desktopChannel = new QCopChannel("QPE/Desktop");
192 connect(m_desktopChannel, SIGNAL(received(const QCString&, const QByteArray& ) ), 192 connect(m_desktopChannel, SIGNAL(received(const QCString&,const QByteArray&) ),
193 this, SLOT(slotDesktopReceive(const QCString&, const QByteArray& ) ) ); 193 this, SLOT(slotDesktopReceive(const QCString&,const QByteArray&) ) );
194 /* the numberof synced channels will be set to zero */ 194 /* the numberof synced channels will be set to zero */
195 m_synced = 0; 195 m_synced = 0;
196 196
197 /* 197 /*
198 * We use {} around the QCopEnvelope because it sends its 198 * We use {} around the QCopEnvelope because it sends its
199 * data on destruction of QCopEnvelope with 199 * data on destruction of QCopEnvelope with
200 */ 200 */
201 /* check again if not present increment synced*/ 201 /* check again if not present increment synced*/
202 if ( QCopChannel::isRegistered("QPE/Application/todolist") ) { 202 if ( QCopChannel::isRegistered("QPE/Application/todolist") ) {
203 QCopEnvelope env("QPE/Application/todolist", "flush()" ); 203 QCopEnvelope env("QPE/Application/todolist", "flush()" );
204 // env << data; but we do not have any parameters here 204 // env << data; but we do not have any parameters here
205 }else 205 }else
@@ -298,26 +298,26 @@ void MainWindow::slotShowRecord( const OPimRecord& rec) {
298 298
299 299
300void MainWindow::slotDate() { 300void MainWindow::slotDate() {
301 /* 301 /*
302 * called by the action we will show a Popup 302 * called by the action we will show a Popup
303 * at the current mouse position with a DateChooser 303 * at the current mouse position with a DateChooser
304 * to select the day 304 * to select the day
305 */ 305 */
306 qWarning("slot Date"); 306 qWarning("slot Date");
307 QPopupMenu *menu = new QPopupMenu(); 307 QPopupMenu *menu = new QPopupMenu();
308 /* A Month to select a date from TRUE for auto close */ 308 /* A Month to select a date from TRUE for auto close */
309 DateBookMonth *month = new DateBookMonth(menu, 0, true ); 309 DateBookMonth *month = new DateBookMonth(menu, 0, true );
310 connect(month, SIGNAL(dateClicked(int, int, int) ), 310 connect(month, SIGNAL(dateClicked(int,int,int) ),
311 this, SLOT(slotLoadForDay(int, int, int) ) ); 311 this, SLOT(slotLoadForDay(int,int,int) ) );
312 312
313 menu->insertItem( month ); 313 menu->insertItem( month );
314 314
315 menu->exec( QCursor::pos() ); 315 menu->exec( QCursor::pos() );
316 316
317 /* 317 /*
318 * we do not need to delete month because 318 * we do not need to delete month because
319 * we delete its parent menu 319 * we delete its parent menu
320 */ 320 */
321 321
322 delete menu; 322 delete menu;
323} 323}