00001 // $Id: QRootWindowPlugin.cpp 478 2009-10-29 12:26:09Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #include "QRootWindow.h" 00015 #include "QRootWindowPlugin.h" 00016 00017 #include <QtPlugin> 00018 00019 00020 QRootWindowPlugin::QRootWindowPlugin(QObject *parent) 00021 : QObject(parent) 00022 { 00023 initialized = false; 00024 } 00025 00026 void QRootWindowPlugin::initialize(QDesignerFormEditorInterface * /* core */) 00027 { 00028 if (initialized) 00029 return; 00030 initialized = true; 00031 } 00032 00033 bool QRootWindowPlugin::isInitialized() const 00034 { 00035 return initialized; 00036 } 00037 00038 QWidget *QRootWindowPlugin::createWidget(QWidget *parent) 00039 { 00040 QRootWindow* widg=new QRootWindow(parent, 0, true); 00041 QPalette* npal= new QPalette(widg->palette()); 00042 npal->setBrush(QPalette::Window,QPixmap(":/root.png")); 00043 widg->setPalette(*npal); 00044 widg->setAutoFillBackground(true); 00045 return widg; 00046 } 00047 00048 QString QRootWindowPlugin::name() const 00049 { 00050 return "QRootWindow"; 00051 } 00052 00053 QString QRootWindowPlugin::group() const 00054 { 00055 return "Go4 Custom Widgets"; 00056 } 00057 00058 QIcon QRootWindowPlugin::icon() const 00059 { 00060 return QIcon(":/go4logo2.png"); 00061 } 00062 00063 QString QRootWindowPlugin::toolTip() const 00064 { 00065 return "Qwidget to embed a ROOT TGCompositeFrame"; 00066 } 00067 00068 QString QRootWindowPlugin::whatsThis() const 00069 { 00070 return "ROOT TGFrame embedded into a QWidget "; 00071 } 00072 00073 bool QRootWindowPlugin::isContainer() const 00074 { 00075 return false; 00076 } 00077 00078 QString QRootWindowPlugin::domXml() const 00079 { 00080 return "<widget class=\"QRootWindow\" name=\"QRootWindow\">\n" 00081 " <property name=\"geometry\">\n" 00082 " <rect>\n" 00083 " <x>0</x>\n" 00084 " <y>0</y>\n" 00085 " <width>100</width>\n" 00086 " <height>100</height>\n" 00087 " </rect>\n" 00088 " </property>\n" 00089 "</widget>\n"; 00090 } 00091 00092 QString QRootWindowPlugin::includeFile() const 00093 { 00094 return "QRootWindow.h"; 00095 } 00096 00097