[Qt-creator] Resize probelm
Yuvaraj R
yuvaraj at ongobiz.com
Tue May 5 16:49:41 CEST 2009
Hi All
I am facing the size problem...
I ma display in the frame in listview
To display the frames in listview:
Tweet * t = new Tweet(this);
t->resize(ui->listView->size().width(), t->size().height());
qDebug("width:%d",ui->listView->size().width());
qDebug("Height:%d", t->size().height());
model->item(i)->setSizeHint(t->size());
ui->listView->setIndexWidget(model->item(i)->index(), t);
Here Tweet is frame class....
When i am maximizing the window that time my frame width too maximize. and
when i am minimizing the window that time frame have to minimize.
I am using event class to get the window current width..
Code is here...
void MainWindow::resizeEvent( QResizeEvent *event )
{
emit resizeView( event->size().width(), event->oldSize().width() );
}
MainWindow w;
QObject :: connect(&w,signal(resizeView),&w,Slot(resizeData));
void mainWindow :: resizeData(int width,int old width)
{
QSize itemSize;
Tweet *aTweet;
for ( int i = 0; i < rowCount(); i++ ) {
aTweet =t;
aTweet->resize( width , aTweet->size().height() );
itemSize = item(i)->sizeHint();
itemSize.rwidth() += width - oldWidth;
itemSize.rheight() = aTweet->size().height();
item(i)->setSizeHint( itemSize );
}
But my window is crazing .....when i am trying the modify the window size
please help me how do solve this issue
Thanks
Yuvaraj R
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090505/152421b2/attachment.html
More information about the Qt-creator-old
mailing list