medBrowserPacsSearchToolBox::medBrowserPacsSearchToolBox(QWidget *parent) : medToolBox(parent), d(new medBrowserPacsSearchToolBoxPrivate) { QWidget *page = new QWidget(this); d->edit = new QLineEdit(page); d->button = new QPushButton("Search", page); QHBoxLayout *layout = new QHBoxLayout(page); layout->addWidget(d->edit); layout->addWidget(d->button); this->setTitle("Search"); this->addWidget(page); connect(d->edit, SIGNAL(returnPressed()), this, SLOT(onSearch())); connect(d->button, SIGNAL(clicked()), this, SLOT(onSearch())); }
void MainWindow::createMenu() { menuBar()->addAction("Go to Passage", this, SLOT(onSelectVerse())); menuBar()->addAction("Select Translation", this, SLOT(selectTranslation())); menuBar()->addAction("Search", this, SLOT(onSearch())); menuBar()->addAction("Settings", this, SLOT(onSettings())); }
void BlockExplorer::keyPressEvent(QKeyEvent* event) { switch ((Qt::Key)event->key()) { case Qt::Key_Enter: case Qt::Key_Return: onSearch(); return; default: return QMainWindow::keyPressEvent(event); } }
MyStations::MyStations() :m_searchResults( 0 ) { AuthenticatedUser user; m_myStationList << helper( RadioStation::library( user ), "My Library" ) << helper( RadioStation::recommendations( user ), "Recommended" ) << helper( RadioStation::lovedTracks( user ), "My Loved Tracks" ) << helper( RadioStation::neighbourhood( user ), "My Neighbourhood" ); ui.setupUi( this ); ui.list->setItemDelegate( new MyStationsDelegate ); //It would be nice to set the backgroundRole to Window but this screws up //the painting when scrolling / hovering items :( // //ui.list->viewport()->setBackgroundRole( QPalette::Window ); ui.list->setSpacing( 0 ); connect( ui.list, SIGNAL( itemEntered( QListWidgetItem* )), SLOT( onItemHover( QListWidgetItem* ))); connect( ui.list, SIGNAL( itemClicked( QListWidgetItem* )), SLOT( onItemClicked( QListWidgetItem* ))); ui.spinner->hide(); connect( ui.searchBox, SIGNAL( returnPressed()), SLOT( onSearch())); connect( ui.searchButton, SIGNAL( clicked()), SLOT( onSearch())); ui.list->setMouseTracking( true ); setMouseTracking( true ); foreach( const RadioStation& r, m_myStationList ) { QListWidgetItem* i = new QListWidgetItem( QIcon( ":/station.png" ), r.title() ); i->setData( Qt::UserRole, QVariant::fromValue<RadioStation>( r )); ui.list->addItem( i ); }
BlockExplorer::BlockExplorer(QWidget* parent) : QMainWindow(parent), ui(new Ui::BlockExplorer), m_NeverShown(true), m_HistoryIndex(0) { ui->setupUi(this); this->setStyleSheet(GUIUtil::loadStyleSheet()); connect(ui->pushSearch, SIGNAL(released()), this, SLOT(onSearch())); connect(ui->content, SIGNAL(linkActivated(const QString&)), this, SLOT(goTo(const QString&))); connect(ui->back, SIGNAL(released()), this, SLOT(back())); connect(ui->forward, SIGNAL(released()), this, SLOT(forward())); }
TopBarWidget::TopBarWidget(MainWidget *w) : TWidget(w) , _a_appearance(animation(this, &TopBarWidget::step_appearance)) , _clearSelection(this, lang(lng_selected_clear), st::topBarClearButton) , _forward(this, lang(lng_selected_forward), st::defaultActiveButton) , _delete(this, lang(lng_selected_delete), st::defaultActiveButton) , _info(this, nullptr, st::infoButton) , _mediaType(this, lang(lng_media_type), st::topBarButton) , _search(this, st::topBarSearch) { _clearSelection->setTextTransform(Ui::RoundButton::TextTransform::ToUpper); _forward->setTextTransform(Ui::RoundButton::TextTransform::ToUpper); _delete->setTextTransform(Ui::RoundButton::TextTransform::ToUpper); connect(_forward, SIGNAL(clicked()), this, SLOT(onForwardSelection())); connect(_delete, SIGNAL(clicked()), this, SLOT(onDeleteSelection())); connect(_clearSelection, SIGNAL(clicked()), this, SLOT(onClearSelection())); connect(_info, SIGNAL(clicked()), this, SLOT(onInfoClicked())); connect(_search, SIGNAL(clicked()), this, SLOT(onSearch())); subscribe(Adaptive::Changed(), [this]() { updateAdaptiveLayout(); }); setCursor(style::cur_pointer); showAll(); }