示例#1
0
EventSearch::EventSearch(QWidget *parent) :
    QWidget(parent)
{

    // Heisann
    mainLayout = new QGridLayout(this);
    setLayout(mainLayout);

    includeDates = new QCheckBox(QString("Inkluder datoområde?"));
    mainLayout->addWidget(includeDates, 0, 0, 1, 2);

    fromLabel = new QLabel("&Fra:", this);
    fromSearch = new QDateEdit(this);
    fromLabel->setBuddy(fromSearch);
    mainLayout->addWidget(fromLabel, 1, 0);
    mainLayout->addWidget(fromSearch, 1, 1);

    toLabel = new QLabel("&Til:", this);
    toSearch = new QDateEdit(this);
    toLabel->setBuddy(toSearch);
    mainLayout->addWidget(toLabel, 2, 0);
    mainLayout->addWidget(toSearch, 2, 1);

    titleLabel = new QLabel("T&ittel:", this);
    titleSearch = new QLineEdit(this);
    titleLabel->setBuddy(titleSearch);
    mainLayout->addWidget(titleLabel, 3, 0);
    mainLayout->addWidget(titleSearch, 3, 1);

    descriptionLabel = new QLabel("&Beskrivelse:", this);
    descriptionSearch = new QLineEdit(this);
    descriptionLabel->setBuddy(descriptionSearch);
    mainLayout->addWidget(descriptionLabel, 4, 0);
    mainLayout->addWidget(descriptionSearch, 4, 1);

    participantLabel = new QLabel("&Deltager:", this);
    participantSearch = new QLineEdit(this);
    participantLabel->setBuddy(participantSearch);
    mainLayout->addWidget(participantLabel, 5, 0);
    mainLayout->addWidget(participantSearch, 5, 1);

    search = new QPushButton("&Søk", this);
    mainLayout->addWidget(search, 6, 0);

    clear = new QPushButton("&Rens", this);
    mainLayout->addWidget(clear, 6, 1);

    connect(clear, SIGNAL(clicked()), this, SLOT(clearFields()));
    connect(search, SIGNAL(clicked()), this, SLOT(searchClicked()));

    connect(includeDates, SIGNAL(toggled(bool)), this, SLOT(setDateFieldState(bool)));
    includeDates->setChecked(false);
    setDateFieldState(false);

    //connect(this, SIGNAL(queryArgs(const EventHandler::QueryArgs&)), this, SLOT(debugQuery(const EventHandler::QueryArgs&)));

    clearFields();
}
示例#2
0
void Mpdf::initTop2()
{
    pageLabel = new QLabel;
    pageLabel->setText("Pages");

    prevButton = new QPushButton;
    prevButton->setText("prev");
    prevButton->setMinimumWidth(30);
    prevButton->setFlat(true);

    top2Layout = new QHBoxLayout;
    top2Layout->addWidget(pageLabel);
    top2Layout->addWidget(prevButton);

    numberButtonVec = new QVector<QPushButton *>;
    signalMapper = new QSignalMapper(this);

    for (int i = 0; i < 9; i++)
    {
        QPushButton *numberButton = new QPushButton;
        numberButton->setText(QString::number(i + 1));
        numberButton->setMinimumWidth(15);
        numberButton->setFlat(true);
        numberButtonVec->push_back(numberButton);
        top2Layout->addWidget(numberButton);

        signalMapper->setMapping(numberButton, i);
        connect(numberButton, SIGNAL(clicked()),
            signalMapper, SLOT(map()));
    }
    
    nextButton = new QPushButton;
    nextButton->setText("next");
    nextButton->setMinimumWidth(30);
    nextButton->setFlat(true);
    top2Layout->addWidget(nextButton);

    searchButton = new QPushButton;
    searchButton->setText("Search");
    top2Layout->addWidget(searchButton);

    connect(prevButton, SIGNAL(clicked()),
            this, SLOT(prevClicked()));
    connect(signalMapper, SIGNAL(mapped(int)),
            this, SLOT(numberClicked(int)));
    connect(nextButton, SIGNAL(clicked()),
            this, SLOT(nextClicked()));
    connect(searchButton, SIGNAL(clicked()),
            this, SLOT(searchClicked()));
}
示例#3
0
void SearchWidget::initUi()
{
	m_title = new TitleWidget(false, this);
	m_title->setFixedSize(searchTitleSize);
	m_title->move(0, 0);

	FuncButton *searchButton = new FuncButton(":/buttons/search_btn", this);
	connect(searchButton, SIGNAL(clicked()), this, SLOT(searchClicked()));

	searchButton->setCapturEnterEvent(false);
	m_searLineEdit = new QLineEdit(this);
	m_searLineEdit->setFixedWidth(searchWidgetSize.width() * 0.85);
	QHBoxLayout *searLayout = new QHBoxLayout;
	searLayout->addWidget(m_searLineEdit, 0, Qt::AlignLeft | Qt::AlignVCenter);
	searLayout->addWidget(searchButton, 0, Qt::AlignVCenter);
	searLayout->addStretch();

	m_musicSearch = new QCheckBox("单曲搜索", this);
	m_aritlsSearch = new QCheckBox("歌手搜索", this);
	m_albumSearch = new QCheckBox("专辑搜索", this);
	m_lyricSearch = new QCheckBox("歌词搜索", this);
	m_listsSearch = new QCheckBox("歌单搜索", this);
	m_ownerSearch = new QCheckBox("主播电台", this);

	m_musicSearch->setChecked(true);

	QHBoxLayout *searCheck1 = new QHBoxLayout;
	searCheck1->addWidget(m_musicSearch, 0, Qt::AlignLeft | Qt::AlignVCenter);
	searCheck1->addWidget(m_aritlsSearch, 0, Qt::AlignVCenter);
	searCheck1->addWidget(m_albumSearch, 0, Qt::AlignRight | Qt::AlignVCenter);
	searCheck1->setContentsMargins(0, 5, 5, 0);

	QHBoxLayout *searCheck2 = new QHBoxLayout;
	searCheck2->addWidget(m_listsSearch, 0, Qt::AlignLeft | Qt::AlignVCenter);
	searCheck2->addWidget(m_lyricSearch, 0, Qt::AlignVCenter);
	searCheck2->addWidget(m_ownerSearch, 0, Qt::AlignRight | Qt::AlignVCenter);
	searCheck2->setContentsMargins(0, 5, 5, 0);

	QVBoxLayout *mainLayout = new QVBoxLayout(this);
	mainLayout->addSpacing(searchTitleSize.height() + 10);
	mainLayout->addLayout(searLayout);
	mainLayout->addLayout(searCheck1);
	mainLayout->addLayout(searCheck2);

	QLabel *label = new QLabel("<font color='red' size=5>当前只实现单曲查找...</font>", this);
	mainLayout->addWidget(label, 0, Qt::AlignRight | Qt::AlignVCenter);

	mainLayout->setContentsMargins(10, 0, 10, 10);
}
示例#4
0
SearchDlg::SearchDlg(QCatDataModuleClass *_dm, int _catId, QWidget *parent)
 : dm(_dm), QDialog(parent), Ui::SearchDialog()
{
    //setupUi();
	catId = _catId;
    returnedId = -1;
    //dbConnName = connName;
    //db = QSqlDatabase::database(dbConnName, true);
    searchInDirs = dm->settings->searchDirNames;
    searchInFiles = dm->settings->searchFileNames;
    searchInDescriptions = dm->settings->searchDescriptions;
    caseSensitiveSearch = dm->settings->searchCaseSensitive;
	diskNames.clear();
  
	setupUi(this);
    
    QStringList resultHeader;
    resultHeader << tr("Name") << tr("Ext") << tr("Disk name") << tr("Size") << tr("Date") << tr("Time") << tr("Attr");
    resultsTreeWidget->setHeaderLabels(resultHeader);
	resultsTreeWidget->header()->setResizeMode(QHeaderView::ResizeToContents);
    
    if (searchInFiles)
        sfCheckBox->setCheckState(Qt::Checked);
    else
        sfCheckBox->setCheckState(Qt::Unchecked);
    if (searchInDirs)
        sdiCheckBox->setCheckState(Qt::Checked);
    else
        sdiCheckBox->setCheckState(Qt::Unchecked);
    if (searchInDescriptions)
        sdeCheckBox->setCheckState(Qt::Checked);
    else
        sdeCheckBox->setCheckState(Qt::Unchecked);
    if (caseSensitiveSearch)
        csCheckBox->setCheckState(Qt::Checked);
    else
        csCheckBox->setCheckState(Qt::Unchecked);
    
    
    connect(searchPushButton, SIGNAL(clicked()), this, SLOT(searchClicked()));
    connect(settingsPushButton, SIGNAL(clicked()), this, SLOT(settingsClicked()));
    connect(csCheckBox, SIGNAL(stateChanged(int)), this, SLOT(caseSensitiveStateChanged(int)));
    connect(sfCheckBox, SIGNAL(stateChanged(int)), this, SLOT(searchInFilesStateChanged(int)));
    connect(sdiCheckBox, SIGNAL(stateChanged(int)), this, SLOT(searchInDirsStateChanged(int)));
    connect(sdeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(searchInDescStateChanged(int)));
    connect(resultsTreeWidget, SIGNAL(itemActivated(QTreeWidgetItem*, int)), this, SLOT(itemIsActivated(QTreeWidgetItem*, int)));
    
    
}
示例#5
0
OptionsDialog::OptionsDialog(QWidget * par,const QString &szGroup,bool bModal)
    : QDialog(par)
{
    setObjectName("general_options_dialog");

    setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::KVIrc)));

    m_szGroup = szGroup;

    QString szDialogTitle;

    if(szGroup.isEmpty() || KviQString::equalCI(szGroup,"general"))
    {
        szDialogTitle = __tr2qs_ctx("General Preferences","options");
    } else if(KviQString::equalCI(szGroup,"theme"))
    {
        szDialogTitle = __tr2qs_ctx("Theme Preferences","options");
    } else {
        szDialogTitle = __tr2qs_ctx("KVIrc Preferences","options");
    }

    QString szDialog = __tr2qs_ctx("This dialog contains a set of KVIrc settings.<br> Use the icons " \
                                   "on the left to navigate through the option pages. The text box in the " \
                                   "bottom left corner is a small search engine. It will highlight the " \
                                   "pages that contain options related to the search term you have entered.","options");


    QString szInfoTips;
    szInfoTips = __tr2qs_ctx("Many settings have tooltips that can be shown by holding " \
                             "the cursor over their label for a few seconds.","options");

    QString szOkCancelButtons = __tr2qs_ctx("When you have finished, click \"<b>OK</b>\" to accept your changes " \
                                            "or \"<b>Cancel</b>\" to discard them. Clicking \"<b>Apply</b>\" will commit your " \
                                            "changes without closing the window.","options");

    QString szFrontText = QString(
                              "<table width=\"100%\" height=\"100%\" valign=\"top\" align=\"center\" cellpadding=\"4\">" \
                              "<tr>" \
                              "<td bgcolor=\"#303030\" valign=\"top\">" \
                              "<center><h1><font color=\"#FFFFFF\">%1</font></h1></center>" \
                              "</td>" \
                              "</tr>" \
                              "<tr>" \
                              "<td valign=\"bottom\">" \
                              "<p>" \
                              "%2" \
                              "</p>" \
                              "<br style=\"line-height:5px;\"/>" \
                              "<p>" \
                              "%3" \
                              "</p>" \
                              "<br style=\"line-height:5px;\"/>" \
                              "<p>" \
                              "%4" \
                              "</p>" \
                              "</td>" \
                              "</tr>" \
                              "</table>"
                          ).arg(szDialogTitle, szDialog, szInfoTips, szOkCancelButtons);

    QString szCaption = szDialogTitle + " - KVIrc";
    setWindowTitle(szCaption);

    QGridLayout * g1 = new QGridLayout(this);
    QSplitter * spl = new QSplitter(Qt::Horizontal,this);
    spl->setChildrenCollapsible(false);

    g1->addWidget(spl,0,0,1,5);

    KviTalVBox * vbox = new KviTalVBox(spl);
    vbox->setSpacing(2);
    vbox->setMargin(3);

    // Controlling list view
    m_pTreeWidget = new QTreeWidget(vbox);

    m_pTreeWidget->header()->hide();
    m_pTreeWidget->setRootIsDecorated(true);
    m_pTreeWidget->setSortingEnabled(false);
    m_pTreeWidget->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding);
    m_pTreeWidget->setCurrentItem(NULL);

    connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem *)),this,SLOT(treeWidgetItemSelectionChanged(QTreeWidgetItem *, QTreeWidgetItem *)));

    KviTalHBox * hbox = new KviTalHBox(vbox);
    hbox->setSpacing(2);
    hbox->setMargin(3);

    m_pSearchLineEdit = new QLineEdit(hbox);
    connect(m_pSearchLineEdit,SIGNAL(returnPressed()),this,SLOT(searchClicked()));
    m_pSearchButton = new QToolButton(hbox);
    m_pSearchButton->setIconSize(QSize(16,16));
    m_pSearchButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Search)));
    connect(m_pSearchButton,SIGNAL(clicked()),this,SLOT(searchClicked()));
    connect(m_pSearchLineEdit,SIGNAL(textChanged(const QString &)),this,SLOT(searchLineEditTextChanged(const QString &)));

    QString szTip = __tr2qs_ctx("<p>This is the search tool for this options dialog.</p>" \
                                "<p>You can enter a search term either in your native " \
                                "language or in English and press the button on the right. " \
                                "The pages that contain some options related to the " \
                                "search term will be highlighted and you will be able " \
                                "to quickly find them.</p><p>Try \"nickname\" for example.</p>","options");
    KviTalToolTip::add(m_pSearchLineEdit,szTip);
    KviTalToolTip::add(m_pSearchButton,szTip);

    vbox = new KviTalVBox(spl);
    vbox->setSpacing(2);
    vbox->setMargin(3);

    m_pCategoryLabel = new QLabel("<b>&nbsp;</b>",vbox);
    m_pCategoryLabel->setObjectName("labgeneraloptions");

    QFrame * f = new QFrame(vbox);
    f->setFrameStyle(QFrame::HLine | QFrame::Sunken);

    // Widget stack
    m_pWidgetStack = new QStackedWidget(vbox);
    vbox->setStretchFactor(m_pWidgetStack,1);

    // First widget visible
    m_pFrontWidget = new OptionsDialogFrontWidget(m_pWidgetStack,szFrontText);
    m_pWidgetStack->addWidget(m_pFrontWidget);

    int idx = m_pWidgetStack->indexOf(m_pFrontWidget);
    m_pWidgetStack->widget(idx)->raise();

    //  Ok,Cancel,Help
    QPushButton * b = new QPushButton(__tr2qs_ctx("&OK","options"),this);
    b->setObjectName("btnok");
    KviTalToolTip::add(b,__tr2qs_ctx("Close this dialog, accepting all changes.","options"));
    connect(b,SIGNAL(clicked()),this,SLOT(okClicked()));
    //b->setMinimumWidth(whatIsThisWidth);
    b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));
    g1->addWidget(b,1,2);

    b = new QPushButton(__tr2qs_ctx("&Apply","options"),this);
    b->setObjectName("btnapply");
    KviTalToolTip::add(b,__tr2qs_ctx("Commit all changes immediately.","options"));
    connect(b,SIGNAL(clicked()),this,SLOT(applyClicked()));
    b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));
    g1->addWidget(b,1,3);

    b = new QPushButton(__tr2qs_ctx("Cancel","options"),this);
    b->setObjectName("btncancel");
    KviTalToolTip::add(b,__tr2qs_ctx("Close this dialog, discarding all changes.","options"));
    b->setDefault(true);
    //b->setMinimumWidth(whatIsThisWidth);
    connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked()));
    b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)));
    g1->addWidget(b,1,4);

    g1->setRowStretch(0,1);
    g1->setColumnStretch(1,1);


    fillTreeWidget(0,g_pOptionsInstanceManager->instanceEntryTree(),szGroup);

    if(!parent())
    {
        if(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).y() < 5)
            KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).setY(5);

        //setGeometry(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry));
        resize(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).width(),
               KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).height());
        move(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).x(),
             KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).y());
    }

    new QShortcut(Qt::Key_Escape,this,SLOT(close()));

    if(bModal)
        setWindowModality(par ? Qt::WindowModal : Qt::ApplicationModal);
}
示例#6
0
void ClientSearch::search(){
    text_Search->selectAll();
    emit searchClicked(text_Search->text(),selected_search);
}
void PeopleApplication::createPeoplePage()
{

    //m_AccountManager = AccountManger::getInstance();
    m_mainPage = new MApplicationPage;
    m_mainPage->setTitle(QObject::tr("People","Title of the application"));

    QGraphicsLinearLayout *linear = new QGraphicsLinearLayout(Qt::Vertical);
    linear->setContentsMargins(0, 0, 0, 0);
    linear->setSpacing(0);
    m_mainPage->centralWidget()->setLayout(linear);

    m_topSpacer = new QGraphicsWidget;
    m_topSpacer->setPreferredHeight(0);
    linear->addItem(m_topSpacer);

    m_people = new SeasidePeople;
    linear->addItem(m_people);

    m_bottomSpacer = new QGraphicsWidget;
    m_bottomSpacer->setPreferredHeight(0);
    linear->addItem(m_bottomSpacer); 

    m_actionSearch = new MAction(QObject::tr("Search","Menu action to bring up search for contact list"), this);
    m_actionSearch->setLocation(MAction::ApplicationMenuLocation);
    m_mainPage->addAction(m_actionSearch);
    connect(m_actionSearch, SIGNAL(triggered()), this, SLOT(searchClicked()));

    m_actionAdd = new MAction(QObject::tr("Add Contact","Menu action to add contact"), this);
    m_actionAdd->setLocation(MAction::ApplicationMenuLocation);
    m_mainPage->addAction(m_actionAdd);
    connect(m_actionAdd, SIGNAL(triggered()), this, SLOT(addNewContact()));

    m_actionAll = new MAction(QObject::tr("<b>Show All</b>","Menu filter to show all contacts"), this);  
    m_actionAll->setLocation(MAction::ApplicationMenuLocation);
    m_actionAll->setObjectName("ShowAllFilter");
    m_actionAll->setCheckable(true);
    connect(m_actionAll, SIGNAL(triggered()), m_people, SLOT(filterAll()));

    m_actionFav = new MAction(QObject::tr("Show Favorites", "Menu filter to show all contacts marked as favorites"), this);
    m_actionFav->setLocation(MAction::ApplicationMenuLocation);
    m_actionFav->setObjectName("ShowFavoritesFilter");
    m_actionFav->setCheckable(true);
    connect(m_actionFav, SIGNAL(triggered()), m_people, SLOT(filterFavorites()));

    m_actionRecent = new MAction(QObject::tr("Show Recent","Menu filter to show all contacts with recent communications"), this);
    m_actionRecent->setLocation(MAction::ApplicationMenuLocation);
    m_actionRecent->setCheckable(true);
    m_actionRecent->setObjectName("ShowRecentFilter");
    connect(m_actionRecent, SIGNAL(triggered()), m_people, SLOT(filterRecent()));

    m_actionFilters = new QActionGroup(this);
    m_actionFilters->addAction(m_actionAll);
    m_actionFilters->addAction(m_actionRecent);
    m_actionFilters->addAction(m_actionFav);
    m_actionFilters->setExclusive(true);
    m_mainPage->addActions(m_actionFilters->actions());
    connect(m_actionFilters, SIGNAL(triggered(QAction*)), this, SLOT(menuFilterSelected(QAction*)));

    connect(m_people, SIGNAL(itemClicked(QModelIndex)),
            this, SLOT(createDetailPage(QModelIndex)));
    connect(m_people, SIGNAL(editRequest(QModelIndex)),
            this, SLOT(createEditPage(QModelIndex)));

    connect(m_people, SIGNAL(callNumber(const QString&)),
            this, SLOT(callNumber(const QString&)));
    connect(m_people, SIGNAL(composeSMS(const QString&)),
            this, SLOT(composeSMS(const QString&)));
    connect(m_people, SIGNAL(composeIM(const QString&)),
            this, SLOT(composeIM(const QString&)));
    connect(m_people, SIGNAL(composeEmail(const QString&)),
            this, SLOT(composeEmail(const QString&)));

    m_mainPage->appear();

    initSlider();
    initSearch();
    repositionOverlays();
}