Пример #1
0
 public function __construct(QFileInfo $fileInfo, QWidget $parent = NULL)
 {
     parent::__construct($parent);
     $permissionsGroup = new QGroupBox(tr("Permissions"));
     $readable = new QCheckBox(tr("Readable"));
     if ($fileInfo->isReadable()) {
         $readable->setChecked(true);
     }
     $writable = new QCheckBox(tr("Writable"));
     if ($fileInfo->isWritable()) {
         $writable->setChecked(true);
     }
     $executable = new QCheckBox(tr("Executable"));
     if ($fileInfo->isExecutable()) {
         $executable->setChecked(true);
     }
     $ownerGroup = new QGroupBox(tr("Ownership"));
     $ownerLabel = new QLabel(tr("Owner"));
     $ownerValueLabel = new QLabel($fileInfo->owner());
     $ownerValueLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
     $groupLabel = new QLabel(tr("Group"));
     $groupValueLabel = new QLabel($fileInfo->group());
     $groupValueLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
     $permissionsLayout = new QVBoxLayout();
     $permissionsLayout->addWidget($readable);
     $permissionsLayout->addWidget($writable);
     $permissionsLayout->addWidget($executable);
     $permissionsGroup->setLayout($permissionsLayout);
     $ownerLayout = new QVBoxLayout();
     $ownerLayout->addWidget($ownerLabel);
     $ownerLayout->addWidget($ownerValueLabel);
     $ownerLayout->addWidget($groupLabel);
     $ownerLayout->addWidget($groupValueLabel);
     $ownerGroup->setLayout($ownerLayout);
     $mainLayout = new QVBoxLayout();
     $mainLayout->addWidget($permissionsGroup);
     $mainLayout->addWidget($ownerGroup);
     $mainLayout->addStretch(1);
     $this->setLayout($mainLayout);
 }
Пример #2
0
 private function createOptionsGroupBox()
 {
     $this->optionsGroupBox = new QGroupBox(tr("Options"));
     $this->delaySpinBox = new QSpinBox();
     $this->delaySpinBox->setSuffix(tr(" s"));
     $this->delaySpinBox->setMaximum(60);
     $this->connect($this->delaySpinBox, SIGNAL("valueChanged(int)"), $this, SLOT("updateCheckBox()"));
     $this->delaySpinBoxLabel = new QLabel(tr("Screenshot Delay:"));
     $this->hideThisWindowCheckBox = new QCheckBox(tr("Hide This Window"));
     $this->optionsGroupBoxLayout = new QGridLayout();
     $this->optionsGroupBoxLayout->addWidget($this->delaySpinBoxLabel, 0, 0);
     $this->optionsGroupBoxLayout->addWidget($this->delaySpinBox, 0, 1);
     $this->optionsGroupBoxLayout->addWidget($this->hideThisWindowCheckBox, 1, 0, 1, 2);
     $this->optionsGroupBox->setLayout($this->optionsGroupBoxLayout);
 }