예제 #1
0
파일: contenttab.cpp 프로젝트: KDE/kst-plot
ContentTab::ContentTab(QWidget *parent, ObjectStore *store)
  : DialogTab(parent), _store(store) {

  setupUi(this);

  _up->setIcon(KstGetIcon("kst_uparrow"));
  _down->setIcon(KstGetIcon("kst_downarrow"));
  _add->setIcon(KstGetIcon("kst_rightarrow"));
  _remove->setIcon(KstGetIcon("kst_leftarrow"));
  _up->setToolTip(tr("Raise in plot order: Alt+Up"));
  _down->setToolTip(tr("Lower in plot order: Alt+Down"));
  _add->setToolTip(tr("Select: Alt+s"));
  _remove->setToolTip(tr("Remove: Alt+r"));


  connect(_add, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
  connect(_remove, SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
  connect(_up, SIGNAL(clicked()), this, SLOT(upButtonClicked()));
  connect(_down, SIGNAL(clicked()), this, SLOT(downButtonClicked()));

  connect(_add, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_remove, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_up, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_down, SIGNAL(clicked()), this, SIGNAL(modified()));

  connect(_availableRelationList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(availableDoubleClicked(QListWidgetItem*)));
  connect(_displayedRelationList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(displayedDoubleClicked(QListWidgetItem*)));

  connect(_availableRelationList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
  connect(_displayedRelationList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));

  connect(_editSelectedAvailable, SIGNAL(clicked()), this, SLOT(editSelectedAvailable()));
  connect(_editSelectedDisplayed, SIGNAL(clicked()), this, SLOT(editSelectedDisplayed()));

}
예제 #2
0
파일: datawizard.cpp 프로젝트: KDE/kst-plot
DataWizardPageVectors::DataWizardPageVectors(QWidget *parent)
  : QWizardPage(parent) {
   setupUi(this);

  _up->setIcon(KstGetIcon("kst_uparrow"));
  _down->setIcon(KstGetIcon("kst_downarrow"));
  _add->setIcon(KstGetIcon("kst_rightarrow"));
  _remove->setIcon(KstGetIcon("kst_leftarrow"));
  _up->setToolTip(tr("Raise in plot order: Alt+Up"));
  _down->setToolTip(tr("Lower in plot order: Alt+Down"));
  _add->setToolTip(tr("Select: Alt+s"));
  _remove->setToolTip(tr("Remove: Alt+r"));

  connect(_add, SIGNAL(clicked()), this, SLOT(add()));
  connect(_remove, SIGNAL(clicked()), this, SLOT(remove()));
  connect(_up, SIGNAL(clicked()), this, SLOT(up()));
  connect(_down, SIGNAL(clicked()), this, SLOT(down()));
  connect(_vectors, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(add()));
  connect(_vectorsToPlot, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(remove()));
  connect(_vectorReduction, SIGNAL(textChanged(QString)), this, SLOT(filterVectors(QString)));
  connect(_vectorSearch, SIGNAL(clicked()), this, SLOT(searchVectors()));

  _vectors->setSortingEnabled(false);
  _vectorsToPlot->setSortingEnabled(false);
}
예제 #3
0
VectorSelector::VectorSelector(QWidget *parent, ObjectStore *store)
  : QWidget(parent), _allowEmptySelection(false), _isX(false), _store(store)  {

  setupUi(this);

  int size = style()->pixelMetric(QStyle::PM_SmallIconSize);

  _newVector->setIcon(KstGetIcon("kst_vectornew"));
  _editVector->setIcon(KstGetIcon("kst_vectoredit"));

  _newVector->setFixedSize(iconWidth(), iconWidth());
  _editVector->setFixedSize(iconWidth(), iconWidth());

  fillVectors();
  connect(_newVector, SIGNAL(pressed()), this, SLOT(newVector()));
  connect(_editVector, SIGNAL(pressed()), this, SLOT(editVector()));
  connect(_vector, SIGNAL(activated(int)), this, SLOT(emitSelectionChanged()));
  connect(_vector, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDescriptionTip()));
  connect(UpdateServer::self(), SIGNAL(objectListsChanged()), this, SLOT(fillVectors()));
}
예제 #4
0
StringSelector::StringSelector(QWidget *parent, ObjectStore *store)
  : QWidget(parent), _allowEmptySelection(false), _store(store) {

  setupUi(this);

  int size = style()->pixelMetric(QStyle::PM_SmallIconSize);

  _newString->setIcon(KstGetIcon("kst_stringnew"));
  _editString->setIcon(KstGetIcon("kst_stringedit"));

  _newString->setFixedSize(size + 8, size + 8);
  _editString->setFixedSize(size + 8, size + 8);
  _selectString->setFixedSize(size + 8, size + 8);

  fillStrings();

  connect(_newString, SIGNAL(pressed()), this, SLOT(newString()));
  connect(_editString, SIGNAL(pressed()), this, SLOT(editString()));
  connect(_string, SIGNAL(currentIndexChanged(int)), this, SLOT(emitSelectionChanged()));
  connect(_string, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDescriptionTip()));
}
예제 #5
0
void DataSourceSelector::setup() {

  _fileEdit = new QLineEdit(this);
  _fileButton = new QToolButton(this);

  int h = fontMetrics().lineSpacing()*4/3;

  _fileEdit->setFixedHeight(h);


  QHBoxLayout * layout = new QHBoxLayout(this);
  layout->setMargin(0);
  layout->addWidget(_fileEdit);
  layout->addWidget(_fileButton);

  _fileButton->setFixedSize(h,h);
  setLayout(layout);

  //int size = style()->pixelMetric(QStyle::PM_SmallIconSize);
  _fileButton->setFixedSize(h,h);
  _fileButton->setIcon(KstGetIcon("kst_changefile"));
  //qDebug() << "file button small icon size" << size;

  setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
  //connect (_fileEdit, SIGNAL(textChanged(const QString &)), this, SIGNAL(changed(const QString &)));
  connect (_fileEdit, SIGNAL(textChanged(QString)), this, SLOT(updateFile(QString)));
  connect (_fileButton, SIGNAL(clicked()), this, SLOT(chooseFile()));

  QFileSystemModel *dirModel = new QFileSystemModel;
  dirModel->setFilter(QDir::AllEntries);
  dirModel->setRootPath(QString('/'));

  QCompleter *completer = new QCompleter(this);
  completer->setModel(dirModel); 

  _fileEdit->setCompleter(completer);
  setFixedHeight(h);
}
예제 #6
0
Application::Application(int &argc, char **argv)
    : QApplication(argc, argv) {

  QCoreApplication::setApplicationName("Kst");
  setWindowIcon(KstGetIcon("kst"));

  Builtins::initPrimitives(); //libkst
  Builtins::initDataSources(); //libkstapp
  Builtins::initObjects();    //libkstmath
  Builtins::initRelations();  //libkstmath
  Builtins::initGraphics();   //libkstapp

  //Replace the data singleton with one that actually works
  Data::replaceSelf(new DataGui);

  //Replace the dialoglauncher singleton with one that actually works
  DialogLauncher::replaceSelf(new DialogLauncherGui);

  //Also give us dialog-script scripting functionality
  //DialogLauncherSI::self = new DialogLauncherSI;

  //_mainWindow->show();
  //_mainWindow->hide();
}
예제 #7
0
파일: labeltab.cpp 프로젝트: KDE/kst-plot
LabelTab::LabelTab(PlotItem* plotItem, QWidget *parent)
  : DialogTab(parent), _plotItem(plotItem), _activeLineEdit(0), _fontDirty(false) {

  setupUi(this);

  int h = fontMetrics().lineSpacing();
  _globalLabelBold->setIcon(KstGetIcon("kst_bold"));
  _globalLabelBold->setFixedHeight(h);
  _globalLabelBold->setFixedWidth(h);
  _globalLabelItalic->setIcon(KstGetIcon("kst_italic"));
  _globalLabelItalic->setFixedHeight(h);
  _globalLabelItalic->setFixedWidth(h);
  _globalLabelColor->setFixedHeight(h);
  _globalLabelColor->setFixedWidth(h);

  _topLabelText->setFixedHeight(h*4/3);
  _bottomLabelText->setFixedHeight(h*4/3);
  _leftLabelText->setFixedHeight(h*4/3);
  _rightLabelText->setFixedHeight(h*4/3);

  setTabTitle(tr("Labels"));

  setGlobalFont(_plotItem->globalFont());
  _globalLabelColor->setColor(_plotItem->globalFontColor());
  _globalLabelFontSize->setValue(_plotItem->globalFontScale());

  _topLabelText->setObjectStore(kstApp->mainWindow()->document()->objectStore());
  _bottomLabelText->setObjectStore(kstApp->mainWindow()->document()->objectStore());
  _leftLabelText->setObjectStore(kstApp->mainWindow()->document()->objectStore());
  _rightLabelText->setObjectStore(kstApp->mainWindow()->document()->objectStore());

  connect(_topLabelText, SIGNAL(textChanged()), this, SIGNAL(modified()));
  connect(_leftLabelText, SIGNAL(textChanged()), this, SIGNAL(modified()));
  connect(_bottomLabelText, SIGNAL(textChanged()), this, SIGNAL(modified()));
  connect(_rightLabelText, SIGNAL(textChanged()), this, SIGNAL(modified()));

  connect(_topLabelText, SIGNAL(textChanged()), this, SLOT(_enableLabelLabels()));
  connect(_bottomLabelText, SIGNAL(textChanged()), this, SLOT(_enableLabelLabels()));
  connect(_leftLabelText, SIGNAL(textChanged()), this, SLOT(_enableLabelLabels()));
  connect(_rightLabelText, SIGNAL(textChanged()), this, SLOT(_enableLabelLabels()));

  connect(_autoScaleNumberAxis, SIGNAL(stateChanged(int)), this, SIGNAL(modified()));
  connect(_showLegend, SIGNAL(stateChanged(int)), this, SIGNAL(modified()));

  connect(_editLegendContents, SIGNAL(pressed()), _plotItem->legend(), SLOT(edit()));

  connect(_globalLabelFontSize, SIGNAL(valueChanged(double)), this, SIGNAL(globalFontUpdate()));
  connect(_globalLabelBold, SIGNAL(toggled(bool)), this, SIGNAL(globalFontUpdate()));
  connect(_globalLabelItalic, SIGNAL(toggled(bool)), this, SIGNAL(globalFontUpdate()));
  connect(_globalLabelFontFamily, SIGNAL(currentFontChanged(QFont)), this, SIGNAL(globalFontUpdate()));
  connect(_globalLabelColor, SIGNAL(changed(QColor)), this, SIGNAL(globalFontUpdate()));
  connect(_globalLabelBold, SIGNAL(toggled(bool)), this, SLOT(buttonUpdate()));
  connect(_globalLabelItalic, SIGNAL(toggled(bool)), this, SLOT(buttonUpdate()));

  connect(_topLabelAuto, SIGNAL(toggled(bool)), this, SIGNAL(modified()));
  connect(_leftLabelAuto, SIGNAL(toggled(bool)), this, SIGNAL(modified()));
  connect(_bottomLabelAuto, SIGNAL(toggled(bool)), this, SIGNAL(modified()));
  connect(_rightLabelAuto, SIGNAL(toggled(bool)), this, SIGNAL(modified()));

  connect(_topLabelAuto, SIGNAL(toggled(bool)), this, SLOT(activateFields()));
  connect(_leftLabelAuto, SIGNAL(toggled(bool)), this, SLOT(activateFields()));
  connect(_bottomLabelAuto, SIGNAL(toggled(bool)), this, SLOT(activateFields()));
  connect(_rightLabelAuto, SIGNAL(toggled(bool)), this, SLOT(activateFields()));

}