qt-interest@trolltech.com
[Top] [All Lists]

access class related ui namespace from outside

Subject: access class related ui namespace from outside
From: Petr Vanek
Date: Mon, 19 Mar 2007 13:05:24 +0100
hi all

I'm porting a large app to Qt4. I have a lot of files ported to the new ui
system. Let's have an example:

class Foo : public QWidget, Ui::Foo
{
   blah // constructor, setupUi(this) etc.
};

and in the other file:

class Prefs : public QDialog
{
...
private:
   Foo f;
}

void Prefs::loadFoo()
{
   f->myEditWidget->setText("blah");
...
}

the compiler exists with error:
/home/pvanek/135/Scribus/scribus/ui_tabgeneral.h: In member function âvoid
Preferences::updatePreferences()â:
/home/pvanek/135/Scribus/scribus/ui_tabgeneral.h:49: error: âQSpinBox*
Ui_TabGeneral::GFsizeâ is inaccessible
/home/pvanek/135/Scribus/scribus/prefs.cpp:340: error: within this context

how I can access the Ui namespace? I do not want to update thousands of
lines with sed or my poor hands to use Ui::Foo as a public member accessing
its widgets with "f.ui->myEditWidget". Is there any way to do it?

all the best
Petr Vanek

--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>