void MainWindow::connectSignals()
{
    for(auto iter = kProperties.constBegin(); iter != kProperties.constEnd(); ++iter)
    {
        QSignalMapper *mapper = new QSignalMapper(this);
        mapper->setMapping(mWindow, iter.key());
        connect(mapper, SIGNAL(mapped(int)), SLOT(onMapped(int)));

        const QMetaObject *meta = mapper->metaObject();
        connect(mWindow, QQmlProperty(mWindow, iter.value()).property().notifySignal(),
                mapper, meta->method(meta->indexOfMethod("map()")));
    }
    connect(mWindow, SIGNAL(saveClicked()), SIGNAL(saveClicked()));
    connect(mWindow, SIGNAL(updateViewClicked()), SIGNAL(updateViewClicked()));
}
Exemplo n.º 2
0
void MainWindow::setupConnections()
{
    // connect signals for menu actions
    connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveClicked()));
    connect(ui->actionLoad, SIGNAL(triggered()), this, SLOT(loadClicked()));
    connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(close()));
    connect(ui->actionShowTable, SIGNAL(triggered()), _pointsWidget, SLOT(show()));

    // connect signals to control calculation process (start, stop, pause, processed, ...)
    connect(this, SIGNAL(startProcessing()), _plotBuilder, SLOT(start()));
    connect(ui->stopButton, SIGNAL(clicked()), _plotBuilder, SLOT(stop()));
    connect(this, SIGNAL(pauseProcessing()), _plotBuilder, SLOT(pause()));
    connect(this, SIGNAL(resumeProcessing()), _plotBuilder, SLOT(resume()));

    // connect signals to intercept and display calculation results
    connect(_plotBuilder, SIGNAL(finished()), this, SLOT(processingFinished()));
    connect(_plotBuilder, SIGNAL(processed(double, double, double)), this, SLOT(valueProcessed(double, double, double)));

    // connect signals to populate or clear points collection
    connect(_plotBuilder, SIGNAL(processed(double, double, double)), _points, SLOT(addPoint(double, double)));
    connect(_plotBuilder, SIGNAL(started()), _points, SLOT(clear()));

    // connect signals to update widget that displays points collection
    connect(this, SIGNAL(startProcessing()), _pointsWidget, SLOT(updatePage()));
    connect(this, SIGNAL(pauseProcessing()), _pointsWidget, SLOT(updatePage()));
    connect(_plotBuilder, SIGNAL(finished()), _pointsWidget, SLOT(updatePage()));
}
void SvCreator::addEvents(void)
{
  connect(m_subMenus["NewFile"],SIGNAL(triggered(bool)),this,SLOT(newView()));
  connect(m_subMenus["NewNode"],SIGNAL(triggered(bool)),this,SLOT(newNode()));
  connect(m_subMenus["CopySelected"],SIGNAL(triggered(bool)),this,SLOT(copySelected()));
  connect(m_subMenus["PasteFromSelected"],SIGNAL(triggered(bool)),this,SLOT(pasteFromSelected()));
  connect(m_subMenus["DeleteNode"],SIGNAL(triggered(bool)),this,SLOT(deleteNode()));
  connect(m_subMenus["Open"],SIGNAL(triggered(bool)),this,SLOT(open()));
  connect(m_subMenus["Save"],SIGNAL(triggered(bool)),this,SLOT(save()));
  connect(m_subMenus["SaveAs"], SIGNAL(triggered(bool)), this, SLOT(saveAs()));
  connect(m_subMenus["ImportHostGroupAsBusinessView"],SIGNAL(triggered(bool)),this,SLOT(handleImportHostGroupAsBusinessView()));
  connect(m_subMenus["ImportMonitorItemsAsDataPoints"],SIGNAL(triggered(bool)),this,SLOT(handleImportMonitorItemsAsDataPoints()));
  connect(m_subMenus["ImportNagiosChecks"],SIGNAL(triggered(bool)),this,SLOT(importNagiosChecks()));
  connect(m_subMenus["ImportNagiosBPIConf"],SIGNAL(triggered(bool)),this,SLOT(handleImportNagiosBPIConfigAsBusinessView()));
  connect(m_subMenus["ImportZabbixITServices"],SIGNAL(triggered(bool)),this,SLOT(handleImportZabbixITServicesAsBusinessView()));
  connect(m_subMenus["Quit"],SIGNAL(triggered(bool)),this,SLOT(treatCloseAction()));
  connect(m_subMenus["ShowAbout"],SIGNAL(triggered(bool)),this,SLOT(handleShowAbout()));
  connect(m_subMenus["ShowOnlineResources"],SIGNAL(triggered(bool)),this,SLOT(handleShowOnlineResources()));
  connect(m_editor,SIGNAL(saveClicked()),this,SLOT(save()));
  connect(m_editor,SIGNAL(closeClicked()),this,SLOT(treatCloseAction()));
  connect(m_editor,SIGNAL(returnPressed()),this,SLOT(handleReturnPressed()));
  connect(m_editor,SIGNAL(nodeTypeActivated(qint32)),this,SLOT(handleNodeTypeActivated(qint32)));
  connect(m_editor,SIGNAL(errorOccurred(QString)),this, SLOT(handleErrorOccurred(QString)));
  connect(m_tree,SIGNAL(itemSelectionChanged()),this,SLOT(handleSelectedNodeChanged()));
  connect(m_tree,SIGNAL(treeNodeMoved(QString)),this,SLOT(handleTreeNodeMoved(QString)));
}
Exemplo n.º 4
0
ScreenControl::ScreenControl(QWidget *parent) : 
  QWidget(parent)
{
  setupUi(this);
  _autoSave=false;
  _keyColumns=1;
  _searchType=Query;
  _shown=false;
  _listReportName=QString();
  _print->setVisible(! _listReportName.isEmpty());
  
  _model = new XSqlTableModel;
  
  connect (_new,	SIGNAL(clicked()),	this,	SLOT(newRow()));
  connect (_save,       SIGNAL(clicked()),      this,   SIGNAL(saveClicked()));
  connect (_save,	SIGNAL(clicked()),	this,	SLOT(save()));
  connect (_print,	SIGNAL(clicked()),	this,	SIGNAL(printClicked()));
  connect (_print,      SIGNAL(clicked()),      this,   SLOT(print()));
  connect (_prev,	SIGNAL(clicked()),	this,	SLOT(toPrevious()));
  connect (_next,	SIGNAL(clicked()),	this,	SLOT(toNext()));
  connect (_search,	SIGNAL(clicked()),	this,	SLOT(search()));
  connect (_model,      SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(enableSave()));
  
  _view->setVisible(FALSE);
  _save->setEnabled(false);

  _model->setEditStrategy(QSqlTableModel::OnManualSubmit);
}
Exemplo n.º 5
0
ComSettings::ComSettings(QWidget *parent) : QWidget(parent)
{
	ui.setupUi(this);
	connect(ui.cancelPushButton,SIGNAL(clicked()),this,SIGNAL(cancelClicked()));
	connect(ui.savePushButton,SIGNAL(clicked()),this,SIGNAL(saveClicked()));
	connect(ui.datalogLocationBrowseButton,SIGNAL(clicked()),this,SLOT(browseLogFolderClicked()));
}
Exemplo n.º 6
0
QWidget* medDatabaseDataSource::mainViewWidget()
{
    if(d->mainWidget.isNull())
    {
        d->mainWidget = new QWidget;
        d->largeView = new medDatabaseView(d->mainWidget);
        d->largeView->setModel(d->proxy);

        QVBoxLayout *database_layout = new QVBoxLayout(d->mainWidget);
        database_layout->setContentsMargins(0, 0, 0, 0);
        database_layout->setSpacing(0);
        database_layout->addWidget(d->largeView);

        connect(d->largeView, SIGNAL(open(const medDataIndex&)), this, SIGNAL(open(const medDataIndex&)));
        connect(d->largeView, SIGNAL(exportData(const medDataIndex&)), this, SIGNAL(exportData(const medDataIndex&)));
        connect(d->largeView, SIGNAL(dataRemoved(const medDataIndex&)), this, SIGNAL(dataRemoved(const medDataIndex&)));

        if(!d->toolBoxes.isEmpty())
        {
            connect(d->actionsToolBox, SIGNAL(removeClicked()), d->largeView, SLOT(onRemoveSelectedItemRequested()));
            connect(d->actionsToolBox, SIGNAL(exportClicked()), d->largeView, SLOT(onExportSelectedItemRequested()));
            connect(d->actionsToolBox, SIGNAL(viewClicked()), d->largeView, SLOT(onViewSelectedItemRequested()));
            connect(d->actionsToolBox, SIGNAL(saveClicked()), d->largeView, SLOT(onSaveSelectedItemRequested()));
            connect(d->actionsToolBox, SIGNAL(newPatientClicked()), d->largeView, SLOT(onCreatePatientRequested()));
            connect(d->actionsToolBox, SIGNAL(newStudyClicked()), d->largeView, SLOT(onCreateStudyRequested()));
            connect(d->actionsToolBox, SIGNAL(editClicked()), d->largeView, SLOT(onEditRequested()));

            connect(d->largeView, SIGNAL(patientClicked(const medDataIndex&)), d->actionsToolBox, SLOT(patientSelected(const medDataIndex&)));
            connect(d->largeView, SIGNAL(seriesClicked(const medDataIndex&)), d->actionsToolBox, SLOT(seriesSelected(const medDataIndex&)));
            connect(d->largeView, SIGNAL(noPatientOrSeriesSelected()), d->actionsToolBox, SLOT(noPatientOrSeriesSelected()));
            connect(d->largeView, SIGNAL(multipleEntriesSelected(const QVector<medDataIndex>&)), d->actionsToolBox, SLOT(multipleEntriesSelected(const QVector<medDataIndex>&)));
        }
Exemplo n.º 7
0
//----------------------------------------------------------------------
// Save Single File Dialog Widget
//----------------------------------------------------------------------
SaveSingleDialogWidget::SaveSingleDialogWidget(MainWindow *mainWindow, RideItem *rideItem) :
    QDialog(mainWindow, Qt::Dialog), mainWindow(mainWindow), rideItem(rideItem)
{
    setWindowTitle(tr("Save and Conversion"));
    QVBoxLayout *mainLayout = new QVBoxLayout(this);

    // Warning text
    warnText = new QLabel(tr("WARNING\n\nYou have made changes to ") + rideItem->fileName + tr(" If you want to save\nthem, we need to convert the ride to GoldenCheetah\'s\nnative format. Should we do so?\n"));
    mainLayout->addWidget(warnText);

    // Buttons
    QHBoxLayout *buttonLayout = new QHBoxLayout;
    saveButton = new QPushButton(tr("&Save and Convert"), this);
    buttonLayout->addWidget(saveButton);
    abandonButton = new QPushButton(tr("&Discard Changes"), this);
    buttonLayout->addWidget(abandonButton);
    cancelButton = new QPushButton(tr("&Cancel Save"), this);
    buttonLayout->addWidget(cancelButton);
    mainLayout->addLayout(buttonLayout);

    // Don't warn me!
    warnCheckBox = new QCheckBox(tr("Always warn me about file conversions"), this);
    warnCheckBox->setChecked(true);
    mainLayout->addWidget(warnCheckBox);

    // connect up slots
    connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
    connect(abandonButton, SIGNAL(clicked()), this, SLOT(abandonClicked()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
    connect(warnCheckBox, SIGNAL(clicked()), this, SLOT(warnSettingClicked()));
}
Exemplo n.º 8
0
/*
 * Initialize
 */
void MovieSequenceForm::init()
{
  setAttribute(Qt::WA_DeleteOnClose);
  setAttribute(Qt::WA_AlwaysShowToolTips);
  mSegments = mvMovieSegmentArray();
  connect(doneButton, SIGNAL(clicked()), this, SLOT(close()));
  connect(addAfterButton, SIGNAL(clicked()), this, SLOT(addAfterClicked()));
  connect(addBeforeButton, SIGNAL(clicked()), this, SLOT(addBeforeClicked()));
  connect(replaceButton, SIGNAL(clicked()), this, SLOT(replaceClicked()));
  connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
  connect(setMovieButton, SIGNAL(clicked()), this, SLOT(setMovieClicked()));
  connect(setStartButton, SIGNAL(clicked()), this, SLOT(setStartClicked()));
  connect(setEndButton, SIGNAL(clicked()), this, SLOT(setEndClicked()));
  connect(runAllButton, SIGNAL(clicked()), this, SLOT(runAllClicked()));
  connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
  connect(loadButton, SIGNAL(clicked()), this, SLOT(loadClicked()));
  connect(helpButton, SIGNAL(clicked()), this, SLOT(helpClicked()));
  connect(table, SIGNAL(cellChanged(int, int)), this, SLOT(entryChanged(int,int)));
  setFontDependentWidths();
  mModified = false;

  // Change window size to give 4 rows plus header
  imod_info_input();
  adjustSize();
  QSize winSize = sizeHint();
  QSize tableSize = table->sizeHint();
  int desired = 5.6 * (table->fontMetrics().height() + 3);
  resize(winSize.width(), winSize.height() + (desired - tableSize.height()));
}
Exemplo n.º 9
0
QTORGANIZER_USE_NAMESPACE

AddCalendarPage::AddCalendarPage(QWidget *parent)
    :QWidget(parent),
    m_manager(0)
{
    QHBoxLayout* hbLayout = new QHBoxLayout();
    QPushButton *okButton = new QPushButton("Save", this);
    connect(okButton,SIGNAL(clicked()),this,SLOT(saveClicked()));
    hbLayout->addWidget(okButton);
    QPushButton *cancelButton = new QPushButton("Cancel", this);
    connect(cancelButton,SIGNAL(clicked()),this,SLOT(cancelClicked()));
    hbLayout->addWidget(cancelButton);

    QVBoxLayout *scrollAreaLayout = new QVBoxLayout();
    scrollAreaLayout->addStretch();
    scrollAreaLayout->addLayout(hbLayout);

    QScrollArea *scrollArea = new QScrollArea(this);
    scrollArea->setWidgetResizable(true);
    QWidget *formContainer = new QWidget(scrollArea);
    formContainer->setLayout(scrollAreaLayout);
    scrollArea->setWidget(formContainer);

    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->addWidget(scrollArea);
    setLayout(mainLayout);
}
Exemplo n.º 10
0
  NetworkProxyDialog::NetworkProxyDialog(QSettings &t_settings, QWidget *t_parent = 0)
    : QDialog(t_parent), 
      m_settings(t_settings)
  {
    QGridLayout *layout = new QGridLayout(this);

    // NoProxy, DefaultProxy, Socks5Proxy, HttpProxy, HttpCachingProxy, FtpCachingProxy
    m_proxyType = new QComboBox();
    m_proxyType->addItem("No Proxy", QNetworkProxy::NoProxy);
    // Allow http only for now since that's known to be supported by ruby / aws
    // m_proxyType->addItem("Socks5 Proxy", QNetworkProxy::Socks5Proxy);
    m_proxyType->addItem("Http Proxy", QNetworkProxy::HttpProxy);

    connect(m_proxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(proxyTypeChanged(int)));

    m_hostName = new QLineEdit(this);
    m_port = new QLineEdit(this);
    m_port->setValidator(new QIntValidator(0, 65535));

    m_user = new QLineEdit(this);


    layout->addWidget(new QLabel("Proxy Type"), 0, 0);
    layout->addWidget(m_proxyType, 0, 1);
    layout->addWidget(new QLabel("Host Name"), 1, 0);
    layout->addWidget(m_hostName, 1, 1);
    layout->addWidget(new QLabel("Port"), 2, 0);
    layout->addWidget(m_port, 2, 1);
    layout->addWidget(new QLabel("User Name"), 3, 0);
    layout->addWidget(m_user, 3, 1);
    
    QHBoxLayout *buttonBox = new QHBoxLayout();

    QPushButton *saveButton = new QPushButton("Save");
    QPushButton *cancelButton = new QPushButton("Cancel");
    QPushButton *testButton = new QPushButton("Test");
   
    buttonBox->addWidget(saveButton);
    buttonBox->addWidget(cancelButton);
    buttonBox->addWidget(testButton);

    layout->addLayout(buttonBox, 4,0,1,2);

    connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
    connect(testButton, SIGNAL(clicked()), this, SLOT(testClicked()));

    QNetworkProxy proxy(createProxy(t_settings));

    int type = m_proxyType->findData(proxy.type());
    QString user = proxy.user();
    QString hostname = proxy.hostName();
    int port = proxy.port();

    m_proxyType->setCurrentIndex(type>-1?type:0);
    m_user->setText(user);
    m_hostName->setText(hostname);
    m_port->setText(QString::number(port));
    proxyTypeChanged(m_proxyType->currentIndex());
  }
Exemplo n.º 11
0
NeoControl::NeoControl(QWidget *parent, Qt::WFlags f)
    : QWidget(parent)
{
#ifdef QTOPIA
    this->setWindowState(Qt::WindowMaximized);
#else
    Q_UNUSED(f);
#endif
    bQvga = new QPushButton(tr("Switch to QVGA"), this);
    connect(bQvga, SIGNAL(clicked()), this, SLOT(qvgaClicked()));

    bBack = new QPushButton(this);
    connect(bBack, SIGNAL(clicked()), this, SLOT(backClicked()));

    bNext = new QPushButton(tr("Next"), this);
    connect(bNext, SIGNAL(clicked()), this, SLOT(nextClicked()));

    bSave = new QPushButton(tr("Save"), this);
    connect(bSave, SIGNAL(clicked()), this, SLOT(saveClicked()));

    chkDeepSleep = new QCheckBox(tr("Deep sleep"), this);
    connect(chkDeepSleep, SIGNAL(stateChanged(int)), this, SLOT(deepSleepStateChanged(int)));

    chkMux = new QCheckBox(tr("Multiplexing"), this);
    connect(chkMux, SIGNAL(stateChanged(int)), this, SLOT(muxStateChanged(int)));

    chkFso = new QCheckBox(tr("Use FSO (freesmartphone.org)"), this);
    connect(chkFso, SIGNAL(stateChanged(int)), this, SLOT(fsoStateChanged(int)));

    label = new QLabel(this);
    lineEdit = new QLineEdit(this);

    label4 = new QLabel(this);
    label5 = new QLabel(this);

    slider4 = new MixerSlider(this);
    slider5 = new MixerSlider(this);

    buttonLayout = new QHBoxLayout();
    buttonLayout->setAlignment(Qt::AlignBottom);
    buttonLayout->addWidget(bBack);
    buttonLayout->addWidget(bNext);

    layout = new QVBoxLayout(this);
    layout->addWidget(bQvga);
    layout->addWidget(label);
    layout->addWidget(label4);
    layout->addWidget(slider4);
    layout->addWidget(label5);
    layout->addWidget(slider5);
    layout->addWidget(bSave);
    layout->addWidget(lineEdit);
    layout->addWidget(chkDeepSleep);
    layout->addWidget(chkMux);
    layout->addWidget(chkFso);
    layout->addLayout(buttonLayout);

    showScreen(NeoControl::ScreenInit);
}
Exemplo n.º 12
0
//Connections for Other Tool Buttons
void Application::SaveClicked()
{
	saveClicked();
	connect(saveaxbutton,SIGNAL(clicked()),this,SLOT(saveAxialcl()));
	connect(savecobutton,SIGNAL(clicked()),this,SLOT(savecorocl()));
	connect(savesabutton,SIGNAL(clicked()),this,SLOT(savesagicl()));
	connect(savepabutton,SIGNAL(clicked()),this,SLOT(savepathcl()));
}
Exemplo n.º 13
0
SaveOnExitDialogWidget::SaveOnExitDialogWidget(MainWindow *mainWindow, QList<RideItem *>dirtyList) :
    QDialog(mainWindow, Qt::Dialog), mainWindow(mainWindow), dirtyList(dirtyList)
{
    setWindowTitle("Save Changes");
    QVBoxLayout *mainLayout = new QVBoxLayout(this);

    // Warning text
    warnText = new QLabel(tr("WARNING\n\nYou have made changes to some rides which\nhave not been saved. They are listed below."));
    mainLayout->addWidget(warnText);

    // File List
    dirtyFiles = new QTableWidget(dirtyList.count(), 0, this);
    dirtyFiles->setColumnCount(2);
    dirtyFiles->horizontalHeader()->hide();
    dirtyFiles->verticalHeader()->hide();

    // Populate with dirty List
    for (int i=0; i<dirtyList.count(); i++) {
        // checkbox
        QCheckBox *c = new QCheckBox;
        c->setCheckState(Qt::Checked);
        dirtyFiles->setCellWidget(i,0,c);

        // filename
        QTableWidgetItem *t = new QTableWidgetItem;
        t->setText(dirtyList.at(i)->fileName);
        t->setFlags(t->flags() & (~Qt::ItemIsEditable));
        dirtyFiles->setItem(i,1,t);
    }

    // prettify the list
    dirtyFiles->setShowGrid(false);
    dirtyFiles->resizeColumnToContents(0);
    dirtyFiles->resizeColumnToContents(1);
    mainLayout->addWidget(dirtyFiles);

    // Buttons
    QHBoxLayout *buttonLayout = new QHBoxLayout;
    saveButton = new QPushButton(tr("&Save and Exit"), this);
    buttonLayout->addWidget(saveButton);
    abandonButton = new QPushButton(tr("&Discard and Exit"), this);
    buttonLayout->addWidget(abandonButton);
    cancelButton = new QPushButton(tr("&Cancel Exit"), this);
    buttonLayout->addWidget(cancelButton);
    mainLayout->addLayout(buttonLayout);

    // Don't warn me!
    exitWarnCheckBox = new QCheckBox(tr("Always check for unsaved changes on exit"), this);
    exitWarnCheckBox->setChecked(true);
    mainLayout->addWidget(exitWarnCheckBox);

    // connect up slots
    connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
    connect(abandonButton, SIGNAL(clicked()), this, SLOT(abandonClicked()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
    connect(exitWarnCheckBox, SIGNAL(clicked()), this, SLOT(warnSettingClicked()));
}
Exemplo n.º 14
0
//#include "freeems/fetable2ddata.h"
TableView2D::TableView2D(QWidget *parent)
{
	Q_UNUSED(parent)
	//m_isSignedData = isSigned;
	m_isFlashOnly = false;
	ui.setupUi(this);
	metaDataValid = false;
	tableData=0;
	//ui.tableWidget->setColumnCount(1);
	ui.tableWidget->setRowCount(2);
	ui.tableWidget->horizontalHeader()->hide();
	ui.tableWidget->verticalHeader()->hide();
	//ui.tableWidget->setColumnWidth(0,100);
	connect(ui.savePushButton,SIGNAL(clicked()),this,SLOT(saveClicked()));
	connect(ui.loadFlashPushButton,SIGNAL(clicked()),this,SLOT(loadFlashClicked()));
	connect(ui.loadRamPushButton,SIGNAL(clicked()),this,SLOT(loadRamClicked()));
	connect(ui.tableWidget,SIGNAL(cellChanged(int,int)),this,SLOT(tableCellChanged(int,int)));
	connect(ui.tableWidget,SIGNAL(currentCellChanged(int,int,int,int)),this,SLOT(tableCurrentCellChanged(int,int,int,int)));
	connect(ui.exportPushButton,SIGNAL(clicked()),this,SLOT(exportClicked()));
	connect(ui.importPushButton,SIGNAL(clicked()),this,SLOT(importClicked()));
	connect(ui.tableWidget,SIGNAL(hotKeyPressed(int,Qt::KeyboardModifiers)),this,SLOT(hotKeyPressed(int,Qt::KeyboardModifiers)));
	ui.tableWidget->addHotkey(Qt::Key_Plus,Qt::ShiftModifier);
	ui.tableWidget->addHotkey(Qt::Key_Minus,Qt::NoModifier);
	ui.tableWidget->addHotkey(Qt::Key_Underscore,Qt::ShiftModifier);
	ui.tableWidget->addHotkey(Qt::Key_Equal,Qt::NoModifier);
	ui.tableWidget->setItemDelegate(new TableWidgetDelegate());

	QPalette pal = ui.plot->palette();
	pal.setColor(QPalette::Background,QColor::fromRgb(0,0,0));
	ui.plot->setPalette(pal);
	curve = new QwtPlotCurve("Test");
	curve->attach(ui.plot);
	curve->setPen(QPen(QColor::fromRgb(255,0,0),3));
	QwtPlotGrid *grid = new QwtPlotGrid();
	grid->setPen(QPen(QColor::fromRgb(100,100,100)));
	grid->attach(ui.plot);


	//curve->setData()
	//QwtSeriesData<QwtIntervalSample> series;
	/*if (!isram)
	{
		//Is only flash
		ui.loadRamPushButton->setVisible(false);
	}
	else if (!isflash)
	{
		//Is only ram
		ui.loadFlashPushButton->setVisible(false);
		ui.savePushButton->setVisible(false);
	}
	else
	{
		//Is both ram and flash
	}*/
	connect(ui.tracingCheckBox,SIGNAL(stateChanged(int)),this,SLOT(tracingCheckBoxStateChanged(int)));
}
Exemplo n.º 15
0
ParserMaker::ParserMaker(QWidget *parent, ParserManager *pd, SiilihaiSettings &s, SiilihaiProtocol &p) :
    QMainWindow(parent), pdb(pd), settings(s), protocol(p), nam(this), engine(this, 0, 0, &nam) {
    ui.setupUi(this);
    loginMatcher = new PatternMatcher(this, true);

    groupListEditor = new GroupListPatternEditor(engine, &parser, &subscription, this);
    ui.tabWidget->addTab(groupListEditor, groupListEditor->tabIcon(), groupListEditor->tabName());
    threadListEditor = new ThreadListPatternEditor(engine, &parser, &subscription, this);
    ui.tabWidget->addTab(threadListEditor, threadListEditor->tabIcon(), threadListEditor->tabName());
    threadListEditor->setEnabled(false);
    messageListEditor = new MessageListPatternEditor(engine, &parser, &subscription, this);
    ui.tabWidget->addTab(messageListEditor, threadListEditor->tabIcon(), messageListEditor->tabName());
    messageListEditor->setEnabled(false);

    connect(groupListEditor, SIGNAL(groupSelected(ForumGroup*)), threadListEditor, SLOT(setGroup(ForumGroup*)));
    connect(threadListEditor, SIGNAL(threadSelected(ForumThread*)), messageListEditor, SLOT(setThread(ForumThread*)));

    connect(&protocol, SIGNAL(saveParserFinished(int, QString)), this, SLOT(saveParserFinished(int, QString)));
    connect(ui.openParserButton, SIGNAL(clicked()), this, SLOT(openClicked()));
    connect(ui.newFromRequestButton, SIGNAL(clicked()), this, SLOT(newFromRequestClicked()));
    connect(ui.saveChangesButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
    connect(ui.saveAsNewButton, SIGNAL(clicked()), this, SLOT(saveAsNewClicked()));
    connect(ui.testForumUrlButton, SIGNAL(clicked()), this, SLOT(testForumUrlClicked()));
    connect(ui.forumUrl, SIGNAL(textEdited(QString)), this, SLOT(updateState()));
    connect(ui.parserName, SIGNAL(textEdited(QString)), this, SLOT(updateState()));
    connect(ui.parserType, SIGNAL(currentIndexChanged(int)), this, SLOT(updateState()));
    connect(ui.viewThreadPath, SIGNAL(textEdited(QString)), this, SLOT(updateState()));
    connect(ui.threadListPath, SIGNAL(textEdited(QString)), this, SLOT(updateState()));
    connect(ui.viewMessagePath, SIGNAL(textEdited(QString)), this, SLOT(updateState()));
    connect(ui.loginPath, SIGNAL(textEdited(QString)), this, SLOT(updateState()));
    connect(ui.loginTypeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateState()));
    connect(ui.tryLoginButton, SIGNAL(clicked()), this, SLOT(tryLogin()));
    connect(ui.tryWithoutLoginButton, SIGNAL(clicked()), this, SLOT(tryWithoutLogin()));
    connect(ui.verifyLoginPattern, SIGNAL(textEdited(QString)), this, SLOT(updateState()));
    connect(ui.helpButton, SIGNAL(clicked()), this, SLOT(helpClicked()));
    connect(&engine, SIGNAL(loginFinished(ForumSubscription *,bool)), this, SLOT(loginFinished(ForumSubscription *, bool)));
    connect(&subscription, SIGNAL(errorsChanged()), this, SLOT(subscriptionErrorsChanged()));

    connect(&engine, SIGNAL(getHttpAuthentication(ForumSubscription *, QAuthenticator *)),
            this, SLOT(getHttpAuthentication(ForumSubscription *, QAuthenticator *)));

    connect(loginMatcher, SIGNAL(dataMatched(int, QString, PatternMatchType)),
            this, SLOT(dataMatched(int, QString, PatternMatchType)));
    connect(loginMatcher, SIGNAL(dataMatchingStart(QString&)), this, SLOT(dataMatchingStart(QString&)));
    connect(loginMatcher, SIGNAL(dataMatchingEnd()), this, SLOT(dataMatchingEnd()));

    subscription.setLatestThreads(100);
    subscription.setLatestMessages(100);
    loginWithoutCredentials = false;

    updateState();
    ui.tabWidget->setCurrentIndex(0);
    if (!restoreGeometry(settings.value("parsermaker_geometry").toByteArray()))
        showMaximized();

    show();
}
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    //
    QObject::connect(ui->QLoad,SIGNAL(clicked()),
                     this, SLOT(loadClicked()));

    QObject::connect(ui->QSave,SIGNAL(clicked()),
                     this, SLOT(saveClicked()));
}
Exemplo n.º 17
0
TableView3D::TableView3D(QWidget *parent)
{
	Q_UNUSED(parent)
	m_isFlashOnly = false;
	m_tableMap=0;
	ui.setupUi(this);
	tableData=0;
	m_tracingEnabled = false;
	connect(ui.savePushButton,SIGNAL(clicked()),this,SLOT(saveClicked()));
	connect(ui.loadFlashPushButton,SIGNAL(clicked()),this,SLOT(loadClicked()));
	connect(ui.loadRamPushButton,SIGNAL(clicked()),this,SLOT(loadRamClicked()));
	connect(ui.exportPushButton,SIGNAL(clicked()),this,SLOT(exportClicked()));
	connect(ui.importPushButton,SIGNAL(clicked()),this,SLOT(importClicked()));
	connect(ui.tableWidget,SIGNAL(hotKeyPressed(int,Qt::KeyboardModifier)),this,SLOT(hotKeyPressed(int,Qt::KeyboardModifier)));
	connect(ui.tracingCheckBox,SIGNAL(stateChanged(int)),this,SLOT(tracingCheckBoxStateChanged(int)));
	ui.tableWidget->addHotkey(Qt::Key_Plus,Qt::ShiftModifier);
	ui.tableWidget->addHotkey(Qt::Key_Minus,Qt::NoModifier);
	ui.tableWidget->addHotkey(Qt::Key_Underscore,Qt::ShiftModifier);
	ui.tableWidget->addHotkey(Qt::Key_Equal,Qt::NoModifier);
	connect(ui.tableWidget,SIGNAL(itemChangeRequest(int,int,int,int,QString)),this,SLOT(itemChangeRequest(int,int,int,int,QString)));
	//ui.tableWidget->setItemDelegate(new TableWidgetDelegate());

	setContextMenuPolicy(Qt::DefaultContextMenu);
	//QAction* fooAction = new QAction("foo",this);
	//QAction* barAction = new QAction("bar",this);
	//connect(fooAction, SIGNAL(triggered()), this, SLOT(doSomethingFoo()));
	//connect(barAction, SIGNAL(triggered()), this, SLOT(doSomethingBar()));
	//addAction(fooAction);
	//addAction(barAction);
	metaDataValid = true;
	/*if (!isram)
	{
		//Is only flash
		ui.loadRamPushButton->setVisible(false);
	}
	else if (!isflash)
	{
		//Is only ram
		ui.savePushButton->setVisible(false);
		ui.loadFlashPushButton->setVisible(false);
	}
	else
	{
		//Is both ram and flash
	}*/
	//ui.importPushButton->setVisible(false);
	//ui.tracingCheckBox->setVisible(false);
	//ui.tracingCheckBox->setEnabled(false);
	connect(ui.showMapPushButton,SIGNAL(clicked()),this,SLOT(showMapClicked()));
	m_inputTimer = new QTimer(this);
	connect(m_inputTimer,SIGNAL(timeout()),this,SLOT(inputTimerTimeout()));
}
Exemplo n.º 18
0
void UserMenuDialog::slotSaveClicked()
{
	if ( saveClicked() ) {
		m_modified = false;
		if ( m_currentXmlInstalled ) {
			slotInstallClicked();   // includes all updates
		}
		else {
			setXmlFile(m_currentXmlFile,false);
		}
		updateDialogButtons();
	}
}
Exemplo n.º 19
0
bool UserMenuDialog::okClicked()
{
	if ( m_currentXmlFile.isEmpty() ) {
		return !saveAsClicked().isEmpty();
	}

	if ( ! saveClicked() ) {
		return false;
	}

	if ( m_currentXmlInstalled ) {
		m_modified = false;
		slotInstallClicked();
	}
	return true;
}
Exemplo n.º 20
0
MCentral::MCentral(){
	//
	#ifdef MYDEBUG
		qDebug() << "Startuje MCentral::MCentral()";
	#endif
	//
	ioActions = new IOActions();
	combo = new QComboBox; //
	combo-> setEnabled(false);
	textEdit = new QTextEdit(tr("Tu wyswietlaja sie rezultaty"));
	mainTextEdit = new QTextEdit(tr("Tu wyswietla sie graf"));
	refreshButton = new QPushButton(tr("Wyczysc rezultaty"));
	refreshButton->setEnabled(false);
	saveButton = new QPushButton(tr("Zapisz zmiany"));
	saveButton->setEnabled(false);
	restoreButton = new QPushButton(tr("Anuluj zmiany"));
	restoreButton->setEnabled(false);
	//
	connect(refreshButton, SIGNAL(clicked()), this, SLOT(repaintGraph())); //Obs³uga przycisku odœwie¿
	connect(combo, SIGNAL(currentIndexChanged(QString)), this, SLOT(repaintGraph(QString))); //Obs³uga comboboxa
	connect(combo, SIGNAL(currentIndexChanged(QString)), this, SLOT(disableSaveRestore())); //
	connect(mainTextEdit, SIGNAL(textChanged()), ioActions,  SLOT(modify()));
	connect(mainTextEdit, SIGNAL(textChanged()), this,  SLOT(enableSaveRestore()));
	connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
	connect(saveButton, SIGNAL(clicked()), this, SLOT(disableSaveRestore()));
	connect(restoreButton, SIGNAL(clicked()), this, SLOT(restoreClicked()));
	connect(restoreButton, SIGNAL(clicked()), this, SLOT(disableSaveRestore()));
	//
	horizontalGroupBox = new QGroupBox(tr("Opcje edycji:"));
	QHBoxLayout *horizontalLayout = new QHBoxLayout;
    horizontalLayout->addWidget(saveButton);
    horizontalLayout->addWidget(restoreButton);
	horizontalLayout->addWidget(refreshButton);
    horizontalGroupBox->setLayout(horizontalLayout);
	//
	layout = new QVBoxLayout; 
	layout->addWidget(combo);
	layout->addWidget(mainTextEdit);
	layout->addWidget(horizontalGroupBox);
	layout->addWidget(textEdit);
	//layout->addStretch(); //to nie daje ¿adnych zmian
	setLayout(layout); 
	//
	#ifdef MYDEBUG
		qDebug() << "Konczy sie MCentral::MCentral()";
	#endif
}
Exemplo n.º 21
0
void StationPage::createContent()
{
    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal);
    centralWidget()->setLayout(layout);
    QGraphicsLinearLayout *layout_btn = new QGraphicsLinearLayout(Qt::Vertical);
    layout_btn->setSpacing(0);
    layout->addItem(layout_btn);

    sourceCombo = new MComboBox();
    sourceCombo->setTitle("Select source");
    for (int i=0; i<sourcelist->size(); i++){
        sourceCombo->addItem(QString::fromStdString(sourcelist->at(i)->name()));
    }

    layout_btn->addItem(sourceCombo);

    countryCombo = new MComboBox();
    countryCombo->setTitle("Select country");
    layout_btn->addItem(countryCombo);

    regionCombo = new MComboBox();
    regionCombo->setTitle("Select region");
    layout_btn->addItem(regionCombo);

    cityCombo = new MComboBox();
    cityCombo->setTitle("Select city");
    layout_btn->addItem(cityCombo);

    MButton *savebutton = new MButton("Save");
    layout->addItem(savebutton);

    connect(sourceCombo, SIGNAL(currentIndexChanged(int)),
            this, SLOT(sourceChanged(int)));
    connect(countryCombo, SIGNAL(currentIndexChanged(int)),
            this, SLOT(countryChanged(int)));
    connect(regionCombo, SIGNAL(currentIndexChanged(int)),
            this, SLOT(regionChanged(int)));
    connect(savebutton, SIGNAL(clicked()),
            this, SLOT(saveClicked()));

    if (sourceCombo->count() > 0)
        sourceCombo->setCurrentIndex(0);

}
Exemplo n.º 22
0
formControl::formControl(QWidget *parent) : 
  QWidget(parent)
{
  setupUi(this);
  _autoSave=false;
  _searchType=Query;
  _shown=false;
  
  connect (_new,	SIGNAL(clicked()),	this,	SLOT(newRow()));
  connect (_save,       SIGNAL(clicked()),      this,   SIGNAL(saveClicked()));
  connect (_save,	SIGNAL(clicked()),	this,	SLOT(save()));
  connect (_print,	SIGNAL(clicked()),	this,	SLOT(print()));
  connect (_prev,	SIGNAL(clicked()),	this,	SLOT(toPrevious()));
  connect (_next,	SIGNAL(clicked()),	this,	SLOT(toNext()));
  connect (_search,	SIGNAL(clicked()),	this,	SLOT(search()));
  
  //Hiding future functionality that has been commented out for now
  _print->setVisible(FALSE);
  _view->setVisible(FALSE);

}
Exemplo n.º 23
0
QTM_USE_NAMESPACE

AddCalendarPage::AddCalendarPage(QWidget *parent)
    :QWidget(parent),
    m_manager(0)
{
#if defined(Q_WS_MAEMO_5)
    // Maemo5 calendar features
    QLabel *nameLabel = new QLabel("Name:", this);
    m_nameEdit = new QLineEdit(this);

    QLabel *colorLabel = new QLabel("Color:", this);
    m_colorComboBox = new QComboBox(this); // must be filled later
    connect(m_colorComboBox, SIGNAL(currentIndexChanged(const QString&)),
            this, SLOT(colorChanged(const QString&)));

    QLabel *typeLabel = new QLabel("Type:", this);
    m_typeComboBox = new QComboBox(this); // must be filled later
    connect(m_typeComboBox, SIGNAL(currentIndexChanged(const QString&)),
            this, SLOT(typeChanged(const QString&)));

    m_visibleCheckBox = new QCheckBox("Visible", this);
    connect(m_visibleCheckBox, SIGNAL(stateChanged(int)),
            this, SLOT(visibilityChanged(int)));

    m_readonlyCheckBox = new QCheckBox("Readonly", this);
    connect(m_readonlyCheckBox, SIGNAL(stateChanged(int)),
            this, SLOT(readonlyChanged(int)));
#endif

#ifndef Q_OS_SYMBIAN
    // Add push buttons for non-Symbian platforms as they do not support soft keys
    QHBoxLayout* hbLayout = new QHBoxLayout();
    QPushButton *okButton = new QPushButton("Save", this);
    connect(okButton,SIGNAL(clicked()),this,SLOT(saveClicked()));
    hbLayout->addWidget(okButton);
    QPushButton *cancelButton = new QPushButton("Cancel", this);
    connect(cancelButton,SIGNAL(clicked()),this,SLOT(cancelClicked()));
    hbLayout->addWidget(cancelButton);
#endif

    QVBoxLayout *scrollAreaLayout = new QVBoxLayout();

#if defined(Q_WS_MAEMO_5)
    scrollAreaLayout->addWidget(nameLabel);
    scrollAreaLayout->addWidget(m_nameEdit);
    scrollAreaLayout->addWidget(colorLabel);
    scrollAreaLayout->addWidget(m_colorComboBox);
    scrollAreaLayout->addWidget(typeLabel);
    scrollAreaLayout->addWidget(m_typeComboBox);

    QHBoxLayout *checkBoxLayout = new QHBoxLayout();
    checkBoxLayout->addWidget(m_visibleCheckBox);
    checkBoxLayout->addWidget(m_readonlyCheckBox);
    scrollAreaLayout->addLayout(checkBoxLayout);
#endif

    scrollAreaLayout->addStretch();

#ifndef Q_OS_SYMBIAN
    scrollAreaLayout->addLayout(hbLayout);
#endif

    QScrollArea *scrollArea = new QScrollArea(this);
    scrollArea->setWidgetResizable(true);
    QWidget *formContainer = new QWidget(scrollArea);
    formContainer->setLayout(scrollAreaLayout);
    scrollArea->setWidget(formContainer);

    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->addWidget(scrollArea);
    setLayout(mainLayout);

    // Add softkeys
    QAction* cancelSoftKey = new QAction("Cancel", this);
    cancelSoftKey->setSoftKeyRole(QAction::NegativeSoftKey);
    addAction(cancelSoftKey);
    connect(cancelSoftKey, SIGNAL(triggered(bool)), this, SLOT(cancelClicked()));

    QAction* saveSoftKey = new QAction("Save",this);
    saveSoftKey->setSoftKeyRole(QAction::PositiveSoftKey);
    addAction(saveSoftKey);
    connect(saveSoftKey, SIGNAL(triggered(bool)), this, SLOT(saveClicked()));
}
Exemplo n.º 24
0
void PanelResourceInfo::slotSave() {
	emit saveClicked();
}
Exemplo n.º 25
0
BackstageOSF::BackstageOSF(QWidget *parent) : BackstagePage(parent)
{
	QGridLayout *layout = new QGridLayout(this);
	layout->setSpacing(0);
	layout->setContentsMargins(0, 0, 0, 0);
	setLayout(layout);

	QWidget *topRow = new QWidget(this);
	layout->addWidget(topRow);

	QGridLayout *topRowLayout = new QGridLayout();
	topRowLayout->setContentsMargins(0, 6, 12, 0);
	topRow->setLayout(topRowLayout);

	QLabel *label = new QLabel("Open Science Framework", topRow);
	QSizePolicy sp = label->sizePolicy();
	sp.setHorizontalStretch(1);
	label->setSizePolicy(sp);
	label->setContentsMargins(12, 12, 12, 1);
	topRowLayout->addWidget(label, 0, 0);

	_nameButton = new QToolButton(topRow);
	_nameButton->hide();
	topRowLayout->addWidget(_nameButton, 0, 1);

	connect(_nameButton, SIGNAL(clicked(bool)), this, SLOT(nameClicked()));

	QWidget *buttonsWidget = new QWidget(this);
	buttonsWidget->setContentsMargins(0, 0, 0, 0);
	layout->addWidget(buttonsWidget);

	QGridLayout *buttonsWidgetLayout = new QGridLayout(buttonsWidget);
	buttonsWidgetLayout->setContentsMargins(0, 0, 12, 0);
	buttonsWidget->setLayout(buttonsWidgetLayout);

	_breadCrumbs = new BreadCrumbs(buttonsWidget);
	buttonsWidgetLayout->addWidget(_breadCrumbs, 0, 0);

	_newFolderButton = new QToolButton(buttonsWidget);
	_newFolderButton->setText("New Folder");
	_newFolderButton->hide();
	buttonsWidgetLayout->addWidget(_newFolderButton, 0, 2);

	_fileNameContainer = new QWidget(this);
	_fileNameContainer->hide();
	_fileNameContainer->setObjectName("browseContainer");
	layout->addWidget(_fileNameContainer);

	QHBoxLayout *saveLayout = new QHBoxLayout(_fileNameContainer);
	_fileNameContainer->setLayout(saveLayout);

	_fileNameTextBox = new QLineEdit(_fileNameContainer);
	QSizePolicy policy = _fileNameTextBox->sizePolicy();
	policy.setHorizontalStretch(1);
	_fileNameTextBox->setSizePolicy(policy);
	_fileNameTextBox->setEnabled(false);

	saveLayout->addWidget(_fileNameTextBox);

	_saveButton = new QPushButton(_fileNameContainer);
	_saveButton->setText("Save");
	_saveButton->setEnabled(false);
	saveLayout->addWidget(_saveButton, 0, Qt::AlignRight);

	QWidget *line;

	line = new QWidget(this);
	line->setFixedHeight(1);
	line->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
	line->setStyleSheet("QWidget { background-color: #A3A4A5 ; }");
	layout->addWidget(line);

	_model = new FSBMOSF();

	connect(_model, SIGNAL(authenticationSuccess()), this, SLOT(updateUserDetails()));
	connect(_model, SIGNAL(authenticationClear()), this, SLOT(updateUserDetails()));

	_fsBrowser = new FSBrowser(this);
	_fsBrowser->setViewType(FSBrowser::ListView);
	_fsBrowser->setFSModel(_model);
	layout->addWidget(_fsBrowser);

	_breadCrumbs->setModel(_model);
	_breadCrumbs->setEnabled(false);

	connect(_fsBrowser, SIGNAL(entryOpened(QString)), this, SLOT(notifyDataSetOpened(QString)));
	connect(_fsBrowser, SIGNAL(entrySelected(QString)), this, SLOT(notifyDataSetSelected(QString)));

	connect(_saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
	connect(_newFolderButton, SIGNAL(clicked(bool)), this, SLOT(newFolderClicked()));

	line = new QWidget(this);
	line->setFixedWidth(1);
	line->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
	line->setStyleSheet("QWidget { background-color: #A3A4A5 ; }");
	layout->addWidget(line, 0, 1, 6, 1);

	QWidget *about = new QWidget(this);
	about->setObjectName("aboutOSF");
	about->setStyleSheet("#aboutOSF { border-top: 1px solid #A3A4A5 ; }");
	layout->addWidget(about);

	QHBoxLayout *aboutLayout = new QHBoxLayout(about);
	aboutLayout->setSpacing(12);
	about->setLayout(aboutLayout);

	HyperlinkLabel *aboutOSF = new HyperlinkLabel(about);
	aboutOSF->setText("<a href='https://osf.io/getting-started/'>About the OSF</a>");

	HyperlinkLabel *registerOSF = new HyperlinkLabel(about);
	registerOSF->setText("<a href='https://osf.io/'>Register</a>");

	aboutLayout->addWidget(aboutOSF);
	aboutLayout->addWidget(registerOSF);
	aboutLayout->addStretch(1);
}
Exemplo n.º 26
0
PolycrankPanelDlg::PolycrankPanelDlg(QWidget *parent, World *world) : QDialog(parent)
{  
	syncLabel = new QLabel(tr("Status   MRROC++   Connection"));
    Q0Label = new QLabel(tr("Q0"));
    Q1Label = new QLabel(tr("Q1"));
    Q2Label = new QLabel(tr("Q2"));
    Q3Label = new QLabel(tr("Q3"));
    Q4Label = new QLabel(tr("Q4"));
    Q5Label = new QLabel(tr("Q5"));
    Q6Label = new QLabel(tr("Q6"));
	
	dofLabel = new QLabel(tr("Q  "));

	DegreesLineEdit = new QLineEdit;
	DegreesLineEdit->setText("DEGREES");
	DegreesLineEdit->setEnabled(false);

    Q0DegreesLineEdit = new QLineEdit;
    Q1DegreesLineEdit = new QLineEdit;
    Q2DegreesLineEdit = new QLineEdit;
    Q3DegreesLineEdit = new QLineEdit;
    Q4DegreesLineEdit = new QLineEdit;
    Q5DegreesLineEdit = new QLineEdit;
    Q6DegreesLineEdit = new QLineEdit;

	RadianLineEdit = new QLineEdit;
	RadianLineEdit->setText("RADIAN");
	RadianLineEdit->setEnabled(false);

    Q0RadianLineEdit = new QLineEdit;
    Q1RadianLineEdit = new QLineEdit;
    Q2RadianLineEdit = new QLineEdit;
    Q3RadianLineEdit = new QLineEdit;
    Q4RadianLineEdit = new QLineEdit;
    Q5RadianLineEdit = new QLineEdit;
    Q6RadianLineEdit = new QLineEdit;

    Q0DegreesLineEdit->setReadOnly(true);
    Q1DegreesLineEdit->setReadOnly(true);
    Q2DegreesLineEdit->setReadOnly(true);
    Q3DegreesLineEdit->setReadOnly(true);
    Q4DegreesLineEdit->setReadOnly(true);
    Q5DegreesLineEdit->setReadOnly(true);
	Q6DegreesLineEdit->setReadOnly(true);

    Q0RadianLineEdit->setReadOnly(true);
    Q1RadianLineEdit->setReadOnly(true);
    Q2RadianLineEdit->setReadOnly(true);
    Q3RadianLineEdit->setReadOnly(true);
    Q4RadianLineEdit->setReadOnly(true);
    Q5RadianLineEdit->setReadOnly(true);
	Q6RadianLineEdit->setReadOnly(true);

	progressBar = new QProgressBar();
	progressBar->setTextVisible( false );
	progressBar->setRange( 0, 1 );

	IPLabel = new QLabel(tr("&IP   "));
    IPLineEdit = new QLineEdit;
    IPLabel->setBuddy(IPLineEdit);
	IPLineEdit->setText("127.0.0.1");
	QRegExpValidator *reVal = new QRegExpValidator( QRegExp("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"), this );
    IPLineEdit->setValidator( reVal );

	PortLabel = new QLabel(tr("&Port"));
    PortLineEdit = new QLineEdit;
    PortLabel->setBuddy(PortLineEdit);
	PortLineEdit->setText("5000");
	QIntValidator *intVal = new QIntValidator( 0, 100000, this );//range of port 0-100.000
	PortLineEdit->setValidator(intVal);

	spinBox = new QSpinBox;
	spinBox->setRange(1, 100);
	
	spinBox->setEnabled(true);
    
	slider = new QSlider(Qt::Horizontal);
    slider->setRange(1, 100);
	slider->setEnabled(true);
	
    QObject::connect(spinBox, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int)));
    QObject::connect(slider, SIGNAL(valueChanged(int)), spinBox, SLOT(setValue(int)));
	spinBox->setValue(50);
    
	freqLabel = new QLabel(tr("Frequency [Hz]"));
    QHBoxLayout *freqLayout = new QHBoxLayout;
	freqLayout->addWidget(freqLabel);
	freqLayout->addWidget(slider);
    freqLayout->addWidget(spinBox);

    edpCheckBox = new QCheckBox(tr("&Connect with EDP Polycrank"));
	edpCheckBox->setEnabled(true);//show
	
	saveCheckBox = new QCheckBox(tr("&Save Polycrank Trajectory"));
	saveCheckBox->setEnabled(false);//hide

	QHBoxLayout *edpLayout = new QHBoxLayout;
    edpLayout->addWidget(edpCheckBox);
	edpLayout->addWidget(saveCheckBox);
	connect(edpCheckBox, SIGNAL(clicked()),this, SLOT(edpClicked()));
	connect(saveCheckBox, SIGNAL(clicked()),this, SLOT(saveClicked()));
	
    QHBoxLayout *ipLayout = new QHBoxLayout;
    ipLayout->addWidget(IPLabel);
    ipLayout->addWidget(IPLineEdit);

    QHBoxLayout *portLayout = new QHBoxLayout;
    portLayout->addWidget(PortLabel);
    portLayout->addWidget(PortLineEdit);

	QHBoxLayout *syncLayout = new QHBoxLayout;
	syncLayout->addWidget(syncLabel);
	syncLayout->addWidget(progressBar);

	QHBoxLayout *TitleLayout = new QHBoxLayout;
    TitleLayout->addWidget(dofLabel);
    TitleLayout->addWidget(DegreesLineEdit);
	TitleLayout->addWidget(RadianLineEdit);

	QHBoxLayout *Q0Layout = new QHBoxLayout;
    Q0Layout->addWidget(Q0Label);
    Q0Layout->addWidget(Q0DegreesLineEdit);
	Q0Layout->addWidget(Q0RadianLineEdit);

	QHBoxLayout *Q1Layout = new QHBoxLayout;
	Q1Layout->addWidget(Q1Label);
    Q1Layout->addWidget(Q1DegreesLineEdit);
	Q1Layout->addWidget(Q1RadianLineEdit);

	QHBoxLayout *Q2Layout = new QHBoxLayout;
    Q2Layout->addWidget(Q2Label);
    Q2Layout->addWidget(Q2DegreesLineEdit);
	Q2Layout->addWidget(Q2RadianLineEdit);

	QHBoxLayout *Q3Layout = new QHBoxLayout;
	Q3Layout->addWidget(Q3Label);
    Q3Layout->addWidget(Q3DegreesLineEdit);
	Q3Layout->addWidget(Q3RadianLineEdit);

	QHBoxLayout *Q4Layout = new QHBoxLayout;
    Q4Layout->addWidget(Q4Label);
    Q4Layout->addWidget(Q4DegreesLineEdit);
	Q4Layout->addWidget(Q4RadianLineEdit);

	QHBoxLayout *Q5Layout = new QHBoxLayout;
	Q5Layout->addWidget(Q5Label);
    Q5Layout->addWidget(Q5DegreesLineEdit);
	Q5Layout->addWidget(Q5RadianLineEdit);

	QHBoxLayout *Q6Layout = new QHBoxLayout;
	Q6Layout->addWidget(Q6Label);
    Q6Layout->addWidget(Q6DegreesLineEdit);
	Q6Layout->addWidget(Q6RadianLineEdit);
	
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addLayout(ipLayout);
	mainLayout->addLayout(portLayout);
	mainLayout->addLayout(freqLayout);
	mainLayout->addLayout(edpLayout);
	mainLayout->addLayout(syncLayout);
	mainLayout->addLayout(TitleLayout);
	mainLayout->addLayout(Q0Layout);
	mainLayout->addLayout(Q1Layout);
	mainLayout->addLayout(Q2Layout);
	mainLayout->addLayout(Q3Layout);
	mainLayout->addLayout(Q4Layout);
	mainLayout->addLayout(Q5Layout);
	mainLayout->addLayout(Q6Layout);

    setLayout(mainLayout);
	setWindowTitle(tr("Connect with MRROC++"));

	tableRobots[0] = world->robotVec[0];//Polycrank
	//tableRobots[1] = world->robotVec[1];//Hand
	
	QString name = "PolycrankPanel";
	tableRobots[0]->setName(name);
	std::cout<<"PolycrankPanelDlg::PolycrankPanelDlg() = "<<tableRobots[0]->getName().toStdString()<<"\n";

	QObject::connect(this, SIGNAL(rejected ()), this, SLOT(XClicked()));
}
Exemplo n.º 27
0
KSnapshot::KSnapshot(QWidget *parent, const char *name, bool grabCurrent)
  : DCOPObject("interface"), 
    KDialogBase(parent, name, true, QString::null, Help|User1, User1, 
    true, KStdGuiItem::quit() )
{
    grabber = new QWidget( 0, 0, WStyle_Customize | WX11BypassWM );
    grabber->move( -1000, -1000 );
    grabber->installEventFilter( this );

    KStartupInfo::appStarted();

    QVBox *vbox = makeVBoxMainWidget();
    mainWidget = new KSnapshotWidget( vbox, "mainWidget" );

    connect(mainWidget, SIGNAL(startImageDrag()), SLOT(slotDragSnapshot()));

    connect( mainWidget, SIGNAL( newClicked() ), SLOT( slotGrab() ) );
    connect( mainWidget, SIGNAL( saveClicked() ), SLOT( slotSaveAs() ) );
    connect( mainWidget, SIGNAL( printClicked() ), SLOT( slotPrint() ) );
    connect( mainWidget, SIGNAL( copyClicked() ), SLOT( slotCopy() ) );

    grabber->show();
    grabber->grabMouse( waitCursor );

    if ( !grabCurrent )
	snapshot = QPixmap::grabWindow( qt_xrootwin() );
    else {
	mainWidget->setMode( WindowUnderCursor );
	mainWidget->setIncludeDecorations( true );
	performGrab();
    }

    updatePreview();
    grabber->releaseMouse();
    grabber->hide();

    KConfig *conf=KGlobal::config();
    conf->setGroup("GENERAL");
    mainWidget->setDelay(conf->readNumEntry("delay",0));
    mainWidget->setMode( conf->readNumEntry( "mode", 0 ) );
    mainWidget->setIncludeDecorations(conf->readBoolEntry("includeDecorations",true));
    filename = KURL::fromPathOrURL( conf->readPathEntry( "filename", QDir::currentDirPath()+"/"+i18n("snapshot")+"1.png" ));

    // Make sure the name is not already being used
    while(KIO::NetAccess::exists( filename, false, this )) {
	autoincFilename();
    }

    connect( &grabTimer, SIGNAL( timeout() ), this, SLOT(  grabTimerDone() ) );
    connect( &updateTimer, SIGNAL( timeout() ), this, SLOT(  updatePreview() ) );
    QTimer::singleShot( 0, this, SLOT( updateCaption() ) );

    KHelpMenu *helpMenu = new KHelpMenu(this, KGlobal::instance()->aboutData(), false);

    QPushButton *helpButton = actionButton( Help );
    helpButton->setPopup(helpMenu->menu());

    KAccel* accel = new KAccel(this);
    accel->insert(KStdAccel::Quit, kapp, SLOT(quit()));
    accel->insert( "QuickSave", i18n("Quick Save Snapshot &As..."),
		   i18n("Save the snapshot to the file specified by the user without showing the file dialog."),
		   CTRL+SHIFT+Key_S, this, SLOT(slotSave()));
    accel->insert(KStdAccel::Save, this, SLOT(slotSaveAs()));
//    accel->insert(KShortcut(CTRL+Key_A), this, SLOT(slotSaveAs()));
    accel->insert( "SaveAs", i18n("Save Snapshot &As..."),
		   i18n("Save the snapshot to the file specified by the user."),
		   CTRL+Key_A, this, SLOT(slotSaveAs()));
    accel->insert(KStdAccel::Print, this, SLOT(slotPrint()));
    accel->insert(KStdAccel::New, this, SLOT(slotGrab()));
    accel->insert(KStdAccel::Copy, this, SLOT(slotCopy()));

    accel->insert( "Quit2", Key_Q, this, SLOT(slotSave()));
    accel->insert( "Save2", Key_S, this, SLOT(slotSaveAs()));
    accel->insert( "Print2", Key_P, this, SLOT(slotPrint()));
    accel->insert( "New2", Key_N, this, SLOT(slotGrab()));
    accel->insert( "New3", Key_Space, this, SLOT(slotGrab()));

    setEscapeButton( User1 );
    connect( this, SIGNAL( user1Clicked() ), SLOT( reject() ) );

    mainWidget->btnNew->setFocus();
}
Exemplo n.º 28
0
ossimQtIcpDialog::ossimQtIcpDialog(QWidget* parent,
                                   ossimImageChain* image_chain)
   : QDialog(parent, "ossimQtIcpDialog", true, WDestructiveClose),
     theChain(image_chain),
     theWriter(NULL),
     theMainVBox(NULL),
     
     theHBox1(NULL),
     theSourceImageGroupBox(NULL),         
     theSourceImageLabel(NULL),
     
     theHBox2(NULL),
     theStartLineGroupBox(NULL),
     theStartLineField(NULL),
     theStopLineGroupBox(NULL),   
     theStopLineField(NULL),
     
     theHBox3(NULL),
     theStartSampleGroupBox(NULL),
     theStartSampleField(NULL),
     theStopSampleGroupBox(NULL),   
     theStopSampleField(NULL),
     
     theHBox4(NULL),
     theOutputImageGroupBox(NULL),      
     theOutputImageField(NULL),
     theOutputImageButton(NULL),
     
     theHBox5(NULL),
     theOutputImageTypeGroupBox(NULL),
     theOutputImageWriterMenu(NULL),
     theEditOutputImageWriterButton(NULL),
     
     theHBox6(NULL),
     theSaveButton(NULL),
     theCloseButton(NULL),
     theSourceImageRect(),
     theOutputImageRect()
{
   setCaption("Export Image");
   

   // Main vertical box.
   theMainVBox = new QVBoxLayout(this);

   // First row, display source image file name.
   theHBox1 = new QHBoxLayout(theMainVBox);
   
   theSourceImageGroupBox = new QGroupBox(1,
                                          Qt::Horizontal,
                                          "source image",
                                          this,
                                          "theSourceImageGroupBox");
   theSourceImageGroupBox->setAlignment(Qt::AlignHCenter);
   QString s = getImageFileName();
   theSourceImageLabel = new QLabel(s,
                                    theSourceImageGroupBox,
                                    "theSourceImageLabel");
   theHBox1->addWidget(theSourceImageGroupBox);
   // End of first row.

   // Second row, start line, stop line.
   theHBox2 = new QHBoxLayout(theMainVBox);
   theStartLineGroupBox = new QGroupBox(1, Qt::Horizontal, "start line", this);
   theStartLineGroupBox->setAlignment(Qt::AlignHCenter);
   theStartLineField = new QLineEdit(theStartLineGroupBox, "theStartLineField");
   theHBox2->addWidget(theStartLineGroupBox);

   // Make the stop line box.
   theStopLineGroupBox = new QGroupBox(1, Qt::Horizontal, "stop line", this);
   theStopLineGroupBox->setAlignment(Qt::AlignHCenter);
   theStopLineField = new QLineEdit(theStopLineGroupBox, "theStopLineField");
   theHBox2->addWidget(theStopLineGroupBox);
   // End of second row.

   // Third row, start sample, stop sample.
   theHBox3 = new QHBoxLayout(theMainVBox);

   // Make the start sample box.
   theStartSampleGroupBox =
      new QGroupBox(1, Qt::Horizontal, "start sample", this);
   theStartSampleGroupBox->setAlignment(Qt::AlignHCenter);
   theStartSampleField = new QLineEdit(theStartSampleGroupBox,
                                       "theStartSampleField");
   theHBox3->addWidget(theStartSampleGroupBox);

   // Make the stop sample box.
   theStopSampleGroupBox =
      new QGroupBox(1, Qt::Horizontal, "stop sample", this);
   theStopSampleGroupBox->setAlignment(Qt::AlignHCenter);
   theStopSampleField = new QLineEdit(theStopSampleGroupBox,
                                      "theStopSampleField");
   theHBox3->addWidget(theStopSampleGroupBox);

   // End of third row...

   // Fourth row, output file, file dialog button.
   theHBox4 = new QHBoxLayout(theMainVBox);
   theOutputImageGroupBox =
      new QHGroupBox("output image", this, "theOutputImageGroupBox");
   theOutputImageGroupBox->setAlignment(Qt::AlignHCenter);
   theOutputImageField = new QLineEdit(theOutputImageGroupBox,
                                       "theOutputImageField");
   theOutputImageButton = new QPushButton( theOutputImageGroupBox,
                                           "theOutputImageButton" );
   theOutputImageButton->setText( "..." );
   theOutputImageButton->setDefault(false);
   theOutputImageButton->setAutoDefault(false);
   theHBox4->addWidget(theOutputImageGroupBox);
   // End of fourth row...
   
   // Fifth row.
   theHBox5 = new QHBoxLayout(theMainVBox);
   theOutputImageTypeGroupBox =
      new QHGroupBox("output image type", this, "theOutputImageTypeGroupBox");
   theOutputImageTypeGroupBox->setAlignment(Qt::AlignHCenter);
   
   theOutputImageWriterMenu = new QComboBox(theOutputImageTypeGroupBox,
                                       "theOutputWriterBox");
   buildWriterMenu();
   theEditOutputImageWriterButton =
      new QPushButton( theOutputImageTypeGroupBox,
                       "theEditOutputImageWriterButton" );
   theEditOutputImageWriterButton->setText( "edit writer" );
   theEditOutputImageWriterButton->setDefault(false);
   theEditOutputImageWriterButton->setAutoDefault(false);
   theHBox5->addWidget(theOutputImageTypeGroupBox);

   // Sixth row.
   theHBox6 = new QHBoxLayout(theMainVBox);

   theSaveButton = new QPushButton( this, "theSaveButton" );
   theSaveButton->setText( "Save" );
   theSaveButton->setDefault(false);
   theSaveButton->setAutoDefault(false);   
   
   theCloseButton = new QPushButton( this, "theCloseButton" );
   theCloseButton->setText( "Close" );
   theCloseButton->setDefault(false);
   theCloseButton->setAutoDefault(false);   

   theHBox6->addWidget(theSaveButton);
   theHBox6->addWidget(theCloseButton);

   //---
   // Connect all the signals to slots...
   //
   // NOTE:
   // If a push button is set to "default" or "auto default" it will always
   // call that slot when return is pressed in the dialog.
   // Since this isn't what I want all defaults are set to off!
   //---
   connect( theStartLineField, SIGNAL ( returnPressed() ),
            this, SLOT ( startLinePressed() ) );
   
   connect( theStopLineField, SIGNAL ( returnPressed() ),
            this, SLOT ( stopLinePressed() ) );
   
   connect( theStartSampleField, SIGNAL ( returnPressed() ),
            this, SLOT ( startSamplePressed() ) );
   
   connect( theStopSampleField, SIGNAL ( returnPressed() ),
            this, SLOT ( stopSamplePressed() ) );

   connect( theOutputImageField, SIGNAL ( returnPressed() ),
            this, SLOT ( outputImagePressed() ) );

   connect( theOutputImageButton, SIGNAL ( clicked() ),
            this, SLOT ( outputImageClicked() ) );

   connect( theOutputImageWriterMenu, SIGNAL ( activated( const QString& ) ),
            this, SLOT ( outputImageWriterMenuActivated( const QString& ) ) );

   connect( theEditOutputImageWriterButton,
            SIGNAL ( clicked() ),
            this,
            SLOT ( editOutputImageWriterClicked() ) );

   connect( theSaveButton, SIGNAL ( clicked() ),
            this, SLOT ( saveClicked() ) );
   
   connect( theCloseButton, SIGNAL ( clicked() ),
            this, SLOT ( closeClicked() ) );

   initializeDialog();
}
Exemplo n.º 29
0
ThumbnailStrip::ThumbnailStrip(QWidget *parent)
    : QWidget(parent),
      panelSize(122),
      current(-1),
      thumbView(NULL)
{
    thumbView = new ThumbnailView();
    widget = new ClickableWidget();

    thumbView->setWidget(widget);
    thumbView->setFrameShape(QFrame::NoFrame);

    viewLayout = new QBoxLayout(QBoxLayout::LeftToRight);
    viewLayout->setSpacing(0);
    widget->setLayout(viewLayout);
    widget->setStyleSheet("background-color: #202020;"); // doesnt work from qss for some reason

    scrollBar = thumbView->horizontalScrollBar();

    // BUTTONS
    buttonsWidget = new QWidget();
    buttonsWidget->setAccessibleName("panelButtonsWidget");

    openButton = new ClickableLabel();
    openButton->setAccessibleName("panelButton");
    openButton->setPixmap(QPixmap(":/images/res/icons/open.png"));

    saveButton = new ClickableLabel();
    saveButton->setAccessibleName("panelButton");
    saveButton->setPixmap(QPixmap(":/images/res/icons/save.png"));

    settingsButton = new ClickableLabel();
    settingsButton->setAccessibleName("panelButton");
    settingsButton->setPixmap(QPixmap(":/images/res/icons/settings.png"));

    buttonsLayout = new QBoxLayout(QBoxLayout::LeftToRight);
    buttonsLayout->setSpacing(0);
    buttonsLayout->setContentsMargins(0,0,0,0);
    buttonsLayout->addWidget(openButton);
    buttonsLayout->addWidget(saveButton);
    buttonsLayout->addWidget(settingsButton);
    buttonsLayout->addStretch(0);

    buttonsWidget->setLayout(buttonsLayout);

    // main layout
    layout = new QBoxLayout(QBoxLayout::TopToBottom);
    layout->setSpacing(0);
    layout->setContentsMargins(0,0,0,0);
    layout->addWidget(buttonsWidget);
    layout->addWidget(thumbView);

    this->setLayout(layout);

    // other extremely important things

    thumbView->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
    widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
    widget->setAccessibleName("thumbnailWidget");
    thumbView->setAccessibleName("thumbnailView");
    loadTimer.setSingleShot(true);
    timeLine = new QTimeLine(SCROLL_ANIMATION_SPEED, thumbView);
    timeLine->setCurveShape(QTimeLine::EaseInCurve);

    thumbView->horizontalScrollBar()->setAttribute(Qt::WA_NoMousePropagation, true);
    thumbView->verticalScrollBar()->setAttribute(Qt::WA_NoMousePropagation, true);
    this->setAttribute(Qt::WA_NoMousePropagation, true);
    this->setFocusPolicy(Qt::NoFocus);
    thumbView->setFocusPolicy(Qt::NoFocus);

    // actions
    connect(openButton, SIGNAL(clicked()), this, SIGNAL(openClicked()));
    connect(saveButton, SIGNAL(clicked()), this, SIGNAL(saveClicked()));
    connect(settingsButton, SIGNAL(clicked()), this, SIGNAL(settingsClicked()));

    connect(widget, SIGNAL(pressed(QPoint)), this, SLOT(viewPressed(QPoint)));
    connect(&loadTimer, SIGNAL(timeout()), this, SLOT(loadVisibleThumbnails()));
    connect(settings, SIGNAL(settingsChanged()), this, SLOT(readSettings()));

    readSettings();
    this->hide();
}
Exemplo n.º 30
0
QTM_USE_NAMESPACE

TodoEditPage::TodoEditPage(QWidget *parent)
    :QWidget(parent),
    m_manager(0),
    m_subjectEdit(0),
    m_startTimeEdit(0),
    m_dueTimeEdit(0),
    m_priorityEdit(0),
    m_statusEdit(0),
    m_alarmComboBox(0)
{
    // Create widgets
    QLabel *subjectLabel = new QLabel("Subject:", this);
    m_subjectEdit = new QLineEdit(this);
    QLabel *startTimeLabel = new QLabel("Start time:", this);
    m_startTimeEdit = new QDateTimeEdit(this);
    m_startTimeEdit->setDisplayFormat(QString("yyyy-MM-dd hh:mm:ss AP"));
    QLabel *dueTimeLabel = new QLabel("Due time:", this);
    m_dueTimeEdit = new QDateTimeEdit(this);
    m_dueTimeEdit->setDisplayFormat(QString("yyyy-MM-dd hh:mm:ss AP"));
    QLabel *priorityLabel = new QLabel("Priority:", this);
    m_priorityEdit = new QComboBox(this);
    QLabel *statusLabel = new QLabel("Status:", this);
    m_statusEdit = new QComboBox(this);
    QLabel *alarmLabel = new QLabel("Alarm:", this);
    m_alarmComboBox = new QComboBox(this);
    QLabel *calendarLabel = new QLabel("Calendar:", this);

    QStringList alarmList;
    alarmList  << "None"
                << "0 minutes before"
                << "5 minutes before"
                << "15 minutes before"
                << "30 minutes before"
                << "1 hour before";
    m_alarmComboBox->addItems(alarmList);
    connect(m_alarmComboBox, SIGNAL(currentIndexChanged(const QString)), this,
                        SLOT(handleAlarmIndexChanged(const QString)));

    m_calendarComboBox = new QComboBox(this);
    // the calendar names are not know here, fill the combo box later...

#ifndef Q_OS_SYMBIAN
    // Add push buttons for non-Symbian platforms as they do not support soft keys
    QHBoxLayout* hbLayout = new QHBoxLayout();
    QPushButton *okButton = new QPushButton("Save", this);
    connect(okButton,SIGNAL(clicked()),this,SLOT(saveClicked()));
    hbLayout->addWidget(okButton);
    QPushButton *cancelButton = new QPushButton("Cancel", this);
    connect(cancelButton,SIGNAL(clicked()),this,SLOT(cancelClicked()));
    hbLayout->addWidget(cancelButton);
#endif

    // check to see whether we support alarms.
    QOrganizerManager defaultManager;
    QStringList supportedDefinitionNames = defaultManager.detailDefinitions(QOrganizerItemType::TypeTodo).keys();

    QVBoxLayout *scrollAreaLayout = new QVBoxLayout();
    scrollAreaLayout->addWidget(subjectLabel);
    scrollAreaLayout->addWidget(m_subjectEdit);
    scrollAreaLayout->addWidget(startTimeLabel);
    scrollAreaLayout->addWidget(m_startTimeEdit);
    scrollAreaLayout->addWidget(dueTimeLabel);
    scrollAreaLayout->addWidget(m_dueTimeEdit);
    scrollAreaLayout->addWidget(priorityLabel);
    scrollAreaLayout->addWidget(m_priorityEdit);
    scrollAreaLayout->addWidget(statusLabel);
    scrollAreaLayout->addWidget(m_statusEdit);
    if (supportedDefinitionNames.contains(QOrganizerItemVisualReminder::DefinitionName)) {
        scrollAreaLayout->addWidget(alarmLabel);
        scrollAreaLayout->addWidget(m_alarmComboBox);
    }
    scrollAreaLayout->addWidget(calendarLabel);
    scrollAreaLayout->addWidget(m_calendarComboBox);
    scrollAreaLayout->addStretch();
#ifndef Q_OS_SYMBIAN
    scrollAreaLayout->addLayout(hbLayout);
#endif

    QScrollArea *scrollArea = new QScrollArea(this);
    scrollArea->setWidgetResizable(true);
    QWidget *formContainer = new QWidget(scrollArea);
    formContainer->setLayout(scrollAreaLayout);
    scrollArea->setWidget(formContainer);

    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->addWidget(scrollArea);
    setLayout(mainLayout);

    // Add softkeys
    QAction* cancelSoftKey = new QAction("Cancel", this);
    cancelSoftKey->setSoftKeyRole(QAction::NegativeSoftKey);
    addAction(cancelSoftKey);
    connect(cancelSoftKey, SIGNAL(triggered(bool)), this, SLOT(cancelClicked()));
    
    QAction* saveSoftKey = new QAction("Save", this);
    saveSoftKey->setSoftKeyRole(QAction::PositiveSoftKey);
    addAction(saveSoftKey);
    connect(saveSoftKey, SIGNAL(triggered(bool)), this, SLOT(saveClicked()));
    
    // Fill priority combo
    m_priorityEdit->addItem("Unknown", QVariant(QOrganizerItemPriority::UnknownPriority));
    m_priorityEdit->addItem("Highest", QVariant(QOrganizerItemPriority::HighestPriority));
    m_priorityEdit->addItem("Extremely high", QVariant(QOrganizerItemPriority::ExtremelyHighPriority));
    m_priorityEdit->addItem("Very high", QVariant(QOrganizerItemPriority::VeryHighPriority));
    m_priorityEdit->addItem("High", QVariant(QOrganizerItemPriority::HighPriority));
    m_priorityEdit->addItem("Medium", QVariant(QOrganizerItemPriority::MediumPriority));
    m_priorityEdit->addItem("Low", QVariant(QOrganizerItemPriority::LowPriority));
    m_priorityEdit->addItem("Very low", QVariant(QOrganizerItemPriority::VeryLowPriority));
    m_priorityEdit->addItem("Extremely low", QVariant(QOrganizerItemPriority::ExtremelyLowPriority));
    m_priorityEdit->addItem("Lowest", QVariant(QOrganizerItemPriority::LowestPriority));

    // Fill status combo
    m_statusEdit->addItem("Not started", QVariant(QOrganizerTodoProgress::StatusNotStarted));
    m_statusEdit->addItem("In progress", QVariant(QOrganizerTodoProgress::StatusInProgress));
    m_statusEdit->addItem("Complete", QVariant(QOrganizerTodoProgress::StatusComplete));
}