PDA

View Full Version : QWidget -> updateGeometry dont work.



patrik08
13th July 2006, 14:19
I use a class flowlayout [ http://doc.trolltech.com/4.1/layouts-flowlayout-flowlayout-cpp.html ]
to add invoice line (QList items & Propriety)

My problem is QWidget -> updateGeometry() dont work!
How i can solved?

If i large the widget from hand ... dispay the result ok....

http://ppk.ciz.ch/format/images/flowlayout_line.png



/* the line wo i add .. */
class ItemLine : public QWidget


void Compose_Fak::RepainterWindowNow()
{
retranslateUi(this);
updateGeometry();
}

patrik08
13th July 2006, 16:32
if i repaint widget so ...


void Compose_Fak::RepainterWindowNow()
{
int xh = height();
int xw = width();
resize(xw + 5,xh);
resize(xw,xh);
}

works ok....

but exist other solution?

jacek
13th July 2006, 16:39
When do you call that Compose_Fak::RepainterWindowNow() method? Maybe you block the event loop somewhere?

patrik08
13th July 2006, 17:07
When do you call that Compose_Fak::RepainterWindowNow() method? Maybe you block the event loop somewhere?

is possibel... is on same time...


connect( aggiungilineax, SIGNAL( clicked() ),this, SLOT( AppendLine()));
connect( aggiungilineax, SIGNAL( clicked() ),this, SLOT( RepainterWindowNow()));

i test on emit at end of RepainterWindowNow....


it compliments for Your Master's Degree in Computer Science ...

jacek
13th July 2006, 17:17
connect( aggiungilineax, SIGNAL( clicked() ),this, SLOT( RepainterWindowNow()));
When you trigger that slot using clicked() signal, then it means that updateGeometry() doesn't work for some other reason.

Why do you want to invoke it anyway?

patrik08
13th July 2006, 17:21
When you trigger that slot using clicked() signal, then it means that updateGeometry() doesn't work for some other reason.
Why do you want to invoke it anyway?

it compliments for Your Master's Degree in Computer Science ... :)


Work if the screen qwidget is not fullscreen ... by fullscren is same as pictures ..
http://ppk.ciz.ch/format/images/flowlayout_line.png



void Compose_Fak::RepainterWindowNow()
{
int xh = height(); /* incomming emit ReloadPageFull() */
int xw = width();
resize(xw + 10,xh);
resize(xw,xh);
}

void Compose_Fak::AppendLine()
{
int sumflow = flow->count();
if ( sumflow < 9) {
summlinerfak++;
fiocco = new ItemLine(piano_centrale);
fiocco->setNumerate(summlinerfak);
fiocco->setTitle("Testo di descrizione");
fiocco->setQuant(2.5);
fiocco->setUnitprice(1.16);
flow->addWidget(fiocco);
/*QSize actualf = flow->sizeHint();
int hsww = actualf.height();
int wsww = actualf.width();
qDebug() << "### misura .. alto=" << hsww << " largo=" << wsww; */
lines.append( fiocco ); /* QList<ItemLine *> lines; */
} else {
aggiungilineax->setDisabled (true); /* disable button */
}
emit ReloadPageFull();
}

franco.amato
18th January 2010, 20:53
I use a class flowlayout [ http://doc.trolltech.com/4.1/layouts-flowlayout-flowlayout-cpp.html ]
to add invoice line (QList items & Propriety)

My problem is QWidget -> updateGeometry() dont work!
How i can solved?

If i large the widget from hand ... dispay the result ok....

http://ppk.ciz.ch/format/images/flowlayout_line.png



/* the line wo i add .. */
class ItemLine : public QWidget


void Compose_Fak::RepainterWindowNow()
{
retranslateUi(this);
updateGeometry();
}

Hi I can help with qmake.net I'm Italian

seven7
22nd May 2013, 15:55
if i repaint widget so ...


void Compose_Fak::RepainterWindowNow()
{
int xh = height();
int xw = width();
resize(xw + 5,xh);
resize(xw,xh);
}

works ok....

but exist other solution?


I had the same problem and "adjustSize()" on the parent widget did the trick (Qt4.8). (I know this thread is really old, but perhaps it helps someone.)