Commit 3dfa8b5e authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Fixed frames.

parent 2bb6f30f
......@@ -56,10 +56,7 @@ NavQt::NavQt(void* nav_parent_ctx, QWidget* nav_parent_wid,
debug_print("creating a scrolledbrowwidgetqt\n");
QScrollArea* scrolledbrow = ((QScrollArea*) scrolledbrowwidgetqt_new(Nav::init_brow_cb, this, &brow_widget));
scrolledbrow->setFrameShape(QFrame::Box);
scrolledbrow->setLineWidth(3);
form_widget = scrolledbrow;
form_widget = wrapInFrame(scrolledbrow);
server = new QLocalServer(trace_obj);
server->listen("STRING");
......
......@@ -57,10 +57,7 @@ PalQt::PalQt(void* pal_parent_ctx, QWidget* pal_parent_wid,
QScrollArea* scrolledbrow = ((QScrollArea*) scrolledbrowwidgetqt_new(Pal::init_brow_cb, this, &brow_widget));
brow_widget->setToolTip(fl("PalQt"));
scrolledbrow->setFrameShape(QFrame::Box);
scrolledbrow->setLineWidth(3);
form_widget = scrolledbrow;
form_widget = wrapInFrame(scrolledbrow);
showNow(brow_widget);
......
......@@ -61,6 +61,7 @@
#include <QColor>
#include <QInputDialog>
#include <QLayout>
#include <QMessageBox>
#include <QScrollArea>
......@@ -89,10 +90,7 @@ WNavQt::WNavQt(void* xn_parent_ctx, QWidget* xn_parent_wid, const char* xn_name,
WNav::init_brow_base_cb, this, &brow_widget));
brow_widget->setToolTip(fl("WNavQt"));
scrolledbrow->setFrameShape(QFrame::Box);
scrolledbrow->setLineWidth(3);
form_widget = scrolledbrow;
form_widget = wrapInFrame(scrolledbrow);
showNow(brow_widget);
......
......@@ -69,6 +69,7 @@
#include <QMenu>
#include <QMenuBar>
#include <QMessageBox>
#include <QPushButton>
#include <QScrollArea>
#include <QTimer>
#include <QVBoxLayout>
......
......@@ -346,4 +346,16 @@ void add_expanding(QLayout* layout, QWidget* widget)
void add_expanding(QLayout* layout, QLayout* widget)
{
add_expanding(layout, layout_to_widget(widget));
}
QFrame* wrapInFrame(QFrame* widget)
{
widget->setFrameStyle(QFrame::NoFrame);
QFrame *frame = new QFrame();
frame->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
QVBoxLayout *layout = new QVBoxLayout();
layout->setContentsMargins(3, 3, 3, 3);
layout->addWidget(widget);
frame->setLayout(layout);
return frame;
}
\ No newline at end of file
......@@ -108,4 +108,6 @@ void add_expanding(QSplitter* splitter, QLayout* widget);
void add_expanding(QLayout* layout, QWidget* widget);
void add_expanding(QLayout* layout, QLayout* widget);
QFrame* wrapInFrame(QFrame* widget);
#endif // QT_HELPERS_H
......@@ -49,6 +49,7 @@
#include <QMenu>
#include <QMenuBar>
#include <QPalette>
#include <QPushButton>
#include <QVBoxLayout>
void RtMonQtWidget::closeEvent(QCloseEvent* event)
......@@ -146,9 +147,9 @@ RtMonQt::RtMonQt(void* rtmon_parent_ctx, QWidget* rtmon_parent_wid,
dcli_translate_filename(fname, "$pwr_exe/pwr_logofullg.png");
bbox_image_gray = new_image_label(toplevel, fname);
bbox_label = new QPushButton("Down");
bbox_label = new QLabel("Down");
bbox_label->setFixedSize(170, 25);
bbox_label->setEnabled(false);
bbox_label->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
QVBoxLayout* bbox = new QVBoxLayout();
bbox_start
......
......@@ -45,7 +45,6 @@
#include <QAction>
#include <QLabel>
#include <QPushButton>
#include <QTimer>
#include <QWidget>
......@@ -58,7 +57,7 @@ public:
~RtMonQt();
QWidget* nodelistnav_widget;
QPushButton* bbox_label;
QLabel* bbox_label;
QWidget* bbox_start;
QWidget* bbox_restart;
QWidget* bbox_stop;
......
......@@ -460,6 +460,7 @@ OpQt::OpQt(void* op_parent_ctx, QWidget* op_parent_wid, char* opplace,
modifyBackground(toplevel, background);
toplevel->setLayout(vbox_conf);
toplevel->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
toplevel->show();
if (start_jop) {
......
......@@ -130,12 +130,12 @@ private:
OpQtWidget* toplevel;
};
class OpQtWidget : public QWidget {
class OpQtWidget : public QFrame {
Q_OBJECT
public:
OpQtWidget(OpQt* parent_ctx, QWidget* parent)
: QWidget(), op(parent_ctx)
: QFrame(), op(parent_ctx)
{
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment