QRect MainWinRect = this->geometry(); //int VerWinHeight = 300; fVerSec = new VerticalSection(this); fVerSec->setWindowTitle(tr("Vertical Section")); fVerSec->move(screenGeometry.width() - fVerSec->width(),this->geometry().bottom()); fVerSec->setWindowFlags(fVerSec->windowFlags() | Qt::FramelessWindowHint); //fVerSec->show(); flist_vsf = new list_vsf(this); flist_vsf->setWindowTitle(tr("Volume Scans List")); flist_vsf->move(screenGeometry.width() - flist_vsf->width(),fVerSec->geometry().bottom()); flist_vsf->setWindowFlags(flist_vsf->windowFlags() | Qt::FramelessWindowHint); flist_vsf->set_parent_container(Container); flist_vsf->update_vsf_list();//Container->Config.Data.PathToDir.Archive); //flist_vsf->show(); InitMainMenu();
[code] QRect MainWinRect = this->geometry(); //int VerWinHeight = 300; fVerSec = new VerticalSection(this); fVerSec->setWindowTitle(tr("Vertical Section")); fVerSec->move(screenGeometry.width() - fVerSec->width(),this->geometry().bottom()); fVerSec->setWindowFlags(fVerSec->windowFlags() | Qt::FramelessWindowHint); //fVerSec->show(); flist_vsf = new list_vsf(this); flist_vsf->setWindowTitle(tr("Volume Scans List")); flist_vsf->move(screenGeometry.width() - flist_vsf->width(),fVerSec->geometry().bottom()); flist_vsf->setWindowFlags(flist_vsf->windowFlags() | Qt::FramelessWindowHint); flist_vsf->set_parent_container(Container); flist_vsf->update_vsf_list();//Container->Config.Data.PathToDir.Archive); //flist_vsf->show(); InitMainMenu();
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){.... //--- work screen size without statusbar --- QRect screenGeometry = QApplication::desktop()->screenGeometry(); int MainWinWidth = 240; int MainWinHeight = 120; this->setFixedSize(MainWinWidth, MainWinHeight); this->move(0, 0); //this->move(screenGeometry.width() - this->width(), screenGeometry.top()); this->show(); //--- window of vertical section --- fVerSec = new VerticalSection(this); //**fVerSec->setWindowFlags(fVerSec->windowFlags() | Qt::FramelessWindowHint); fVerSec->setWindowTitle(tr("Vertical Section")); //--- window of list of scan files --- flist_vsf = new list_vsf(this); flist_vsf->setWindowTitle(tr("Volume Scans List")); flist_vsf->set_parent_container(Container); flist_vsf->update_vsf_list();//Container->Config.Data.PathToDir.Archive); QTimer::singleShot(50, this, SLOT(adjustVerSecGeometry()));...}void MainWindow::adjustVerSecGeometry(){ int VerWinHeight = 300; fVerSec->resize(this->width(), VerWinHeight); fVerSec->move(this->geometry().left(), this->geometry().bottom() + 1); fVerSec->show(); //flist_vsf->show(); QTimer::singleShot(50, this, SLOT(adjustListVsfGeometry()));}void MainWindow::adjustListVsfGeometry(){ QRect screenGeometry = QApplication::desktop()->screenGeometry(); flist_vsf->resize(this->width(), screenGeometry.height() - fVerSec->geometry().bottom() - 1); flist_vsf->move(this->geometry().left(), fVerSec->geometry().bottom() + 1); flist_vsf->show(); QTimer::singleShot(50, this, SLOT(adjustListVsfGeometry2()));}
void TMap::adjust_colorscale2(){ QWidget *widget_color_scale2 = new QWidget(ui->widget_aaaaa); QPalette palette; QBrush brush; brush.setStyle(Qt::SolidPattern); for (int i = 0; i < MapScale->ScaleLen; ++i) { color_scales[i] = new QLineEdit(widget_color_scale2); color_scales[i]->setText(MapScale->ArrCaptions[i]); color_scales[i]->setAlignment(Qt::AlignCenter); color_scales[i]->setFrame(false); brush.setColor(MapScale->ArrColors[i]); palette.setBrush(QPalette::Active, QPalette::Base, brush); palette.setBrush(QPalette::Inactive, QPalette::Base, brush); palette.setBrush(QPalette::Disabled, QPalette::Base, brush); color_scales[i]->setPalette(palette); } QVBoxLayout *color_scales_Layout = new QVBoxLayout(widget_color_scale2); for (int i = 0; i < MapScale->ScaleLen; ++i) { color_scales_Layout->addWidget(color_scales[i]); } color_scales_Layout->setMargin(0); color_scales_Layout->setSpacing(0);}