Example #1
0
DimensionModify::DimensionModify(QWidget* parent,
#if QT_VERSION < 0x040000
                                 const char* name, WFlags f
#else
                                 Qt::WFlags flags
#endif
                                 )
  : QDialog(parent,
#if QT_VERSION < 0x040000
            name,false,f
#else
            flags
#endif
            ),
    _ui(NULL)
{
#if QT_VERSION < 0x040000
  _ui = new DimensionModifyBase(this);
#else
  _ui = new Ui::DimensionModify;
  _ui->setupUi(this);
#endif

  QIntValidator* intv = new QIntValidator(this);

  _ui->_dimensionX->setValidator(intv);
  _ui->_dimensionY->setValidator(intv);
  _ui->_dimensionZ->setValidator(intv);

  connect(_ui->_ok,SIGNAL(clicked()),SLOT(okSlot()));
}
Example #2
0
RemapVoxels::RemapVoxels(QWidget* parent,
#if QT_VERSION < 0x040000
                                 const char* name, WFlags f
#else
                                 Qt::WFlags flags
#endif
                                 )
  : QDialog(parent,
#if QT_VERSION < 0x040000
            name,false,f
#else
            flags
#endif
            ),
    _ui(NULL)
{
#if QT_VERSION < 0x040000
  _ui = new RemapVoxelsBase(this);
#else
  _ui = new Ui::RemapVoxels;
  _ui->setupUi(this);
#endif

  QDoubleValidator* doublev = new QDoubleValidator(this);
  _ui->_minValue->setValidator(doublev);
  _ui->_maxValue->setValidator(doublev);

  connect(_ui->_ok,SIGNAL(clicked()),SLOT(okSlot()));
}
Example #3
0
Setting::Setting(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Setting)
{
    ui->setupUi(this);
    this->setWindowTitle("Settings");
    this->setMaximumSize(543,441);
    this->setMinimumSize(543,441);
    readTxt();
    connect(ui->applyButton,SIGNAL(clicked()),this,SLOT(applySlot()));
    connect(ui->okButton,SIGNAL(clicked()),this,SLOT(okSlot()));
}
Example #4
0
CFrmSettings::CFrmSettings()
{
    this->gvc = gvContext();
    Ui_Dialog tempDia;
    tempDia.setupUi(this);
    graph = NULL;
    activeWindow = NULL;
    QString path;
#ifndef WIN32
    char *s = getenv("GVEDIT_PATH");
    if (s)
	path = s;
    else
	path = GVEDIT_DATADIR;
#endif

    connect(WIDGET(QPushButton, pbAdd), SIGNAL(clicked()), this,
	    SLOT(addSlot()));
    connect(WIDGET(QPushButton, pbNew), SIGNAL(clicked()), this,
	    SLOT(newSlot()));
    connect(WIDGET(QPushButton, pbOpen), SIGNAL(clicked()), this,
	    SLOT(openSlot()));
    connect(WIDGET(QPushButton, pbSave), SIGNAL(clicked()), this,
	    SLOT(saveSlot()));
    connect(WIDGET(QPushButton, btnOK), SIGNAL(clicked()), this,
	    SLOT(okSlot()));
    connect(WIDGET(QPushButton, btnCancel), SIGNAL(clicked()), this,
	    SLOT(cancelSlot()));
    connect(WIDGET(QPushButton, pbOut), SIGNAL(clicked()), this,
	    SLOT(outputSlot()));
    connect(WIDGET(QPushButton, pbHelp), SIGNAL(clicked()), this,
	    SLOT(helpSlot()));

    connect(WIDGET(QComboBox, cbScope), SIGNAL(currentIndexChanged(int)),
	    this, SLOT(scopeChangedSlot(int)));
    scopeChangedSlot(0);


#ifndef WIN32
    loadAttrs(path + "/attrs.txt", WIDGET(QComboBox, cbNameG),
	      WIDGET(QComboBox, cbNameN), WIDGET(QComboBox, cbNameE));
#else
    loadAttrs("../share/graphviz/gvedit/attributes.txt",
	      WIDGET(QComboBox, cbNameG), WIDGET(QComboBox, cbNameN),
	      WIDGET(QComboBox, cbNameE));
#endif
    setWindowIcon(QIcon(":/images/icon.png"));
}
Example #5
0
EditToolBar::EditToolBar(QWidget *parent) :
    QDialog(parent)
{
    //configure u
    ui.setupUi(this);

    //no search made yet
    searchMade = false;

    //icons size - copied from kedittoolbar class, in kdelibs
    iconSize = this->style()->pixelMetric(QStyle::PM_SmallIconSize);

    //separator item
    separatorItem = new QListWidgetItem(QString("--- %1 ---").arg(tr("Separator")));
    separatorItem->setData(32, "_separator");

    //setup icons
    ui.okButton->setIcon(QIcon::fromTheme("dialog-ok"));
    ui.applyButton->setIcon(QIcon::fromTheme("dialog-ok-apply"));
    ui.cancelButton->setIcon(QIcon::fromTheme("dialog-cancel"));
    ui.clearButton1->setIcon(QIcon::fromTheme("edit-clear-locationbar-rtl"));
    ui.clearButton2->setIcon(QIcon::fromTheme("edit-clear-locationbar-rtl"));
    ui.addButton->setIcon(QIcon::fromTheme("go-next"));
    ui.removeButton->setIcon(QIcon::fromTheme("go-previous"));
    ui.moveDownButton->setIcon(QIcon::fromTheme("go-down"));
    ui.moveUpButton->setIcon(QIcon::fromTheme("go-up"));
    ui.setDefaultsButton->setIcon(QIcon::fromTheme("document-revert"));

    //connections
    connect(this, SIGNAL(actionsListChanged()), this, SLOT(updateButtons()));
    connect(ui.currentActions, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
    connect(ui.availableActions, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
    connect(this, SIGNAL(actionsListChanged()), this, SLOT(actionsChangedSlot()));
    connect(ui.okButton, SIGNAL(clicked()), this, SLOT(okSlot()));
    connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applySlot()));
    connect(ui.addButton, SIGNAL(clicked()), this, SLOT(addAction()));
    connect(ui.removeButton, SIGNAL(clicked()), this, SLOT(removeAction()));
    connect(ui.moveDownButton, SIGNAL(clicked()), this, SLOT(moveDownAction()));
    connect(ui.moveUpButton, SIGNAL(clicked()), this, SLOT(moveUpAction()));
    connect(ui.currentFilter, SIGNAL(textChanged(QString)), this, SLOT(searchInCurrentActionsSlot(QString)));
    connect(ui.availableFilter, SIGNAL(textChanged(QString)), this, SLOT(searchInAvailableActionsSlot(QString)));
    connect(ui.setDefaultsButton, SIGNAL(clicked()), this, SLOT(setDefaults()));

    this->setWindowTitle(tr("Configure toolbar"));
}
Example #6
0
EditToolBar::EditToolBar(QWidget *parent) :
    QDialog(parent)
{
    ui.setupUi(this);
    ui.okButton->setIcon(QIcon::fromTheme("dialog-ok"));
    ui.applyButton->setIcon(QIcon::fromTheme("dialog-ok-apply"));
    ui.cancelButton->setIcon(QIcon::fromTheme("dialog-cancel"));

    tbe = new ToolBarEdit(this);
    tbe->setMaximumWidth(ui.widget->maximumWidth());
    tbe->setMaximumHeight(ui.widget->maximumHeight());

    connect(tbe, SIGNAL(actionsListChanged()), this, SLOT(actionsChangedSlot()));
    connect(ui.okButton, SIGNAL(clicked()), this, SLOT(okSlot()));
    connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applySlot()));

    ui.widget = tbe;

    this->setWindowTitle(tr("Configure toolbar"));
}
AddMonitorWidget::AddMonitorWidget(QWidget* parent):QWidget(parent)
{
    filterlabel = new QLabel(tr("过滤"));
    listwidget = new QListWidget;

    QHBoxLayout*   rowlayout1 = new QHBoxLayout;
    rowlayout1->addWidget(filterlabel);
    QHBoxLayout*   rowlayout2 = new QHBoxLayout;
    rowlayout2->addWidget(new QLabel(tr("日期:")));
    rowlayout2->addWidget(new QLabel(tr("从")));
    startdate = new QLineEdit;
    startdate->setStyleSheet("max-width: 150;");
    rowlayout2->addWidget(startdate);
    rowlayout2->addWidget(new QLabel(tr("到")));
    enddate = new QLineEdit;
    enddate->setStyleSheet("max-width: 150;");
    rowlayout2->addWidget(enddate);
    rowlayout2->addStretch();
    QHBoxLayout*  rowlayout3 = new QHBoxLayout;
    rowlayout3->addWidget(new QLabel(tr("后缀:")));
    rowlayout3->addWidget(new QLabel(tr(".")));
    suffix = new QLineEdit;
    suffix->setStyleSheet("max-width: 150;");
    rowlayout3->addWidget(suffix);
    rowlayout3->addStretch();
    QHBoxLayout*  rowlayout4 = new QHBoxLayout;
    rowlayout4->addWidget(new QLabel(tr("大小:")));
    rowlayout4->addWidget(new QLabel(tr("从")));
    startsize = new QLineEdit;
    startsize->setStyleSheet("max-width: 150;");
    endsize = new QLineEdit;
    endsize->setStyleSheet("max-width: 150;"); 
    rowlayout4->addWidget(startsize);
    rowlayout4->addWidget(new QLabel(tr("到")));
    rowlayout4->addWidget(endsize);
    rowlayout4->addStretch();
    QHBoxLayout*  rowlayout5 = new QHBoxLayout;
    folderCBox = new QCheckBox(tr("目录"));
    fileCBox = new QCheckBox(tr("文件"));
    rowlayout5->addWidget(folderCBox);
    rowlayout5->addWidget(fileCBox);
    rowlayout5->addStretch();
    QHBoxLayout*  rowlayout6 = new QHBoxLayout;
    QPushButton*  okbutton = new QPushButton(tr("保存"));
    QPushButton*  cancelbutton = new QPushButton(tr("取消"));
    rowlayout6->addWidget(cancelbutton);
    rowlayout6->addWidget(okbutton);
    QVBoxLayout*  mainlayout = new QVBoxLayout;
    mainlayout->addLayout(rowlayout1);
    mainlayout->addLayout(rowlayout2);
    mainlayout->addLayout(rowlayout3);
    mainlayout->addLayout(rowlayout4);
    mainlayout->addLayout(rowlayout5);
    mainlayout->addWidget(listwidget);
    mainlayout->addLayout(rowlayout6);
    this->setLayout(mainlayout);

    this->ShowFolder("/home/lyh");

    connect(listwidget,SIGNAL(itemDoubleClicked(QListWidgetItem*)),this,SLOT(ShowFolderSlot(QListWidgetItem*)));
    connect(cancelbutton,SIGNAL(clicked()),this,SLOT(close()));
    connect(okbutton,SIGNAL(clicked()),this,SLOT(okSlot()));
}