这篇教程C++ widget函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中widget函数的典型用法代码示例。如果您正苦于以下问题:C++ widget函数的具体用法?C++ widget怎么用?C++ widget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了widget函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GitSubmitEditorWidget *GitSubmitEditor::submitEditorWidget(){ return static_cast<GitSubmitEditorWidget *>(widget());}
开发者ID:anchowee,项目名称:QtCreator,代码行数:4,
示例2: QAbstractButton *ButtonTaskMenu::button() const{ return qobject_cast<QAbstractButton *>(widget());}
开发者ID:kileven,项目名称:qt5,代码行数:4,
示例3: /** Returns corresponding Tools-view. */ UIToolsView *view() const { return qobject_cast<UIToolsView*>(widget()); }
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:2,
示例4: widgetvoid ImageBrowserScrollArea::resizeEvent(QResizeEvent *event) { QWidget *child = widget(); if (child != 0) { ((ImageBrowserView*) child)->resizeUpdate(); }}
开发者ID:susannej,项目名称:interlace,代码行数:6,
示例5: switchbool QWidgetWindow::event(QEvent *event){ if (m_widget->testAttribute(Qt::WA_DontShowOnScreen)) { // /a event is uninteresting for QWidgetWindow, the event was probably // generated before WA_DontShowOnScreen was set return m_widget->event(event); } switch (event->type()) { case QEvent::Close: handleCloseEvent(static_cast<QCloseEvent *>(event)); return true; case QEvent::Enter: case QEvent::Leave: handleEnterLeaveEvent(event); return true; // these should not be sent to QWidget, the corresponding events // are sent by QApplicationPrivate::notifyActiveWindowChange() case QEvent::FocusIn: handleFocusInEvent(static_cast<QFocusEvent *>(event)); // Fallthrough case QEvent::FocusOut: {#ifndef QT_NO_ACCESSIBILITY QAccessible::State state; state.active = true; QAccessibleStateChangeEvent ev(widget(), state); QAccessible::updateAccessibility(&ev);#endif return false; } case QEvent::FocusAboutToChange: if (QApplicationPrivate::focus_widget) { if (QApplicationPrivate::focus_widget->testAttribute(Qt::WA_InputMethodEnabled)) QGuiApplication::inputMethod()->commit(); QGuiApplication::sendSpontaneousEvent(QApplicationPrivate::focus_widget, event); } return true; case QEvent::KeyPress: case QEvent::KeyRelease: case QEvent::ShortcutOverride: handleKeyEvent(static_cast<QKeyEvent *>(event)); return true; case QEvent::MouseMove: case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::MouseButtonDblClick: handleMouseEvent(static_cast<QMouseEvent *>(event)); return true; case QEvent::NonClientAreaMouseMove: case QEvent::NonClientAreaMouseButtonPress: case QEvent::NonClientAreaMouseButtonRelease: case QEvent::NonClientAreaMouseButtonDblClick: handleNonClientAreaMouseEvent(static_cast<QMouseEvent *>(event)); return true; case QEvent::TouchBegin: case QEvent::TouchUpdate: case QEvent::TouchEnd: case QEvent::TouchCancel: handleTouchEvent(static_cast<QTouchEvent *>(event)); return true; case QEvent::Move: handleMoveEvent(static_cast<QMoveEvent *>(event)); return true; case QEvent::Resize: handleResizeEvent(static_cast<QResizeEvent *>(event)); return true;#ifndef QT_NO_WHEELEVENT case QEvent::Wheel: handleWheelEvent(static_cast<QWheelEvent *>(event)); return true;#endif#ifndef QT_NO_DRAGANDDROP case QEvent::DragEnter: case QEvent::DragMove: handleDragEnterMoveEvent(static_cast<QDragMoveEvent *>(event)); return true; case QEvent::DragLeave: handleDragLeaveEvent(static_cast<QDragLeaveEvent *>(event)); return true; case QEvent::Drop: handleDropEvent(static_cast<QDropEvent *>(event)); return true;#endif case QEvent::Expose: handleExposeEvent(static_cast<QExposeEvent *>(event)); return true; case QEvent::WindowStateChange://.........这里部分代码省略.........
开发者ID:jhribal,项目名称:qtbase,代码行数:101,
示例6: QueryWidget *WorkAreaTabWidget::queryWidget(int index){ return qobject_cast<QueryWidget *>(widget(index));}
开发者ID:davidau,项目名称:robomongo,代码行数:4,
示例7: viewQDeclarativeView* QDeclarativeViewNodeInstance::view() const{ QDeclarativeView* view = qobject_cast<QDeclarativeView*>(widget()); Q_ASSERT(view); return view;}
开发者ID:TheProjecter,项目名称:project-qtcreator,代码行数:6,
示例8: KVSO_CLASS_FUNCTION return true;}KVSO_CLASS_FUNCTION(groupBox,title){ CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(((KviTalGroupBox *)widget())->title()); return true;}KVSO_CLASS_FUNCTION(groupBox,setFlat){ CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("bFlag",KVS_PT_BOOL,0,bEnabled) KVSO_PARAMETERS_END(c) ((KviTalGroupBox *)widget())->setFlat(bEnabled); return true;}KVSO_CLASS_FUNCTION(groupBox,isFlat){ CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((KviTalGroupBox *)widget())->isFlat()); return true;}KVSO_CLASS_FUNCTION(groupBox,setCheckable){ CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("bFlag",KVS_PT_BOOL,0,bEnabled) KVSO_PARAMETERS_END(c)
开发者ID:Heufneutje,项目名称:KVIrc,代码行数:31,
示例9: QAccessibleTextWidget/*! /fn QAccessibleTextEdit::QAccessibleTextEdit(QWidget *widget) Constructs a QAccessibleTextEdit object for a /a widget.*/QAccessibleTextEdit::QAccessibleTextEdit(QWidget *o): QAccessibleTextWidget(o, QAccessible::EditableText){ Q_ASSERT(widget()->inherits("QTextEdit"));}
开发者ID:FlavioFalcao,项目名称:qt5,代码行数:10,
示例10: /*! Returns the text edit. */QTextEdit *QAccessibleTextEdit::textEdit() const{ return static_cast<QTextEdit *>(widget());}
开发者ID:FlavioFalcao,项目名称:qt5,代码行数:5,
示例11: plainTextEditQPlainTextEdit* QAccessiblePlainTextEdit::plainTextEdit() const{ return static_cast<QPlainTextEdit *>(widget());}
开发者ID:FlavioFalcao,项目名称:qt5,代码行数:4,
示例12: Q_ASSERTQAccessiblePlainTextEdit::QAccessiblePlainTextEdit(QWidget* o) :QAccessibleTextWidget(o){ Q_ASSERT(widget()->inherits("QPlainTextEdit"));}
开发者ID:FlavioFalcao,项目名称:qt5,代码行数:5,
示例13: removeTab// Swap two tab indicesvoid MHTabWidget::MoveTab(int fromIndex, int toIndex){ removeTab(fromIndex); insertTab(toIndex, widget(fromIndex), tabIcon(fromIndex), tabText(fromIndex)); setCurrentIndex(toIndex);}
开发者ID:V10git,项目名称:x64dbg,代码行数:7,
示例14: qDebug//.........这里部分代码省略......... if (tool) { wsa.save_under = True; wsa_mask |= CWSaveUnder; } if (flags & Qt::X11BypassWindowManagerHint) { wsa.override_redirect = True; wsa_mask |= CWOverrideRedirect; }#if 0 if (wsa_mask && initializeWindow) { Q_ASSERT(id); XChangeWindowAttributes(dpy, id, wsa_mask, &wsa); }#endif if (mwmhints.functions != 0) { mwmhints.flags |= MWM_HINTS_FUNCTIONS; mwmhints.functions |= MWM_FUNC_MOVE | MWM_FUNC_RESIZE; } else { mwmhints.functions = MWM_FUNC_ALL; } if (!(flags & Qt::FramelessWindowHint) && flags & Qt::CustomizeWindowHint && flags & Qt::WindowTitleHint && !(flags & (Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint))) { // a special case - only the titlebar without any button mwmhints.flags = MWM_HINTS_FUNCTIONS; mwmhints.functions = MWM_FUNC_MOVE | MWM_FUNC_RESIZE; mwmhints.decorations = 0; } if (widget()->windowModality() == Qt::WindowModal) { mwmhints.input_mode = MWM_INPUT_PRIMARY_APPLICATION_MODAL; } else if (widget()->windowModality() == Qt::ApplicationModal) { mwmhints.input_mode = MWM_INPUT_FULL_APPLICATION_MODAL; } setMWMHints(mwmhints); QVector<Atom> netWmState = getNetWmState(); if (flags & Qt::WindowStaysOnTopHint) { if (flags & Qt::WindowStaysOnBottomHint) qWarning() << "QWidget: Incompatible window flags: the window can't be on top and on bottom at the same time"; if (!netWmState.contains(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_ABOVE))) netWmState.append(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_ABOVE)); if (!netWmState.contains(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_STAYS_ON_TOP))) netWmState.append(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_STAYS_ON_TOP)); } else if (flags & Qt::WindowStaysOnBottomHint) { if (!netWmState.contains(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_BELOW))) netWmState.append(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_BELOW)); } if (widget()->isFullScreen()) { if (!netWmState.contains(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_FULLSCREEN))) netWmState.append(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_FULLSCREEN)); } if (widget()->isMaximized()) { if (!netWmState.contains(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_MAXIMIZED_HORZ))) netWmState.append(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_MAXIMIZED_HORZ)); if (!netWmState.contains(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_MAXIMIZED_VERT))) netWmState.append(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_MAXIMIZED_VERT)); } if (widget()->windowModality() != Qt::NonModal) { if (!netWmState.contains(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_MODAL))) netWmState.append(QXlibStatic::atom(QXlibStatic::_NET_WM_STATE_MODAL)); } if (!netWmState.isEmpty()) { XChangeProperty(mScreen->display()->nativeDisplay(), x_window, QXlibStatic::atom(QXlibStatic::_NET_WM_STATE), XA_ATOM, 32, PropModeReplace, (unsigned char *) netWmState.data(), netWmState.size()); } else { XDeleteProperty(mScreen->display()->nativeDisplay(), x_window, QXlibStatic::atom(QXlibStatic::_NET_WM_STATE)); }//##### only if initializeWindow??? if (popup || tooltip) { // popup widget#ifdef MYX11_DEBUG qDebug() << "Doing XChangeWindowAttributes for popup" << wsa.override_redirect;#endif // set EWMH window types // setNetWmWindowTypes(); wsa.override_redirect = True; wsa.save_under = True; XChangeWindowAttributes(mScreen->display()->nativeDisplay(), x_window, CWOverrideRedirect | CWSaveUnder, &wsa); } else {#ifdef MYX11_DEBUG qDebug() << "Doing XChangeWindowAttributes for non-popup";#endif } return flags;}
开发者ID:maxxant,项目名称:qt,代码行数:101,
示例15: scrollWidthint ScrollArea::scrollWidth() const { QWidget *w(widget()); return w ? qMax(w->width(), width()) : width();}
开发者ID:2asoft,项目名称:tdesktop,代码行数:4,
示例16: databaseFromDatabaseWidgetvoid DatabaseTabWidget::lockDatabases(){ for (int i = 0; i < count(); i++) { DatabaseWidget* dbWidget = static_cast<DatabaseWidget*>(widget(i)); Database* db = databaseFromDatabaseWidget(dbWidget); DatabaseWidget::Mode mode = dbWidget->currentMode(); if ((mode != DatabaseWidget::ViewMode && mode != DatabaseWidget::EditMode) || !dbWidget->dbHasKey()) { continue; } // show the correct tab widget before we are asking questions about it setCurrentWidget(dbWidget); if (mode == DatabaseWidget::EditMode) { QMessageBox::StandardButton result = MessageBox::question( this, tr("Lock database"), tr("Can't lock the database as you are currently editing it./nPlease press cancel to finish your changes or discard them."), QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Cancel); if (result == QMessageBox::Cancel) { continue; } } if (m_dbList[db].modified && !m_dbList[db].saveToFilename) { QMessageBox::StandardButton result = MessageBox::question( this, tr("Lock database"), tr("This database has never been saved./nYou can save the dabatase or stop locking it."), QMessageBox::Save | QMessageBox::Cancel, QMessageBox::Cancel); if (result == QMessageBox::Save) { if (!saveDatabase(db)) { continue; } } else if (result == QMessageBox::Cancel) { continue; } } else if (m_dbList[db].modified) { QMessageBox::StandardButton result = MessageBox::question( this, tr("Lock database"), tr("This database has been modified./nDo you want to save the database before locking it?/nOtherwise your changes are lost."), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Cancel); if (result == QMessageBox::Save) { if (!saveDatabase(db)) { continue; } } else if (result == QMessageBox::Discard) { m_dbList[db].modified = false; } else if (result == QMessageBox::Cancel) { continue; } } dbWidget->lock(); // database has changed so we can't use the db variable anymore updateTabName(dbWidget->database()); }}
开发者ID:blazecake,项目名称:keepassx,代码行数:67,
示例17: scrollHeightint ScrollArea::scrollHeight() const { QWidget *w(widget()); return w ? qMax(w->height(), height()) : height();}
开发者ID:2asoft,项目名称:tdesktop,代码行数:4,
示例18: switchvoid ScrollArea::touchEvent(QTouchEvent *e) { if (!e->touchPoints().isEmpty()) { _touchPrevPos = _touchPos; _touchPos = e->touchPoints().cbegin()->screenPos().toPoint(); } switch (e->type()) { case QEvent::TouchBegin: if (_touchPress || e->touchPoints().isEmpty()) return; _touchPress = true; if (_touchScrollState == TouchScrollAuto) { _touchScrollState = TouchScrollAcceleration; _touchWaitingAcceleration = true; _touchAccelerationTime = getms(); touchUpdateSpeed(); _touchStart = _touchPos; } else { _touchScroll = false; _touchTimer.start(QApplication::startDragTime()); } _touchStart = _touchPrevPos = _touchPos; _touchRightButton = false; break; case QEvent::TouchUpdate: if (!_touchPress) return; if (!_touchScroll && (_touchPos - _touchStart).manhattanLength() >= QApplication::startDragDistance()) { _touchTimer.stop(); _touchScroll = true; touchUpdateSpeed(); } if (_touchScroll) { if (_touchScrollState == TouchScrollManual) { touchScrollUpdated(_touchPos); } else if (_touchScrollState == TouchScrollAcceleration) { touchUpdateSpeed(); _touchAccelerationTime = getms(); if (_touchSpeed.isNull()) { _touchScrollState = TouchScrollManual; } } } break; case QEvent::TouchEnd: if (!_touchPress) return; _touchPress = false; if (_touchScroll) { if (_touchScrollState == TouchScrollManual) { _touchScrollState = TouchScrollAuto; _touchPrevPosValid = false; _touchScrollTimer.start(15); _touchTime = getms(); } else if (_touchScrollState == TouchScrollAuto) { _touchScrollState = TouchScrollManual; _touchScroll = false; touchResetSpeed(); } else if (_touchScrollState == TouchScrollAcceleration) { _touchScrollState = TouchScrollAuto; _touchWaitingAcceleration = false; _touchPrevPosValid = false; } } else if (window() && widget()) { // one short tap -- like left mouse click, one long tap -- like right mouse click#ifdef Q_OS_WIN Qt::MouseButton btn(_touchRightButton ? Qt::RightButton : Qt::LeftButton); QPoint mapped(widget()->mapFromGlobal(_touchStart)), winMapped(window()->mapFromGlobal(_touchStart)); QMouseEvent pressEvent(QEvent::MouseButtonPress, mapped, winMapped, _touchStart, btn, Qt::MouseButtons(btn), Qt::KeyboardModifiers()); pressEvent.accept(); qt_sendSpontaneousEvent(widget(), &pressEvent); QMouseEvent releaseEvent(QEvent::MouseButtonRelease, mapped, winMapped, _touchStart, btn, Qt::MouseButtons(btn), Qt::KeyboardModifiers()); qt_sendSpontaneousEvent(widget(), &releaseEvent); if (_touchRightButton) { QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart); qt_sendSpontaneousEvent(widget(), &contextEvent); }#endif } _touchTimer.stop(); _touchRightButton = false; break; case QEvent::TouchCancel: _touchPress = false; _touchScroll = false; _touchScrollState = TouchScrollManual; _touchTimer.stop(); break; }}
开发者ID:AmesianX,项目名称:tdesktop,代码行数:92,
示例19: ConfigurationWindowMainConfigurationWindow::MainConfigurationWindow() : ConfigurationWindow("MainConfiguration", tr("Kadu configuration"), "General", instanceDataManager()), lookChatAdvanced(0){ setWindowRole("kadu-configuration"); widget()->appendUiFile(dataPath("kadu/configuration/dialog.ui"));#ifndef DEBUG_ENABLED ((QWidget *)(widget()->widgetById("debug")->parent()))->hide();#endif#ifndef Q_OS_WIN ((QWidget *)(widget()->widgetById("startup")))->hide();#endif#ifndef Q_WS_X11 ((QWidget *)(widget()->widgetById("windowActivationMethodGroup")))->hide(); ((QWidget *)(widget()->widgetById("notify/fullscreenSilentMode")))->hide();#endif onStartupSetLastDescription = static_cast<QCheckBox *>(widget()->widgetById("onStartupSetLastDescription")); QLineEdit *disconnectDescription = static_cast<QLineEdit *>(widget()->widgetById("disconnectDescription")); QLineEdit *onStartupSetDescription = static_cast<QLineEdit *>(widget()->widgetById("onStartupSetDescription")); Account account = AccountManager::instance()->defaultAccount(); if (!account.isNull() && account.protocolHandler()) { disconnectDescription->setMaxLength(account.data()->maxDescriptionLength()); onStartupSetDescription->setMaxLength(account.data()->maxDescriptionLength()); }// connect(widget()->widgetById("advancedMode"), SIGNAL(toggled(bool)), widget()->widgetById("contactsWithIcons"), SLOT(setEnabled(bool))); connect(widget()->widgetById("showAvatars"), SIGNAL(toggled(bool)), widget()->widgetById("avatarBorder"), SLOT(setEnabled(bool))); connect(widget()->widgetById("showAvatars"), SIGNAL(toggled(bool)), widget()->widgetById("avatarGreyOut"), SLOT(setEnabled(bool))); connect(widget()->widgetById("disconnectWithCurrentDescription"), SIGNAL(toggled(bool)), disconnectDescription, SLOT(setDisabled(bool))); connect(onStartupSetLastDescription, SIGNAL(toggled(bool)), onStartupSetDescription, SLOT(setDisabled(bool))); connect(widget()->widgetById("foldLink"), SIGNAL(toggled(bool)), widget()->widgetById("linkFoldTreshold"), SLOT(setEnabled(bool))); connect(widget()->widgetById("chatPrune"), SIGNAL(toggled(bool)), widget()->widgetById("chatPruneLen"), SLOT(setEnabled(bool))); connect(widget()->widgetById("chatCloseTimer"), SIGNAL(toggled(bool)), widget()->widgetById("chatCloseTimerPeriod"), SLOT(setEnabled(bool))); connect(widget()->widgetById("startupStatus"), SIGNAL(activated(int)), this, SLOT(onChangeStartupStatus(int))); connect(widget()->widgetById("infoPanelBgFilled"), SIGNAL(toggled(bool)), widget()->widgetById("infoPanelBgColor"), SLOT(setEnabled(bool))); connect(widget()->widgetById("showDescription"), SIGNAL(toggled(bool)), widget()->widgetById("multilineDescription"), SLOT(setEnabled(bool)));// connect(widget()->widgetById("useDefaultServers"), SIGNAL(toggled(bool)), widget()->widgetById("serverList"), SLOT(setDisabled(bool))); connect(widget()->widgetById("openChatOnMessage"), SIGNAL(toggled(bool)), widget()->widgetById("openChatOnMessageWhenOnline"), SLOT(setEnabled(bool))); connect(widget()->widgetById("displayGroupTabs"), SIGNAL(toggled(bool)), widget()->widgetById("showGroupAll"), SLOT(setEnabled(bool))); emoticonsStyleComboBox = static_cast<ConfigComboBox *>(widget()->widgetById("emoticonsStyle")); emoticonsThemeComboBox = static_cast<ConfigComboBox *>(widget()->widgetById("emoticonsTheme")); emoticonsScalingComboBox = static_cast<ConfigComboBox *>(widget()->widgetById("emoticonsScaling")); connect(emoticonsThemeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onChangeEmoticonsTheme(int))); connect(widget()->widgetById("emoticonsPaths"), SIGNAL(changed()), this, SLOT(setEmoticonThemes())); QWidget *showInformationPanel = widget()->widgetById("showInformationPanel"); connect(showInformationPanel, SIGNAL(toggled(bool)), widget()->widgetById("showVerticalScrollbar"), SLOT(setEnabled(bool))); connect(showInformationPanel, SIGNAL(toggled(bool)), widget()->widgetById("showEmoticonsInPanel"), SLOT(setEnabled(bool))); ConfigCheckBox *useDefaultBrowserCheckbox = static_cast<ConfigCheckBox *>(widget()->widgetById("useDefaultBrowser")); ConfigLineEdit *browserCommandLineEdit = static_cast<ConfigLineEdit *>(widget()->widgetById("browserPath")); connect(useDefaultBrowserCheckbox, SIGNAL(toggled(bool)), browserCommandLineEdit, SLOT(setDisabled(bool))); ConfigCheckBox *useDefaultEMailCheckbox = static_cast<ConfigCheckBox *>(widget()->widgetById("useDefaultEMail")); ConfigLineEdit *mailCommandLineEdit = static_cast<ConfigLineEdit *>(widget()->widgetById("mailPath")); connect(useDefaultEMailCheckbox, SIGNAL(toggled(bool)), mailCommandLineEdit, SLOT(setDisabled(bool))); connect(widget()->widgetById("lookChatAdvanced"), SIGNAL(clicked()), this, SLOT(showLookChatAdvanced())); Preview *infoPanelSyntaxPreview = static_cast<Preview *>(widget()->widgetById("infoPanelSyntaxPreview")); infoPanelSyntaxPreview->setResetBackgroundColor(config_file.readEntry("Look", "InfoPanelBgColor")); connect(infoPanelSyntaxPreview, SIGNAL(needFixup(QString &)), Core::instance()->kaduWindow()->infoPanel(), SLOT(styleFixup(QString &))); connect(widget()->widgetById("infoPanelSyntax"), SIGNAL(syntaxChanged(const QString &)), infoPanelSyntaxPreview, SLOT(syntaxChanged(const QString &))); connect(widget()->widgetById("infoPanelSyntax"), SIGNAL(onSyntaxEditorWindowCreated(SyntaxEditorWindow *)), this, SLOT(onInfoPanelSyntaxEditorWindowCreated(SyntaxEditorWindow *))); connect(widget()->widgetById("iconPaths"), SIGNAL(changed()), this, SLOT(setIconThemes())); connect(widget()->widgetById("ignoreMessagesFromAnonymous"), SIGNAL(toggled(bool)), widget()->widgetById("ignoreMessagesFromAnonymousInConferences"), SLOT(setEnabled(bool))); QWidget *useUserboxBackground = widget()->widgetById("useUserboxBackground"); connect(useUserboxBackground, SIGNAL(toggled(bool)), widget()->widgetById("userboxBackground"), SLOT(setEnabled(bool))); connect(useUserboxBackground, SIGNAL(toggled(bool)), widget()->widgetById("userboxBackgroundDisplayStyle"), SLOT(setEnabled(bool))); widget()->widgetById("parseStatus")->setToolTip(qApp->translate("@default", SyntaxText)); (static_cast<ConfigSyntaxEditor *>(widget()->widgetById("infoPanelSyntax")))->setSyntaxHint(qApp->translate("@default", SyntaxText)); userboxTransparency = static_cast<QCheckBox *>(widget()->widgetById("userboxTransparency")); userboxAlpha = static_cast<QSlider *>(widget()->widgetById("userboxAlpha")); connect(userboxTransparency, SIGNAL(toggled(bool)), widget()->widgetById("userboxAlpha"), SLOT(setEnabled(bool))); buddyColors = new BuddyListBackgroundColorsWidget(this); triggerCompositingStateChanged();}
开发者ID:partition,项目名称:kadu,代码行数:92,
示例20: switchvoid PLineEdit::messageHandler(int fd, PukeMessage *pm){ PukeMessage pmRet; switch(pm->iCommand){ case PUKE_LINED_SET_MAXLENGTH: if(widget() == 0){ debug("PLineEdit: No Widget set"); return; } widget()->setMaxLength(pm->iArg); pmRet.iCommand = - pm->iCommand; pmRet.iWinId = pm->iWinId; pmRet.iArg = widget()->maxLength(); pmRet.cArg = 0; emit outputMessage(fd, &pmRet); break; case PUKE_LINED_SET_ECHOMODE: if(widget() == 0){ debug("PLineEdit: No Widget set"); return; } widget()->setEchoMode((QLineEdit::EchoMode) pm->iArg); pmRet.iCommand = - pm->iCommand; pmRet.iWinId = pm->iWinId; pmRet.iArg = widget()->echoMode(); pmRet.cArg = 0; emit outputMessage(fd, &pmRet); break; case PUKE_LINED_SET_TEXT: if(widget() == 0){ debug("PLineEdit: No Widget set"); return; } debug("PukeLine Edit: Got: %s", pm->cArg); widget()->setText(pm->cArg); pmRet.iCommand = - pm->iCommand; pmRet.iWinId = pm->iWinId; pmRet.iArg = 0; pmRet.iTextSize = strlen(widget()->text()); pmRet.cArg = new char[strlen(widget()->text())+1]; strcpy(pmRet.cArg, widget()->text()); emit outputMessage(fd, &pmRet); delete[] pmRet.cArg; break; case PUKE_LINED_GET_TEXT: if(widget() == 0){ debug("PLineEdit: No Widget set"); return; } pmRet.iCommand = - pm->iCommand; pmRet.iWinId = pm->iWinId; pmRet.iArg = 0; pmRet.iTextSize = strlen(widget()->text()); pmRet.cArg = new char[strlen(widget()->text())+1]; strcpy(pmRet.cArg, widget()->text()); emit outputMessage(fd, &pmRet); delete[] pmRet.cArg; break; default: PWidget::messageHandler(fd, pm); }}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:62,
示例21: widgetvoid MainConfigurationWindow::onChangeStartupStatus(int index){ onStartupSetLastDescription->setEnabled(index != 6); widget()->widgetById("startupStatusInvisibleWhenLastWasOffline")->setEnabled(index == 0); widget()->widgetById("onStartupSetDescription")->setEnabled(!onStartupSetLastDescription->isChecked() && index != 6);}
开发者ID:partition,项目名称:kadu,代码行数:6,
示例22: deletevoid QgsRelationWidgetWrapper::setFeature( const QgsFeature& feature ){ delete ( mRelationWidget ); mRelationWidget = QgsRelationEditorWidget::createRelationEditor( mRelation, feature, context(), widget() ); widget()->layout()->addWidget( mRelationWidget );}
开发者ID:vpicavet,项目名称:Quantum-GIS,代码行数:6,
示例23: setLanguagesvoid MainConfigurationWindow::setLanguages(){ ConfigComboBox *languages = static_cast<ConfigComboBox *>(widget()->widgetById("languages")); languages->setItems(LanguagesManager::languageValues(), LanguagesManager::languageNames());}
开发者ID:partition,项目名称:kadu,代码行数:6,
示例24: check_insidevoid Desktop::HandleEvent( const sf::Event& event ) { // Activate context. Context::Activate( m_context ); sf::Vector2f local_pos; bool check_inside( false ); Widget::Ptr last_receiver( m_last_receiver.lock() ); // If we've got a mouse event, get local mouse position and mark event for being checked against widget's allocation. if( event.type == sf::Event::MouseMoved ) { m_last_mouse_pos.x = event.mouseMove.x; m_last_mouse_pos.y = event.mouseMove.y; local_pos = TransformToLocal( sf::Vector2f( static_cast<float>( event.mouseMove.x ), static_cast<float>( event.mouseMove.y ) ) ); check_inside = true; } else if( event.type == sf::Event::MouseButtonPressed || event.type == sf::Event::MouseButtonReleased ) { m_last_mouse_pos.x = event.mouseButton.x; m_last_mouse_pos.y = event.mouseButton.y; local_pos = TransformToLocal( sf::Vector2f( static_cast<float>( event.mouseButton.x ), static_cast<float>( event.mouseButton.y ) ) ); check_inside = true; } for( std::size_t index = 0; index < m_children.size(); ++index ) { Widget::Ptr widget( m_children[index] ); // Skip widget if not visible. if( !widget->IsVisible() ) { continue; } bool is_inside( widget->GetAllocation().contains( local_pos ) ); // If the event is a mouse button press, check if we need to focus another widget. if( index > 0 && event.type == sf::Event::MouseButtonPressed && is_inside ) { m_children.erase( m_children.begin() + index ); m_children.push_front( widget ); RecalculateWidgetLevels(); } // If inside check is needed, do so for all widgets except the top window. // Else it would run into trouble when moving the window, for example, // where the mouse may be outside the widget's allocation. if( check_inside && !is_inside && index > 0 ) { continue; } // If last receiver is different from current, fake a mouse move event so // that states are reset correctly. Warning, this is a hack, but it works C++ widgetChanged函数代码示例 C++ widgGetFromID函数代码示例
|