public function __construct($events, $startIndex, $parent = 0) { parent::__construct($parent); $this->startIndex = $startIndex; /* $this->csPath = c(PQNAME)->csPath; $this->csEvents = c(PQNAME)->csEvents; $this->csName = c(PQNAME)->csName; $component = get_class($object); $events = array(); while ($component != null) { $componentPath = $this->csPath . "/$component/" . $this->csName; $eventsPath = $this->csPath . "/$component/" . $this->csEvents; $r = array(); if (file_exists($eventsPath) && is_file($eventsPath)) { require ($eventsPath); if (count($r) > 0) { $events[$component] = $r; } } $component = null; require($componentPath); if (isset($r['parent']) && !empty(trim($r['parent']))) { $component = $r['parent']; } } $list = new QListWidget($this); $list->alternatingRowColors = true; $list->connect(SIGNAL('itemDoubleClicked(int)'), $this, SLOT('itemDoubleClicked(int)')); foreach($events as $c => $e) { foreach($e as $event) { $list->addItem($event['event']); } }*/ $list = new QListWidget($this); $list->alternatingRowColors = true; $list->connect(SIGNAL('itemDoubleClicked(int)'), $this, SLOT('itemDoubleClicked(int)')); foreach ($events as $eventIndex => $event) { $list->addItem($event['event']); } }
public function __construct(QFileInfo $fileInfo, QWidget $parent = NULL) { parent::__construct($parent); $topLabel = new QLabel(tr("Open with:")); $applicationsListBox = new QListWidget(); $applications = array(); for ($i = 1; $i <= 30; ++$i) { $applications[] = tr("Application %1")->arg($i); } $applicationsListBox->insertItems(0, $applications); $alwaysCheckBox = new QCheckBox(); if ($fileInfo->suffix()->isEmpty()) { $alwaysCheckBox = new QCheckBox(tr("Always use this application to " . "open this type of file")); } else { $alwaysCheckBox = new QCheckBox(tr("Always use this application to " . "open files with the extension '%1'") . arg($fileInfo->suffix())); } $layout = new QVBoxLayout(); $layout->addWidget($topLabel); $layout->addWidget($applicationsListBox); $layout->addWidget($alwaysCheckBox); $this->setLayout($layout); }