Example #1
0
FilterHeader::FilterHeader( QWidget* parent )
    : BasicHeader( parent )
{
    m_filterField = new QSearchField( this );
    m_filterField->setPlaceholderText( tr( "Filter..." ) );
    m_filterField->setFixedWidth( 220 );
    ui->horizontalLayout->addWidget( m_filterField );

    connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) );
    connect( m_filterField, SIGNAL( textChanged( QString ) ), SLOT( onFilterEdited() ) );
}
Example #2
0
/**
 * @brief MovieListDialog::MovieListDialog
 * @param parent
 */
MovieListDialog::MovieListDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::MovieListDialog)
{
    ui->setupUi(this);
#if QT_VERSION >= 0x050000
    ui->movies->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
#else
    ui->movies->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
#endif
#ifdef Q_OS_MAC
    setWindowFlags((windowFlags() & ~Qt::WindowType_Mask) | Qt::Sheet);
    setStyleSheet(styleSheet() + " #MovieListDialog { border: 1px solid rgba(0, 0, 0, 100); border-top: none; }");
#else
    setWindowFlags((windowFlags() & ~Qt::WindowType_Mask) | Qt::Dialog);
#endif
    connect(ui->buttonClose, SIGNAL(clicked()), this, SLOT(reject()));
    connect(ui->buttonAddMovies, SIGNAL(clicked()), this, SLOT(onAddMovies()));
    connect(ui->filter, SIGNAL(textEdited(QString)), this, SLOT(onFilterEdited(QString)));
}