Form::Form(QWidget *parent) : QWidget(parent), ui(new Ui::Form) { ui->setupUi(this); connect(ui->goButton, SIGNAL(clicked()), this, SLOT(goClicked())); connect(ui->lePostalAddress, SIGNAL(returnPressed()), this, SLOT(goClicked())); connect(&m_geocodeDataManager, SIGNAL(coordinatesReady(double,double)), this, SLOT(showCoordinates(double,double))); connect(&m_geocodeDataManager, SIGNAL(errorOccured(QString)), this, SLOT(errorOccured(QString))); QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true); ui->lePostalAddress->setText(""); ui->webView->setUrl(QUrl("qrc:/html/google_maps.html")); }
void Mpdf::initTop3() { zoominButton = new QPushButton(scrollArea); zoominButton->setText("+"); zoominButton->setMaximumWidth(30); zoomoutButton = new QPushButton(scrollArea); zoomoutButton->setText("-"); zoomoutButton->setMaximumWidth(30); spacerItem2 = new QSpacerItem(30, 30, QSizePolicy::Expanding, QSizePolicy::Minimum); searchLine = new QLineEdit; goButton = new QPushButton; goButton->setText("Go"); top3Layout = new QHBoxLayout; top3Layout->addWidget(zoominButton); top3Layout->addWidget(zoomoutButton); top3Layout->addItem(spacerItem2); top3Layout->addWidget(searchLine); top3Layout->addWidget(goButton); searchView = false; connect(zoominButton, SIGNAL(clicked()), this, SLOT(zoominClicked())); connect(zoomoutButton, SIGNAL(clicked()), this, SLOT(zoomoutClicked())); connect(goButton, SIGNAL(clicked()), this, SLOT(goClicked())); }
void MainView::setDocument( const QString& applnk_filename ) { DocLnk *file = new DocLnk( applnk_filename ); location->setEditText( file->file() ); goClicked(); }
void AddressBarWidget::initialize() { // Connecting necessary Signals to Slots connect(iSlidingTimer, SIGNAL(timeout()), this, SLOT(slideTick())); connect(ui.SlidePushButton, SIGNAL(clicked()), this, SLOT(propagateSlideClicked())); connect(ui.SlidePushButton, SIGNAL(clicked()), this, SLOT(slide())); // Connecting internal Signals with external ones connect(ui.GoStopPushButton, SIGNAL(clicked()), this, SIGNAL(goClicked())); connect(ui.ReloadPushButton, SIGNAL(clicked()), this, SIGNAL(reloadClicked())); }
void AddressBarWidget::setStopIcon() { ui.GoStopPushButton->setIcon(iStopIcon); ui.GoStopPushButton->setIconSize(QSize(40, 40)); ui.GoStopPushButton->setFlat(false); // Put the proper Signal Connections in place: // when the GoStopPushButton is clicked, sent a "sopClicked" signal. disconnect(ui.GoStopPushButton, SIGNAL(clicked()), this, SIGNAL(goClicked())); connect(ui.GoStopPushButton, SIGNAL(clicked()), this, SIGNAL(stopClicked())); }
/** * * @param parent */ CodeEditor::CodeEditor(QWidget *parent) : QWidget(parent), ui(new Ui::CodeEditor) { ui->setupUi(this); ui->tabWidget->addTab(new QPlainTextEdit, "Tab 1"); ui->tabWidget->addTab(new QPlainTextEdit, "Tab 2"); ui->tabWidget->setCurrentIndex(0); connect(ui->execButton, SIGNAL(clicked()), this, SIGNAL(goClicked())); }
MainView::MainView(QWidget *parent, const char *name, WFlags fl) : QMainWindow(parent, name, fl) { setIcon( Resource::loadPixmap( "remote" ) ); setCaption(tr("uBrowser")); setToolBarsMovable( false ); QToolBar *toolbar = new QToolBar(this, "toolbar"); back = new QToolButton(Resource::loadPixmap("ubrowser/back"), 0, 0, 0, 0, toolbar, "back"); forward = new QToolButton(Resource::loadPixmap("ubrowser/forward"), 0, 0, 0, 0, toolbar, "forward"); home = new QToolButton(Resource::loadPixmap("ubrowser/home"), 0, 0, 0, 0, toolbar, "home"); location = new QComboBox(true, toolbar, "location"); go = new QToolButton(Resource::loadPixmap("ubrowser/go"), 0, 0, 0, 0, toolbar, "go"); toolbar->setStretchableWidget(location); toolbar->setHorizontalStretchable(true); location->setAutoCompletion( true ); addToolBar(toolbar); browser = new QTextBrowser(this, "browser"); setCentralWidget(browser); //make the button take you to the location connect(go, SIGNAL(clicked()), this, SLOT(goClicked()) ); connect(location->lineEdit(), SIGNAL(returnPressed()), this, SLOT(goClicked()) ); //make back, forward and home do their thing (isnt QTextBrowser great?) connect(back, SIGNAL(clicked()), browser, SLOT(backward()) ); connect(forward, SIGNAL(clicked()), browser, SLOT(forward()) ); connect(home, SIGNAL(clicked()), browser, SLOT(home()) ); //make back and forward buttons be enabled, only when you can go back or forward (again, i love QTextBrowser) //this doesnt seem to work, but doesnt break anything either... connect(browser, SIGNAL(backwardAvailable(bool)), back, SLOT(setOn(bool)) ); connect(browser, SIGNAL(forwardAvailable(bool)), forward, SLOT(setOn(bool)) ); //notify me when the text of the browser has changed (like when the user clicks a link) connect(browser, SIGNAL(textChanged()), this, SLOT(textChanged()) ); http = new HttpFactory(browser); if( qApp->argc() > 1 ) { char **argv = qApp->argv(); int i = 0; QString *openfile = new QString( argv[0] ); while( openfile->contains( "ubrowser" ) == 0 && i < qApp->argc() ) { i++; *openfile = argv[i]; } *openfile = argv[i+1]; if( !openfile->startsWith( "http://" ) && !openfile->startsWith( "/" ) ) { openfile->insert( 0, QDir::currentDirPath()+"/" ); } location->setEditText( *openfile ); goClicked(); } }