示例#1
0
PoolWindow::PoolWindow(QWidget *parent)
	: QMainWindow(parent)
	, ui_()
	, poolTableModel_()
	, itemDelegate_(new PoolItemDelegate(poolTableModel_))
	, rootFilterNode_()
{
	setWindowFlags(Qt::NoDropShadowWindowHint);
	ui_.setupUi(this);
	ui_.poolTbl_->setItemDelegate(itemDelegate_.data());
	ui_.poolTbl_->setModel(&poolTableModel_);
	ui_.poolTbl_->setSortingEnabled(true);
	ui_.poolTbl_->setSelectionBehavior(QAbstractItemView::SelectRows);
	ui_.poolTbl_->horizontalHeader()->setSectionsMovable(true);
	ui_.poolTbl_->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu);
	connect(ui_.poolTbl_->horizontalHeader(), SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(hideColumnsContextMenuRequested(QPoint)));
	connect(ui_.poolTbl_->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), this, SLOT(currentRowChanged(QModelIndex, QModelIndex)));
	connect(ui_.actionAdvancedFilter, SIGNAL(triggered()), this, SLOT(actionAdvancedFilter()));
	connect(ui_.actionEnableFilter, SIGNAL(triggered(bool)), this, SLOT(actionEnableFilter(bool)));
	connect(ui_.actionAddToCollection, SIGNAL(triggered()), this, SLOT(actionAddToCollection()));
	connect(ui_.actionRemoveFromCollection, SIGNAL(triggered()), this, SLOT(actionRemoveFromCollection()));
	connect(ui_.actionAddToDeck, SIGNAL(triggered()), this, SLOT(actionAddToDeck()));
	connect(ui_.actionRemoveFromDeck, SIGNAL(triggered()), this, SLOT(actionRemoveFromDeck()));
	connect(ui_.actionDownloadCardArt, SIGNAL(triggered()), this, SLOT(actionDownloadCardArt()));
	connect(ui_.actionFetchOnlineData, SIGNAL(triggered()), this, SLOT(actionFetchOnlineData()));
	connect(this, SIGNAL(fontChanged()), ui_.poolTbl_, SLOT(handleFontChanged()));

	ui_.statusBar->addPermanentWidget(new QLabel("Search: "));
	QLabel* permanentStatusBarLabel = new QLabel();
	ui_.statusBar->addPermanentWidget(permanentStatusBarLabel);
	connect(ui_.poolTbl_, SIGNAL(searchStringChanged(QString)), permanentStatusBarLabel, SLOT(setText(QString)));
}
void CAPresentationHandler::setSearchString (const QString& searchString)
{
    d->searchString = searchString;
    d->findText->find(searchString);

    emit searchStringChanged();
}
示例#3
0
void SearchWidget::handleSearchStringChanged(const QString &string)
{
    if (m_notificationMode == NotifyOnChange)
    {
        handleFindPrevious();
        handleFindNext();
        emit searchStringChanged(string);
    }
}
示例#4
0
void SearchWidget::on_searchString_returnPressed()
{
    if (m_notificationMode == NotifyOnReturn)
    {
        handleFindPrevious();
        handleFindNext();
        emit searchStringChanged(ui->searchString->text());
    }
}
示例#5
0
void CASpreadsheetHandler::setSearchString (const QString& searchString)
{
    d->searchString = searchString;

    d->sheetView = d->canvasItem->sheetView(d->sheet);
    d->canvasItem->setActiveSheet(d->sheet);
    d->findText->setCurrentSheet(d->sheet,d->sheetView);
    d->findText->find(searchString);

    emit searchStringChanged();
}
示例#6
0
void TextFind::findTextChange(const QString &text)
{
    if (text.isEmpty())
    {
        nextBtn->setEnabled(false);
        prevBtn->setEnabled(false);
        replaceBtn->setEnabled(false);
        replaceAllBtn->setEnabled(false);
    } else {
        nextBtn->setEnabled(true);
        prevBtn->setEnabled(true);
        replaceBtn->setEnabled(true);
        replaceAllBtn->setEnabled(true);
    }
    emit searchStringChanged(text);
}
示例#7
0
MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f )
    : QMainWindow( parent, name, f ), _currentItem(0)
{
    setCaption( tr("OSearch") );

    setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));

    QFrame *mainFrame = new QFrame( this, "mainFrame" );
    mainFrame->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));

    mainLayout = new QVBoxLayout( mainFrame );
    mainLayout->setSpacing( 0 );
    mainLayout->setMargin( 3 );

    resultsList = new OListView( mainFrame );
    resultsList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
    mainLayout->addWidget( resultsList );

    detailsFrame = new QFrame( mainFrame, "detailsFrame" );
    QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame );
    richEdit = new QTextView( detailsFrame );
    QWhatsThis::add( richEdit, tr("The details of the current result") );
    richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
    detailsLayout->addWidget( richEdit );

    buttonBox = new QHBox( mainFrame, "Button Box" );

    _buttonCount = 0;

    mainLayout->addWidget( detailsFrame );
    mainLayout->addWidget( buttonBox );
    detailsFrame->hide();
    buttonBox->hide();

    searches.append( new AppLnkSearch( resultsList, tr("Applications") ) );
    searches.append( new DocLnkSearch( resultsList, tr("Documents") ) );
    searches.append( new TodoSearch( resultsList, tr("Todo List") ) );
    searches.append( new DatebookSearch( resultsList, tr("Calendar") ) );
    searches.append( new AdressSearch( resultsList, tr("Contacts") ) );
    searches.append( new MemoSearch( resultsList, tr("Notes") ) );

    setCentralWidget( mainFrame );

    popupTimer = new QTimer();
    searchTimer = new QTimer();

    connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup()));
    connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged()));
    connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*)));
    connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*)));

    signalMapper = new QSignalMapper( this );

    connect(signalMapper, SIGNAL(mapped(int)), SLOT( slotAction(int) ) );

    makeMenu();

    Config cfg( "osearch", Config::User );
    cfg.setGroup( "search_settings" );
    actionCaseSensitiv->setOn( cfg.readBoolEntry( "caseSensitiv", false ) );
    actionWildcards->setOn( cfg.readBoolEntry( "wildcards", false ) );
//    actionWholeWordsOnly->setOn( cfg.readBoolEntry( "whole_words_only", false ) );
}
示例#8
0
void MainWindow::optionChanged(int )
{
    searchStringChanged();
}