void QLayout::freeze( int w, int h ) { if ( w <= 0 || h <= 0 ) { setResizeMode( Fixed ); } else { setResizeMode( FreeResize ); // layout will not change min/max size mainWidget()->setFixedSize( w, h ); } }
APMToolBar::APMToolBar(QWidget *parent): QDeclarativeView(parent), m_uas(0) { // Configure our QML object // Hack to fix QTBUG 34300 on OSX where QDir::currentPath has changed behavior. This causes // relative paths to inside the .app package to fail. #ifdef Q_OS_MAC bool test123; QString qmlFile = QApplication::applicationDirPath(); qmlFile.append("/qml/ApmToolBar.qml"); setSource(QUrl::fromLocalFile(qmlFile)); #else setSource(QUrl::fromLocalFile("qml/ApmToolBar.qml")); #endif setResizeMode(QDeclarativeView::SizeRootObjectToView); this->rootContext()->setContextProperty("globalObj", this); connect(LinkManager::instance(),SIGNAL(newLink(LinkInterface*)), this, SLOT(updateLinkDisplay(LinkInterface*))); if (LinkManager::instance()->getLinks().count()>=3) { updateLinkDisplay(LinkManager::instance()->getLinks().last()); } setConnection(false); connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUasSet(UASInterface*))); activeUasSet(UASManager::instance()->getActiveUAS()); }
void KbLayoutWidget::initUI() { setObjectName("KeyboardLayoutFrame"); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setSelectionMode(QAbstractItemView::NoSelection); setResizeMode(Adjust); for (int i = 0; i < m_buttons.length(); i++) { LayoutButton* itemButton = new LayoutButton(m_buttons[i]); m_layoutButtons.append(itemButton); itemButton->setFixedSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT); QFrame* borderFrame = new QFrame; borderFrame->setObjectName("LayoutBorderFrame"); QVBoxLayout* borderLayout = new QVBoxLayout; borderLayout->setContentsMargins(0, 0, 0, 0); borderLayout->setSpacing(0); borderLayout->addWidget(itemButton); borderFrame->setLayout(borderLayout); borderFrame->setFixedSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT); QListWidgetItem* item = new QListWidgetItem(this); item->sizeHint(); this->addItem(item); setItemWidget(item, borderFrame); this->setGridSize(QSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT)); this->setFixedWidth(widget_width); } this->setFixedHeight(DDESESSIONCC::LAYOUTBUTTON_HEIGHT*3); updateStyle(":/skin/keybdlayoutwidget.qss", this); }
KDevSplashScreen::KDevSplashScreen() : QQuickView() { setFlags(Qt::FramelessWindowHint | Qt::SplashScreen); setResizeMode(QQuickView::SizeViewToRootObject); setSource(QUrl(QStringLiteral("qrc:/kdevelop/splash.qml"))); if (!rootObject()) { qWarning() << "Could not load KDevelop splash screen"; hide(); // hide instead of showing garbage return; } if (rootObject()) { rootObject()->setProperty("appIcon", QUrl::fromLocalFile(KIconLoader().iconPath("kdevelop", -48))); rootObject()->setProperty("appVersionMajor", VERSION_MAJOR); rootObject()->setProperty("appVersionMinor", VERSION_MINOR); rootObject()->setProperty("appVersionPatch", VERSION_PATCH); } QRect geo = geometry(); geo.moveCenter(screen()->geometry().center()); setGeometry(geo); }
TIconView::TIconView( QWidget *parent, const char* name ) : KIconView( parent, name ), _module(0L) { setResizeMode( Adjust ); setItemsMovable( false ); setItemTextPos( Right ); setGridX( 200 ); setGridY( 70 ); QFont f = font(); f.setWeight( QFont::Bold ); setFont( f ); setShowToolTips( false ); KConfig *config = KGlobal::config(); config->setGroup("Extra"); showExtras = config->readNumEntry( "Selected" ); toolTip = 0; connect( this, SIGNAL( executed( QIconViewItem* ) ), SLOT( slotItemSelected( QIconViewItem* ) ) ); /* comment those signals due to bug#7761 connect( this, SIGNAL( executed( QIconViewItem* ) ), SLOT( removeToolTip()) ); connect( this, SIGNAL( onItem( QIconViewItem* ) ), SLOT( showToolTip( QIconViewItem* ) ) ); connect( this, SIGNAL( onViewport() ), SLOT( removeToolTip() ) ); */ }
ViewHeader::ViewHeader( QAbstractItemView* parent ) : QHeaderView( Qt::Horizontal, parent ) , m_parent( parent ) , m_menu( new QMenu( this ) ) , m_sigmap( new QSignalMapper( this ) ) , m_init( false ) { m_menu->setFont( TomahawkUtils::systemFont() ); #if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) setSectionResizeMode( QHeaderView::Interactive ); setSectionsMovable( true ); #else setResizeMode( QHeaderView::Interactive ); setMovable( true ); #endif setMinimumSectionSize( 60 ); setDefaultAlignment( Qt::AlignLeft ); setStretchLastSection( true ); // m_menu->addAction( tr( "Resize columns to fit window" ), this, SLOT( onToggleResizeColumns() ) ); // m_menu->addSeparator(); connect( m_sigmap, SIGNAL( mapped( int ) ), SLOT( toggleVisibility( int ) ) ); }
MainWidget::MainWidget(QWidget *parent) : QDeclarativeView(parent) { // Switch to fullscreen in device #if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) setWindowState(Qt::WindowFullScreen); #endif setResizeMode(QDeclarativeView::SizeRootObjectToView); // Register Tile to be available in QML qmlRegisterType<Tile>("gameCore", 1, 0, "Tile"); // Setup context m_context = rootContext(); m_context->setContextProperty("mainWidget", this); m_context->setContextProperty("gameData", &m_gameData); // Set view optimizations not already done for QDeclarativeView setAttribute(Qt::WA_OpaquePaintEvent); setAttribute(Qt::WA_NoSystemBackground); // Make QDeclarativeView use OpenGL backend QGLWidget *glWidget = new QGLWidget(this); setViewport(glWidget); setViewportUpdateMode(QGraphicsView::FullViewportUpdate); // Open root QML file setSource(QUrl(filename)); }
KexiFieldListView::KexiFieldListView(QWidget *parent, const char *name, int options) : KListView(parent, name) , m_schema(0) , m_keyIcon(SmallIcon("key")) , m_noIcon(KexiUtils::emptyIcon(KIcon::Small)) , m_options(options) , m_allColumnsItem(0) { setAcceptDrops(true); viewport()->setAcceptDrops(true); setDropVisualizer(false); setDropHighlighter(true); setAllColumnsShowFocus(true); addColumn(i18n("Field Name")); if (m_options & ShowDataTypes) addColumn(i18n("Data Type")); if (m_options & AllowMultiSelection) setSelectionMode(QListView::Extended); setResizeMode(QListView::LastColumn); // header()->hide(); setSorting(-1, true); // disable sorting setDragEnabled(true); connect(this, SIGNAL(doubleClicked(QListViewItem*, const QPoint &, int)), this, SLOT(slotDoubleClicked(QListViewItem*))); }
StatesEditorWidget::StatesEditorWidget(StatesEditorView *statesEditorView, StatesEditorModel *statesEditorModel) : QQuickWidget(), m_statesEditorView(statesEditorView), m_imageProvider(0), m_qmlSourceUpdateShortcut(0) { m_imageProvider = new Internal::StatesEditorImageProvider; m_imageProvider->setNodeInstanceView(statesEditorView->nodeInstanceView()); engine()->addImageProvider(QStringLiteral("qmldesigner_stateseditor"), m_imageProvider); engine()->addImportPath(qmlSourcesPath()); m_qmlSourceUpdateShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F4), this); connect(m_qmlSourceUpdateShortcut, SIGNAL(activated()), this, SLOT(reloadQmlSource())); setResizeMode(QQuickWidget::SizeRootObjectToView); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); rootContext()->setContextProperty(QStringLiteral("statesEditorModel"), statesEditorModel); rootContext()->setContextProperty(QLatin1String("canAddNewStates"), true); Theming::insertTheme(&m_themeProperties); rootContext()->setContextProperty(QLatin1String("creatorTheme"), &m_themeProperties); Theming::registerIconProvider(engine()); setWindowTitle(tr("States", "Title of Editor widget")); // init the first load of the QML UI elements reloadQmlSource(); }
TListView::TListView(TListViewPrivate &dd): d_ptr(&dd) { //Q_D(TListView); //d->q_ptr = this; setWrapping(true); setResizeMode(QListView::Adjust); }
PfdQmlGadgetWidget::PfdQmlGadgetWidget(QWindow *parent) : QQuickView(parent) { setResizeMode(SizeRootObjectToView); objectsToExport << "VelocityActual" << "PositionActual" << "AltitudeHoldDesired" << "AttitudeActual" << "AirspeedActual" << "Accels" << "VelocityDesired" << "StabilizationDesired" << "PathDesired" << "HomeLocation" << "Waypoint" << "WaypointActive" << "GPSPosition" << "GCSTelemetryStats" << "FlightBatteryState"; ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); m_objManager = pm->getObject<UAVObjectManager>(); foreach (const QString &objectName, objectsToExport) { exportUAVOInstance(objectName, 0); }
QtQuick1ApplicationViewer::QtQuick1ApplicationViewer(QWidget *parent) : QDeclarativeView(parent) , d(new QtQuick1ApplicationViewerPrivate()) { connect(engine(), SIGNAL(quit()), SLOT(close())); setResizeMode(QDeclarativeView::SizeRootObjectToView); }
WidgetBoxCategoryListView::WidgetBoxCategoryListView(QDesignerFormEditorInterface *core, QWidget *parent) : QListView(parent), m_proxyModel(new QSortFilterProxyModel(this)), m_model(new WidgetBoxCategoryModel(core, this)) { setFocusPolicy(Qt::NoFocus); setFrameShape(QFrame::NoFrame); setIconSize(QSize(22, 22)); setSpacing(1); setTextElideMode(Qt::ElideMiddle); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setResizeMode(QListView::Adjust); setUniformItemSizes(true); setItemDelegate(new WidgetBoxCategoryEntryDelegate(this)); connect(this, SIGNAL(pressed(QModelIndex)), this, SLOT(slotPressed(QModelIndex))); setEditTriggers(QAbstractItemView::AnyKeyPressed); m_proxyModel->setSourceModel(m_model); m_proxyModel->setFilterRole(FilterRole); setModel(m_proxyModel); connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(scratchPadChanged())); }
JumpFitDataTablePresenter::JumpFitDataTablePresenter(JumpFitModel *model, QTableWidget *dataTable) : IndirectDataTablePresenter(model, dataTable, jumpFitHeaders()), m_jumpFitModel(model) { auto header = dataTable->horizontalHeader(); header->setResizeMode(1, QHeaderView::Stretch); }
Smb4KSharesView::Smb4KSharesView(QWidget *parent) : QListWidget(parent) { setMouseTracking(true); setSelectionMode(ExtendedSelection); setResizeMode(Adjust); setSortingEnabled(true); setWordWrap(true); setAcceptDrops(true); setDragEnabled(true); setDropIndicatorShown(true); setUniformItemSizes(true); setWrapping(true); setContextMenuPolicy(Qt::CustomContextMenu); m_tooltipItem = 0; m_mouseInside = false; // Connections: connect(this, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(slotItemEntered(QListWidgetItem*))); connect(this, SIGNAL(viewportEntered()), this, SLOT(slotViewportEntered())); }
RocketBar::MainWidget::MainWidget( RocketBar::Context *config, QWidget *parent) : QDeclarativeView(parent), mContext(config), mLauncherList(QList<QObject*>()), mAppletList(QList<QObject*> ()) { /* initialize a borderless panel window */ setFocus(Qt::ActiveWindowFocusReason); setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); setAttribute(Qt::WA_TranslucentBackground); setAttribute(Qt::WA_X11NetWmWindowTypeDock); setStyleSheet("border-style: none;background:transparent;"); setResizeMode(QDeclarativeView::SizeRootObjectToView); engine()->addImageProvider(QLatin1String("xdg"), mContext->mImageProvider); engine()->addImageProvider(QLatin1String("task"), mContext->mWindowManager->taskImageProvider()); engine()->addImageProvider(QLatin1String("applet"), mContext->mAppletImageProvider); buildMenu(); buildLauncher(); buildApplets(); updateWindow(); connect(mContext->mWindowManager, SIGNAL(windowsChanged(WindowManager::WindowList&)), this, SLOT(updateWindows(WindowManager::WindowList&))); }
QmlViewGadgetWidget::QmlViewGadgetWidget(QWidget *parent) : QDeclarativeView(parent) { setMinimumSize(64,64); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); setResizeMode(SizeRootObjectToView); QStringList objectsToExport; objectsToExport << "VelocityActual" << "PositionActual" << "AttitudeActual" << "GPSPosition" << "GCSTelemetryStats" << "FlightBatteryState"; ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject<UAVObjectManager>(); foreach (const QString &objectName, objectsToExport) { UAVObject* object = objManager->getObject(objectName); if (object) engine()->rootContext()->setContextProperty(objectName, object); else qWarning() << "Failed to load object" << objectName; }
MainModelerWindow::MainModelerWindow() { QSurfaceFormat new_format = format(); new_format.setVersion(OPENGL_MAJOR_VERSION, OPENGL_MINOR_VERSION); new_format.setProfile(QSurfaceFormat::CoreProfile); setFormat(new_format); scenery = new Scenery(); scenery->autoPreset(); renderer = new OpenGLRenderer(scenery); render_preview_provider = new RenderPreviewProvider(); qmlRegisterType<OpenGLView>("Paysages", 1, 0, "OpenGLView"); engine()->addImageProvider("renderpreviewprovider", render_preview_provider); setMinimumSize(QSize(1280, 720)); setTitle(QObject::tr("Paysages 3D")); setResizeMode(QQuickView::SizeRootObjectToView); setSource(QUrl("qrc:///main.qml")); atmosphere = new AtmosphereModeler(this); water = new WaterModeler(this); cameras = new ModelerCameras(this); render_process = new RenderProcess(this, render_preview_provider); connectQmlSignal("tool_file_new", SIGNAL(clicked()), this, SLOT(newFile())); connectQmlSignal("tool_file_save", SIGNAL(clicked()), this, SLOT(saveFile())); connectQmlSignal("tool_file_load", SIGNAL(clicked()), this, SLOT(loadFile())); connectQmlSignal("tool_file_exit", SIGNAL(clicked()), this, SLOT(exit())); connectQmlSignal("root", SIGNAL(stopped()), this, SLOT(effectiveExit())); }
ECBrowser::ECBrowser(Framework *framework, ECEditorWindow *editorWindow, QWidget *parent): QtTreePropertyBrowser(parent), menu_(0), treeWidget_(0), editorWindow_(editorWindow), framework_(framework) { setMouseTracking(true); setAcceptDrops(true); setResizeMode(QtTreePropertyBrowser::Interactive); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(ShowComponentContextMenu(const QPoint &))); treeWidget_ = findChild<QTreeWidget *>(); assert(treeWidget_); treeWidget_->setSortingEnabled(true); treeWidget_->setFocusPolicy(Qt::StrongFocus); treeWidget_->setAcceptDrops(true); treeWidget_->setDragDropMode(QAbstractItemView::DropOnly); treeWidget_->header()->setSortIndicator(0, Qt::AscendingOrder); connect(treeWidget_, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), SLOT(SelectionChanged(QTreeWidgetItem*, QTreeWidgetItem*)), Qt::UniqueConnection); connect(treeWidget_, SIGNAL(itemExpanded(QTreeWidgetItem *)), SLOT(ResizeHeaderToContents())); connect(treeWidget_, SIGNAL(itemCollapsed(QTreeWidgetItem *)), SLOT(ResizeHeaderToContents())); QShortcut *delete_shortcut = new QShortcut(KEY_DELETE_SHORTCUT, this); QShortcut *copy_shortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_C), this); QShortcut *paste_shortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_V), this); connect(delete_shortcut, SIGNAL(activated()), SLOT(OnDeleteAction()), Qt::UniqueConnection); connect(copy_shortcut, SIGNAL(activated()), SLOT(CopyComponent()), Qt::UniqueConnection); connect(paste_shortcut, SIGNAL(activated()), SLOT(PasteComponent()), Qt::UniqueConnection); }
QtQuick2ApplicationViewer::QtQuick2ApplicationViewer(QWindow *parent) : QQuickView(parent) , d(new QtQuick2ApplicationViewerPrivate()) { connect(engine(), SIGNAL(quit()), SLOT(close())); setResizeMode(QQuickView::SizeRootObjectToView); }
bool QLayout::qt_property( int id, int f, QVariant* v) { switch ( id - staticMetaObject()->propertyOffset() ) { case 0: switch( f ) { case 0: setMargin(v->asInt()); break; case 1: *v = QVariant( this->margin() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 1: switch( f ) { case 0: setSpacing(v->asInt()); break; case 1: *v = QVariant( this->spacing() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 2: switch( f ) { case 0: setResizeMode((ResizeMode&)v->asInt()); break; case 1: *v = QVariant( (int)this->resizeMode() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; default: return QObject::qt_property( id, f, v ); } return TRUE; }
/********************************************************************** * * KivioIconView * **********************************************************************/ KivioIconView::KivioIconView( bool _readWrite,QWidget *parent, const char *name ) : QIconView( parent, name ) { m_pSpawnerSet = NULL; m_pCurDrag = NULL; isReadWrite=_readWrite; objList.append(this); setGridX( 64 ); setGridY( 64 ); setResizeMode( Adjust ); setWordWrapIconText(true); setHScrollBarMode( AlwaysOff ); setVScrollBarMode( Auto ); setAutoArrange(true); setSorting(true); setItemsMovable(false); setArrangement(LeftToRight); setAcceptDrops(false); viewport()->setAcceptDrops(false); if(isReadWrite) { connect(this, SIGNAL(doubleClicked(QIconViewItem*)), this, SLOT(slotDoubleClicked(QIconViewItem*))); connect(this, SIGNAL(clicked(QIconViewItem*)), this, SLOT(slotClicked(QIconViewItem*))); } }
SystemCompositor::SystemCompositor() : VCompositor(this) , m_currentSurface(0) { // Enable the subsurface extension enableSubSurfaceExtension(); // System compositor protocol m_protocol = new SystemCompositorServer(this, QWaylandCompositor::handle()); // Allow QML to access this compositor rootContext()->setContextProperty("compositor", this); // All the screen is initially available m_availableGeometry = screen()->availableGeometry(); connect(screen(), SIGNAL(virtualGeometryChanged(QRect)), this, SIGNAL(screenGeometryChanged())); // Load the QML code setSource(QUrl("qrc:///qml/Compositor.qml")); setResizeMode(QQuickView::SizeRootObjectToView); setColor(Qt::black); winId(); connect(this, SIGNAL(windowAdded(QVariant)), rootObject(), SLOT(windowAdded(QVariant))); connect(this, SIGNAL(windowDestroyed(QVariant)), rootObject(), SLOT(windowDestroyed(QVariant))); connect(this, SIGNAL(windowResized(QVariant)), rootObject(), SLOT(windowResized(QVariant))); connect(this, SIGNAL(sceneGraphInitialized()), this, SLOT(sceneGraphInitialized()), Qt::DirectConnection); connect(this, SIGNAL(frameSwapped()), this, SLOT(frameSwapped())); }
QmlApplicationViewer::QmlApplicationViewer(QWindow *parent) : QQuickView(parent) , d(new QmlApplicationViewerPrivate(this)) { connect(engine(), SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit())); setResizeMode(QQuickView::SizeRootObjectToView); }
/*! Main view's constructor, full of important stuff. Sets all global properties, sizing policy, connects important signals and slots, reads config file(s). */ CcfMain::CcfMain(CcfCommandLineParser *cmd, QWindow *parent) : QQuickView(parent), CcfError(), mCmdLnParser(cmd) { qmlRegisterType<CcfQmlBaseRosterMenu>("QmlBase", 0, 1, "BaseRosterMenu"); qmlRegisterType<CcfQmlBaseScenario>("QmlBase", 0, 1, "BaseScenario"); qmlRegisterType<CcfQmlBaseMap>("QmlBase", 0, 1, "Map"); qmlRegisterType<CcfQmlBaseUnit>("QmlBase", 0, 1, "BaseUnit"); qmlRegisterType<CcfQmlBaseSoldier>("QmlBase", 0, 1, "Soldier"); mLogger = new CcfLogger(this, mCmdLnParser->isDebug()); mGlobal = new CcfGlobal(this); mGameManager = new CcfGameManager(this); mEngineHelpers = new CcfEngineHelpers(this); initConfiguration(); rootContext()->setContextProperty("Global", mGlobal); rootContext()->setContextProperty("Config", mConfiguration); rootContext()->setContextProperty("GameManager", mGameManager); rootContext()->setContextProperty("EngineHelpers", mEngineHelpers); rootContext()->setContextProperty("Logger", mLogger); QString pwd = qApp->applicationDirPath() + "/"; rootContext()->setContextProperty("PWD", pwd); setResizeMode(QQuickView::SizeRootObjectToView); // connect(this, SIGNAL(sceneResized(QSize)), configuration, SLOT(windowResized(QSize))); connect(mConfiguration, SIGNAL(sizeModifiedInGame(int,int)), this, SLOT(forceViewportResize(int,int))); connect(engine(), SIGNAL(quit()), this, SLOT(quit())); connect(mConfiguration, SIGNAL(maximise()), this, SLOT(showMaximized())); connect(mConfiguration, SIGNAL(demaximise()), this, SLOT(showNormal())); connect(mGlobal, SIGNAL(disableQrc(QObject*)), this, SLOT(disableQrc(QObject*))); }
int QwtPicker::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: activated((*reinterpret_cast< bool(*)>(_a[1]))); break; case 1: selected((*reinterpret_cast< const QPolygon(*)>(_a[1]))); break; case 2: appended((*reinterpret_cast< const QPoint(*)>(_a[1]))); break; case 3: moved((*reinterpret_cast< const QPoint(*)>(_a[1]))); break; case 4: removed((*reinterpret_cast< const QPoint(*)>(_a[1]))); break; case 5: changed((*reinterpret_cast< const QPolygon(*)>(_a[1]))); break; case 6: setEnabled((*reinterpret_cast< bool(*)>(_a[1]))); break; default: ; } _id -= 7; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< bool*>(_v) = isEnabled(); break; case 1: *reinterpret_cast< ResizeMode*>(_v) = resizeMode(); break; case 2: *reinterpret_cast< DisplayMode*>(_v) = trackerMode(); break; case 3: *reinterpret_cast< QPen*>(_v) = trackerPen(); break; case 4: *reinterpret_cast< QFont*>(_v) = trackerFont(); break; case 5: *reinterpret_cast< RubberBand*>(_v) = rubberBand(); break; case 6: *reinterpret_cast< QPen*>(_v) = rubberBandPen(); break; } _id -= 7; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setEnabled(*reinterpret_cast< bool*>(_v)); break; case 1: setResizeMode(*reinterpret_cast< ResizeMode*>(_v)); break; case 2: setTrackerMode(*reinterpret_cast< DisplayMode*>(_v)); break; case 3: setTrackerPen(*reinterpret_cast< QPen*>(_v)); break; case 4: setTrackerFont(*reinterpret_cast< QFont*>(_v)); break; case 5: setRubberBand(*reinterpret_cast< RubberBand*>(_v)); break; case 6: setRubberBandPen(*reinterpret_cast< QPen*>(_v)); break; } _id -= 7; } else if (_c == QMetaObject::ResetProperty) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 7; } #endif // QT_NO_PROPERTIES return _id; }
QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : QDeclarativeView(parent) , d(new QmlApplicationViewerPrivate(this)) { connect(engine(), SIGNAL(quit()), SLOT(close())); setResizeMode(QDeclarativeView::SizeRootObjectToView); // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in }
int QtTreePropertyBrowser::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QtAbstractPropertyBrowser::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: collapsed((*reinterpret_cast< QtBrowserItem*(*)>(_a[1]))); break; case 1: expanded((*reinterpret_cast< QtBrowserItem*(*)>(_a[1]))); break; case 2: d_func()->slotCollapsed((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break; case 3: d_func()->slotExpanded((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break; case 4: d_func()->slotCurrentBrowserItemChanged((*reinterpret_cast< QtBrowserItem*(*)>(_a[1]))); break; case 5: d_func()->slotCurrentTreeItemChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< QTreeWidgetItem*(*)>(_a[2]))); break; default: ; } _id -= 6; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< int*>(_v) = indentation(); break; case 1: *reinterpret_cast< bool*>(_v) = rootIsDecorated(); break; case 2: *reinterpret_cast< bool*>(_v) = alternatingRowColors(); break; case 3: *reinterpret_cast< bool*>(_v) = isHeaderVisible(); break; case 4: *reinterpret_cast< ResizeMode*>(_v) = resizeMode(); break; case 5: *reinterpret_cast< int*>(_v) = splitterPosition(); break; case 6: *reinterpret_cast< bool*>(_v) = propertiesWithoutValueMarked(); break; } _id -= 7; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setIndentation(*reinterpret_cast< int*>(_v)); break; case 1: setRootIsDecorated(*reinterpret_cast< bool*>(_v)); break; case 2: setAlternatingRowColors(*reinterpret_cast< bool*>(_v)); break; case 3: setHeaderVisible(*reinterpret_cast< bool*>(_v)); break; case 4: setResizeMode(*reinterpret_cast< ResizeMode*>(_v)); break; case 5: setSplitterPosition(*reinterpret_cast< int*>(_v)); break; case 6: setPropertiesWithoutValueMarked(*reinterpret_cast< bool*>(_v)); break; } _id -= 7; } else if (_c == QMetaObject::ResetProperty) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 7; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 7; } #endif // QT_NO_PROPERTIES return _id; }
PathWindow::PathWindow(QWidget *parent) : QListWidget(parent) { char sz[16]; setViewMode(QListWidget::IconMode); setResizeMode(QListWidget::Adjust); setMovement(QListWidget::Static); connect(this, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(moveClicked(QListWidgetItem*))); }
ListViews::ListViews( QWidget *parent, const char *name ) : QSplitter( Qt::Horizontal, parent, name ) { lstFolders.setAutoDelete( TRUE ); folders = new QListView( this ); folders->header()->setClickEnabled( FALSE ); folders->addColumn( "Folder" ); initFolders(); setupFolders(); folders->setRootIsDecorated( TRUE ); setResizeMode( folders, QSplitter::KeepSize ); QSplitter *vsplitter = new QSplitter( Qt::Vertical, this ); messages = new QListView( vsplitter ); messages->addColumn( "Sender" ); messages->addColumn( "Subject" ); messages->addColumn( "Date" ); messages->setColumnAlignment( 1, Qt::AlignRight ); messages->setAllColumnsShowFocus( TRUE ); messages->setShowSortIndicator( TRUE ); menu = new QPopupMenu( messages ); for( int i = 1; i <= 10; i++ ) menu->insertItem( QString( "Context Item %1" ).arg( i ) ); connect(messages, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint& , int ) ), this, SLOT( slotRMB( QListViewItem *, const QPoint &, int ) ) ); vsplitter->setResizeMode( messages, QSplitter::KeepSize ); message = new QLabel( vsplitter ); message->setAlignment( Qt::AlignTop ); message->setBackgroundMode( PaletteBase ); connect( folders, SIGNAL( selectionChanged( QListViewItem* ) ), this, SLOT( slotFolderChanged( QListViewItem* ) ) ); connect( messages, SIGNAL( selectionChanged() ), this, SLOT( slotMessageChanged() ) ); connect( messages, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( slotMessageChanged() ) ); messages->setSelectionMode( QListView::Extended ); // some preparations folders->firstChild()->setOpen( TRUE ); folders->firstChild()->firstChild()->setOpen( TRUE ); folders->setCurrentItem( folders->firstChild()->firstChild()->firstChild() ); folders->setSelected( folders->firstChild()->firstChild()->firstChild(), TRUE ); messages->setSelected( messages->firstChild(), TRUE ); messages->setCurrentItem( messages->firstChild() ); message->setMargin( 5 ); QValueList<int> lst; lst.append( 170 ); setSizes( lst ); }