[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Some problems porting an app
From: Waldo Bastian <bastian () kde ! org>
Date: 2003-03-31 8:11:52
[Download RAW message or body]
On Monday 31 March 2003 04:02, Alex wrote:
> I have this error:
>
> fsmview.cpp: In method `void FSMView::addTran()':
> fsmview.cpp:67: type `QTable' is not a base type for type `QWidget'
> make: *** [fsmview.o] Error 1
>
> And the source code, is just that:
>
> void FSMView::addTran()
> {
> QTable *temp = statetabs->currentPage();
> temp->setNumRows( temp->numRows() + 1);
> }
>
> "statetabs", is a QTabWidget.
statetabs->currentPage() returns QWidget *. You need to cast it explicitly to
QTable *. For example:
QTable *temp = dynamic_cast<QTable *>(statetabs->currentPage());
if (temp)
temp->setNumRows( temp->numRows() + 1);
Cheers,
Waldo
--
bastian@kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian@suse.com
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic