void BedCorrelationItemView::slotCustomContextMenuRequested(const QPoint& p) {
    QMenu* m = new QMenu(this);

    QAction* reloadA = new QAction(tr("Reload"), this);
    QAction* createA = new QAction(tr("Create BedCorrelation..."), this);
    QAction* editA = new QAction(tr("Edit..."), this);
    QAction* deleteA = new QAction(tr("Delete"), this);

    connect(reloadA, SIGNAL(activated()), this, SLOT(slotReload()));
    connect(createA, SIGNAL(activated()), this, SLOT(slotCreate()));
    connect(editA, SIGNAL(activated()), this, SLOT(slotEdit()));
    connect(deleteA, SIGNAL(activated()), this, SLOT(slotDelete()));

    m->addAction(createA);

    if (selectedIndexes().count() == 1) {
        m->insertSeparator(editA);
        m->addAction(editA);
    }

    if (selectedIndexes().count() > 0) {
        m->insertSeparator(deleteA);
        m->addAction(deleteA);
    }
    m->addAction(reloadA);
    m->exec(mapToGlobal(p));
}
예제 #2
0
BaseMainWindow::BaseMainWindow(QWidget *parent) :
    QMainWindow(parent)
{
    connect(this, SIGNAL(sigCreate()), this, SLOT(slotCreate()), Qt::QueuedConnection);
    connect(this, SIGNAL(sigDestroy()), this, SLOT(slotDestroy()), Qt::QueuedConnection);

    m_nStatus=ESTATUS_UNKNOW;
    emit sigCreate();
}
예제 #3
0
void SliderGenerator::connectButton()
{
	connect(buttonMainTemplate, SIGNAL(clicked()), this, SLOT(slotChooseMainTemplate()));
	connect(buttonRadioTemplate, SIGNAL(clicked()), this, SLOT(slotChooseRadioTemplate()));
	connect(buttonRadioCheckedTemplate, SIGNAL(clicked()), this, SLOT(slotChooseRadioCheckedTemplate()));
	connect(buttonSlideTemplate, SIGNAL(clicked()), this, SLOT(slotChooseSlideTemplate()));
	connect(buttonLabelTemplate, SIGNAL(clicked()), this, SLOT(slotChooseLabelTemplate()));
	connect(buttonCSSControlTemplate, SIGNAL(clicked()), this, SLOT(slotChooseCSSControlTemplate()));
	connect(buttonOutFile, SIGNAL(clicked()), this, SLOT(slotChooseOutfile()));
	connect(buttonCreate, SIGNAL(clicked()), this, SLOT(slotCreate()));
}
ProfileNewDlg::ProfileNewDlg(QWidget *parent)
:QDialog(parent)
{
	setupUi(this);
	setModal(true);
	setWindowTitle(CAP(caption()));

	bg_defAct->setButton(bg_defAct->id((Q3Button *)rb_chat));
	le_name->setFocus();

	connect(pb_create, SIGNAL(clicked()), SLOT(slotCreate()));
	connect(pb_close, SIGNAL(clicked()), SLOT(reject()));
	connect(le_name, SIGNAL(textChanged(const QString &)), SLOT(nameModified()));

	nameModified();
}
예제 #5
0
ProfileNewDlg::ProfileNewDlg(QWidget *parent)
:QDialog(parent)
{
	setupUi(this);
	setModal(true);
	setWindowTitle(CAP(windowTitle()));

	buttonGroup_ = new QButtonGroup(this);
	buttonGroup_->addButton(rb_message, 0);
	buttonGroup_->addButton(rb_chat, 1);
	rb_chat->setChecked(true);

	le_name->setFocus();

	connect(pb_create, SIGNAL(clicked()), SLOT(slotCreate()));
	connect(pb_close, SIGNAL(clicked()), SLOT(reject()));
	connect(le_name, SIGNAL(textChanged(const QString &)), SLOT(nameModified()));

	nameModified();
}
BedCorrelationItemView::BedCorrelationItemView(QWidget* p, BedCorrelationItemModel* model)
: TreeView(p),
_profileCorrelation(0) {
    // setSortingEnabled(true);
    setEnabled(false);

    setModel(model);
    connect(model, SIGNAL(reloaded()), this, SLOT(slotReloaded()));

    setContextMenuPolicy(Qt::CustomContextMenu);

    connect(this, SIGNAL(activated(const QModelIndex&)), this, SLOT(slotIndexActivated(const QModelIndex&)));
    connect(this, SIGNAL(clicked(const QModelIndex&)), this, SLOT(slotIndexActivated(const QModelIndex&)));

    connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(slotCustomContextMenuRequested(const QPoint&)));
    connect(this, SIGNAL(reloadRequest()), model, SLOT(reload()));
    connect(this, SIGNAL(createBedCorrelationRequest()), model, SLOT(slotCreate()));
    connect(this, SIGNAL(editRequest(const QModelIndex&)), model, SLOT(slotEdit(const QModelIndex&)));
    connect(this, SIGNAL(deleteRequest(QModelIndexList)), model, SLOT(slotDelete(QModelIndexList)));
}
예제 #7
0
PackageDialog::PackageDialog(QWidget *parent_, bool create_)
			: QDialog(parent_) //, 0, TRUE, Qt::WDestructiveClose)
{
  all = new QVBoxLayout(this);
  all->setMargin(5);
  all->setSpacing(6);

  QHBoxLayout *h2 = new QHBoxLayout();

  if(create_) {  // create or extract package ?
    setWindowTitle(tr("Create Project Package"));

    QHBoxLayout *h1 = new QHBoxLayout();
    all->addLayout(h1);
    QLabel *packLabel = new QLabel(tr("Package:"));
    NameEdit = new QLineEdit();
    QPushButton *ButtBrowse = new QPushButton(tr("Browse"));
    connect(ButtBrowse, SIGNAL(clicked()), SLOT(slotBrowse()));
    h1->addWidget(packLabel);
    h1->addWidget(NameEdit);
    h1->addWidget(ButtBrowse);

    LibraryCheck = new QCheckBox(tr("include user libraries"));
    all->addWidget(LibraryCheck);

    Group = new QGroupBox(tr("Choose projects:"));
    all->addWidget(Group);
    
    QScrollArea *scrollArea = new QScrollArea(Group);
    scrollArea->setWidgetResizable(true);
    
    QWidget *scrollWidget = new QWidget();
    
    QVBoxLayout *checkBoxLayout = new QVBoxLayout();
    scrollWidget->setLayout(checkBoxLayout);
    scrollArea->setWidget(scrollWidget);
    
    QVBoxLayout *areaLayout = new QVBoxLayout();
    areaLayout->addWidget(scrollArea);
    Group->setLayout(areaLayout);
    
    // ...........................................................
    all->addLayout(h2);
    QPushButton *ButtCreate = new QPushButton(tr("Create"));
    h2->addWidget(ButtCreate);
    connect(ButtCreate, SIGNAL(clicked()), SLOT(slotCreate()));
    QPushButton *ButtCancel = new QPushButton(tr("Cancel"));
    h2->addWidget(ButtCancel);
    connect(ButtCancel, SIGNAL(clicked()), SLOT(reject()));

    // ...........................................................
    // insert all projects
    QStringList PrDirs = QucsSettings.QucsHomeDir.entryList("*", QDir::Dirs, QDir::Name);
    QStringList::iterator it;
    for(it = PrDirs.begin(); it != PrDirs.end(); it++)
       if((*it).right(4) == "_prj"){   // project directories end with "_prj"
         QCheckBox *subCheck = new QCheckBox((*it).left((*it).length()-4));
         checkBoxLayout->addWidget(subCheck);
         BoxList.append(subCheck);
       }
    
    //QColor theColor;
    if(BoxList.isEmpty()) {
      ButtCreate->setEnabled(false);
      //theColor =
      //   (new QLabel(tr("No projects!"), Dia_Box))->paletteBackgroundColor();
      QLabel *noProj = new QLabel(tr("No projects!"));
      checkBoxLayout->addWidget(noProj);              
    }
    //else
    //  theColor = BoxList.current()->paletteBackgroundColor();
    //Dia_Scroll->viewport()->setPaletteBackgroundColor(theColor);
  }

  else {  // of "if(create_)"
    setWindowTitle(tr("Extract Project Package"));

    MsgText = new QTextEdit(this);
    MsgText->setTextFormat(Qt::PlainText);
    MsgText->setWordWrapMode(QTextOption::NoWrap);
    MsgText->setReadOnly(true);
    all->addWidget(MsgText);

    all->addLayout(h2);
    h2->addStretch(5);
    ButtClose = new QPushButton(tr("Close"));
    h2->addWidget(ButtClose);
    ButtClose->setDisabled(true);
    connect(ButtClose, SIGNAL(clicked()), SLOT(accept()));

    resize(400, 250);
  }
}