void SubjectsDialog::createUI()
{
    this->setWindowTitle(QString::fromUtf8("Tantárgyak"));

    this->m_newButton = new QPushButton(QString::fromUtf8("Új"));
    this->m_modifyButton = new QPushButton(QString::fromUtf8("Módosítások alkalmazása"));
    this->m_deleteButton = new QPushButton(QString::fromUtf8("Kijelöltek törlése"));
    this->m_clearAllButton = new QPushButton(QString::fromUtf8("Mind törlése"));
    this->m_refreshButton = new QPushButton(QString::fromUtf8("Tábla frissítése"));

    this->m_buttonsLayout = new QHBoxLayout();
    this->m_buttonsLayout->addWidget(this->m_newButton);
    this->m_buttonsLayout->addWidget(this->m_modifyButton);
    this->m_buttonsLayout->addWidget(this->m_deleteButton);
    this->m_buttonsLayout->addWidget(this->m_clearAllButton);
    this->m_buttonsLayout->addWidget(this->m_refreshButton);

    this->m_tableWidget = new QTableWidget();
    this->m_tableWidget->setMinimumSize(600, 400);

    this->m_layout = new QVBoxLayout();
    this->m_layout->addLayout(this->m_buttonsLayout);
    this->m_layout->addWidget(this->m_tableWidget);

    this->setLayout(this->m_layout);

    connect(this->m_newButton, SIGNAL(clicked()), this, SLOT(newButtonClicked()));
    connect(this->m_modifyButton, SIGNAL(clicked()), this, SLOT(modifyButtonClicked()));
    connect(this->m_deleteButton, SIGNAL(clicked()), this, SLOT(deleteButtonClicked()));
    connect(this->m_refreshButton, SIGNAL(clicked()), this, SLOT(refreshTable()));
    connect(this->m_clearAllButton, SIGNAL(clicked()), gdata, SLOT(deleteAllSubjects()));
    connect(gdata, SIGNAL(subjectsReady()), this, SLOT(subjectsReady()));
}
OpenSearchDialog::OpenSearchDialog(QWidget *parent)
    : QDialog(parent)
    , m_model(0)
{
    setModal(true);
    setupUi(this);

    m_model = new OpenSearchEngineModel(ToolbarSearch::openSearchManager(), this);
    m_tableView->setModel(m_model);
    m_tableView->horizontalHeader()->resizeSection(0, 200);
    m_tableView->horizontalHeader()->setStretchLastSection(true);
    m_tableView->verticalHeader()->hide();
    m_tableView->verticalHeader()->setDefaultSectionSize(1.2 * fontMetrics().height());
    m_tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
    m_tableView->setShowGrid(false);
    m_tableView->setAlternatingRowColors(true);

    connect(m_closeButton, SIGNAL(clicked()),
            this, SLOT(close()));
    connect(m_addButton, SIGNAL(clicked()),
            this, SLOT(addButtonClicked()));
    connect(m_deleteButton, SIGNAL(clicked()),
            this, SLOT(deleteButtonClicked()));
    connect(m_restoreButton, SIGNAL(clicked()),
            this, SLOT(restoreButtonClicked()));
}
FlashSegmentWindowHandler::FlashSegmentWindowHandler(QObject *parent) :
    QObject(parent)
{
    connect(mWindow.ui->classList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*, QListWidgetItem*)));
    connect(mWindow.ui->okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
    connect(mWindow.ui->addButton, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
    connect(mWindow.ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteButtonClicked()));
    connect(mWindow.ui->viewButton, SIGNAL(clicked()), this, SLOT(viewButtonClicked()));
}
示例#4
0
CloudRoutesDialog::CloudRoutesDialog( CloudRouteModel *model, QWidget *parent ) : QDialog( parent ),
    d( new Private( model ) )
{
    d->setupUi( this );
    
    RouteItemDelegate *delegate = new RouteItemDelegate( d->listView, d->m_model );
    connect( delegate, SIGNAL(downloadButtonClicked(QString)), this, SIGNAL(downloadButtonClicked(QString)) );
    connect( delegate, SIGNAL(openButtonClicked(QString)), this, SIGNAL(openButtonClicked(QString)) );
    connect( delegate, SIGNAL(deleteButtonClicked(QString)), this, SIGNAL(deleteButtonClicked(QString)) );
    connect( delegate, SIGNAL(removeFromCacheButtonClicked(QString)), this, SIGNAL(removeFromCacheButtonClicked(QString)) );
    connect( delegate, SIGNAL(uploadToCloudButtonClicked(QString)), this, SIGNAL(uploadToCloudButtonClicked(QString)) );
    connect( d->m_model, SIGNAL(modelReset()), this, SLOT(updateNoRouteLabel()) );

    d->progressBar->setHidden( true );
    d->labelNoRoute->setHidden( true );

    d->listView->setItemDelegate( delegate );
    d->listView->setModel( d->m_model );
}
示例#5
0
void EditSourcesDlg::addSource(QDir dir)
{
    QSharedPointer<BackupSource> source(new BackupSource(dir));
    BackupSourceWidget *widget = new BackupSourceWidget(source);
    m_sourcesWidget->append(widget);
    connect(widget,
            SIGNAL(deleteButtonClicked()),
            this,
            SLOT(onDeleteButtonPressed()));
}
示例#6
0
bool RouteItemDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index )
{
    Q_UNUSED( model );

    if ( ( event->type() == QEvent::MouseButtonRelease ) ) {
        QMouseEvent *mouseEvent = static_cast<QMouseEvent*>( event );
        QPoint pos = mouseEvent->pos();
        
        bool cached = index.data( CloudRouteModel::IsCached ).toBool();
        bool onCloud = index.data( CloudRouteModel::IsOnCloud ).toBool();

        if( cached && !onCloud ) {
            QRect uploadRect = position( UploadToCloudButton, option );

            if ( uploadRect.contains( pos ) ) {
                QString timestamp = index.data( CloudRouteModel::Timestamp ).toString();
                emit uploadToCloudButtonClicked( timestamp );
                return true;
            }
        }

        if ( cached ) {
            QRect openRect = position( OpenButton, option );
            QRect cacheRemoveRect = position( RemoveFromCacheButton, option );

            if ( openRect.contains( pos ) ) {
                QString timestamp = index.data( CloudRouteModel::Timestamp ).toString();
                emit openButtonClicked( timestamp );
                return true;
            } else if ( cacheRemoveRect.contains( pos ) ) {
                QString timestamp = index.data( CloudRouteModel::Timestamp ).toString();
                emit removeFromCacheButtonClicked( timestamp );
                return true;
            }
        } else {
            QRect downloadRect = position( DownloadButton, option );
            QRect cloudRemoveRect = position( RemoveFromCloudButton, option );
            
            if ( downloadRect.contains( pos ) ) {
                QString timestamp = index.data( CloudRouteModel::Timestamp ).toString();
                m_model->setDownloadingItem( index );
                emit downloadButtonClicked( timestamp );
                return true;
            }
            
            if ( cloudRemoveRect.contains( pos ) ) {
                QString timestamp = index.data( CloudRouteModel::Timestamp ).toString();
                emit deleteButtonClicked( timestamp );
                return true;
            }
        }
    }
    
    return false;
}
示例#7
0
bool ptImageSpotEditor::eventFilter(QObject *obj, QEvent *event) {
  // detect delete button click
  if (event->type() == QEvent::MouseButtonPress) {
    if (obj == DelButton) {
      emit deleteButtonClicked();
      return true;
    }
  }

  // else: pass the event on to the parent class
  return QObject::eventFilter(obj, event);
}
EnvironmentVariablesDialog::EnvironmentVariablesDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::EnvironmentVariablesDialog)
{
    ui->setupUi(this);
    
    connect(ui->addButton, SIGNAL(clicked()),
            this, SLOT(addButtonClicked()));
    connect(ui->editButton, SIGNAL(clicked()),
            this, SLOT(editButtonClicked()));
    connect(ui->deleteButton, SIGNAL(clicked()),
            this, SLOT(deleteButtonClicked()));
    connect(ui->valueViewer, SIGNAL(itemSelectionChanged()),
            this, SLOT(viewerSelectionChanged()));
}
示例#9
0
int appSQL::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: displayButtonClicked(); break;
        case 1: submitChangedButtonClicked(); break;
        case 2: revertChangedButtonClicked(); break;
        case 3: addButtonClicked(); break;
        case 4: deleteButtonClicked(); break;
        case 5: searchButtonClicked(); break;
        case 6: closeButtonClicked(); break;
        }
        _id -= 7;
    }
    return _id;
}
示例#10
0
ResultsWindow::ResultsWindow(QWidget *parent, ResultItemsModel *resultItems) :
    QWidget(parent)
{
    resultItemsModel = resultItems;

    scanButton = new QPushButton(tr("Start Scan"));
    deleteButton = new QPushButton(tr("Delete Duplicates..."));
    exportButton = new QPushButton(tr("Export..."));
    label = new QLabel(tr("Scan Results"));

    QObject::connect(scanButton, SIGNAL(clicked()), this, SLOT(scanButtonClicked()));
    QObject::connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteButtonClicked()));
    QObject::connect(exportButton, SIGNAL(clicked()), this, SLOT(exportButtonClicked()));

    buttonLayout = new QHBoxLayout;
    buttonLayout->addWidget(label);
    buttonLayout->addWidget(scanButton);
    buttonLayout->addWidget(deleteButton);
    buttonLayout->addWidget(exportButton);
    buttonLayout->addStretch();

    //XXX Junk test code to see if this is working

    view = new QTableView;
    view->verticalHeader()->hide();
    view->setModel(resultItemsModel);
    view->resizeColumnsToContents();

    outerLayout = new QVBoxLayout;
    outerLayout->addLayout(buttonLayout);
    outerLayout->addWidget(view);

    setLayout(outerLayout);


}
示例#11
0
ChordEdit::ChordEdit(Score* s, QWidget* parent)
   : QDialog(parent)
      {
      _harmony = 0;
      score    = s;

      setupUi(this);
      // note that rootGroup button identifiers map conveniently
      // onto all possible tpc2step return values: don't change
      rootGroup = new QButtonGroup(this);
      rootGroup->addButton(rootC,   0);
      rootGroup->addButton(rootD,   1);
      rootGroup->addButton(rootE,   2);
      rootGroup->addButton(rootF,   3);
      rootGroup->addButton(rootG,   4);
      rootGroup->addButton(rootA,   5);
      rootGroup->addButton(rootB,   6);

      // note that accidentalsGroup button identifiers map conveniently
      // onto all possible tpc2alter return values: don't change
      accidentalsGroup = new QButtonGroup(this);
      accidentalsGroup->addButton(accDFlat,  -2 + 3);
      accidentalsGroup->addButton(accFlat,   -1 + 3);
      accidentalsGroup->addButton(accNone,    0 + 3);
      accidentalsGroup->addButton(accSharp,   1 + 3);
      accidentalsGroup->addButton(accDSharp,  2 + 3);

      extensionGroup = new QButtonGroup(this);
      extensionGroup->addButton(extMaj,    2);
      extensionGroup->addButton(ext2,     15);
      extensionGroup->addButton(extMaj7,   6);
      extensionGroup->addButton(extMaj9,   7);
      extensionGroup->addButton(ext6,      5);
      extensionGroup->addButton(ext69,    14);

      extensionGroup->addButton(extm,     16);
      extensionGroup->addButton(extm7,    19);
      extensionGroup->addButton(extm6,    23);
      extensionGroup->addButton(extm9,    20);
      extensionGroup->addButton(extmMaj7, 18);
      extensionGroup->addButton(extm7b5,  32);
      extensionGroup->addButton(extdim,   33);
      extensionGroup->addButton(ext7,     64);
      extensionGroup->addButton(ext9,     70);
      extensionGroup->addButton(ext13,    65);
      extensionGroup->addButton(ext7b9,   76);
      extensionGroup->addButton(extsus,  184);
      extensionGroup->addButton(ext7Sus, 128);
      extensionGroup->addButton(extOther,  0);

      extOtherCombo->clear();
      ChordList* cl = score->style()->chordList();
      foreach (const ChordDescription* cd, *cl) {
            QString p;
            if (cd->names.isEmpty())
                  p = "?";
            else
                  p = cd->names.front();
            extOtherCombo->addItem(p, cd->id);
            }
      connect(rootGroup, SIGNAL(buttonClicked(int)), SLOT(chordChanged()));
      connect(extensionGroup, SIGNAL(buttonClicked(int)), SLOT(chordChanged()));
      connect(extOtherCombo, SIGNAL(currentIndexChanged(int)), SLOT(chordChanged()));
      connect(accidentalsGroup, SIGNAL(buttonClicked(int)), SLOT(chordChanged()));
      connect(bassNote, SIGNAL(currentIndexChanged(int)), SLOT(chordChanged()));
      connect(extOther, SIGNAL(toggled(bool)), SLOT(otherToggled(bool)));
      connect(addButton, SIGNAL(clicked()), SLOT(addButtonClicked()));
      connect(deleteButton, SIGNAL(clicked()), SLOT(deleteButtonClicked()));

      extOtherCombo->setEnabled(false);

      model = new QStandardItemModel(0, 3);
      model->setHeaderData(0, Qt::Horizontal, tr("Type"));
      model->setHeaderData(1, Qt::Horizontal, tr("Value"));
      model->setHeaderData(2, Qt::Horizontal, tr("Alter"));

      connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
                     SLOT(modelDataChanged(QModelIndex,QModelIndex)));

      degreeTable->setModel(model);
      delegate = new DegreeTabDelegate;
      degreeTable->setItemDelegate(delegate);
      degreeTable->setColumnWidth(0, 80);
      degreeTable->setColumnWidth(1, 71);
      degreeTable->setColumnWidth(2, 71);
      }
UI_AnnotationEditwindow::UI_AnnotationEditwindow(int file_number, QWidget *w_parent)
{
  mainwindow = (UI_Mainwindow *)w_parent;

  file_num = file_number;

  annotation = mainwindow->annotationlist[file_num];

  dockedit = new QDockWidget("Annotation editor", w_parent);
  dockedit->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
  dockedit->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable);

  annot_edit_dialog = new QDialog;
  annot_edit_dialog->setMinimumSize(640, 45);

  dockedit->setWidget(annot_edit_dialog);

  descriptionLabel = new QLabel(annot_edit_dialog);
  descriptionLabel->setGeometry(10, 10, 78, 25);
  descriptionLabel->setText("Description");

  annot_descript_lineEdit = new QLineEdit(annot_edit_dialog);
  annot_descript_lineEdit->setGeometry(90, 10, 150, 25);

  onsetLabel = new QLabel(annot_edit_dialog);
  onsetLabel->setGeometry(250, 10, 48, 25);
  onsetLabel->setText("Onset");

  posNegTimebox = new QComboBox(annot_edit_dialog);
  posNegTimebox->setGeometry(300, 10, 35, 25);
  posNegTimebox->setEditable(false);
  posNegTimebox->addItem("+");
  posNegTimebox->addItem("-");

  onset_daySpinbox = new QSpinBox(annot_edit_dialog);
  onset_daySpinbox->setGeometry(335, 10, 45, 25);
  onset_daySpinbox->setRange(0, 99);
  onset_daySpinbox->setSingleStep(1);
  onset_daySpinbox->setValue(0);

  onset_timeEdit = new QTimeEdit(annot_edit_dialog);
  onset_timeEdit->setGeometry(380, 10, 100, 25);
  onset_timeEdit->setDisplayFormat("hh:mm:ss.zzz");
  onset_timeEdit->setMinimumTime(QTime(-1, 0, 0, 0));

  durationLabel = new QLabel(annot_edit_dialog);
  durationLabel->setGeometry(490, 10, 58, 25);
  durationLabel->setText("Duration");

  duration_spinbox = new QDoubleSpinBox(annot_edit_dialog);
  duration_spinbox->setGeometry(550, 10, 120, 25);
  duration_spinbox->setRange(-1.0, 10000.0);
  duration_spinbox->setSingleStep(1.0);
  duration_spinbox->setDecimals(3);
  duration_spinbox->setSuffix(" sec");
  duration_spinbox->setValue(-1.0);

  modifybutton = new QPushButton(annot_edit_dialog);
  modifybutton->setGeometry(720, 10, 100, 25);
  modifybutton->setText("Modify");
  modifybutton->setEnabled(false);

  deletebutton = new QPushButton(annot_edit_dialog);
  deletebutton->setGeometry(840, 10, 100, 25);
  deletebutton->setText("Delete");
  deletebutton->setEnabled(false);

  createbutton = new QPushButton(annot_edit_dialog);
  createbutton->setGeometry(960, 10, 100, 25);
  createbutton->setText("Create");

  QObject::connect(modifybutton, SIGNAL(clicked()),               this, SLOT(modifyButtonClicked()));
  QObject::connect(deletebutton, SIGNAL(clicked()),               this, SLOT(deleteButtonClicked()));
  QObject::connect(createbutton, SIGNAL(clicked()),               this, SLOT(createButtonClicked()));
  QObject::connect(dockedit,     SIGNAL(visibilityChanged(bool)), this, SLOT(open_close_dock(bool)));
}
TsDeviceDialogContainer::TsDeviceDialogContainer(QAbstractListModel *model,
                                                 QObject *parent)
    :
    QObject(parent),
    mVisibilityPublisher(TsProperty::KTsPath),
    mDismissRequestSubscriber(QString("%1/%2").arg(TsProperty::KTsPath).arg(TsProperty::KDismissRequestPath))
{
    bool ok(true);
    mLoader.load(KDocmlPath, &ok);
    Q_ASSERT(ok);

    HbDialog *dialog =
        qobject_cast<HbDialog *>(mLoader.findWidget("tsdevicedialog"));
    TsTasksGrid *grid =
        qobject_cast<TsTasksGrid *>(mLoader.findWidget("taskgrid"));
    Q_ASSERT(dialog);
    Q_ASSERT(grid);
    
    bool cssLoaded = HbStyleLoader::registerFilePath(":/resource/hbdialog.css");
    Q_ASSERT(cssLoaded);
    {
        HbLabel *dialogHeading = qobject_cast<HbLabel *>(dialog->headingWidget());
        Q_ASSERT(dialogHeading);
        HbFrameDrawer *headingFrame = new HbFrameDrawer(QLatin1String("qtg_fr_popup_heading"), HbFrameDrawer::ThreePiecesHorizontal);
        dialogHeading->setBackgroundItem(new HbFrameItem(headingFrame));
    }

    grid->setEnabledAnimations(HbAbstractItemView::None);
    grid->setModel(model);

    changeOrientation(dialog->mainWindow()->orientation());
    switchViewOnModelChange();

    // needed because of Qt::QueuedConnection used below
    // @todo: check if we actually need queued connections
    qRegisterMetaType<QModelIndex>("QModelIndex");

    // connect the grid and model
    connect(grid,
            SIGNAL(activated(QModelIndex)),
            model,
            SLOT(openApplication(QModelIndex)));
    connect(grid,
            SIGNAL(activated(QModelIndex)),
            dialog,
            SLOT(close()));
    connect(grid,
            SIGNAL(deleteButtonClicked(QModelIndex)),
            model, SLOT(closeApplication(QModelIndex)),
            Qt::QueuedConnection);

    connect(dialog->mainWindow(),
            SIGNAL(orientationChanged(Qt::Orientation)),
            this,
            SLOT(changeOrientation(Qt::Orientation)));
    connect(dialog,
            SIGNAL(aboutToClose()),
            this,
            SIGNAL(deviceDialogClosed()));

    // switch between grid and "no items" label when model is updated
    connect(model, SIGNAL(modelReset()), this, SLOT(switchViewOnModelChange()));
    connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(switchViewOnModelChange()));
    connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(switchViewOnModelChange()));

    connect(this,
            SIGNAL(deviceDialogClosed()),
            this,
            SLOT(notifyDialogClosed()));
    mVisibilityPublisher.setValue(TsProperty::KVisibilityPath,
                                  static_cast<int>(true));
    mVisibilityPublisher.sync();

    connect(&mDismissRequestSubscriber,
            SIGNAL(contentsChanged()),
            this,
            SLOT(handleDismissRequest()));
}