I'm showing content of my application that loads file and show the names, values, etc.
I'm trying to learn and use qml, I was using QWebView.
I'm resizing the widget elements manually with a line that lets you "move" it resizing a TreeWidget (in the left side) and the "View" (in the right side):
void MapBrowser::redoLayout(const QSize& twsize, const QSize& wvsize)
{
static int padleft = ui->treeWidget->x();
static int padmid = ui->line->x() - ui->treeWidget->x() - ui->treeWidget->width();
if (this->size() == this->minimumSize()) return;
if (twsize.width() < ui->treeWidget->minimumSize().width()) return;
if (wvsize.width() < ui->declarativeView->minimumSize().width()) return;
//if (wvsize.width() < ui->webView->minimumSize().width()) return;
ui->treeWidget->resize(twsize);
ui->declarativeView->resize(wvsize);
//ui->webView->resize(wvsize);
QPoint twmove
(padleft, ui
->treeWidget
->y
());
QPoint lnmove
(ui
->treeWidget
->x
() + ui
->treeWidget
->width
() + padmid, ui
->line
->y
());
QPoint wvmove
(ui
->line
->x
() + ui
->line
->width
() + padmid, ui
->declarativeView
->y
());
//QPoint wvmove(ui->line->x() + ui->line->width() + padmid, ui->webView->y());
ui->treeWidget->move(twmove);
ui->line->move(lnmove);
ui->declarativeView->move(wvmove);
//ui->webView->move(wvmove);
}
void MapBrowser::redoLayout(const QSize& twsize, const QSize& wvsize)
{
static int padleft = ui->treeWidget->x();
static int padmid = ui->line->x() - ui->treeWidget->x() - ui->treeWidget->width();
if (this->size() == this->minimumSize()) return;
if (twsize.width() < ui->treeWidget->minimumSize().width()) return;
if (wvsize.width() < ui->declarativeView->minimumSize().width()) return;
//if (wvsize.width() < ui->webView->minimumSize().width()) return;
ui->treeWidget->resize(twsize);
ui->declarativeView->resize(wvsize);
//ui->webView->resize(wvsize);
QPoint twmove(padleft, ui->treeWidget->y());
QPoint lnmove(ui->treeWidget->x() + ui->treeWidget->width() + padmid, ui->line->y());
QPoint wvmove(ui->line->x() + ui->line->width() + padmid, ui->declarativeView->y());
//QPoint wvmove(ui->line->x() + ui->line->width() + padmid, ui->webView->y());
ui->treeWidget->move(twmove);
ui->line->move(lnmove);
ui->declarativeView->move(wvmove);
//ui->webView->move(wvmove);
}
To copy to clipboard, switch view to plain text mode
But, my problem is:
I need to update the size of the main Rectangle, how can I do this ?
Bookmarks