QWidget -> updateGeometry dont work.
I use a class flowlayout [ http://doc.trolltech.com/4.1/layouts...ayout-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
Code:
/* the line wo i add .. */
void Compose_Fak::RepainterWindowNow()
{
retranslateUi(this);
updateGeometry();
}
Re: QWidget -> updateGeometry dont work.
if i repaint widget so ...
Code:
void Compose_Fak::RepainterWindowNow()
{
int xh = height();
int xw = width();
resize(xw + 5,xh);
resize(xw,xh);
}
works ok....
but exist other solution?
Re: QWidget -> updateGeometry dont work.
When do you call that Compose_Fak::RepainterWindowNow() method? Maybe you block the event loop somewhere?
Re: QWidget -> updateGeometry dont work.
Quote:
Originally Posted by jacek
When do you call that Compose_Fak::RepainterWindowNow() method? Maybe you block the event loop somewhere?
is possibel... is on same time...
Code:
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 ...
Re: QWidget -> updateGeometry dont work.
Quote:
Originally Posted by patrik08
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?
Re: QWidget -> updateGeometry dont work.
Quote:
Originally Posted by jacek
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
Code:
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();
}
Re: QWidget -> updateGeometry dont work.
Quote:
Originally Posted by
patrik08
Hi I can help with qmake.net I'm Italian
Re: QWidget -> updateGeometry dont work.
Quote:
Originally Posted by
patrik08
if i repaint widget so ...
Code:
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.)