Example #1
0
QPushButton* SettingsDialog::addPathEdit(QString dir)
{
    if (amountPaths > maxAmountPaths) {
        showError(tr("Cannot add more than %1 paths").arg(maxAmountPaths));
        return NULL;
    }
    QHBoxLayout *hLayout = new QHBoxLayout();
    hLayout->setObjectName("pathLine");
    hLayout->setSizeConstraint(QHBoxLayout::SetMinimumSize);

    QLineEdit *lineEdit = new QLineEdit(dir);
    lineEdit->setMinimumHeight(25);
    lineEdit->setObjectName("path");
    if (!dir.isEmpty())
        lineEdit->setToolTip(dir);
    hLayout->addWidget(lineEdit);

    QPushButton *browseButton = new QPushButton(tr("Browse..."));
    browseButton->setMinimumHeight(28);
    hLayout->addWidget(browseButton);
    connect(browseButton, &QPushButton::clicked,
            lineEdit, [this, lineEdit]() {this->onBrowseButtonClicked(lineEdit);});

    QPushButton *minusButton = new QPushButton("-");
    minusButton->setMinimumHeight(28);
    minusButton->setMaximumWidth(28);
    minusButton->setObjectName("minusButton");
    hLayout->addWidget(minusButton);
    connect(minusButton, &QPushButton::clicked,
            hLayout, [this, hLayout]() {this->removeLine(hLayout);});

    ui->pathHolderLayout->addLayout(hLayout);
    amountPaths++;
    return browseButton;
}
DateCluster::DateCluster(QWidget *pParent, const char *pName) : QWidget(pParent)
{
  if(pName)
    setObjectName(pName);

  QSizePolicy tsizePolicy(static_cast<QSizePolicy::Policy>(0), static_cast<QSizePolicy::Policy>(0));
  tsizePolicy.setHorizontalStretch(0);
  tsizePolicy.setVerticalStretch(0);
  tsizePolicy.setHeightForWidth(sizePolicy().hasHeightForWidth());
  setSizePolicy(tsizePolicy);

  QHBoxLayout *mainLayout = new QHBoxLayout(this);
  mainLayout->setSpacing(5);
  mainLayout->setMargin(0);
  mainLayout->setObjectName(QString::fromUtf8("mainLayout"));

  QVBoxLayout *literalLayout = new QVBoxLayout();
  literalLayout->setSpacing(5);
  literalLayout->setMargin(0);
  literalLayout->setObjectName(QString::fromUtf8("literalLayout"));

  _startDateLit = new QLabel(tr("Start Date:"), this);
  _startDateLit->setObjectName("_startDateLit");
  _startDateLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
  literalLayout->addWidget(_startDateLit);

  _endDateLit = new QLabel(tr("End Date:"), this);
  _endDateLit->setObjectName("_endDateLit");
  _endDateLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
  literalLayout->addWidget(_endDateLit);

  mainLayout->addLayout(literalLayout);

  QVBoxLayout *dataLayout = new QVBoxLayout();
  dataLayout->setSpacing(5);
  dataLayout->setMargin(0);
  dataLayout->setObjectName(QString::fromUtf8("dataLayout"));

  _startDate = new DLineEdit(this);
  _startDate->setObjectName("_startDate");
  dataLayout->addWidget(_startDate);

  _endDate = new DLineEdit(this);
  _endDate->setObjectName("_endDate");
  dataLayout->addWidget(_endDate);

  mainLayout->addLayout(dataLayout);

  _startDateLit->setBuddy(_startDate);
  _endDateLit->setBuddy(_endDate);

  connect(_startDate, SIGNAL(newDate(const QDate &)), this, SIGNAL(updated()));
  connect(_endDate,   SIGNAL(newDate(const QDate &)), this, SIGNAL(updated()));

  //setTabOrder(_startDate, _endDate);
  //setTabOrder(_endDate, _startDate);
  setFocusProxy(_startDate);
}
Example #3
0
void MainWindow::initTextEditor()
{
    //create tab
    QWidget *tab = new QWidget(this);
    QString objName = QString("tab"),
            fileName = "";
    tab->setObjectName(objName);
    //create layout
    QHBoxLayout *layout = new QHBoxLayout(tab);
    layout->setSpacing(0);
    layout->setContentsMargins(11, 11, 11, 11);
    layout->setObjectName(QString("horizontalLayout"));
    layout->setContentsMargins(0, 0, 0, 0);

    //create textedit
    QTextEdit *edit = new QTextEdit(tab);
    edit->setObjectName(QString("textEdit"));

    layout->addWidget(edit);
    ui->tabs->addWidget(tab);

    //slot and signal
    //font change signal
    connect(edit, SIGNAL(currentCharFormatChanged(QTextCharFormat)),
            this, SLOT(currentCharFormatChanged(QTextCharFormat)));
    connect(edit, SIGNAL(cursorPositionChanged()),
            this, SLOT(cursorPositionChanged()));

    //modification
    connect(edit->document(), SIGNAL(modificationChanged(bool)),
            ui->actionSave, SLOT(setEnabled(bool)));
    connect(edit->document(), SIGNAL(modificationChanged(bool)),
            this, SLOT(setWindowModified(bool)));
    connect(edit->document(), SIGNAL(undoAvailable(bool)),
            ui->actionUndo, SLOT(setEnabled(bool)));
    connect(edit->document(), SIGNAL(redoAvailable(bool)),
            ui->actionRedo, SLOT(setEnabled(bool)));

    //redo undo
    connect(ui->actionUndo, SIGNAL(triggered()), edit, SLOT(undo()));
    connect(ui->actionRedo, SIGNAL(triggered()), edit, SLOT(redo()));

    //cut copy paste
    connect(ui->actionCut, SIGNAL(triggered()), edit, SLOT(cut()));
    connect(ui->actionCopy, SIGNAL(triggered()), edit, SLOT(copy()));
    connect(ui->actionPaste, SIGNAL(triggered()), edit, SLOT(paste()));

    connect(edit, SIGNAL(copyAvailable(bool)), ui->actionCut, SLOT(setEnabled(bool)));
    connect(edit, SIGNAL(copyAvailable(bool)), ui->actionCopy, SLOT(setEnabled(bool)));

    textEditor.tab = tab;
    textEditor.editor = edit;
    textEditor.layout = layout;
    textEditor.objName = objName;
    textEditor.fileName = fileName;
}
Example #4
0
/**
 * Initialize the User interface
 */
void Doppelclick::initializeUi(void) 
{
	/* Settings for the Main Window */
	setWindowTitle("Doppelclick Spiel");

	/* Settings for the MainLayout */
	QVBoxLayout *mainLayout = new QVBoxLayout(this);
	mainLayout->setObjectName("MainLayout");

	/* Layout for Button and smilies */
	QHBoxLayout *doppelLayout = new QHBoxLayout();
	doppelLayout->setObjectName("DoppelLayout");

	/* Settings for the doppelButton */
	doppelButton = new QPushButton("Doppelclick");
	doppelButton->setObjectName("DoppelButton");
	doppelButton->setMinimumHeight(100);
	doppelButton->setMinimumWidth(100);

	gameIcon = new QLabel(NEUTRAL);

	/* Settings for Difficulty Slider*/
	diffiSlider = new QSlider();
	diffiSlider->setMinimum(1);
    diffiSlider->setMaximum(3);

	doppelLayout->addWidget(doppelButton);
	doppelLayout->addWidget(gameIcon);

	/* Place for the difficult settings */
	QGroupBox *difficultBox = new QGroupBox(tr("Schwierigkeit"));
	QHBoxLayout *difficultLayout = new QHBoxLayout();
	QVBoxLayout *tickLabelLayout = new QVBoxLayout();

	tickLabelLayout->addWidget(new QLabel("Schwer"));
	tickLabelLayout->addWidget(new QLabel("Normal"));
	tickLabelLayout->addWidget(new QLabel("Leicht"));
	
	difficultLayout->addWidget(diffiSlider);
	difficultLayout->addLayout(tickLabelLayout);
	difficultBox->setLayout(difficultLayout);


	doppelLayout->addWidget(difficultBox);
	
	/* Settings for the gameState */
	QLabel *line = new QLabel("<hr>");
	gameStateLabel = new QLabel("<b>Bereit ...</b>");

	/* Add widgets to the MainLayout */
	mainLayout->insertLayout(-1, doppelLayout, 0);
	mainLayout->addWidget(line);
	mainLayout->addWidget(gameStateLabel);
}
    void setupUi(QDialog *ExportToDialog)
    {
        if (ExportToDialog->objectName().isEmpty())
            ExportToDialog->setObjectName(QString::fromUtf8("ExportToDialog"));
        ExportToDialog->resize(289, 300);
        vboxLayout = new QVBoxLayout(ExportToDialog);
#ifndef Q_OS_MAC
        vboxLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
        vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
        vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
        label = new QLabel(ExportToDialog);
        label->setObjectName(QString::fromUtf8("label"));

        vboxLayout->addWidget(label);

        formats_listWidget = new QListWidget(ExportToDialog);
        formats_listWidget->setObjectName(QString::fromUtf8("formats_listWidget"));

        vboxLayout->addWidget(formats_listWidget);

        hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
        hboxLayout->setSpacing(6);
#endif
        hboxLayout->setContentsMargins(0, 0, 0, 0);
        hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
        spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum);

        hboxLayout->addItem(spacerItem);

        okButton = new QPushButton(ExportToDialog);
        okButton->setObjectName(QString::fromUtf8("okButton"));

        hboxLayout->addWidget(okButton);

        cancelButton = new QPushButton(ExportToDialog);
        cancelButton->setObjectName(QString::fromUtf8("cancelButton"));

        hboxLayout->addWidget(cancelButton);


        vboxLayout->addLayout(hboxLayout);


        retranslateUi(ExportToDialog);
        QObject::connect(okButton, SIGNAL(clicked()), ExportToDialog, SLOT(accept()));
        QObject::connect(cancelButton, SIGNAL(clicked()), ExportToDialog, SLOT(reject()));

        QMetaObject::connectSlotsByName(ExportToDialog);
    } // setupUi
Example #6
0
void MainWindow::addNewItem()
{
    // copied from ui_itemFrame.h
    QHBoxLayout *itemLayout = new QHBoxLayout();
    itemLayout->setObjectName(QString::fromUtf8("itemLayout"));
    itemLayout->setSizeConstraint(QLayout::SetFixedSize);
    QCheckBox *haveFoundCheckBox = new QCheckBox();
    haveFoundCheckBox->setObjectName(QString::fromUtf8("haveFoundCheckBox"));
    haveFoundCheckBox->setMinimumHeight(30);

    itemLayout->addWidget(haveFoundCheckBox);

    QLineEdit *amountBox = new QLineEdit();
    amountBox->setObjectName(QString::fromUtf8("amountBox"));
    amountBox->setMaximumSize(QSize(80, 16777215));
    amountBox->setMinimumHeight(38);
    amountBox->setMinimumWidth(100);

    itemLayout->addWidget(amountBox);

    QLineEdit *itemName = new QLineEdit();
    itemName->setObjectName(QString::fromUtf8("itemName"));
    itemName->setMinimumHeight(38);
    itemName->setMinimumWidth(300);

    itemLayout->addWidget(itemName);

    QSpacerItem *horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);

    itemLayout->addItem(horizontalSpacer);

    QPushButton *deleteButton = new QPushButton();
    deleteButton->setObjectName(QString::fromUtf8("deleteButton"));
    deleteButton->setText("Remove");
    deleteButton->setMinimumHeight(38);
    //deleteButton->setCenterButtons(false);

    itemLayout->addWidget(deleteButton);
    // end of copied from ui_itemFrame.h
    // Doesn't work atm?
    //QObject::connect(deleteButton, SIGNAL(clicked(QAbstractButton*)), haveFoundCheckBox, SLOT(deleteLater()));
    QObject::connect(deleteButton, SIGNAL(clicked()), amountBox, SLOT(deleteLater()));
    QObject::connect(deleteButton, SIGNAL(clicked()), itemName, SLOT(deleteLater()));
    QObject::connect(deleteButton, SIGNAL(clicked()), deleteButton, SLOT(deleteLater()));
    QObject::connect(deleteButton, SIGNAL(clicked()), haveFoundCheckBox, SLOT(deleteLater()));
    QObject::connect(deleteButton, SIGNAL(clicked()), itemLayout, SLOT(deleteLater()));
    QObject::connect(deleteButton, SIGNAL(clicked()), this,SLOT(itemWasRemoved()));
    ui->mainLayout->addLayout(itemLayout);
    widgetsize+=80; // in principle should also reduce when removing item, need to create a slot...
    ui->scrollAreaContents->setFixedHeight(widgetsize);
}
Example #7
0
void MultisigDialog::on_addDestinationButton_clicked()
{
    QFrame* destinationFrame = new QFrame(ui->destinationsScrollAreaContents);
    destinationFrame->setObjectName(QStringLiteral("destinationFrame"));
    destinationFrame->setFrameShape(QFrame::StyledPanel);
    destinationFrame->setFrameShadow(QFrame::Raised);

    QVBoxLayout* frameLayout = new QVBoxLayout(destinationFrame);
    frameLayout->setObjectName(QStringLiteral("destinationFrameLayout"));
    QHBoxLayout* destinationLayout = new QHBoxLayout();
    destinationLayout->setSpacing(0);
    destinationLayout->setObjectName(QStringLiteral("destinationLayout"));
    QLabel* destinationAddressLabel = new QLabel(destinationFrame);
    destinationAddressLabel->setObjectName(QStringLiteral("destinationAddressLabel"));

    destinationLayout->addWidget(destinationAddressLabel);

    QValidatedLineEdit* destinationAddress = new QValidatedLineEdit(destinationFrame);
    destinationAddress->setObjectName(QStringLiteral("destinationAddress"));

    destinationLayout->addWidget(destinationAddress);

    QSpacerItem* horizontalSpacer = new QSpacerItem(10, 20, QSizePolicy::Fixed, QSizePolicy::Minimum);
    destinationLayout->addItem(horizontalSpacer);

    QLabel* destinationAmountLabel = new QLabel(destinationFrame);
    destinationAmountLabel->setObjectName(QStringLiteral("destinationAmountLabel"));

    destinationLayout->addWidget(destinationAmountLabel);

    BitcoinAmountField* destinationAmount = new BitcoinAmountField(destinationFrame);
    destinationAmount->setObjectName(QStringLiteral("destinationAmount"));

    destinationAddressLabel->setText(QApplication::translate("MultisigDialog", strprintf("%i. Address: ", ui->destinationsList->count()+1).c_str(), 0));
    destinationAmountLabel->setText(QApplication::translate("MultisigDialog", "Amount: ", 0));

    destinationLayout->addWidget(destinationAmount);

    QPushButton* destinationDeleteButton = new QPushButton(destinationFrame);
    destinationDeleteButton->setObjectName(QStringLiteral("destinationDeleteButton"));
    QIcon icon;
    icon.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off);
    destinationDeleteButton->setIcon(icon);
    destinationDeleteButton->setAutoDefault(false);
    connect(destinationDeleteButton, SIGNAL(clicked()), this, SLOT(deleteFrame()));
    destinationLayout->addWidget(destinationDeleteButton);

    frameLayout->addLayout(destinationLayout);

    ui->destinationsList->addWidget(destinationFrame);
}
Example #8
0
void FilterDlgImpl::_setupUi()
{
    QGridLayout *gridLayout = new QGridLayout(this);
    gridLayout->setObjectName(QStringLiteral("gridLayout"));

    QHBoxLayout *horizontalLayout = new QHBoxLayout();
    horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));

    QLabel *label = new QLabel(tr("Filtred type operations:"), this);
    horizontalLayout->addWidget(label);

    m_typeTrasnaction = new QComboBox(this);

    QIcon icon;
    icon.addFile(QStringLiteral(":/img/cash2.png"), QSize(), QIcon::Normal, QIcon::Off);
    m_typeTrasnaction->addItem(icon, tr("All"));

    QIcon icon1;
    icon1.addFile(QStringLiteral(":/img/cash-add.png"), QSize(), QIcon::Normal, QIcon::Off);
    m_typeTrasnaction->addItem(icon1, tr("Income"));

    QIcon icon2;
    icon2.addFile(QStringLiteral(":/img/cash-delete.png"), QSize(), QIcon::Normal, QIcon::Off);
    m_typeTrasnaction->addItem(icon2, tr("Expense"));

    horizontalLayout->addWidget(m_typeTrasnaction);

    gridLayout->addLayout(horizontalLayout, 0, 0, 1, 1);

    QPushButton *filterBtn = new QPushButton(tr("Filter"), this);
    filterBtn->setDefault(true);

    gridLayout->addWidget(filterBtn, 0, 1, 1, 1);

    m_query = new QueryTable(this);
    gridLayout->addWidget(m_query, 1, 0, 2, 1);

    QPushButton *closeBtn = new QPushButton(tr("Close"), this);
    closeBtn->setAutoDefault(true);
    closeBtn->setDefault(false);
    gridLayout->addWidget(closeBtn, 1, 1, 1, 1);

    QSpacerItem *verticalSpacer = new QSpacerItem(20, 194, QSizePolicy::Minimum, QSizePolicy::Expanding);
    gridLayout->addItem(verticalSpacer, 2, 1, 1, 1);

    QWidget::setTabOrder(filterBtn, closeBtn);

    connect(closeBtn, SIGNAL(clicked()), this, SLOT(reject()));
    connect(filterBtn, SIGNAL(clicked()), this, SLOT(slot_filter()));
}
Example #9
0
observateurTexte::observateurTexte(Othello * othellier, QPoint  pos) : QLabel(){

	   setWindowTitle("Observateur Texte");
	   this->move(pos.x() + 300, pos.y());
	   Qt::WindowFlags flags = 0;
	   QFont sansFont("Lucida Console", 12);		//police à utiliser
	   sansFont.setWordSpacing(5);
	   flags |= Qt::CustomizeWindowHint;
	   flags |= Qt::WindowTitleHint;
	   setWindowFlags(flags);
	   this->setMinimumWidth(650);
	   this->setFont(sansFont);						//défini la police


	   QHBoxLayout *horizontalLayout;
	   QScrollArea *scrollArea;
	   QWidget *scrollAreaWidgetContents;
	   QVBoxLayout *verticalLayout;

	   horizontalLayout = new QHBoxLayout(this);
       horizontalLayout->setSpacing(6);
       horizontalLayout->setContentsMargins(11, 11, 11, 11);
       horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
       vuePlateau = new QLabel(this);
       vuePlateau->setObjectName(QString::fromUtf8("vuePlateau"));
       horizontalLayout->addWidget(vuePlateau);
       scrollArea = new QScrollArea(this);
       //scrollArea->setFixedWidth(185);
       scrollArea->setMinimumWidth(185);
       scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
       scrollArea->setWidgetResizable(true);
       scrollAreaWidgetContents = new QWidget();
       scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
       scrollAreaWidgetContents->setGeometry(QRect(0, 0, 285, 642));
       verticalLayout = new QVBoxLayout(scrollAreaWidgetContents);
       verticalLayout->setSpacing(6);
       verticalLayout->setContentsMargins(11, 11, 11, 11);
       verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
       listeCoups = new QLabel(scrollAreaWidgetContents);
       listeCoups->setObjectName(QString::fromUtf8("listeCoups"));
       listeCoups->setAlignment(Qt::AlignLeft|Qt::AlignTop);
       verticalLayout->addWidget(listeCoups);
       scrollArea->setWidget(scrollAreaWidgetContents);
       vuePlateau->raise();
       listeCoups->raise();
       horizontalLayout->addWidget(scrollArea);

	   oth = othellier;
}
Example #10
0
DistanceSlider::DistanceSlider(QWidget *parent /*= 0*/)
	: QFrame(parent)
    , layersCount(0)
	, locked(false)
{
    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->setObjectName(QString::fromUtf8("layout"));
    
    splitter = new DistanceSplitter(this);
    splitter->setObjectName(QString::fromUtf8("splitter"));
    splitter->setGeometry(geometry());
    splitter->setOrientation(Qt::Horizontal);
    splitter->setMinimumHeight(20);
    
//    splitter->setOpaqueResize(false); need uncomment if moving will be slow
    
    
    layout->addWidget(splitter);
    layout->setSpacing(0);
    layout->setMargin(0);
    
    
    for(int i = 0 ; i < DAVA::LodComponent::MAX_LOD_LAYERS; ++i)
    {
        frames[i] = new QFrame(splitter);

        frames[i]->setObjectName(QString::fromUtf8(DAVA::Format("frame_%d",  i).c_str()));
        frames[i]->setFrameShape(QFrame::StyledPanel);
        frames[i]->setFrameShadow(QFrame::Raised);
        
        QPalette pallete;
        pallete.setColor(QPalette::Background, backgroundColors[i]);
        
        
        frames[i]->setPalette(pallete);
        frames[i]->setAutoFillBackground(true);

        frames[i]->setMinimumWidth(MIN_WIDGET_WIDTH);
        
        
        splitter->addWidget(frames[i]);
        
        stretchSize[i] = 0;
    }

    setLayout(layout);
    
    connect(splitter, SIGNAL(splitterMoved(int, int)), SLOT(SplitterMoved(int, int)));
}
ZoneListWidget::ZoneListWidget(QWidget* parent):QWidget(parent)
{
    mDragData.Object = 0;
    mDragData.ObjectType = "";
    mDragData.Parameters.clear();

    QVBoxLayout* verticalLayout = new QVBoxLayout(this);

    verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
    QHBoxLayout* horizontalLayout = new QHBoxLayout();
    horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
    filterBox = new QLineEdit(this);
    filterBox->setObjectName(QString::fromUtf8("filterBox"));

    horizontalLayout->addWidget(filterBox);

    clearFilterButton = new QToolButton(this);
    clearFilterButton->setObjectName(QString::fromUtf8("clearFilterButton"));
    clearFilterButton->setIcon(QIcon(":/icons/refresh.svg"));

    horizontalLayout->addWidget(clearFilterButton);
    horizontalLayout->setMargin(0);

    verticalLayout->addLayout(horizontalLayout);

    listWidget = new QListWidget(this);
    listWidget->setViewMode(QListView::IconMode);
    listWidget->setGridSize(QSize(64,64));
    listWidget->setFlow(QListView::LeftToRight);
    listWidget->setIconSize(QSize(48,48));
    listWidget->setDragDropMode(QAbstractItemView::DragOnly);
    listWidget->setWordWrap(true);
    listWidget->setMouseTracking(true);

    verticalLayout->addWidget(listWidget);
    verticalLayout->setMargin(0);

    QObject::connect(clearFilterButton, SIGNAL(clicked()), filterBox, SLOT(clear()));
    QObject::connect(filterBox, SIGNAL(textChanged(QString)), this, SLOT(filterBoxTextChanged(QString)));

    OgitorsRoot::getSingletonPtr()->RegisterDragDropHandler((void*)listWidget, this);

    EventManager::getSingletonPtr()->connectEvent(EventManager::LOAD_STATE_CHANGE, this, true, 0, true, 0, EVENT_CALLBACK(ZoneListWidget, onSceneLoadStateChange));

    /*this->setWindowTitle(QString::fromUtf8("Zones"));
    this->setWindowIconText("../Plugins/Icons/zone.svg");*/
}
        explicit Ui( CertificateRequester * qq )
            : lineEdit( qq ),
              button( tr("Change..."), qq ),
              hlay( qq )
        {
            lineEdit.setObjectName( QLatin1String( "lineEdit" ) );
            button.setObjectName( QLatin1String( "button" ) );
            hlay.setObjectName( QLatin1String( "hlay" ) );

            hlay.addWidget( &lineEdit, 1 );
            hlay.addWidget( &button );

            lineEdit.setReadOnly( true );

            connect( &button, SIGNAL(clicked()),
                     qq, SLOT(slotButtonClicked()) );
        }
Example #13
0
void MultisigDialog::on_addPrivKeyButton_clicked()
{
    if(isFirstPrivKey){//on first click the scroll area must show
        isFirstPrivKey = false;
        ui->keyScrollArea->show();
    }

    if(ui->keyList->count() > 14){
        ui->signButtonStatus->setStyleSheet("QTextEdit{ color: red }");
        ui->signButtonStatus->setText(tr("Maximum (15)"));
        return;
    }

    QFrame* keyFrame = new QFrame(ui->keyScrollAreaContents);

    keyFrame->setObjectName(QStringLiteral("keyFrame"));
    keyFrame->setFrameShape(QFrame::StyledPanel);
    keyFrame->setFrameShadow(QFrame::Raised);

    QHBoxLayout* keyLayout = new QHBoxLayout(keyFrame);
    keyLayout->setObjectName(QStringLiteral("keyLayout"));

    QLabel* keyLabel = new QLabel(keyFrame);
    keyLabel->setObjectName(QStringLiteral("keyLabel"));
    keyLabel->setText(QApplication::translate("MultisigDialog", strprintf("Key %i: ", (ui->keyList->count()+1)).c_str(), 0));
    keyLayout->addWidget(keyLabel);

    QLineEdit* key = new QLineEdit(keyFrame);
    key->setObjectName(QStringLiteral("key"));
    key->setEchoMode(QLineEdit::Password);
    keyLayout->addWidget(key);

    QPushButton* keyDeleteButton = new QPushButton(keyFrame);
    keyDeleteButton->setObjectName(QStringLiteral("keyDeleteButton"));
    QIcon icon;
    icon.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off);
    keyDeleteButton->setIcon(icon);
    keyDeleteButton->setAutoDefault(false);
    connect(keyDeleteButton, SIGNAL(clicked()), this, SLOT(deleteFrame()));
    keyLayout->addWidget(keyDeleteButton);

    ui->keyList->addWidget(keyFrame);
}
Example #14
0
KGpgKeySelectionDlg::KGpgKeySelectionDlg(QWidget *parent) :
    KDialog(parent),
    m_needCheckList(true),
    m_listOk(false),
    m_checkCount(0)
{
  setCaption(i18n("Select additional keys"));
  setButtons(KDialog::Ok | KDialog::Cancel);
  setDefaultButton(KDialog::Ok);
  setModal(true);
  QWidget* page = new QWidget(this);
  setMainWidget(page);
  QVBoxLayout* topLayout = new QVBoxLayout(page);
  topLayout->setSpacing(spacingHint());

  m_listBox = new KEditListBox(page);
  m_listBox->setTitle(i18n("User identification"));
  m_listBox->setButtons((KEditListBox::Remove | KEditListBox::Add));
  m_listBox->setWhatsThis(i18n("Enter the id of the key you want to use for data encryption. This can either be an e-mail address or the hexadecimal key id. In case of the key id, do not forget the leading 0x."));

  topLayout->addWidget(m_listBox);

  // add a LED for the availability of all keys
  QHBoxLayout* ledBox = new QHBoxLayout();
  ledBox->setContentsMargins(0, 0, 0, 0);
  ledBox->setSpacing(6);
  ledBox->setObjectName("ledBoxLayout");

  m_keyLed = new KLed(page);
  m_keyLed->setShape(KLed::Circular);
  m_keyLed->setLook(KLed::Sunken);

  ledBox->addWidget(m_keyLed);
  ledBox->addWidget(new QLabel(i18n("Keys for all of the above user ids found"), page));
  ledBox->addItem(new QSpacerItem(50, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));

  topLayout->addLayout(ledBox);

  connect(m_listBox, SIGNAL(changed()), this, SLOT(slotIdChanged()));
  connect(m_listBox, SIGNAL(added(QString)), this, SLOT(slotKeyListChanged()));
  connect(m_listBox, SIGNAL(removed(QString)), this, SLOT(slotKeyListChanged()));
}
Example #15
0
void EmailAccountWizardAccountPage::startBusyIndicator()
{
    QGridLayout* l = dynamic_cast<QGridLayout*>(layout());
    Q_ASSERT(l);
    if (!l)
        return;

    QLabel* busyLabel = new QLabel(tr("<b>Checking the online database...</b>"));
    busyLabel->setObjectName(kBusyLabelObjectName);
    BusyIndicatorWidget* busyIndicator = new BusyIndicatorWidget();
    busyIndicator->setObjectName(kBusyIndicatorObjectName);

    QHBoxLayout* busyLayout = new QHBoxLayout();
    busyLayout->setObjectName(kBusyLayoutObjectName);
    busyLayout->addWidget(busyLabel, Qt::AlignCenter);
    busyLayout->addWidget(busyIndicator, Qt::AlignRight);
    l->addLayout(busyLayout, l->rowCount() + 1, 0, 1, -1);

    busyIndicator->start();
}
Example #16
0
QtApplication::QtApplication(
    const int &argc, const char** argv,
    const QGLFormat &glFormat,
    GLuint width, GLuint height,
    QWidget *parent)
: Application(argc,argv), isMainloopRunning_(GL_FALSE), exitCode_(0)
{
  app_ = new QApplication(appArgCount,(char**)appArgs);

  glContainer_ = new QWidget(parent);
  glWidget_ = new QTGLWidget(this, glFormat, glContainer_);
  glWidget_->setMinimumSize(100,100);
  glWidget_->setFocusPolicy(Qt::StrongFocus);

  QHBoxLayout *layout = new QHBoxLayout();
  layout->setObjectName(QString::fromUtf8("shaderInputLayout"));
  layout->setContentsMargins(0, 0, 0, 0);
  layout->setMargin(0);
  layout->setSpacing(0);
  layout->addWidget(glWidget_, 1);
  glContainer_->setLayout(layout);
  glContainer_->resize(width, height);
}
Example #17
0
KisBrushSelectionWidget::KisBrushSelectionWidget(QWidget * parent)
        : QWidget(parent)
{
    QHBoxLayout * l = new QHBoxLayout(this);
    l->setObjectName("brushpopuplayout");
    l->setMargin(2);
    l->setSpacing(2);

    m_brushesTab = new QTabWidget(this);
    m_brushesTab->setObjectName("brushestab");
    m_brushesTab->setFocusPolicy(Qt::StrongFocus);
    m_brushesTab->setContentsMargins(1, 1, 1, 1);

    l->addWidget(m_brushesTab);

    m_autoBrushWidget = new KisAutoBrushWidget(0, "autobrush", i18n("Autobrush"));
    connect(m_autoBrushWidget, SIGNAL(sigBrushChanged()), SIGNAL(sigBrushChanged()));
    m_brushesTab->addTab(m_autoBrushWidget, i18n("Autobrush"));

    m_brushChooser = new KisBrushChooser(0);
    connect(m_brushChooser, SIGNAL(sigBrushChanged()), SIGNAL(sigBrushChanged()));
    m_brushesTab->addTab(m_brushChooser, i18n("Predefined Brushes"));

    // XXX: pass image!
    m_customBrushWidget = new KisCustomBrushWidget(0, i18n("Custom Brush"), 0);
    connect(m_customBrushWidget, SIGNAL(sigBrushChanged()), SIGNAL(sigBrushChanged()));
    m_brushesTab->addTab(m_customBrushWidget, i18n("Custom Brush"));

    m_textBrushWidget = new KisTextBrushChooser(0, "textbrush", i18n("Text Brush"));
    connect(m_textBrushWidget, SIGNAL(sigBrushChanged()), SIGNAL(sigBrushChanged()));
    m_brushesTab->addTab(m_textBrushWidget, i18n("Text Brush"));

    setLayout(l);

    m_brushChooser->itemChooser()->setCurrent(0);
    m_autoBrushWidget->activate();
}
Example #18
0
File: aba.cpp Project: helderc/hIP
Aba::Aba(QWidget *parent) :
    QWidget(parent)
{
    // Layout "mae" do widget
    QVBoxLayout *vertLayout = new QVBoxLayout(this);
    vertLayout->setObjectName(QStringLiteral("verticalLayout"));
    vertLayout->setContentsMargins(0,0,0,0);

    // Area de Texto: Criacao e configuracao
    textEdit = new QPlainTextEdit(this);

    QFont font("Monospace");
    font.setStyleHint(QFont::Monospace);
    font.setPointSize(12);
    textEdit->setFont(font);
    textEdit->setReadOnly(true);

    vertLayout->addWidget(textEdit);

    QHBoxLayout *horLayout = new QHBoxLayout();
    horLayout->setObjectName(QStringLiteral("horizontalLayout"));
    horLayout->setContentsMargins(0,0,0,5);

    btnSalvar = new QPushButton(QIcon(":/new/icones/icones/document-save.png"),
                                "Salvar .csv",
                                this);

    // Espacador par deixar o botao no canto direito
    QSpacerItem *horSpacer = new QSpacerItem(0, 0,
                                             QSizePolicy::Expanding,
                                             QSizePolicy::Minimum);
    horLayout->addItem(horSpacer);
    horLayout->addWidget(btnSalvar);

    vertLayout->addLayout(horLayout);

}
    void setupUi(QWidget *Ui_CPicScrollWidget)
    {
        if (Ui_CPicScrollWidget->objectName().isEmpty())
            Ui_CPicScrollWidget->setObjectName(QString::fromUtf8("Ui_CPicScrollWidget"));
        Ui_CPicScrollWidget->resize(672, 322);
        horizontalLayout = new QHBoxLayout(Ui_CPicScrollWidget);
        horizontalLayout->setSpacing(0);
        horizontalLayout->setContentsMargins(0, 0, 0, 0);
        horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
        PicFlow = new CPicFlowWidget(Ui_CPicScrollWidget);
        PicFlow->setObjectName(QString::fromUtf8("PicFlow"));
        QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
        sizePolicy.setHorizontalStretch(0);
        sizePolicy.setVerticalStretch(0);
        sizePolicy.setHeightForWidth(PicFlow->sizePolicy().hasHeightForWidth());
        PicFlow->setSizePolicy(sizePolicy);
        PicFlow->setStyleSheet(QString::fromUtf8("background-color: rgb(144, 178, 196)"));

        horizontalLayout->addWidget(PicFlow);

        Scroll = new CScrollWidget(Ui_CPicScrollWidget);
        Scroll->setObjectName(QString::fromUtf8("Scroll"));
        QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Preferred);
        sizePolicy1.setHorizontalStretch(0);
        sizePolicy1.setVerticalStretch(0);
        sizePolicy1.setHeightForWidth(Scroll->sizePolicy().hasHeightForWidth());
        Scroll->setSizePolicy(sizePolicy1);
        Scroll->setMinimumSize(QSize(150, 0));

        horizontalLayout->addWidget(Scroll);
        horizontalLayout->setStretch(0, 3);
        horizontalLayout->setStretch(1, 1);

        retranslateUi(Ui_CPicScrollWidget);

        QMetaObject::connectSlotsByName(Ui_CPicScrollWidget);
    } // setupUi
Example #20
0
comment::comment( QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl ) :
  QDialog( parent, fl )
{
  if(name)
    setObjectName(name);
  setWindowTitle(tr("Comment"));
  if(modal)
    setWindowModality(Qt::WindowModal);

  _commentid = -1;
  _targetId = -1;
  _mode = cNew;

  if (!name)
    setObjectName("comment");

  QVBoxLayout *moreLayout = new QVBoxLayout(this);
  moreLayout->setContentsMargins(5, 5, 5, 5);
  moreLayout->setSpacing(7);
  moreLayout->setObjectName("moreLayout");

  QHBoxLayout *commentLayout = new QHBoxLayout(this);
  commentLayout->setContentsMargins(5, 5, 5, 5);
  commentLayout->setSpacing(7);
  commentLayout->setObjectName("commentLayout");

  QVBoxLayout *layout11  = new QVBoxLayout(this);
  layout11->setSpacing(5);
  layout11->setObjectName("layout11");

  QHBoxLayout *layout9   = new QHBoxLayout(this);
  layout9->setObjectName("layout9");

  QBoxLayout *layout8    = new QHBoxLayout(this);
  layout8->setSpacing(5);
  layout8->setObjectName("layout8");

  QLabel *_cmnttypeLit = new QLabel(tr("Comment Type:"), this);
  _cmnttypeLit->setObjectName("_cmnttypeLit");
  layout8->addWidget( _cmnttypeLit );

  _cmnttype = new XComboBox( false, this);
  _cmnttype->setObjectName("_cmnttype" );
  layout8->addWidget( _cmnttype );
  layout9->addLayout( layout8 );

  QSpacerItem* spacer = new QSpacerItem( 66, 10, QSizePolicy::Expanding, QSizePolicy::Minimum );
  layout9->addItem( spacer );

  _public = new QCheckBox(tr("Public"), this);
  _public->setObjectName("_public");
  if(!(_x_metrics && _x_metrics->boolean("CommentPublicPrivate")))
    _public->hide();
  _public->setChecked(_x_metrics && _x_metrics->boolean("CommentPublicDefault"));
  layout9->addWidget(_public);
  layout11->addLayout( layout9 );

  _comment = new XTextEdit( this);
  _comment->setObjectName("_comment" );
  _comment->setSpellEnable(true);
  layout11->addWidget( _comment );
  commentLayout->addLayout( layout11 );

  QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
  buttonBox->setOrientation(Qt::Vertical);
  buttonBox->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel);

  _close = buttonBox->button(QDialogButtonBox::Cancel);
  _close->setObjectName("_close");

  _save = buttonBox->button(QDialogButtonBox::Save);
  _save->setObjectName("_save");

  _prev = buttonBox->addButton(tr("&Previous"), QDialogButtonBox::ActionRole);
  _prev->setObjectName("_prev");

  _next = buttonBox->addButton(tr("&Next"), QDialogButtonBox::ActionRole);
  _next->setObjectName("_next");

  _more = buttonBox->addButton(tr("&More"), QDialogButtonBox::ActionRole);
  _more->setObjectName("_more");
  _more->setCheckable(true);

  commentLayout->addWidget(buttonBox);

  moreLayout->addLayout(commentLayout);

  _comments = new Comments(this);
  _comments->setObjectName("_comments");
  _comments->setReadOnly(true);
  _comments->findChild<XCheckBox*>("_verbose")->setForgetful(true);
  _comments->findChild<XCheckBox*>("_verbose")->hide();
  _comments->findChild<XCheckBox*>("_verbose")->setChecked(false);
  _comments->_newComment->setVisible(false);
  _comments->setVerboseCommentList(true);
  _comments->setVisible(false);
  _comments->setEditable(false);
  moreLayout->addWidget(_comments);

  resize( QSize(524, 270).expandedTo(minimumSizeHint()) );
  //clearWState( WState_Polished );

  connect(buttonBox, SIGNAL(accepted()), this, SLOT(sSave()));
  connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
  connect(_next, SIGNAL(clicked()), this, SLOT(sNextComment()));
  connect(_prev, SIGNAL(clicked()), this, SLOT(sPrevComment()));
  connect(_more, SIGNAL(toggled(bool)), _comments, SLOT(setVisible(bool)));

  setTabOrder( _cmnttype, _comment );
  setTabOrder( _comment, _save );
  setTabOrder( _save, _close );

  _sourcetype = "";
  _cmnttype->setAllowNull(true);

  shortcuts::setStandardKeys(this);
}
Example #21
0
void
MainWindow::makeUI()
{
    setObjectName(QString::fromUtf8("MainWindow"));

#if 0
    action_Print = new QAction(this);
    action_Print->setObjectName(QString::fromUtf8("action_Print"));
#endif

#if 1
    action_Exit = new QAction(this);
    action_Exit->setObjectName(QString::fromUtf8("action_Exit"));
	//connect(action_Exit, SIGNAL(triggered()), qApp, SLOT(quit()));
	connect(action_Exit, SIGNAL(triggered()), this, SLOT(close()));
#endif

    action_Multiplot = new QAction(this);
    action_Multiplot->setObjectName(QString::fromUtf8("action_Multiplot"));
	connect(action_Multiplot, SIGNAL(triggered()), this, SLOT(showMultiplot()));

    action_Archivesheet = new QAction(this);
    action_Archivesheet->setObjectName(QString::fromUtf8("action_Archivesheet"));
	connect(action_Archivesheet, SIGNAL(triggered()), this, SLOT(showArchivesheet()));

    action_Archiverviewer = new QAction(this);
    action_Archiverviewer->setObjectName(QString::fromUtf8("action_Archiverviewer"));
	connect(action_Archiverviewer, SIGNAL(triggered()), this, SLOT(showArchiverviewer()));

    action_SignalDB = new QAction(this);
    action_SignalDB->setObjectName(QString::fromUtf8("action_SignalDB"));
	connect(action_SignalDB, SIGNAL(triggered()), this, SLOT(showSignalDB()));

    action_PVListV = new QAction(this);
    action_PVListV->setObjectName(QString::fromUtf8("action_PVListV"));
	connect(action_PVListV, SIGNAL(triggered()), this, SLOT(showPVListViewer()));

	action_Manual = new QAction(this);
	action_Manual->setObjectName(QString::fromUtf8("action_Manual"));
	connect(action_Manual, SIGNAL(triggered()), this, SLOT(showManual()));

	action_AboutECH = new QAction(this);
	action_AboutECH->setObjectName(QString::fromUtf8("action_AboutECH"));
	connect(action_AboutECH, SIGNAL(triggered()), this, SLOT(showAboutECH()));

    centralwidget = new QWidget(this);
    centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
    //centralwidget->setGeometry(QRect(0, 0, 1280, 821));
	
    widget = new QWidget(centralwidget);
    widget->setObjectName(QString::fromUtf8("widget"));
    widget->setGeometry(QRect(200, 0, 1080, 821));
    widget->setMinimumSize(QSize(400, 0));
    vboxLayout = new QVBoxLayout(widget);
    vboxLayout->setSpacing(0);
    vboxLayout->setMargin(0);
    vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
    dockWidget = new QDockWidget(widget);
    dockWidget->setObjectName(QString::fromUtf8("dockWidget"));
    QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(7));
    sizePolicy.setHorizontalStretch(0);
    sizePolicy.setVerticalStretch(0);
    sizePolicy.setHeightForWidth(dockWidget->sizePolicy().hasHeightForWidth());
    dockWidget->setSizePolicy(sizePolicy);
    //dockWidget->setFeatures(QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable|QDockWidget::NoDockWidgetFeatures);
    //dockWidget->setFeatures(QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable);
    //dockWidget->setAllowedAreas(Qt::AllDockWidgetAreas);
    dockWidgetContents = new QWidget(dockWidget);
    dockWidgetContents->setObjectName(QString::fromUtf8("dockWidgetContents"));

    vdockLayout = new QVBoxLayout(widget);
    vdockLayout->setSpacing(0);
    vdockLayout->setMargin(0);
    vdockLayout->setObjectName(QString::fromUtf8("vdockLayout"));

    stackedWidget = new QStackedWidget(dockWidgetContents);
    stackedWidget->setObjectName(QString::fromUtf8("stackedWidget"));
    stackedWidget->setGeometry(QRect(0, 0, 1080, 821));
    dockWidget->setWidget(dockWidgetContents);

    vboxLayout->addWidget(dockWidget);

	dockWidgetContents->setLayout(vdockLayout);
	vdockLayout->addWidget(stackedWidget);

    tabWidget = new QTabWidget(centralwidget);
    tabWidget->setObjectName(QString::fromUtf8("tabWidget"));
    tabWidget->setGeometry(QRect(0, 0, 200, 821));
    QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(5));
    sizePolicy1.setHorizontalStretch(0);
    sizePolicy1.setVerticalStretch(0);
    sizePolicy1.setHeightForWidth(tabWidget->sizePolicy().hasHeightForWidth());

#if 1
	/* TabWidget color setting */
    QPalette palettetw;

    QBrush brushtw1(QColor(60, 76, 100, 255));
    brushtw1.setStyle(Qt::SolidPattern);
    palettetw.setBrush(QPalette::Active, QPalette::Window, brushtw1);
    //palettetw.setBrush(QPalette::Inactive, QPalette::Window, brushtw1);
    //palettetw.setBrush(QPalette::Disabled, QPalette::Window, brushtw1);

    QBrush brushtw2(QColor(60, 76, 100, 255));
    brushtw2.setStyle(Qt::SolidPattern);
    palettetw.setBrush(QPalette::Active, QPalette::Base, brushtw2);
    //palettetw.setBrush(QPalette::Inactive, QPalette::Base, brushtw2);
    //palettetw.setBrush(QPalette::Disabled, QPalette::Base, brushtw2);

    palettetw.setBrush(QPalette::Active, QPalette::Button, brushtw1);
    //palettetw.setBrush(QPalette::Inactive, QPalette::Button, brushtw1);
    //palettetw.setBrush(QPalette::Disabled, QPalette::Button, brushtw1);

    QBrush brushtw3(QColor(255, 255, 255, 255));
    brushtw3.setStyle(Qt::SolidPattern);
    palettetw.setBrush(QPalette::Active, QPalette::ButtonText, brushtw3);
    //palettetw.setBrush(QPalette::Inactive, QPalette::ButtonText, brushtw3);
    //palettetw.setBrush(QPalette::Disabled, QPalette::ButtonText, brushtw3);

    palettetw.setBrush(QPalette::Active, QPalette::WindowText, brushtw3);
    //palettetw.setBrush(QPalette::Inactive, QPalette::WindowText, brushtw3);
    //palettetw.setBrush(QPalette::Disabled, QPalette::WindowText, brushtw3);

    tabWidget->setPalette(palettetw);

#endif

#if 0
    QPalette palettetw;
    QBrush brushtw1(QColor(0, 0, 55, 200));
    brushtw1.setStyle(Qt::SolidPattern);
    palettetw.setBrush(QPalette::Active, QPalette::Window, brushtw1);
    QBrush brushtw2(QColor(96, 96, 129, 200));
    brushtw2.setStyle(Qt::SolidPattern);
    palettetw.setBrush(QPalette::Active, QPalette::Base, brushtw2);
    QBrush brushtw3(QColor(100, 100, 100, 255));
    brushtw3.setStyle(Qt::SolidPattern);
    palettetw.setBrush(QPalette::Active, QPalette::WindowText, brushtw3);
    //QBrush brushtw4(QColor(255, 255, 255, 50));
    QBrush brushtw4(QColor(55, 55, 55, 100));
    brushtw4.setStyle(Qt::SolidPattern);
    palettetw.setBrush(QPalette::Active, QPalette::Button, brushtw4);
    tabWidget->setPalette(palettetw);
#endif

    tabWidget->setSizePolicy(sizePolicy1);
    tabWidget->setMaximumSize(QSize(16777215, 16777215));
    tabWidget->setTabPosition(QTabWidget::West);
    tabWidget->setTabShape(QTabWidget::Triangular);
    tabWidget->setElideMode(Qt::ElideNone);

    tab_0 = new QWidget();
    tab_0->setObjectName(QString::fromUtf8("tab_0"));
    QFont font;
    font.setPointSize(14);
    vboxLayout0 = new QVBoxLayout(tab_0);
    vboxLayout0->setSpacing(6);
    vboxLayout0->setMargin(4);
    vboxLayout0->setAlignment(Qt::AlignTop);
    vboxLayout0->setObjectName(QString::fromUtf8("vboxLayout0"));

    QPalette paletteb;
    QBrush brushb(QColor(211, 197, 179, 255));
    brushb.setStyle(Qt::SolidPattern);
    paletteb.setBrush(QPalette::Active, QPalette::Button, brushb);
    //paletteb.setBrush(QPalette::Inactive, QPalette::Button, brushb);
    //paletteb.setBrush(QPalette::Disabled, QPalette::Button, brushb);

    QBrush brushbt(QColor(106, 88, 62, 255));
    brushbt.setStyle(Qt::SolidPattern);
    paletteb.setBrush(QPalette::Active, QPalette::ButtonText, brushbt);
    //paletteb.setBrush(QPalette::Inactive, QPalette::ButtonText, brushbt);
    //paletteb.setBrush(QPalette::Disabled, QPalette::ButtonText, brushbt);

    pushButton[0] = new QPushButton(tab_0);
    pushButton[0]->setObjectName(QString::fromUtf8("pushButton_0"));
    pushButton[0]->setFont(font);
    pushButton[0]->setText(QApplication::translate("MainWindow", "Operation", 0, QApplication::UnicodeUTF8));
    pushButton[0]->setPalette(paletteb);
    vboxLayout0->addWidget(pushButton[0]);

    pushButton[1] = new QPushButton(tab_0);
    pushButton[1]->setObjectName(QString::fromUtf8("pushButton_1"));
    pushButton[1]->setFont(font);
    pushButton[1]->setText(QApplication::translate("MainWindow", "Interlock", 0, QApplication::UnicodeUTF8));
    pushButton[1]->setPalette(paletteb);
    vboxLayout0->addWidget(pushButton[1]);

    pushButton[2] = new QPushButton(tab_0);
    pushButton[2]->setObjectName(QString::fromUtf8("pushButton_2"));
    pushButton[2]->setFont(font);
    pushButton[2]->setText(QApplication::translate("MainWindow", "DAQ", 0, QApplication::UnicodeUTF8));
    pushButton[2]->setPalette(paletteb);
    vboxLayout0->addWidget(pushButton[2]);

#if 0
    pushButton[3] = new QPushButton(tab_0);
    pushButton[3]->setObjectName(QString::fromUtf8("pushButton_3"));
    pushButton[3]->setFont(font);
    pushButton[3]->setText(QApplication::translate("MainWindow", "Waveform Graph2", 0, QApplication::UnicodeUTF8));
    pushButton[3]->setPalette(paletteb);
    vboxLayout0->addWidget(pushButton[3]);
#endif

#if 0
    spacerItem0 = new QSpacerItem(20, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
    vboxLayout0->addItem(spacerItem0);
#endif
    frame = new QFrame(tab_0);
    frame->setObjectName(QString::fromUtf8("frame"));
    QSizePolicy sizePolicy2(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(5));
    sizePolicy2.setHorizontalStretch(1);
    sizePolicy2.setVerticalStretch(0);
    sizePolicy2.setHeightForWidth(frame->sizePolicy().hasHeightForWidth());
    frame->setSizePolicy(sizePolicy2);
    frame->setMinimumSize(QSize(16, 704));
    frame->setFrameShape(QFrame::StyledPanel);
    frame->setFrameShadow(QFrame::Raised);

    vboxLayout0->addWidget(frame);
	QVBoxLayout *vfboxLayout = new QVBoxLayout(frame);
	vfboxLayout->setSpacing(0);
	vfboxLayout->setMargin(0);
	vfboxLayout->setObjectName(QString::fromUtf8("vfboxLayout"));

	QUiLoader m_loader;
	QFile *file = new QFile("/usr/local/opi/ui/ECH_Menu_Area.ui");
	file->open(QFile::ReadOnly);
	QWidget *m_widget = m_loader.load(file);
	file->close();
	vfboxLayout->addWidget(m_widget);

	AttachChannelAccess *pattachECHMenu = new AttachChannelAccess(frame);

/* TG remove 20130704
    tab_1 = new QWidget();
    tab_1->setObjectName(QString::fromUtf8("tab_1"));
    vboxLayout1 = new QVBoxLayout(tab_1);
    vboxLayout1->setSpacing(6);
    vboxLayout1->setMargin(4);
    vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));

    pushButton[3] = new QPushButton(tab_1);
    pushButton[3]->setObjectName(QString::fromUtf8("pushButton_3"));
    pushButton[3]->setFont(font);
    pushButton[3]->setText(QApplication::translate("MainWindow", "DAQ WavePattern", 0, QApplication::UnicodeUTF8));
    pushButton[3]->setPalette(paletteb);
    vboxLayout1->addWidget(pushButton[3]);

	spacerItem1 = new QSpacerItem(20, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
	vboxLayout1->addItem(spacerItem1);


    frame2 = new QFrame(tab_1);
    frame2->setObjectName(QString::fromUtf8("frame2"));
    QSizePolicy sizePolicy3(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(5));
    sizePolicy3.setHorizontalStretch(1);
    sizePolicy3.setVerticalStretch(0);
    sizePolicy3.setHeightForWidth(frame2->sizePolicy().hasHeightForWidth());
    frame2->setSizePolicy(sizePolicy3);
    frame2->setMinimumSize(QSize(16, 704));
    frame2->setFrameShape(QFrame::StyledPanel);
    frame2->setFrameShadow(QFrame::Raised);

    vboxLayout1->addWidget(frame2);
	QVBoxLayout *vfboxLayout1 = new QVBoxLayout(frame2);
	vfboxLayout1->setSpacing(0);
	vfboxLayout1->setMargin(0);
	vfboxLayout1->setObjectName(QString::fromUtf8("vfboxLayout1"));
	QUiLoader m_loader1;
	QFile *file1 = new QFile("/usr/local/opi/ui/ECH_Menu_Area.ui");
	file1->open(QFile::ReadOnly);
	QWidget *m_widget1 = m_loader1.load(file1);
	file1->close();
	vfboxLayout1->addWidget(m_widget1);

	AttachChannelAccess *pattachECHSubMenu = new AttachChannelAccess(frame2);

*/

	/*
    spacerItem1 = new QSpacerItem(20, 20, QSizePolicy::Fixed, QSizePolicy::Fixed);
    vfboxLayout->addItem(spacerItem1);

	QUiLoader m_loader2;
	QFile *file2 = new QFile("/usr/local/opi/ui/ECH_Menu_Area2.ui");
	file2->open(QFile::ReadOnly);
	QWidget *m_widget2 = m_loader2.load(file2);
	file2->close();
	vfboxLayout->addWidget(m_widget2);
	*/




    tabWidget->addTab(tab_0, QApplication::translate("MainWindow", "ECH Main panels", 0, QApplication::UnicodeUTF8));
//    tabWidget->addTab(tab_1, QApplication::translate("MainWindow", "ECH Sub panels", 0, QApplication::UnicodeUTF8));

    menubar = new QMenuBar(this);
    menubar->setObjectName(QString::fromUtf8("menubar"));
    menubar->setGeometry(QRect(0, 0, 1280, 30));
    menu_File = new QMenu(menubar);
    menu_File->setObjectName(QString::fromUtf8("menu_File"));
    menu_Util = new QMenu(menubar);
    menu_Util->setObjectName(QString::fromUtf8("menu_Util"));
	menu_Help = new QMenu(menubar);
	menu_Help->setObjectName(QString::fromUtf8("menu_Help"));
    setMenuBar(menubar);

    QLabel *slabel1 = new QLabel("Set your mouse on the dynamic value to read PVNAME.");
    slabel1->setAlignment(Qt::AlignHCenter);
    slabel1->setMinimumSize(slabel1->sizeHint());
    slabel1->setFrameStyle(QFrame::Panel | QFrame::Plain);

    QFrame *sframe = new QFrame();
    QVBoxLayout *svlayout = new QVBoxLayout(sframe);
    svlayout->setSpacing(1);
    svlayout->setMargin(2);

    statusBar()->addWidget(sframe,1);
    
    toolBar = new QToolBar(this);
    toolBar->setObjectName(QString::fromUtf8("toolBar"));

    QPalette palette;
    QBrush brush(QColor(108, 147, 255, 100));
    brush.setStyle(Qt::SolidPattern);
    palette.setBrush(QPalette::Active, QPalette::Base, brush);
    palette.setBrush(QPalette::Active, QPalette::AlternateBase, brush);
    QBrush brush1(QColor(44, 51, 91, 100));
    brush1.setStyle(Qt::SolidPattern);
    palette.setBrush(QPalette::Active, QPalette::Window, brush1);
    QBrush brush2(QColor(108, 147, 255, 100));
    brush2.setStyle(Qt::SolidPattern);
    palette.setBrush(QPalette::Inactive, QPalette::Base, brush2);
    QBrush brush3(QColor(44, 51, 91, 100));
    brush3.setStyle(Qt::SolidPattern);
    palette.setBrush(QPalette::Inactive, QPalette::Window, brush3);
    QBrush brush4(QColor(44, 51, 91, 100));
    brush4.setStyle(Qt::SolidPattern);
    palette.setBrush(QPalette::Disabled, QPalette::Base, brush4);
    QBrush brush5(QColor(44, 51, 91, 100));
    brush5.setStyle(Qt::SolidPattern);
    palette.setBrush(QPalette::Disabled, QPalette::Window, brush5);
    toolBar->setPalette(palette);
    toolBar->setOrientation(Qt::Horizontal);
    addToolBar(static_cast<Qt::ToolBarArea>(4), toolBar);

    menubar->addAction(menu_File->menuAction());
    menubar->addAction(menu_Util->menuAction());
    //menubar->addAction(menu_View->menuAction());
	menubar->addSeparator();
    menubar->addAction(menu_Help->menuAction());
#if 0
    menu_File->addAction(action_Print);
#endif
    menu_File->addAction(action_Exit);

    menu_Util->addAction(action_Multiplot);
    menu_Util->addAction(action_Archivesheet);
    menu_Util->addAction(action_Archiverviewer);
    menu_Util->addAction(action_SignalDB);
    menu_Util->addAction(action_PVListV);

#if 0
	menu_Help->addAction(action_Manual);
#endif
	menu_Help->addAction(action_AboutECH);

#if 1
    QFrame *tbframe = new QFrame();
    toolBar->addWidget(tbframe);

    QHBoxLayout *tblayout = new QHBoxLayout(tbframe);
    tblayout->QLayout::setAlignment(Qt::AlignRight|Qt::AlignVCenter);
    tblayout->setSpacing(0);
    tblayout->setMargin(0);
    tblayout->setObjectName(QString::fromUtf8("toolBarLayout"));

    QSpacerItem *tbspacer = new QSpacerItem(1000, 10, QSizePolicy::Fixed, QSizePolicy::Fixed);
    QSpacerItem *tbspacer2 = new QSpacerItem(5, 5, QSizePolicy::Fixed, QSizePolicy::Fixed);

	//CAGraphic *ioc1HB = new CAGraphic();
	ioc1HB = new CAGraphic();
	ioc1HB->setLineWidth(2);
	ioc1HB->setMinimumSize(QSize(20,20));
	ioc1HB->setMaximumSize(QSize(20,20));
	ioc1HB->setFillColor(QColor("white"));
	ioc1HB->setLineColor(QColor("black"));
	ioc1HB->setFillMode(StaticGraphic::Solid);
	ioc1HB->setPvname("ECH_HEARTBEAT");
	ioc1HB->setFillDisplayMode(CAGraphic::ActInact);
	ioc1HB->setObjectName("CAGraphic_ioc1HB");
	ioc1HB->setToolTip("ECH IOC HEART BEAT");

	//CAGraphic *ioc2HB = new CAGraphic();
/*
	ioc2HB = new CAGraphic();
	ioc2HB->setLineWidth(2);
	ioc2HB->setMinimumSize(QSize(20,20));
	ioc2HB->setMaximumSize(QSize(20,20));
	ioc2HB->setFillColor(QColor("white"));
	ioc2HB->setLineColor(QColor("black"));
	ioc2HB->setFillMode(StaticGraphic::Solid);
	ioc2HB->setPvname("ECH_LTU_HEARTBEAT");
	ioc2HB->setFillDisplayMode(CAGraphic::ActInact);
	ioc2HB->setObjectName("CAGraphic_ioc2HB");
	ioc2HB->setToolTip("ECH LTU HEART BEAT");
*/

    font.setPointSize(12);
    //CAWclock *wclock1 = new CAWclock();
    wclock1 = new CAWclock();
	wclock1->setMinimumSize(QSize(160,20));
	wclock1->setMaximumSize(QSize(160,20));
	wclock1->setPvname("ECH_IOC_WCLOCK.RVAL");
	wclock1->setFont(font);
	wclock1->setObjectName("CAWclock_wclock1");
	
    //QLabel *logo = new QLabel("KSTAR logo");
    logo = new QLabel("KSTAR logo");
    logo->setPixmap(QPixmap::fromImage(QImage(":/images/kstar.png")));

    tblayout->addItem(tbspacer);
    tblayout->addWidget(wclock1);
    tblayout->addItem(tbspacer2);
	tblayout->addWidget(ioc1HB);
//	tblayout->addWidget(ioc2HB);
    tblayout->addItem(tbspacer2);
    tblayout->addWidget(logo);
	AttachChannelAccess *pattachTB = new AttachChannelAccess(tbframe);
#endif

    QSize size(1280, 1024);
    size = size.expandedTo(minimumSizeHint());
    resize(size);
    tabWidget->setCurrentIndex(0);
    QMetaObject::connectSlotsByName(this);

    msgframe = new QFrame(centralwidget);
    msgframe->setObjectName(QString::fromUtf8("msgframe"));
    QSizePolicy sizePolicy4(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(5));
    sizePolicy4.setHorizontalStretch(0);
    sizePolicy4.setVerticalStretch(0);
    sizePolicy4.setHeightForWidth(frame->sizePolicy().hasHeightForWidth());
//TG    msgframe->setGeometry(QRect(19, 820, 1255, 90));
    //msgframe->setSizePolicy(sizePolicy4);
    msgframe->setGeometry(QRect(10, 880, 1254, 70));
    //msgframe->setMinimumSize(QSize(1164, 90));
    //msgframe->setFrameShape(QFrame::StyledPanel);
    //msgframe->setFrameShadow(QFrame::Raised);

	vboxLayout2 = new QVBoxLayout(msgframe);
	vboxLayout2->setSpacing(0);
	vboxLayout2->setMargin(0);


/*
	QUiLoader m_loader2;
	QFile *file2 = new QFile("/usr/local/opi/ui/ECH_message.ui");
	file2->open(QFile::ReadOnly);
	QWidget *m_widget2 = m_loader2.load(file2);
	file2->close();
	vboxLayout2->addWidget(m_widget2);
*/

	QHBoxLayout *vhLayout = new QHBoxLayout();
	vhLayout->setSpacing(0);
	vhLayout->setMargin(0);

	CADisplayer *ioc1_interlock = new CADisplayer();
	ioc1_interlock->setMinimumSize(QSize(160,20));
	ioc1_interlock->setMaximumSize(QSize(160,20));
	ioc1_interlock->setPvname("ECH_IOC1_INTERLOCK");
	ioc1_interlock->setObjectName("CADisplayer_ioc1_interlock");
	ioc1_interlock->setVisible(false);
	vhLayout->addWidget(ioc1_interlock);

	CADisplayer *ioc2_interlock = new CADisplayer();
	ioc2_interlock->setMinimumSize(QSize(160,20));
	ioc2_interlock->setMaximumSize(QSize(160,20));
	ioc2_interlock->setPvname("ECH_IOC2_INTERLOCK");
	ioc2_interlock->setObjectName("CADisplayer_ioc2_interlock");
	ioc2_interlock->setVisible(false);
	vhLayout->addWidget(ioc2_interlock);
	vboxLayout2->addLayout(vhLayout);

	textEdit = new QTextEdit(this);
	textEdit->setObjectName(QString::fromUtf8("textEdit"));
	//textEdit->setGeometry(QRect(0, 0, 1000, 50)); 
	//textEdit->setGeometry(QRect(16, 900, 1000, 70)); 
	textEdit->setFontPointSize(12);
	textEdit->setAutoFormatting(QTextEdit::AutoAll);
	textEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);

	vboxLayout2->addWidget(textEdit);

	//AttachChannelAccess *pattach_msg = new AttachChannelAccess(msgframe);
	setCentralWidget(centralwidget);

	QObject::connect(ioc1_interlock, SIGNAL(valueChanged(QString)), this,  SLOT(changeText(QString))); 

	QObject::connect(tabWidget, SIGNAL(currentChanged(int)), SLOT(setDefaultIndex(int))); 


	// Set Object Text.
	setWindowTitle(QApplication::translate("MainWindow", "ECH (KSTAR 84GHz ECH System)", 0, QApplication::UnicodeUTF8));
	setWindowIcon(QIcon(QString::fromUtf8("/usr/local/opi/images/ECH.xpm")));
#if 0
    action_Print->setText(QApplication::translate("MainWindow", "&Print", 0, QApplication::UnicodeUTF8));
#endif
    action_Exit->setText(QApplication::translate("MainWindow", "e&Xit", 0, QApplication::UnicodeUTF8));
    action_Multiplot->setText(QApplication::translate("MainWindow", "&Multiplot", 0, QApplication::UnicodeUTF8));
    action_Archivesheet->setText(QApplication::translate("MainWindow", "&Archivesheet", 0, QApplication::UnicodeUTF8));
    action_Archiverviewer->setText(QApplication::translate("MainWindow", "a&Rchiveviewer", 0, QApplication::UnicodeUTF8));
    action_SignalDB->setText(QApplication::translate("MainWindow", "&SignalDB", 0, QApplication::UnicodeUTF8));
    action_PVListV->setText(QApplication::translate("MainWindow", "&PVListviewer", 0, QApplication::UnicodeUTF8));
    action_Manual->setText(QApplication::translate("MainWindow", "ma&Nual", 0, QApplication::UnicodeUTF8));
    action_AboutECH->setText(QApplication::translate("MainWindow", "About &ECH", 0, QApplication::UnicodeUTF8));
    tabWidget->setTabText(tabWidget->indexOf(tab_0), QApplication::translate("MainWindow", "ECH main panels", 0, QApplication::UnicodeUTF8));
//    tabWidget->setTabText(tabWidget->indexOf(tab_1), QApplication::translate("MainWindow", "ECH sub panels", 0, QApplication::UnicodeUTF8));
    menu_File->setTitle(QApplication::translate("MainWindow", "&File", 0, QApplication::UnicodeUTF8));
    menu_Util->setTitle(QApplication::translate("MainWindow", "&Util", 0, QApplication::UnicodeUTF8));
    //menu_View->setTitle(QApplication::translate("MainWindow", "&View", 0, QApplication::UnicodeUTF8));
    menu_Help->setTitle(QApplication::translate("MainWindow", "&Help", 0, QApplication::UnicodeUTF8));

} // setupUi
Example #22
0
void DiffPage::addOptionsTab()
{
	QWidget* page   = new QWidget( this );
	QVBoxLayout* layout = new QVBoxLayout( page );
	layout->setSpacing( KDialog::spacingHint() );
	layout->setMargin( KDialog::marginHint() );

	// add diff options
	KButtonGroup* optionButtonGroup = new KButtonGroup( page );
	layout->addWidget( optionButtonGroup );
	QVBoxLayout* bgLayout = new QVBoxLayout( optionButtonGroup );
	optionButtonGroup->setTitle( i18n( "General" ) );
	//optionButtonGroup->setMargin( KDialog::marginHint() );

	m_newFilesCheckBox    = new QCheckBox( i18n( "&Treat new files as empty" ), optionButtonGroup );
	m_newFilesCheckBox->setToolTip( i18n( "This option corresponds to the -N diff option." ) );
	m_newFilesCheckBox->setWhatsThis( i18n( "With this option enabled diff will treat a file that only exists in one of the directories as empty in the other directory. This means that the file is compared with an empty file and because of this will appear as one big insertion or deletion." ) );
	bgLayout->addWidget( m_newFilesCheckBox );

	m_smallerCheckBox     = new QCheckBox( i18n( "&Look for smaller changes" ), optionButtonGroup );
	m_smallerCheckBox->setToolTip( i18n( "This corresponds to the -d diff option." ) );
	m_smallerCheckBox->setWhatsThis( i18n( "With this option enabled diff will try a little harder (at the cost of more memory) to find fewer changes." ) );
	bgLayout->addWidget( m_smallerCheckBox );
	m_largerCheckBox      = new QCheckBox( i18n( "O&ptimize for large files" ), optionButtonGroup );
	m_largerCheckBox->setToolTip( i18n( "This corresponds to the -H diff option." ) );
	m_largerCheckBox->setWhatsThis( i18n( "This option lets diff makes better diffs when using large files. The definition of large is nowhere to be found though." ) );
	bgLayout->addWidget( m_largerCheckBox );
	m_caseCheckBox        = new QCheckBox( i18n( "&Ignore changes in case" ), optionButtonGroup );
	m_caseCheckBox->setToolTip( i18n( "This corresponds to the -i diff option." ) );
	m_caseCheckBox->setWhatsThis( i18n( "With this option to ignore changes in case enabled, diff will not indicate a difference when something in one file is changed into SoMEthing in the other file." ) );
	bgLayout->addWidget( m_caseCheckBox );

	QHBoxLayout* groupLayout = new QHBoxLayout();
	layout->addLayout( groupLayout );
	groupLayout->setObjectName( "regexp_horizontal_layout" );
	groupLayout->setSpacing( -1 );
	groupLayout->setMargin( KDialog::marginHint() );

	m_ignoreRegExpCheckBox = new QCheckBox( i18n( "Ignore regexp:" ), page );
	m_ignoreRegExpCheckBox->setToolTip( i18n( "This option corresponds to the -I diff option." ) );
	m_ignoreRegExpCheckBox->setWhatsThis( i18n( "When this checkbox is enabled, an option to diff is given that will make diff ignore lines that match the regular expression." ) );
	groupLayout->addWidget( m_ignoreRegExpCheckBox );
	m_ignoreRegExpEdit = new KLineEdit( QString::null, page);	//krazy:exclude=nullstrassign for old broken gcc
	m_ignoreRegExpEdit->setObjectName("regexplineedit" );
	m_ignoreRegExpEdit->setToolTip( i18n( "Add the regular expression here that you want to use\nto ignore lines that match it." ) );
	groupLayout->addWidget( m_ignoreRegExpEdit );

	if ( !KServiceTypeTrader::self()->query("KRegExpEditor/KRegExpEditor").isEmpty() )
	{
		// Ok editor is available, use it
		QPushButton* ignoreRegExpEditButton = new QPushButton( i18n( "&Edit..." ), page);
		ignoreRegExpEditButton->setObjectName( "regexp_editor_button" );
		ignoreRegExpEditButton->setToolTip( i18n( "Clicking this will open a regular expression dialog where\nyou can graphically create regular expressions." ) );
		groupLayout->addWidget( ignoreRegExpEditButton );
		connect( ignoreRegExpEditButton, SIGNAL( clicked() ), this, SLOT( slotShowRegExpEditor() ) );
	}

	KButtonGroup* moreOptionButtonGroup = new KButtonGroup( page );
	layout->addWidget( moreOptionButtonGroup );
	bgLayout = new QVBoxLayout( moreOptionButtonGroup );
	moreOptionButtonGroup->setTitle( i18n( "Whitespace" ) );
	//moreOptionButtonGroup->setMargin( KDialog::marginHint() );

	m_tabsCheckBox        = new QCheckBox( i18n( "E&xpand tabs to spaces in output" ), moreOptionButtonGroup );
	m_tabsCheckBox->setToolTip( i18n( "This option corresponds to the -t diff option." ) );
	m_tabsCheckBox->setWhatsThis( i18n( "This option does not always produce the right result. Due to this expansion Kompare may have problems applying the change to the destination file." ) );
	bgLayout->addWidget( m_tabsCheckBox );
	m_linesCheckBox       = new QCheckBox( i18n( "I&gnore added or removed empty lines" ), moreOptionButtonGroup );
	m_linesCheckBox->setToolTip( i18n( "This option corresponds to the -B diff option." ) );
	m_linesCheckBox->setWhatsThis( i18n( "This can be very useful in situations where code has been reorganized and empty lines have been added or removed to improve legibility." ) );
	bgLayout->addWidget( m_linesCheckBox );
	m_whitespaceCheckBox  = new QCheckBox( i18n( "Ig&nore changes in the amount of whitespace" ), moreOptionButtonGroup );
	m_whitespaceCheckBox->setToolTip( i18n( "This option corresponds to the -b diff option." ) );
	m_whitespaceCheckBox->setWhatsThis( i18n( "If you are uninterested in differences arising due to, for example, changes in indentation, then use this option." ) );
	bgLayout->addWidget( m_whitespaceCheckBox );
	m_allWhitespaceCheckBox = new QCheckBox( i18n( "Ign&ore all whitespace" ), moreOptionButtonGroup );
	m_allWhitespaceCheckBox->setToolTip( i18n( "This option corresponds to the -w diff option." ) );
	m_allWhitespaceCheckBox->setWhatsThis( i18n( "This is useful for seeing the significant changes without being overwhelmed by all the white space changes." ) );
	bgLayout->addWidget( m_allWhitespaceCheckBox );
	m_ignoreTabExpansionCheckBox = new QCheckBox( i18n( "Igno&re changes due to tab expansion" ), moreOptionButtonGroup );
	m_ignoreTabExpansionCheckBox->setToolTip( i18n( "This option corresponds to the -E diff option." ) );
	m_ignoreTabExpansionCheckBox->setWhatsThis( i18n( "If there is a change because tabs have been expanded into spaces in the other file, then this option will make sure that these do not show up. Kompare currently has some problems applying such changes so be careful when you use this option." ) );
	bgLayout->addWidget( m_ignoreTabExpansionCheckBox );

	layout->addStretch( 1 );
	page->setMinimumSize( sizeHintForWidget( page ) );

	m_tabWidget->addTab( page, i18n( "Options" ) );
}
/**
********************************************************************************
\brief	constructor

Constructor of main window class.

\param		parent			pointer parent window
*******************************************************************************/
MainWindow::MainWindow(QWidget *parent)
    : QWidget(parent)
{
    pEplApi = NULL;

    resize(1000, 600);

    QVBoxLayout *pWindowLayout = new QVBoxLayout();
    pWindowLayout->setObjectName("MainLayout");
    setLayout(pWindowLayout);

    // ---------------------------------------------------------------------
    // Head Region
    // ---------------------------------------------------------------------
    pHeadBackground = new QFrame();
    pHeadBackground->setContentsMargins(0,0,0,0);
    QPalette tmpPal(pHeadBackground->palette());
    tmpPal.setColor(QPalette::Window, Qt::white);
    pHeadBackground->setPalette(tmpPal);
    pHeadBackground->setAutoFillBackground(true);

    pHeadRegion = new QHBoxLayout();
    pHeadRegion->setObjectName("HeadRegion");

    pRightLogo  = new QPixmap(":/img/powerlink_open_source.png");
    pRightLabel = new QLabel();
    pHeadRegion->addWidget(pRightLabel, 1, Qt::AlignLeft);

    pHeadBackground->setLayout(pHeadRegion);
    pWindowLayout->addWidget(pHeadBackground, 0);

    pWindowLayout->addSpacing(10);

    pFrameSepHeadMiddle = new QFrame();
    pFrameSepHeadMiddle->setFrameStyle(QFrame::HLine);
    pWindowLayout->addWidget(pFrameSepHeadMiddle);

    // ---------------------------------------------------------------------
    // Middle Region
    // ---------------------------------------------------------------------

    // separate in left and right side
    QHBoxLayout *pMiddleRegion = new QHBoxLayout();
    pMiddleRegion->setObjectName("MiddleRegion");

    pEplCnState = new EplCnState;
    pMiddleRegion->addWidget(pEplCnState);

    pFrameSepMiddle = new QFrame();
    pFrameSepMiddle->setFrameStyle(QFrame::VLine);
    pMiddleRegion->addWidget(pFrameSepMiddle);

    pEplInput = new EplInput;
    pMiddleRegion->addWidget(pEplInput);

    pFrameSepMiddle2 = new QFrame();
    pFrameSepMiddle2->setFrameStyle(QFrame::VLine);
    pMiddleRegion->addWidget(pFrameSepMiddle2);


    pEplOutput = new EplOutput;
    pMiddleRegion->addWidget(pEplOutput);

    pWindowLayout->addLayout(pMiddleRegion, 8);
    pWindowLayout->addStretch(10);

    pFrameSepMiddleStatus = new QFrame();
    pFrameSepMiddleStatus->setFrameStyle(QFrame::HLine);
    pWindowLayout->addWidget(pFrameSepMiddleStatus);

    // ---------------------------------------------------------------------
    // Status Region
    // ---------------------------------------------------------------------
    QHBoxLayout *pStatusRegion = new QHBoxLayout();
    pStatusRegion->setObjectName("StatusRegion");

    // EPL network state
    pEplState = new EplState;
    pStatusRegion->addWidget(pEplState);

    pWindowLayout->addLayout(pStatusRegion, 0);

    pFrameSepStatusFoot = new QFrame();
    pFrameSepStatusFoot->setFrameStyle(QFrame::HLine);
    pWindowLayout->addWidget(pFrameSepStatusFoot);

    // ---------------------------------------------------------------------
    // Foot Region
    // ---------------------------------------------------------------------

    QHBoxLayout *pFootRegion = new QHBoxLayout();
    pFootRegion->setObjectName("FootRegion");

    QLabel* pNodeIdLabel = new QLabel("Node-ID:");
    pFootRegion->addWidget(pNodeIdLabel);

    QString sNodeId;
    sNodeId.setNum(EplApi::defaultNodeId());

    QValidator *pValidator = new QIntValidator(1, 254, this);
    pNodeIdEdit = new QLineEdit(sNodeId);
    pNodeIdEdit->setValidator(pValidator);
    pFootRegion->addWidget(pNodeIdEdit);

    pFootRegion->addSpacing(20);

    pStartStopEpl = new QPushButton(tr("Start POWERLINK"));
    pFootRegion->addWidget(pStartStopEpl);
    connect(pStartStopEpl, SIGNAL(clicked()), this, SLOT(startPowerlink()));

    pFootRegion->addStretch();

    pToggleMax = new QPushButton(tr("Full Screen"));
    pFootRegion->addWidget(pToggleMax);
    connect(pToggleMax, SIGNAL(clicked()),
            this, SLOT(toggleWindowState()));

    QPushButton *pQuit = new QPushButton(tr("Quit"));
    pFootRegion->addWidget(pQuit);
    connect(pQuit, SIGNAL(clicked()), qApp, SLOT(quit()));

    pWindowLayout->addLayout(pFootRegion, 0);
}
Example #24
0
void TabDeckEditor::createDeckDock()
{
    deckModel = new DeckListModel(this);
    deckModel->setObjectName("deckModel");
    connect(deckModel, SIGNAL(deckHashChanged()), this, SLOT(updateHash()));
    deckView = new QTreeView();
    deckView->setObjectName("deckView");
    deckView->setModel(deckModel);
    deckView->setUniformRowHeights(true);
    deckView->setSortingEnabled(true);
    deckView->sortByColumn(1, Qt::AscendingOrder);
#if QT_VERSION < 0x050000
    deckView->header()->setResizeMode(QHeaderView::ResizeToContents);
#else
    deckView->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
#endif
    deckView->installEventFilter(&deckViewKeySignals);
    connect(deckView->selectionModel(), SIGNAL(currentRowChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(updateCardInfoRight(const QModelIndex &, const QModelIndex &)));
    connect(deckView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(actSwapCard()));
    connect(&deckViewKeySignals, SIGNAL(onS()), this, SLOT(actSwapCard()));
    connect(&deckViewKeySignals, SIGNAL(onEnter()), this, SLOT(actIncrement()));
    connect(&deckViewKeySignals, SIGNAL(onCtrlAltEqual()), this, SLOT(actIncrement()));
    connect(&deckViewKeySignals, SIGNAL(onCtrlAltMinus()), this, SLOT(actDecrement()));
    connect(&deckViewKeySignals, SIGNAL(onRight()), this, SLOT(actIncrement()));
    connect(&deckViewKeySignals, SIGNAL(onLeft()), this, SLOT(actDecrement()));
    connect(&deckViewKeySignals, SIGNAL(onDelete()), this, SLOT(actRemoveCard()));

    nameLabel = new QLabel();
    nameLabel->setObjectName("nameLabel");
    nameEdit = new QLineEdit;
    nameEdit->setObjectName("nameEdit");
    nameLabel->setBuddy(nameEdit);
    connect(nameEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateName(const QString &)));
    commentsLabel = new QLabel();
    commentsLabel->setObjectName("commentsLabel");
    commentsEdit = new QTextEdit;
    commentsEdit->setObjectName("commentsEdit");
    commentsEdit->setMaximumHeight(70);
    commentsLabel->setBuddy(commentsEdit);
    connect(commentsEdit, SIGNAL(textChanged()), this, SLOT(updateComments()));

    hashLabel1 = new QLabel();
    hashLabel1->setObjectName("hashLabel1");
    hashLabel = new QLabel;
    hashLabel->setObjectName("hashLabel");

    QGridLayout *grid = new QGridLayout;
    grid->setObjectName("grid");
    grid->addWidget(nameLabel, 0, 0);
    grid->addWidget(nameEdit, 0, 1);

    grid->addWidget(commentsLabel, 1, 0);
    grid->addWidget(commentsEdit, 1, 1);

    grid->addWidget(hashLabel1, 2, 0);
    grid->addWidget(hashLabel, 2, 1);

    /* Update price
    aUpdatePrices = new QAction(QString(), this);
    aUpdatePrices->setIcon(QPixmap("theme:icons/update"));
    connect(aUpdatePrices, SIGNAL(triggered()), this, SLOT(actUpdatePrices()));
    if (!settingsCache->getPriceTagFeature())
        aUpdatePrices->setVisible(false);
    connect(settingsCache, SIGNAL(priceTagFeatureChanged(int)), this, SLOT(setPriceTagFeatureEnabled(int)));
    */

    QToolBar *deckToolBar = new QToolBar;
    deckToolBar->setObjectName("deckToolBar");
    deckToolBar->setOrientation(Qt::Vertical);
    deckToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    deckToolBar->setIconSize(QSize(24, 24));
    //deckToolBar->addAction(aUpdatePrices);
    QHBoxLayout *deckToolbarLayout = new QHBoxLayout;
    deckToolbarLayout->setObjectName("deckToolbarLayout");
    deckToolbarLayout->addStretch();
    deckToolbarLayout->addWidget(deckToolBar);
    deckToolbarLayout->addStretch();

    QVBoxLayout *rightFrame = new QVBoxLayout;
    rightFrame->setObjectName("rightFrame");
    rightFrame->addLayout(grid);
    rightFrame->addWidget(deckView, 10);
    rightFrame->addLayout(deckToolbarLayout);

    deckDock = new QDockWidget(MainWindow);
    deckDock->setObjectName("deckDock");

    deckDock->setMinimumSize(QSize(200, 41));
    deckDock->setAllowedAreas(Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea);
    deckDock->setFeatures(QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable);
    QWidget *deckDockContents = new QWidget();
    deckDockContents->setObjectName("deckDockContents");
    deckDockContents->setLayout(rightFrame);
    deckDock->setWidget(deckDockContents);

    connect(btnDeck,SIGNAL(toggled(bool)),deckDock,SLOT(setVisible(bool)));
    deckDock->installEventFilter(this);
}
Example #25
0
void TabDeckEditor::createCentralFrame()
{
    searchEdit = new SearchLineEdit;
    searchEdit->setObjectName("searchEdit");
#if QT_VERSION >= 0x050300
    searchEdit->addAction(QPixmap("theme:icons/search"), QLineEdit::LeadingPosition);
#endif

    setFocusProxy(searchEdit);
    setFocusPolicy(Qt::ClickFocus);

    searchEdit->installEventFilter(&searchKeySignals);
    searchKeySignals.setObjectName("searchKeySignals");
    connect(searchEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateSearch(const QString &)));
    connect(&searchKeySignals, SIGNAL(onEnter()), this, SLOT(actAddCard()));
    connect(&searchKeySignals, SIGNAL(onCtrlAltEqual()), this, SLOT(actAddCard()));
    connect(&searchKeySignals, SIGNAL(onCtrlAltRBracket()), this, SLOT(actAddCardToSideboard()));
    connect(&searchKeySignals, SIGNAL(onCtrlAltMinus()), this, SLOT(actDecrementCard()));
    connect(&searchKeySignals, SIGNAL(onCtrlAltLBracket()), this, SLOT(actDecrementCardFromSideboard()));
    connect(&searchKeySignals, SIGNAL(onCtrlAltEnter()), this, SLOT(actAddCardToSideboard()));
    connect(&searchKeySignals, SIGNAL(onCtrlEnter()), this, SLOT(actAddCardToSideboard()));    

    databaseModel = new CardDatabaseModel(db, this);
    databaseModel->setObjectName("databaseModel");
    databaseDisplayModel = new CardDatabaseDisplayModel(this);
    databaseDisplayModel->setSourceModel(databaseModel);
    databaseDisplayModel->setFilterKeyColumn(0);
    databaseDisplayModel->sort(0, Qt::AscendingOrder);

    databaseView = new QTreeView();
    databaseView->setObjectName("databaseView");
    databaseView->setFocusProxy(searchEdit);
    databaseView->setModel(databaseDisplayModel);
    databaseView->setUniformRowHeights(true);
    databaseView->setRootIsDecorated(false);
    databaseView->setAlternatingRowColors(true);
    databaseView->setSortingEnabled(true);
    databaseView->sortByColumn(0, Qt::AscendingOrder);
    databaseView->resizeColumnToContents(0);
    connect(databaseView->selectionModel(), SIGNAL(currentRowChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(updateCardInfoLeft(const QModelIndex &, const QModelIndex &)));
    connect(databaseView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(actAddCard()));
    searchEdit->setTreeView(databaseView);

    aAddCard = new QAction(QString(), this);
    aAddCard->setIcon(QPixmap("theme:icons/arrow_right_green"));
    connect(aAddCard, SIGNAL(triggered()), this, SLOT(actAddCard()));
    aAddCardToSideboard = new QAction(QString(), this);
    aAddCardToSideboard->setIcon(QPixmap("theme:icons/arrow_right_blue"));
    connect(aAddCardToSideboard, SIGNAL(triggered()), this, SLOT(actAddCardToSideboard()));
    aRemoveCard = new QAction(QString(), this);
    aRemoveCard->setIcon(QPixmap("theme:icons/remove_row"));
    connect(aRemoveCard, SIGNAL(triggered()), this, SLOT(actRemoveCard()));
    aIncrement = new QAction(QString(), this);
    aIncrement->setIcon(QPixmap("theme:icons/increment"));
    connect(aIncrement, SIGNAL(triggered()), this, SLOT(actIncrement()));
    aDecrement = new QAction(QString(), this);
    aDecrement->setIcon(QPixmap("theme:icons/decrement"));
    connect(aDecrement, SIGNAL(triggered()), this, SLOT(actDecrement()));

    QToolBar *deckEditToolBar = new QToolBar;
    deckEditToolBar->setObjectName("deckEditToolBar");
    deckEditToolBar->setOrientation(Qt::Horizontal);
    deckEditToolBar->setIconSize(QSize(24, 24));

    deckEditToolBar->addAction(aAddCard);
    deckEditToolBar->addAction(aAddCardToSideboard);
    deckEditToolBar->addAction(aRemoveCard);
    deckEditToolBar->addAction(aDecrement);
    deckEditToolBar->addAction(aIncrement);
    deckEditToolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

    searchLayout = new QHBoxLayout;
    searchLayout->setObjectName("searchLayout");
    searchLayout->addWidget(deckEditToolBar);
    searchLayout->addWidget(searchEdit);
    createShowHideDocksButtons();

    centralFrame = new QVBoxLayout;
    centralFrame->setObjectName("centralFrame");
    centralFrame->addLayout(searchLayout);
    centralFrame->addWidget(databaseView);

    centralWidget = new QWidget(MainWindow);
    centralWidget->setObjectName("centralWidget");
    centralWidget->setLayout(centralFrame);
    MainWindow->setCentralWidget(centralWidget);
    MainWindow->setDockOptions(QMainWindow::AnimatedDocks|QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks);

    QHBoxLayout *mainLayout = new QHBoxLayout;
    mainLayout->setObjectName("mainLayout");
    mainLayout->addWidget(MainWindow);
    setLayout(mainLayout);
}
Example #26
0
void SearchResultWidget::setupUi(QMainWindow* qmw, const QString &iconThemePath)
{
    searchResultWidget = new QDockWidget(qmw);
    searchResultWidget->setObjectName(QString::fromUtf8("searchResultWidget_new"));//object name for created instance, it renames to 'searchResultWidget_old'
    //searchResultWidget->setLayoutDirection(Qt::RightToLeft);
    searchResultWidget->setFeatures(QDockWidget::AllDockWidgetFeatures);
    searchResultWidget->setAttribute(Qt::WA_DeleteOnClose, true);

    searchResultWidget->setStyleSheet("QDockWidget::title { background: transparent; text-align: left; padding: 0 10 0 10;}"
                                      "QDockWidget::close-button, QDockWidget::float-button { background: transparent;}");

    QGridLayout* searchGridLayout = new QGridLayout(searchResultContents);
    searchGridLayout->setSpacing(6);
    searchGridLayout->setContentsMargins(11, 11, 11, 11);
    searchGridLayout->setObjectName(QString::fromUtf8("searchGridLayout"));
    QHBoxLayout* horizontalLayout = new QHBoxLayout();
    horizontalLayout->setSpacing(6);
    horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
    QGridLayout* searchTableGridLayout = new QGridLayout();
    searchTableGridLayout->setSpacing(6);
    searchTableGridLayout->setObjectName(QString::fromUtf8("searchTableGridLayout"));

    //create filter lable and lineEdit and layout
    QHBoxLayout* filterHorizontalLayout = new QHBoxLayout();
    filterHorizontalLayout->setSpacing(6);
    filterHorizontalLayout->setObjectName(QString::fromUtf8("filterHorizontalLayout"));

    QLabel* filterLabel = new QLabel(searchResultContents);
    filterLabel->setObjectName(QString::fromUtf8("filterLabel"));
    filterLabel->setText(tr("Filter:"));
    filterHorizontalLayout->addWidget(filterLabel, 0, Qt::AlignRight | Qt::AlignCenter);

    QString clearIconPath = iconThemePath + "/clear-left.png";
    if (searchResultContents->layoutDirection() == Qt::RightToLeft) {
        clearIconPath = iconThemePath + "/clear-right.png";
    }
    filterLineEdit = new QSearchLineEdit(searchResultContents, clearIconPath, iconThemePath + "/filter.png");
    filterLineEdit->setObjectName(QString::fromUtf8("filterLineEdit"));
#if QT_VERSION >= 0x040700
    filterLineEdit->setPlaceholderText(tr("Filter"));
#endif
    connect(filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterResults(QString)));
    filterHorizontalLayout->addWidget(filterLineEdit);
    QSpacerItem* filterHorizSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
    filterHorizontalLayout->addItem(filterHorizSpacer);

    pageLabel = new QLabel(searchResultContents);
    pageLabel->setObjectName(QString::fromUtf8("pageLabel"));
//  filterHorizontalLayout->addWidget(pageLabel, 0, Qt::AlignRight|Qt::AlignCenter);

    //searchTableGridLayout->addLayout(filterHorizontalLayout, 1, 0, 1, 1);

    //create QTableWidget
    searchTable = new QTableWidget(searchResultContents);
    searchTable->setObjectName(QString::fromUtf8("searchTable"));
    searchTable->setColumnCount(3);
    searchTable->setLayoutDirection(Qt::RightToLeft);
    searchTable->setAlternatingRowColors(true);
    searchTable->setSelectionMode(QAbstractItemView::NoSelection /*SingleSelection*/);
    searchTable->setSelectionBehavior(QAbstractItemView::SelectRows);
    searchTable->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
    searchTable->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
    searchTable->verticalHeader()->setVisible(false);
    //searchTable->horizontalHeader()->setVisible(false);
    searchTable->horizontalHeader()->setHighlightSections(false);
    searchTable->horizontalHeader()->setStretchLastSection(true);
    connect(searchTable, SIGNAL(currentCellChanged(int,int,int,int)), this, SLOT(currentRowColumnChanged(int,int,int,int)));

    //install delagate on third column
    SaagharItemDelegate* searchDelegate = new SaagharItemDelegate(searchTable, searchTable->style(), phrase);
    searchTable->setItemDelegateForColumn(2, searchDelegate);
    connect(this, SIGNAL(searchFiltered(QString)), searchDelegate, SLOT(keywordChanged(QString)));

    //searchTable->setItemDelegateForColumn(2, new SaagharItemDelegate(searchTable, searchTable->style(), phrase));

    searchTableGridLayout->addWidget(searchTable, 0, 0, 1, 1);

//  QVBoxLayout *searchNavVerticalLayout = new QVBoxLayout();
//  searchNavVerticalLayout->setSpacing(6);
//  searchNavVerticalLayout->setObjectName(QString::fromUtf8("searchNavVerticalLayout"));

    searchNextPage = new QToolButton(searchResultContents);
    searchNextPage->setObjectName(QString::fromUtf8("searchNextPage"));
    searchNextPage->setStyleSheet("QToolButton { border: none; padding: 0px; }");

    actSearchNextPage = new QAction(searchResultContents);
    searchNextPage->setDefaultAction(actSearchNextPage);

    connect(searchNextPage, SIGNAL(triggered(QAction*)), this, SLOT(searchPageNavigationClicked(QAction*)));

    searchNextPage->setEnabled(false);
    searchNextPage->hide();

    //searchNavVerticalLayout->addWidget(searchNextPage);

    searchPreviousPage = new QToolButton(searchResultContents);
    searchPreviousPage->setObjectName(QString::fromUtf8("searchPreviousPage"));
    searchPreviousPage->setStyleSheet("QToolButton { border: none; padding: 0px; }");

    actSearchPreviousPage = new QAction(searchResultContents);
    searchPreviousPage->setDefaultAction(actSearchPreviousPage);

    if (qmw->layoutDirection() == Qt::LeftToRight) {
        actSearchPreviousPage->setIcon(QIcon(iconThemePath + "/previous.png"));
        actSearchNextPage->setIcon(QIcon(iconThemePath + "/next.png"));
    }
    else {
        actSearchPreviousPage->setIcon(QIcon(iconThemePath + "/next.png"));
        actSearchNextPage->setIcon(QIcon(iconThemePath + "/previous.png"));
    }

    connect(searchPreviousPage, SIGNAL(triggered(QAction*)), this, SLOT(searchPageNavigationClicked(QAction*)));

    searchPreviousPage->setEnabled(false);
    searchPreviousPage->hide();

//  searchNavVerticalLayout->addWidget(searchPreviousPage);

    //QSpacerItem *searchNavVerticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);

    //searchNavVerticalLayout->addItem(searchNavVerticalSpacer);

//  if (moreThanOnePage)
//      horizontalLayout->addLayout(searchNavVerticalLayout);

    filterHorizontalLayout->addWidget(searchPreviousPage);
    filterHorizontalLayout->addWidget(searchNextPage);
    filterHorizontalLayout->addWidget(pageLabel, 0, Qt::AlignRight | Qt::AlignCenter);
    searchTableGridLayout->addLayout(filterHorizontalLayout, 1, 0, 1, 1);

    horizontalLayout->addLayout(searchTableGridLayout);

    searchGridLayout->addLayout(horizontalLayout, 0, 0, 1, 1);

    /****************************/
    QDockWidget* tmpDockWidget = 0;
    QObjectList mainWindowChildren = qmw->children();
    for (int i = 0; i < mainWindowChildren.size(); ++i) {
        tmpDockWidget = qobject_cast<QDockWidget*>(mainWindowChildren.at(i));
        if (tmpDockWidget) {
            if (mainWindowChildren.at(i)->objectName() == "searchResultWidget_old") {
                break;
            }
        }
    }

    /****************************************/
    searchResultWidget->setWidget(searchResultContents);

    qmw->addDockWidget(Qt::BottomDockWidgetArea, searchResultWidget);

    if (tmpDockWidget && tmpDockWidget->objectName() == "searchResultWidget_old") { //there is another search results dock-widget present
        qmw->tabifyDockWidget(tmpDockWidget, searchResultWidget);
    }


    searchResultWidget->setObjectName("searchResultWidget_old");

    searchResultWidget->show();
    searchResultWidget->raise();
}
Example #27
0
bool MachinesDialog::buildDialog(bool examMode)
#endif
{
	ui->setupUi(this);
	ui->retranslateUi(this);

	QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
	buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
	buttonBox->setStandardButtons(QDialogButtonBox::NoButton);
	connect(buttonBox, SIGNAL(rejected()), this, SLOT(close()));

	QStringList horizontalHeaderLabels = QString(HORIZONTAL_HEADERS).split(";");
	ui->treeWidget->setColumnCount(horizontalHeaderLabels.count());
	ui->treeWidget->setHeaderLabels(horizontalHeaderLabels);
	ui->treeWidget->setSelectionMode(QAbstractItemView::NoSelection);

	if(fileName == "")
	{
		QHBoxLayout *horizontalLayout = new QHBoxLayout(this);
		horizontalLayout->setObjectName("horizontalLayout");

		checkBox = new QCheckBox(this);
		checkBox->setObjectName("checkBox");
		checkBox->setText("Comprimi file");

		horizontalLayout->addWidget(checkBox);
		horizontalLayout->addWidget(buttonBox);
		ui->verticalLayout->addLayout(horizontalLayout);

		setWindowTitle(QApplication::translate("SummaryDialog", "Esporta macchine", 0, QApplication::UnicodeUTF8));
		for(int row = 0; row < vmTab_vec->size(); row++)
		{
			VMTabSettings *vmTabSettings = vmTab_vec->at(row);
			
			QTreeWidgetItem *item = new QTreeWidgetItem();
			item->setCheckState(0, Qt::Unchecked);
			item->setText(0, QString("Macchina: ").append(vmTabSettings->getMachineName()));
			
			for(int iface_index = 0; iface_index < vmTabSettings->vm->ifaces_size; iface_index++)
			{
				QTreeWidgetItem *childItem = new QTreeWidgetItem(item);
				childItem->setText(0, vmTabSettings->vm->ifaces[iface_index]->name);
				childItem->setText(1, vmTabSettings->vm->ifaces[iface_index]->mac);
#ifdef CONFIGURABLE_IP
				childItem->setText(2, vmTabSettings->vm->ifaces[iface_index]->ip);
				childItem->setText(3, vmTabSettings->vm->ifaces[iface_index]->subnetMask);
#endif
			}

			ui->treeWidget->addTopLevelItem(item);
			ui->treeWidget->header()->setResizeMode(QHeaderView::ResizeToContents);
		}

		buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Save);
#ifndef USE_ZLIB
		checkBox->setChecked(false);
		checkBox->setEnabled(false);
#endif		
#ifdef EXAM_MODE
		if(examMode)
			connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotExamExportMachines()));
		else
#endif
		{
			connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotExportMachines()));
		}
	}
	else
	{
		ui->verticalLayout->addWidget(buttonBox);
		setWindowTitle(QApplication::translate("SummaryDialog", "Importa macchine", 0, QApplication::UnicodeUTF8));

		read_result_t read_result = loadMachines(&settings_header, &settings_ifaces, &machines_number);

		switch(read_result)
		{
			case NO_ERROR:
				break;
			case E_UNINMPLEMENTED:
			{
				QMessageBox qm(QMessageBox::Critical, "Ripristino impostazioni", QString::fromUtf8("Funzione non implementata."), QMessageBox::Ok, this);
				qm.setPalette(palette());
				qm.exec();
				return false;
			}				
			case E_INVALID_FILE:
			case E_INVALID_HEADER:
			default:
			{
				QMessageBox qm(QMessageBox::Critical, "Ripristino impostazioni", QString::fromUtf8("Il file selezionato non è valido."), QMessageBox::Ok, this);
				qm.setPalette(palette());
				qm.exec();
				return false;
			}
		}

		for(int i = 0; i < machines_number; i++)
		{
			QTreeWidgetItem *item = new QTreeWidgetItem();
			item->setCheckState(0, Qt::Unchecked);
			item->setText(0, QString("Macchina: ").append(settings_header[i].machine_name));

			for(int iface_index = 0; iface_index < settings_header[i].settings_iface_size; iface_index++)
			{
				QTreeWidgetItem *childItem = new QTreeWidgetItem(item);
				childItem->setText(0, settings_ifaces[i][iface_index].name);
				childItem->setText(1, settings_ifaces[i][iface_index].mac);
#ifdef CONFIGURABLE_IP
				childItem->setText(2, settings_ifaces[i][iface_index].ip);
				childItem->setText(3, settings_ifaces[i][iface_index].subnetMask);
#endif
			}

			ui->treeWidget->addTopLevelItem(item);
			ui->treeWidget->header()->setResizeMode(QHeaderView::ResizeToContents);
		}

		buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Open);
		connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotImportMachines()));
	}
	return true;
}
Example #28
0
void VirtualList::init()
{
    setWindowModality(Qt::ApplicationModal);
    setAttribute(Qt::WA_DeleteOnClose);
    _search	= new QLineEdit(this);
    _search->setObjectName("_search");
    _searchLit	= new QLabel(tr("S&earch for:"), this);
    _searchLit->setBuddy(_search);
    _searchLit->setObjectName("_searchLit");
#ifdef Q_WS_MAC
    _search->setMinimumHeight(22);
#endif
    _buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
                                      Qt::Vertical, this);
    _select	= _buttonBox->button(QDialogButtonBox::Ok);
    _listTab	= new XTreeWidget(this);
    _titleLit	= new QLabel("", this);
    _titleLit->setBuddy(_listTab);
    _titleLit->setObjectName("_titleLit");

    _listTab->setObjectName("_listTab");
    _listTab->setPopulateLinear(false);

    _searchLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
    _select->setEnabled(false);
    _listTab->setMinimumHeight(250);
    _titleLit->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);

    _dialogLyt                = new QVBoxLayout(this);
    _dialogLyt->setContentsMargins(5, 5, 5, 5);

    QHBoxLayout* topLyt	      = new QHBoxLayout();
    QVBoxLayout* searchLyt    = new QVBoxLayout();
    QVBoxLayout* buttonsLyt   = new QVBoxLayout();
    QHBoxLayout* searchStrLyt = new QHBoxLayout();
    QVBoxLayout* tableLyt     = new QVBoxLayout();

    topLyt->setObjectName("topLyt");
    searchLyt->setObjectName("searchLyt");
    buttonsLyt->setObjectName("buttonsLyt");
    searchStrLyt->setObjectName("searchStrLyt");
    tableLyt->setObjectName("tableLyt");

    _dialogLyt->addLayout(topLyt);
    topLyt->addLayout(searchLyt);
    topLyt->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding,
					    QSizePolicy::Minimum));
    topLyt->addLayout(buttonsLyt);
    searchLyt->addLayout(searchStrLyt);
    _dialogLyt->addLayout(tableLyt);

    searchStrLyt->addWidget(_searchLit);
    searchStrLyt->addWidget(_search);
    buttonsLyt->addWidget(_buttonBox);

    tableLyt->addWidget(_titleLit);
    tableLyt->addWidget(_listTab);

    topLyt->setStretchFactor(searchLyt, 0);
    _dialogLyt->setStretchFactor(topLyt, 0);
    _dialogLyt->setStretchFactor(tableLyt, 1);

    connect(_buttonBox,   SIGNAL(rejected()),	 this,   SLOT(sClose()));
    connect(_listTab, SIGNAL(itemSelected(int)), this,	 SLOT(sSelect()));
    connect(_listTab, SIGNAL(valid(bool)),     _select, SLOT(setEnabled(bool)));
    connect(_search,  SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&)));
    connect(_buttonBox,  SIGNAL(accepted()),         this,	 SLOT(sSelect()));
}
Example #29
0
VirtualSearch::VirtualSearch(QWidget* pParent, Qt::WindowFlags pFlags) :
    QDialog(pParent, pFlags)
{
    setAttribute(Qt::WA_DeleteOnClose);
    setWindowModality(Qt::ApplicationModal);
    setObjectName("virtualSearch");

    _search = new QLineEdit(this);
    _search->setObjectName("_search");
    _searchLit = new QLabel(tr("S&earch for:"), this);
    _searchLit->setBuddy(_search);
    _searchLit->setObjectName("_searchLit");

    _searchNumber = new XCheckBox(tr("Search through Numbers"), this);
    _searchNumber->setObjectName("_searchNumber");
    _searchName = new XCheckBox(tr("Search through Names"), this);
    _searchName->setObjectName("_searchName");
    _searchDescrip = new XCheckBox(tr("Search through Descriptions"), this);
    _searchDescrip->setObjectName("_searchDescrip");
    _buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
                                      Qt::Vertical, this);
    _select = _buttonBox->button(QDialogButtonBox::Ok);
    _listTab = new XTreeWidget(this);
    _titleLit = new QLabel("", this);
    _titleLit->setBuddy(_listTab);
    _titleLit->setObjectName("_titleLit");

    _listTab->setObjectName("_listTab");
    _listTab->setPopulateLinear(false);

    _searchLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
    _select->setEnabled(false);
    _listTab->setMinimumHeight(250);
    _titleLit->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);

    _dialogLyt   = new QVBoxLayout(this);
    _dialogLyt->setContentsMargins(5, 5, 5, 5);

    QHBoxLayout* topLyt = new QHBoxLayout();
    searchLyt    = new QVBoxLayout();
    buttonsLyt   = new QVBoxLayout();
    searchStrLyt = new QHBoxLayout();
    selectorsLyt = new QGridLayout();
    tableLyt     = new QVBoxLayout();

    topLyt->setObjectName("topLyt");
    searchLyt->setObjectName("searchLyt");
    buttonsLyt->setObjectName("buttonsLyt");
    searchStrLyt->setObjectName("searchStrLyt");
    selectorsLyt->setObjectName("selectorsLyt");
    tableLyt->setObjectName("tableLyt");

    _dialogLyt->addLayout(topLyt);
    _dialogLyt->addLayout(tableLyt);
    topLyt->addLayout(searchLyt);
    topLyt->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding,
					    QSizePolicy::Minimum));
    topLyt->addLayout(buttonsLyt);
    searchLyt->addItem(searchStrLyt);
    searchLyt->addItem(selectorsLyt);
    searchLyt->setObjectName("searchLyt");

    searchStrLyt->addWidget(_searchLit);
    searchStrLyt->addWidget(_search);
#ifdef Q_WS_MAC
    _search->setMinimumHeight(22);
    selectorsLyt->setVerticalSpacing(6);
#else
    _search->setMinimumHeight(20);
#endif

    selectorsLyt->addWidget(_searchNumber,  0, 0);
    selectorsLyt->addWidget(_searchName,    1, 0);
    selectorsLyt->addWidget(_searchDescrip, 2, 0);
    buttonsLyt->addWidget(_buttonBox);
    buttonsLyt->addItem(new QSpacerItem(20, 0, QSizePolicy::Minimum,
						QSizePolicy::Expanding));
    tableLyt->addWidget(_titleLit);
    tableLyt->addWidget(_listTab);

    ((QBoxLayout*)topLyt)->setStretchFactor(searchLyt, 0);
    ((QBoxLayout*)_dialogLyt)->setStretchFactor(topLyt, 0);
    ((QBoxLayout*)_dialogLyt)->setStretchFactor(tableLyt, 1);

    connect(_listTab,	    SIGNAL(itemSelected(int)),	this, SLOT(sSelect()));
    connect(_buttonBox,	    SIGNAL(accepted()),		this, SLOT(sSelect()));
    connect(_buttonBox,	    SIGNAL(rejected()),		this, SLOT(sClose()));
    connect(_searchNumber,  SIGNAL(clicked()),	        this, SLOT(sFillList()));
    connect(_searchDescrip, SIGNAL(clicked()),  	this, SLOT(sFillList()));
    connect(_search,	    SIGNAL(lostFocus()),	this, SLOT(sFillList()));
    connect(_listTab,	    SIGNAL(valid(bool)),	_select, SLOT(setEnabled(bool)));

    _listTab->addColumn(tr("Number"), -1, Qt::AlignLeft, true, "number");

    if (pParent->inherits("VirtualClusterLineEdit"))
    {
      _parent = (VirtualClusterLineEdit*)(pParent);
      setWindowTitle(_parent->_titlePlural);
      if (_parent->_hasName)
      {
	_listTab->addColumn(tr("Name"),	 -1, Qt::AlignLeft, true, "name");
	_listTab->setColumnWidth(_listTab->columnCount() - 1, 100);
      }

      if (_parent->_hasDescription)
      {
	  _listTab->addColumn(tr("Description"),  -1, Qt::AlignLeft, true, "description" );
	  _listTab->setColumnWidth(_listTab->columnCount() - 1, 100);
      }

      _searchName->setHidden(! _parent->_hasName);
      _searchDescrip->setHidden(! _parent->_hasDescription);
      _id = _parent->_id;
      _titleLit->setText(_parent->_titlePlural);
    }
    else
    {
      _parent = 0;
      _id = -1;
    }
    shortcuts::setStandardKeys(this);
}
AxisDetailsWidget::AxisDetailsWidget(QWidget* parent,
                                     Animation &animation,
                                     Axis &axis,
                                     Engine& engine) :
    ColourGroupGroupWidget(parent, engine),
    iAxis(axis),
    iAnimation(animation),
    iFramesListX(0),
    iFramesListWidth(0),
    iFrameSlider(NULL),
    iGridLayout(NULL) {

    iGridLayout = new QGridLayout();
    iGridLayout->setObjectName(QString::fromUtf8("gridLayout"));

    QSpacerItem* verticalSpacer = new QSpacerItem(20, 115, QSizePolicy::Minimum, QSizePolicy::Expanding);

    QScrollArea* scrollArea = new QScrollArea(this);
    scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
    scrollArea->setWidgetResizable(true);
    scrollArea->setFrameStyle(QFrame::Box);
    scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);

    iScrollAreaWidgetContents = new ScrollContentsWidget(this, animation, axis);
    iScrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
    iScrollAreaWidgetContents->setGeometry(QRect(0, 0, 531, 305));

    QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    sizePolicy.setHorizontalStretch(0);
    sizePolicy.setVerticalStretch(0);
    sizePolicy.setHeightForWidth(iScrollAreaWidgetContents->sizePolicy().hasHeightForWidth());

    iScrollAreaWidgetContents->setSizePolicy(sizePolicy);
    scrollArea->setWidget(iScrollAreaWidgetContents);

    QVBoxLayout* scrollAreaLayout = new QVBoxLayout(iScrollAreaWidgetContents);
    scrollAreaLayout->setObjectName(QString::fromUtf8("scrollAreaLayout"));

    scrollAreaLayout->addLayout(iGridLayout);
    scrollAreaLayout->addItem(verticalSpacer);

    iGridLayout->setVerticalSpacing(FRAME_SPACING);

    iFrameSlider = new QSlider(this);
    iFrameSlider->setObjectName(QString::fromUtf8("horizontalSlider"));
    iFrameSlider->setOrientation(Qt::Horizontal);
    iFrameSlider->setMinimum(iAxis.lowValue());
    iFrameSlider->setMaximum(iAxis.highValue());
    iFrameSlider->setTickPosition(QSlider::TicksBelow);
    iFrameSlider->setPageStep(1);
    iFrameSlider->setSingleStep(1);

    //iGridLayout->addWidget(iFrameSlider, 0, 1, 1, 1);

    iCloseAll = new QToolButton(this);
    iCloseAll->setObjectName(QString::fromUtf8("closeAll"));
    iCloseAll->setIcon(QIcon(":/images/delete.png"));
    iCloseAll->setEnabled(false);

    connect(iCloseAll, SIGNAL(clicked()), this, SLOT(closeAllClicked()));

   // iGridLayout->addWidget(iCloseAll, 0, 2, 1, 1);

    QHBoxLayout* topHorizontalLayout = new QHBoxLayout();
    topHorizontalLayout->setObjectName(QString::fromUtf8("topHorizontalLayout"));

    iSliderSpacer = new QSpacerItem(LED_LABEL_WIDTH + SCROLL_AREA_MARGIN + SLIDER_TICK_OFFSET, iFrameSlider->height(), QSizePolicy::Fixed, QSizePolicy::Fixed);

    topHorizontalLayout->addWidget(iCloseAll);
    topHorizontalLayout->addItem(iSliderSpacer);

    topHorizontalLayout->addWidget(iFrameSlider);
    topHorizontalLayout->addItem(new QSpacerItem(SCROLL_AREA_MARGIN + SLIDER_TICK_OFFSET, iFrameSlider->height(), QSizePolicy::Fixed, QSizePolicy::Fixed));

    QVBoxLayout* contentsLayout = new QVBoxLayout();
    contentsLayout->setObjectName(QString::fromUtf8("contentsLayout"));

    contentsLayout->addLayout(topHorizontalLayout);
    contentsLayout->addWidget(scrollArea);

    QHBoxLayout* mainLayout = new QHBoxLayout(this);
    mainLayout->setObjectName(QString::fromUtf8("mainLayout"));

    mainLayout->addLayout(contentsLayout);

    setAcceptDrops(true);

    connect(iFrameSlider, SIGNAL(valueChanged(int)), &axis, SLOT(setCurrentFrame(int)));
}