00001 // $Id: QRootCanvasPlugin.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 "QRootCanvas.h" 00015 #include "QRootCanvasPlugin.h" 00016 00017 #include <QtPlugin> 00018 //#include <iostream> 00019 00020 00021 QRootCanvasPlugin::QRootCanvasPlugin(QObject *parent) 00022 : QObject(parent) 00023 { 00024 initialized = false; 00025 } 00026 00027 void QRootCanvasPlugin::initialize(QDesignerFormEditorInterface * /* core */) 00028 { 00029 if (initialized) 00030 return; 00031 initialized = true; 00032 } 00033 00034 bool QRootCanvasPlugin::isInitialized() const 00035 { 00036 return initialized; 00037 } 00038 00039 QWidget *QRootCanvasPlugin::createWidget(QWidget *parent) 00040 { 00041 QRootCanvas* widg=new QRootCanvas(parent); 00042 QPalette* npal= new QPalette(widg->palette()); 00043 //npal->setColor(QPalette::Window,Qt::red); 00044 npal->setBrush(QPalette::Window,QPixmap(":/scale.png")); 00045 widg->setPalette(*npal); 00046 widg->setAutoFillBackground(true); 00047 return widg; 00048 00049 } 00050 00051 QString QRootCanvasPlugin::name() const 00052 { 00053 return "QRootCanvas"; 00054 } 00055 00056 QString QRootCanvasPlugin::group() const 00057 { 00058 return "Go4 Custom Widgets"; 00059 } 00060 00061 QIcon QRootCanvasPlugin::icon() const 00062 { 00063 return QIcon(":/go4logo2.png"); 00064 } 00065 00066 QString QRootCanvasPlugin::toolTip() const 00067 { 00068 return "Standard QtROOT canvas"; 00069 } 00070 00071 QString QRootCanvasPlugin::whatsThis() const 00072 { 00073 return "ROOT canvas embedded into QWidget"; 00074 } 00075 00076 bool QRootCanvasPlugin::isContainer() const 00077 { 00078 return false; 00079 } 00080 00081 QString QRootCanvasPlugin::domXml() const 00082 { 00083 return "<widget class=\"QRootCanvas\" name=\"QRootCanvas\">\n" 00084 " <property name=\"geometry\">\n" 00085 " <rect>\n" 00086 " <x>0</x>\n" 00087 " <y>0</y>\n" 00088 " <width>100</width>\n" 00089 " <height>100</height>\n" 00090 " </rect>\n" 00091 " </property>\n" 00092 "</widget>\n"; 00093 } 00094 00095 QString QRootCanvasPlugin::includeFile() const 00096 { 00097 return "QRootCanvas.h"; 00098 } 00099 00100