Button::Button(Qt::Orientation orientation, InsertRemove::Type type, PolicyFlags policy /*= 0*/, QWidget* parent /*= 0*/) : QPushButton(parent), _type(type), _orientation(orientation), _point(QPoint(0,0)), _policy(policy) { QString plus_css = "* {image: url(':/plus-icon.png'); border: 0;}" "*:hover {image: url(':/plus-icon-hover.png');}" "*:pressed {image: url(':/plus-icon-pressed.png');} "; QString minus_css = "* {image: url(':/minus-icon.png'); border: 0;}" "*:hover {image: url(':/minus-icon-hover.png');}" "*:pressed {image: url(':/minus-icon-pressed.png');} "; if (_type == Insert) setStyleSheet(plus_css); else setStyleSheet(minus_css); setFixedSize(SIZE_PX,SIZE_PX); placeButton(); connect(this,SIGNAL(clicked()),this,SLOT(on_clicked())); }
AWebView::AWebView(DownLoad *download, QWidget *parent) : m_downLoad(download) , QWebView(parent) { //Network proxy settings, enabled flash plugins QNetworkProxyFactory::setUseSystemConfiguration(true); QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true); //Add Cache m_ndCache = new QNetworkDiskCache(this); cacheLocation = QDesktopServices::storageLocation(QDesktopServices::CacheLocation); m_ndCache->setCacheDirectory(cacheLocation); page()->networkAccessManager()->setCache(m_ndCache); //WebView signal and slot connect(this, SIGNAL(loadProgress(int)), SLOT(viewProgress(int))); connect(this, SIGNAL(loadFinished(bool)), SLOT(viewFinished(bool))); //The local slot function signal associated with webkit connect(page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addJavaScriptObject())); //Related downloads, here set aside connect(m_downLoad, SIGNAL(on_clicked(QString)), this, SLOT(on_linkClicked(QString))); //The two link opens the page page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); connect(page(), SIGNAL(linkClicked(QUrl)), this, SLOT(on_linkPage(QUrl))); load(QUrl("http://api.83133.com/")); //load(QUrl("http://www.999.com/tool")); }
static Ret designer_on_popup_menu_item_clicked(void* ctx, void* data) { FtkListItemInfo* info = data; FtkListener on_clicked = (FtkListener)info->extra_user_data; if(on_clicked != NULL) { on_clicked(ctx, NULL); } return RET_OK; }
bool ButtonWindow::on_mouse_up(int x, int y) { if (!dragging) return true; dragging = false; release_capture(); if (!down) return true; set_down(false); if (!on_clicked() && id != 0 && parent != NULL) parent->on_command(id, 0); return true; }
dmz::Boolean dmz::V8QtGroupBox::bind ( const String &Signal, const V8Object &Self, const V8Function &Func) { Boolean results (False); if (_widget) { if (Signal == LocalSignalClicked) { connect ( _widget, SIGNAL (clicked ()), SLOT (on_clicked ()), Qt::UniqueConnection); results = True; } else if (Signal == ToggledSignal) { connect ( _widget, SIGNAL (toggled (bool)), SLOT (on_toggle (bool)), Qt::UniqueConnection); results = True; } } if (results) { _register_callback (Signal, Self, Func); } return results; }