summaryrefslogtreecommitdiff
path: root/examples
Side-by-side diff
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
@@ -19,49 +19,49 @@
*/
/*
* The factory is used for quicklaunching
* It needs a constructor ( c'tor ) with at least QWidget, const char* and WFlags as parameter and a static QString appName() matching the TARGET of the .pro
*
* Depending on the global quick launch setting this will create
* either a main method or one for our component plugin system
*/
OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
MainWindow::MainWindow(QWidget *parent, const char* name, WFlags fl )
: QMainWindow( parent, name, fl ) {
setCaption(tr("My MainWindow") );
initUI();
/*
* Tab widget as central
*/
OTabWidget *tab = new OTabWidget(this);
connect(tab, SIGNAL(currentChanged(QWidget*) ),
- this, SLOT( slotCurrentChanged( QWidget* ) ) );
+ this, SLOT( slotCurrentChanged(QWidget*) ) );
setCentralWidget( tab );
Simple1 *simple1 = new Simple1( this );
tab->addTab( simple1, "new", tr("Simple1") );
tab->setCurrentTab( tr("Simple1") );
Simple2 *simple2 = new Simple2( this );
tab->addTab( simple2, "trash", tr("Simple2") );
m_oldCurrent = simple1;
connect(m_fire, SIGNAL(activated() ),
simple1, SLOT(slotFire() ) );
}
MainWindow::~MainWindow() {
// again nothing to delete because Qt takes care
}
void MainWindow::setDocument( const QString& /*str*/ ) {
}
void MainWindow::slotCurrentChanged( QWidget *wid) {
disconnect(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
@@ -58,52 +58,52 @@ MainWindow::MainWindow(QWidget *parent, const char* name, WFlags fl )
m_tab->addTab( m_todoView,"todo/TodoList", tr("Todos") );
m_dateView = new PIMListView(m_tab, "Datebook view" );
m_tab->addTab( m_dateView, "datebook/DateBook", tr("Events") );
/* now connect the actions */
/*
* we connect the activated to our show
* and on activation we will show a detailed
* summary of the record
*/
connect(m_fire, SIGNAL(activated() ),
this, SLOT(slotShow() ) );
/*
* We will change the date
*/
connect(m_dateAction, SIGNAL(activated() ),
this, SLOT(slotDate() ) );
/*
* connect the show signal of the PIMListView
* to a slot to show a dialog
*/
- connect(m_todoView, SIGNAL(showRecord(const OPimRecord& ) ),
- this, SLOT(slotShowRecord(const OPimRecord& ) ) );
- connect(m_dateView, SIGNAL(showRecord(const OPimRecord& ) ),
- this, SLOT(slotShowRecord(const OPimRecord& ) ) );
+ connect(m_todoView, SIGNAL(showRecord(const OPimRecord&) ),
+ this, SLOT(slotShowRecord(const OPimRecord&) ) );
+ connect(m_dateView, SIGNAL(showRecord(const OPimRecord&) ),
+ this, SLOT(slotShowRecord(const OPimRecord&) ) );
/*
* Now comes the important lines of code for this example
* We do not directly call load but delay loading until
* all Events are dispatches and handled.
* SO we will load once our window is mapped to screen
* to achieve that we use a QTimer::singleShot
* After 10 milli seconds the timer fires and on TimerEvent
* out slot slotLoad will be called
* Remember this a Constructor to construct your object and not
* to load
*/
QTimer::singleShot( 10, this, SLOT(slotLoad() ) );
}
MainWindow::~MainWindow() {
// again nothing to delete because Qt takes care
}
void MainWindow::setDocument( const QString& /*str*/ ) {
}
@@ -168,50 +168,50 @@ void MainWindow::slotLoad() {
* startup by QPEApplication. QCOP is asynchronous
*
* To send you'll use QCopEnevelope
*
*/
/*
* What we will do is first is get to know if either
* datebook or todolist are running if so we will kindly
* asked to save the data for us.
* If neither are running we can load directly
*/
if (!QCopChannel::isRegistered("QPE/Application/todolist") &&
!QCopChannel::isRegistered("QPE/Application/datebook") ) {
m_db.load();
m_tb.load();
return slotLoadForDay( QDate::currentDate() );
}
/*
* prepare our answer machine the QCopChannel
* QPE/Desktop will send "flushDone(QString)" when
* the flush is done it emits a signal on receive
*/
m_desktopChannel = new QCopChannel("QPE/Desktop");
- connect(m_desktopChannel, SIGNAL(received(const QCString&, const QByteArray& ) ),
- this, SLOT(slotDesktopReceive(const QCString&, const QByteArray& ) ) );
+ connect(m_desktopChannel, SIGNAL(received(const QCString&,const QByteArray&) ),
+ this, SLOT(slotDesktopReceive(const QCString&,const QByteArray&) ) );
/* the numberof synced channels will be set to zero */
m_synced = 0;
/*
* We use {} around the QCopEnvelope because it sends its
* data on destruction of QCopEnvelope with
*/
/* check again if not present increment synced*/
if ( QCopChannel::isRegistered("QPE/Application/todolist") ) {
QCopEnvelope env("QPE/Application/todolist", "flush()" );
// env << data; but we do not have any parameters here
}else
m_synced++;
if ( QCopChannel::isRegistered("QPE/Application/datebook") ) {
QCopEnvelope env("QPE/Application/datebook", "flush()" );
}else
m_synced++;
/* we will provide a wait scrren */
m_loading = new OWait(this, "wait screen" );
}
void MainWindow::slotDesktopReceive(const QCString& cmd, const QByteArray& data ) {
@@ -286,50 +286,50 @@ void MainWindow::slotShowRecord( const OPimRecord& rec) {
QTextView *view = new QTextView(dia );
view->setText( rec.toRichText() );
box->addWidget( view );
/*
* execute via QPEApplication
* this allows QPEApplication to make a sane decision
* on the size
*/
dia->showMaximized();
QPEApplication::execDialog( dia );
delete dia;
}
void MainWindow::slotDate() {
/*
* called by the action we will show a Popup
* at the current mouse position with a DateChooser
* to select the day
*/
qWarning("slot Date");
QPopupMenu *menu = new QPopupMenu();
/* A Month to select a date from TRUE for auto close */
DateBookMonth *month = new DateBookMonth(menu, 0, true );
- connect(month, SIGNAL(dateClicked(int, int, int) ),
- this, SLOT(slotLoadForDay(int, int, int) ) );
+ connect(month, SIGNAL(dateClicked(int,int,int) ),
+ this, SLOT(slotLoadForDay(int,int,int) ) );
menu->insertItem( month );
menu->exec( QCursor::pos() );
/*
* we do not need to delete month because
* we delete its parent menu
*/
delete menu;
}
/*
* An anonymous namespace this symbol is only available here
* so truely private
*/
namespace {
/* not static cause namespace does that what static would do */
const int RTTI = 5050;
/*
* every ListView got Items. we've special pim items
* holding ownership and the pointer to a pim record
* it can't hold a pimrecord directly because this