fix for Windows, code style

This commit is contained in:
Volker Fischer 2006-02-22 17:48:25 +00:00
parent f7e8634ca9
commit 070158cb33
2 changed files with 36 additions and 18 deletions

View file

@ -136,14 +136,21 @@ void CLlconServerDlg::OnTimer()
// QString().sprintf("%5.2f", vecdSamOffs[i])); // QString().sprintf("%5.2f", vecdSamOffs[i]));
#ifndef _WIN32 #ifndef _WIN32
vecpListViewItems[i]->setVisible(true); vecpListViewItems[i]->setVisible ( true );
#endif #endif
} }
#ifndef _WIN32
else else
vecpListViewItems[i]->setVisible(false); {
#ifdef _WIN32
/* remove text for Windows version */
vecpListViewItems[i]->setText(0,"");
vecpListViewItems[i]->setText(3,"");
vecpListViewItems[i]->setText(4,"");
#else
vecpListViewItems[i]->setVisible ( false );
#endif #endif
} }
}
ListViewMutex.unlock(); ListViewMutex.unlock();

View file

@ -101,15 +101,22 @@ protected:
class CMultColLEDListViewItem : public CMultiColorLEDbase class CMultColLEDListViewItem : public CMultiColorLEDbase
{ {
public: public:
CMultColLEDListViewItem(const int iNewCol) : iColumn(iNewCol), CMultColLEDListViewItem ( const int iNewCol ) : iColumn ( iNewCol ),
pListViewItem(NULL) {} pListViewItem ( NULL ) {}
void SetListViewItemPointer(QListViewItem* pNewListViewItem) void SetListViewItemPointer ( QListViewItem* pNewListViewItem )
{pListViewItem = pNewListViewItem;} {
pListViewItem = pNewListViewItem;
}
protected: protected:
virtual void SetPixmap(QPixmap& NewBitmap) virtual void SetPixmap ( QPixmap& NewBitmap )
{if (pListViewItem != NULL) pListViewItem->setPixmap(iColumn, NewBitmap);} {
if ( pListViewItem != NULL )
{
pListViewItem->setPixmap ( iColumn, NewBitmap );
}
}
QListViewItem* pListViewItem; QListViewItem* pListViewItem;
int iColumn; int iColumn;
@ -119,15 +126,19 @@ protected:
class CServerListViewItem : public QListViewItem class CServerListViewItem : public QListViewItem
{ {
public: public:
CServerListViewItem(QListView* parent) : LED0(1), LED1(2), CServerListViewItem ( QListView* parent ) : LED0 ( 1 ), LED1 ( 2 ),
QListViewItem(parent) {LED0.SetListViewItemPointer(this); QListViewItem ( parent )
LED1.SetListViewItemPointer(this);}
void SetLight(int iWhichLED, int iNewStatus)
{ {
switch (iWhichLED) { LED0.SetListViewItemPointer ( this );
case 0: LED0.SetLight(iNewStatus); break; LED1.SetListViewItemPointer ( this );
case 1: LED1.SetLight(iNewStatus); break; }
void SetLight ( int iWhichLED, int iNewStatus )
{
switch ( iWhichLED )
{
case 0: LED0.SetLight ( iNewStatus ); break;
case 1: LED1.SetLight ( iNewStatus ); break;
} }
} }