gwenhywfar  4.3.1
w_vline.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002     begin       : Mon Feb 15 2010
00003     copyright   : (C) 2010 by Martin Preuss
00004     email       : martin@libchipcard.de
00005 
00006  ***************************************************************************
00007  *          Please see toplevel file COPYING for license details           *
00008  ***************************************************************************/
00009 
00010 
00011 #include <gwen-gui-cpp/cppwidget.hpp>
00012 
00013 
00014 class Qt4_W_VLine: public Qt4_W_Widget {
00015 public:
00016   Qt4_W_VLine(GWEN_WIDGET *w):Qt4_W_Widget(w) {
00017   }
00018 
00019 
00020 
00021   ~Qt4_W_VLine() {
00022   }
00023 
00024 
00025 
00026   virtual int setup() {
00027     QFrame *qw;
00028     uint32_t flags;
00029     GWEN_WIDGET *wParent;
00030     QSizePolicy::Policy hpolicy=QSizePolicy::Minimum;
00031     QSizePolicy::Policy vpolicy=QSizePolicy::Minimum;
00032     const char *s;
00033     QString text;
00034 
00035     flags=GWEN_Widget_GetFlags(_widget);
00036     wParent=GWEN_Widget_Tree_GetParent(_widget);
00037     s=GWEN_Widget_GetText(_widget, 0);
00038     if (s)
00039       text=QString::fromUtf8(s);
00040 
00041     qw=new QFrame();
00042     qw->setFrameShape(QFrame::VLine);
00043     qw->setFrameShadow(QFrame::Sunken);
00044 
00045     /* handle flags */
00046     if (flags & GWEN_WIDGET_FLAGS_FILLX)
00047       hpolicy=QSizePolicy::Expanding;
00048     if (flags & GWEN_WIDGET_FLAGS_FILLY)
00049       vpolicy=QSizePolicy::Expanding;
00050     qw->setSizePolicy(hpolicy, vpolicy);
00051 
00052     GWEN_Widget_SetImplData(_widget, QT4_DIALOG_WIDGET_REAL, (void*) qw);
00053 
00054     if (wParent)
00055       GWEN_Widget_AddChildGuiWidget(wParent, _widget);
00056     return 0;
00057   }
00058 
00059 };
00060 
00061 
00062 
00063 
00064 
00065 
00066