diff options
author | Dirk von Suchodoletz | 2011-03-25 02:29:55 +0100 |
---|---|---|
committer | Dirk von Suchodoletz | 2011-03-25 02:29:55 +0100 |
commit | 2da95e2716a5e912089562f0c43aa7bdae07a70e (patch) | |
tree | 9f2e1df13f7c7a1d98faf6df687586b3ff82f958 /src/gui/connectionFrame.cpp | |
parent | ... (diff) | |
parent | revert username generator (diff) | |
download | pvs-2da95e2716a5e912089562f0c43aa7bdae07a70e.tar.gz pvs-2da95e2716a5e912089562f0c43aa7bdae07a70e.tar.xz pvs-2da95e2716a5e912089562f0c43aa7bdae07a70e.zip |
Merge branch 'master' of openslx.org:pvs
Diffstat (limited to 'src/gui/connectionFrame.cpp')
-rw-r--r-- | src/gui/connectionFrame.cpp | 104 |
1 files changed, 28 insertions, 76 deletions
diff --git a/src/gui/connectionFrame.cpp b/src/gui/connectionFrame.cpp index b618668..32e20f7 100644 --- a/src/gui/connectionFrame.cpp +++ b/src/gui/connectionFrame.cpp @@ -28,58 +28,31 @@ extern "C" ConnectionFrame::ConnectionFrame(QWidget *parent) : QGroupBox(parent) { - //defines the ui-stuff - - _gL = new QGridLayout(this); - _gL->setSpacing(6); - _gL->setMargin(1); - - _split = new QSplitter(this); - _split->setOrientation(Qt::Vertical); - - _frame = new Frame("", _split); - _frame->setConFrame(this); - _split->addWidget(_frame); - - _conFrameTaskbar = new QWidget(_split); - _conFrameTaskbar->setMaximumHeight(30); - - _gLayout = new QGridLayout(_conFrameTaskbar); - _gLayout->setMargin(0); - _gLayout->setSpacing(0); - - _hLayoutInCfTaskbar = new QHBoxLayout(); - - _ip = new QLabel(_conFrameTaskbar); - _ip->setAlignment(Qt::AlignCenter); - - _hLayoutInCfTaskbar->addWidget(_ip); - - _dozentContaimner = new QLabel(_conFrameTaskbar); - _dozentContaimner->setAlignment(Qt::AlignRight); - _dozentContaimner->setMaximumSize(QSize(20, 20)); - _dozentContaimner->setScaledContents(true); - - _hLayoutInCfTaskbar->addWidget(_dozentContaimner); - - _dozentContaimner->setDisabled(true); - - _status = new QLabel(_conFrameTaskbar); - _status->setAlignment(Qt::AlignRight); - _status->setMaximumSize(QSize(22, 21)); - - _hLayoutInCfTaskbar->addWidget(_status); - - _gLayout->addLayout(_hLayoutInCfTaskbar, 0, 0, 1, 1); - _split->addWidget(_conFrameTaskbar); - - _gL->addWidget(_split, 0, 0, 1, 1); - - this->setLayout(_gL); + _layoutTop = new QVBoxLayout(this); + _layoutTop->setMargin(0); + _frame = new Frame("", this); + _frame->setConFrame(this); + _frame->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); + _layoutTop->addWidget(_frame); + _layoutBottom = new QHBoxLayout(this); + _layoutBottom->setMargin(0); + _conFrameTaskbar = new QWidget(this); + _conFrameTaskbar->setLayout(_layoutBottom); + _conFrameTaskbar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); + _ip = new QLabel(_conFrameTaskbar); + _layoutBottom->addStretch(); + _layoutBottom->addWidget(_ip); + _layoutBottom->addStretch(); + _dozentContaimner = new QLabel(_conFrameTaskbar); + _dozentContaimner->setDisabled(true); + _layoutBottom->addWidget(_dozentContaimner); + _status = new QLabel(_conFrameTaskbar); + _layoutBottom->addWidget(_status); + _layoutTop->addWidget(_conFrameTaskbar); + this->setLayout(_layoutTop); setInitSize(190,168); - initFrame(); nat_height = 0; @@ -176,7 +149,7 @@ void ConnectionFrame::setInitSize(int w, int h) { resize(w, h); _frame->resize(w, h); - _conFrameTaskbar->resize(w, h); + //_conFrameTaskbar->resize(w, h); prev_height = h; prev_width = w; init_w = w; @@ -470,32 +443,11 @@ void ConnectionFrame::mouseMoveEvent(QMouseEvent *event) void ConnectionFrame::paintCloseUp(int w, int h) { - - - if (!_frame->image().isNull()) - { - /*this->setFixedWidth(w); - _conFrameTaskbar->setMaximumWidth(w); - resize(w, h);*/ - resizeComponent(w, h); - setMaximumSize(w,h); - resize(w, h); - } - else - { - std::cout << "pixel is NULL" << std::endl; - } - -} - -void ConnectionFrame::resizeComponent(int w, int h) -{ - int th = (h*_conFrameTaskbar->width())/w; - int uh = (h*_ip->width())/w; - _conFrameTaskbar->setMaximumSize(w, th); - _conFrameTaskbar->resize(w, th); - _ip->setMaximumSize(w, uh); - _ip->resize(w,uh); + if (!_frame->image().isNull()) + { + //move(0,0); + resize(w, h); + } } void ConnectionFrame::setSource() |