From kde-devel Mon Aug 18 03:19:27 2003 From: Christian Nitschkowski Date: Mon, 18 Aug 2003 03:19:27 +0000 To: kde-devel Subject: Re: Question about XML-GUIs X-MARC-Message: https://marc.info/?l=kde-devel&m=106117735024861 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 18 August 2003 04:49, Chris Roland wrote: > >That's why I have the QHBox. It should do the trick, too. > >But now I've changed the code to use a QGridLayout, but the labels still > >aren't visible. > > *snip* > void MyWidget::cleanup(void){ > KPassivePopup* popup = new KPassivePopup(this); > QVBox* box = new QVBox(popup); > QLabel* lbl = new QLabel("Busy", box); > QProgressBar* progress = new QProgressBar(box); > > popup->setView(box); > popup->show(); > *snip* > > Sorry, forgot to check out the previous email ;). Have you tried to use > Yes - that doesn't solve the problem. Now the progressbar on the top is even closer to the window-border, because the Label is now a toplevel-widget. > QLabel* lbl = new QLabel("Busy"); This doesn't work this way. I think you thought of "new QLabel("Busy", 0);" > ... > box->addWidget(lbl); > > instead of > > QLabel* lbl = new QLabel("Busy", box); > > > Also, trolltech has a good page on layouts that might help out. > http://doc.trolltech.com/3.0/layout.html > > Thanks - but I know the Qt documentation. It is really great, but it doesn't help me here. This is a strange behaviour where I can't think of the cause. I use a code similar to this in another situation, and there it works. After some experimenting, I changed the code to this: MyWidget::MyWidget(int total, int page, QWidget* parent, const char* name) : QWidget(parent, name){ QGridLayout* layout = new QGridLayout(this, 4, 2); QLabel* info = new QLabel("Busy", this); QLabel* pic = new QLabel(this); QLabel* lbl = new QLabel("page", this); QProgressBar* totalProgress = new QProgressBar(total, this); QProgressBar* pageProgress = new QProgressBar(page, this); pic->setPixmap (someQPixmap); layout->addMultiCellWidget(info, 0, 0, 0, 1); layout->addMultiCellWidget(totalProgress, 1, 1, 0, 1); layout->addWidget(pic, 2, 0); layout->addWidget(lbl, 2, 1); layout->addMultiCellWidget(pageProgress, 3, 3, 0, 1); resize(sizeHint()); } I uploaded a screenshot of it here: http://segfaultskde.berlios.de/other/progress_problem.png > Later, > Chris > Regards Christian Nitschkowski - -- - --: Christian Nitschkowski :-- - --: Jabber: segfault_ii@a-message.de :-- - --: ICQ#: 66190597 :-- - --------------------------------------------------------------- If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization. Murphy's Law -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD8DBQE/QEXF119BwfrC2gIRAkUDAJ4wQ/BPiD1uIt+49QPqm9TTuKXPeQCfbPFi +rGeBFy5xf2POqM2yfcDR0k= =5h1F -----END PGP SIGNATURE----- >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<