ddmMinMaxFrictionFilterWidget::ddmMinMaxFrictionFilterWidget( ddmMinMaxFrictionFilter* filter, QWidget* parent ) : ddmFilterWidget( filter, parent )
{
    this->ui = new Ui::ddmMinMaxFrictionFilterWidget;
    this->ui->setupUi( this );

    QObject::connect( this->spinMinValue(), SIGNAL( valueChanged(double) ), this, SIGNAL( changed() ) );
    QObject::connect( this->spinMaxValue(), SIGNAL( valueChanged(double) ), this, SIGNAL( changed() ) );

    QObject::connect( this->ui->buttonApply, SIGNAL( clicked() ), this, SLOT( slotApplyFilter() ) );
}
Ejemplo n.º 2
0
DTPatientListWidget::DTPatientListWidget(QWidget* parent, Qt::WindowFlags f) :
    DTAbstractMasterWidget(parent,f),
    ui(new Ui::DTPatientListWidget)
{
    ui->setupUi(this);

    mPatientListModel = new DTPatientListModel(this);
    mPatientListModel->setEditStrategy(QSqlTableModel::OnManualSubmit);

    mPatientSearchListModel = new DTPatientListModel(this);
    mPatientSearchListModel->setEditStrategy(QSqlTableModel::OnManualSubmit);

    mPatientListDelegate = new DTPatientListDelegate(this);

    mContentsMenu = new QMenu(this);
    mContentsMenu->addAction(ui->acAddPatient);
    mContentsMenu->addAction(ui->acEditPatient);
    mContentsMenu->addAction(ui->acDelPatient);
//    ui->mPatienstList->setContextMenuPolicy(Qt::CustomContextMenu);
//    connect(ui->mPatienstList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotCustomContentsMenu(QPoint)));

    setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotCustomContentsMenu(QPoint)));

    connect(&gDataModule, SIGNAL(dbOpened()), this, SLOT(slotDBOpened()));
    connect(&gDataModule, SIGNAL(dbClosed()), this, SLOT(slotDBClosed()));
    connect(ui->mFilterTabs, SIGNAL(changeFilter(QString)), this, SLOT(slotApplyFilter(QString)));

    connect(ui->mPatientsList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotDoubleClicked(QModelIndex)));

    ui->mFilterTabs->setShape(QTabBar::TriangularWest);

    ui->mPatientsList->setUniformItemSizes(false);
    ui->mPatientsList->viewport()->installEventFilter(this);
    ui->mPatientsList->setItemDelegate(mPatientListDelegate);
}