Changeset 651 for trunk/tools/assistant/lib/qhelpsearchquerywidget.cpp
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/tools/assistant/lib/qhelpsearchquerywidget.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 119 119 { 120 120 // nothing todo 121 } 122 123 void retranslate() 124 { 125 simpleSearchLabel->setText(QHelpSearchQueryWidget::tr("Search for:")); 126 prevQueryButton->setToolTip(QHelpSearchQueryWidget::tr("Previous search")); 127 nextQueryButton->setToolTip(QHelpSearchQueryWidget::tr("Next search")); 128 searchButton->setText(QHelpSearchQueryWidget::tr("Search")); 129 #ifdef QT_CLUCENE_SUPPORT 130 advancedSearchLabel->setText(QHelpSearchQueryWidget::tr("Advanced search")); 131 similarLabel->setText(QHelpSearchQueryWidget::tr("words <B>similar</B> to:")); 132 withoutLabel->setText(QHelpSearchQueryWidget::tr("<B>without</B> the words:")); 133 exactLabel->setText(QHelpSearchQueryWidget::tr("with <B>exact phrase</B>:")); 134 allLabel->setText(QHelpSearchQueryWidget::tr("with <B>all</B> of the words:")); 135 atLeastLabel->setText(QHelpSearchQueryWidget::tr("with <B>at least one</B> of the words:")); 136 #endif 121 137 } 122 138 … … 361 377 362 378 bool simpleSearch; 379 QLabel *simpleSearchLabel; 380 QLabel *advancedSearchLabel; 381 QLabel *similarLabel; 382 QLabel *withoutLabel; 383 QLabel *exactLabel; 384 QLabel *allLabel; 385 QLabel *atLeastLabel; 363 386 QPushButton *searchButton; 364 387 QWidget* advancedSearchWidget; … … 409 432 410 433 QHBoxLayout* hBoxLayout = new QHBoxLayout(); 411 QLabel *label = new QLabel(tr("Search for:"),this);434 d->simpleSearchLabel = new QLabel(this); 412 435 d->defaultQuery = new QLineEdit(this); 413 436 d->defaultQuery->setCompleter(&d->searchCompleter); 414 437 d->prevQueryButton = new QToolButton(this); 415 438 d->prevQueryButton->setArrowType(Qt::LeftArrow); 416 d->prevQueryButton->setToolTip(tr("Previous search"));417 439 d->prevQueryButton->setEnabled(false); 418 440 d->nextQueryButton = new QToolButton(this); 419 441 d->nextQueryButton->setArrowType(Qt::RightArrow); 420 d->nextQueryButton->setToolTip(tr("Next search"));421 442 d->nextQueryButton->setEnabled(false); 422 d->searchButton = new QPushButton(t r("Search"), this);423 hBoxLayout->addWidget( label);443 d->searchButton = new QPushButton(this); 444 hBoxLayout->addWidget(d->simpleSearchLabel); 424 445 hBoxLayout->addWidget(d->defaultQuery); 425 446 hBoxLayout->addWidget(d->prevQueryButton); … … 440 461 d->showHideAdvancedSearchButton->setMinimumSize(25, 20); 441 462 442 label = new QLabel(tr("Advanced search"),this);463 d->advancedSearchLabel = new QLabel(this); 443 464 QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); 444 sizePolicy.setHeightForWidth( label->sizePolicy().hasHeightForWidth());445 label->setSizePolicy(sizePolicy);465 sizePolicy.setHeightForWidth(d->advancedSearchLabel->sizePolicy().hasHeightForWidth()); 466 d->advancedSearchLabel->setSizePolicy(sizePolicy); 446 467 447 468 QFrame* hLine = new QFrame(this); 448 469 hLine->setFrameStyle(QFrame::HLine); 449 470 hBoxLayout->addWidget(d->showHideAdvancedSearchButton); 450 hBoxLayout->addWidget( label);471 hBoxLayout->addWidget(d->advancedSearchLabel); 451 472 hBoxLayout->addWidget(hLine); 452 473 … … 458 479 gLayout->setMargin(0); 459 480 460 label = new QLabel(tr("words <B>similar</B> to:"),this);461 gLayout->addWidget( label, 0, 0);481 d->similarLabel = new QLabel(this); 482 gLayout->addWidget(d->similarLabel, 0, 0); 462 483 d->similarQuery = new QLineEdit(this); 463 484 d->similarQuery->setCompleter(&d->searchCompleter); 464 485 gLayout->addWidget(d->similarQuery, 0, 1); 465 486 466 label = new QLabel(tr("<B>without</B> the words:"),this);467 gLayout->addWidget( label, 1, 0);487 d->withoutLabel = new QLabel(this); 488 gLayout->addWidget(d->withoutLabel, 1, 0); 468 489 d->withoutQuery = new QLineEdit(this); 469 490 d->withoutQuery->setCompleter(&d->searchCompleter); 470 491 gLayout->addWidget(d->withoutQuery, 1, 1); 471 492 472 label = new QLabel(tr("with <B>exact phrase</B>:"),this);473 gLayout->addWidget( label, 2, 0);493 d->exactLabel = new QLabel(this); 494 gLayout->addWidget(d->exactLabel, 2, 0); 474 495 d->exactQuery = new QLineEdit(this); 475 496 d->exactQuery->setCompleter(&d->searchCompleter); 476 497 gLayout->addWidget(d->exactQuery, 2, 1); 477 498 478 label = new QLabel(tr("with <B>all</B> of the words:"),this);479 gLayout->addWidget( label, 3, 0);499 d->allLabel = new QLabel(this); 500 gLayout->addWidget(d->allLabel, 3, 0); 480 501 d->allQuery = new QLineEdit(this); 481 502 d->allQuery->setCompleter(&d->searchCompleter); 482 503 gLayout->addWidget(d->allQuery, 3, 1); 483 504 484 label = new QLabel(tr("with <B>at least one</B> of the words:"),this);485 gLayout->addWidget( label, 4, 0);505 d->atLeastLabel = new QLabel(this); 506 gLayout->addWidget(d->atLeastLabel, 4, 0); 486 507 d->atLeastQuery = new QLineEdit(this); 487 508 d->atLeastQuery->setCompleter(&d->searchCompleter); … … 490 511 vLayout->addWidget(d->advancedSearchWidget); 491 512 d->advancedSearchWidget->hide(); 513 514 d->retranslate(); 492 515 493 516 connect(d->exactQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); … … 532 555 } 533 556 557 /*! \reimp 558 */ 559 void QHelpSearchQueryWidget::changeEvent(QEvent *event) 560 { 561 if (event->type() == QEvent::LanguageChange) 562 d->retranslate(); 563 else 564 QWidget::changeEvent(event); 565 } 566 534 567 QT_END_NAMESPACE
Note:
See TracChangeset
for help on using the changeset viewer.