50 #include "rendererWidget.hh" 52 #if QT_VERSION >= 0x050000 62 RendererDialog::RendererDialog(QWidget *parent)
67 list->setContextMenuPolicy(Qt::CustomContextMenu);
69 connect(closeButton, SIGNAL(clicked()),
this, SLOT(accept()));
70 connect(list,SIGNAL(customContextMenuRequested(
const QPoint&)),
this,SLOT(slotContextMenu(
const QPoint&)));
73 QString iconPath = OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator();
75 closeButton->setIcon( QIcon(iconPath +
"window-close.png"));
79 void RendererDialog::closeEvent(QCloseEvent *event)
86 void RendererDialog::showEvent ( QShowEvent * ) {
90 void RendererDialog::update()
95 for (
unsigned int i = 0 ; i < renderManager().
available() ; ++i) {
102 QFrame* frame =
new QFrame();
103 QHBoxLayout* hlayout =
new QHBoxLayout;
105 QLabel* name =
new QLabel( renderer->
name );
108 font.setPointSize(10);
110 QLabel* version =
new QLabel( renderer->
version );
111 hlayout->addWidget(name);
112 hlayout->addStretch();
113 hlayout->addWidget(version);
115 QVBoxLayout* vlayout =
new QVBoxLayout;
117 QLabel* description =
new QLabel( renderer->
description );
118 descriptions_.push_back(description);
120 vlayout->addLayout(hlayout,20);
121 vlayout->addWidget(description);
122 frame->setLayout(vlayout);
124 QListWidgetItem *item =
new QListWidgetItem(
"");
125 frames_.push_back(frame);
126 item->setSizeHint( QSize (100,50) );
129 list->setItemWidget(item, frame);
132 item->setBackground( Qt::green );
138 for (
int i=0; i < list->selectedItems().size(); ++i)
140 QListWidgetItem* widget = list->selectedItems()[i];
154 QMenu *menu =
new QMenu(list);
157 action = menu->addAction(tr(
"Activate"));
158 connect(action,SIGNAL(triggered(
bool)),
this,SLOT(slotActivateRenderer()));
161 menu->exec(list->mapToGlobal(_point),0);
QString description
Description of the plugin ( requested from the plugin on load)
unsigned int available()
number of available renderers
void slotActivateRenderer()
Activates the renderer (triggered via the context menu)
unsigned int activeExaminer()
Get the id of the examiner which got the last mouse events.
QString version
Version of the plugin ( requested from the plugin on load)
void slotContextMenu(const QPoint &_point)
Show the custom context menu.
void setActive(unsigned int _active, int _id)
set the active renderer
QString name
Name of the plugin ( requested from the plugin on load)