• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setResizeMode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setResizeMode函数的典型用法代码示例。如果您正苦于以下问题:C++ setResizeMode函数的具体用法?C++ setResizeMode怎么用?C++ setResizeMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setResizeMode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: setResizeMode

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 );
    }
}
开发者ID:opieproject,项目名称:qte-opie,代码行数:9,代码来源:qabstractlayout.cpp


示例2: QDeclarativeView

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());
}
开发者ID:ElliotHYLee,项目名称:qgroundcontrol,代码行数:29,代码来源:apmtoolbar.cpp


示例3: setObjectName

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);
}
开发者ID:Kirek,项目名称:deepin-session-ui-manjaro,代码行数:34,代码来源:kblayoutwidget.cpp


示例4: QQuickView

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);
}
开发者ID:deoakshay,项目名称:kdevelop,代码行数:25,代码来源:splash.cpp


示例5: KIconView

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() ) );
    */

}
开发者ID:hasanakgoz,项目名称:Pardus-2011-Svn-,代码行数:32,代码来源:ticonview.cpp


示例6: QHeaderView

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 ) ) );
}
开发者ID:AshotN,项目名称:tomahawk,代码行数:25,代码来源:ViewHeader.cpp


示例7: QDeclarativeView

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));
}
开发者ID:MilanLi,项目名称:Reversi-Game,代码行数:30,代码来源:mainwidget.cpp


示例8: QQuickWidget

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();
}
开发者ID:daodaoliang,项目名称:qt-creator,代码行数:32,代码来源:stateseditorwidget.cpp


示例9: d_ptr

TListView::TListView(TListViewPrivate &dd): d_ptr(&dd)
   {
      //Q_D(TListView);
      //d->q_ptr = this;
      setWrapping(true);
      setResizeMode(QListView::Adjust);
   }
开发者ID:DimanNe,项目名称:eventmanager,代码行数:7,代码来源:TListView.cpp


示例10: QQuickView

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);
    }
开发者ID:EvalZero,项目名称:TauLabs,代码行数:27,代码来源:pfdqmlgadgetwidget.cpp


示例11: QDeclarativeView

QtQuick1ApplicationViewer::QtQuick1ApplicationViewer(QWidget *parent)
    : QDeclarativeView(parent)
    , d(new QtQuick1ApplicationViewerPrivate())
{
    connect(engine(), SIGNAL(quit()), SLOT(close()));
    setResizeMode(QDeclarativeView::SizeRootObjectToView);
}
开发者ID:csuft,项目名称:qt-creator,代码行数:7,代码来源:qtquick1applicationviewer.cpp


示例12: QListView

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()));
}
开发者ID:maxxant,项目名称:qt,代码行数:25,代码来源:widgetboxcategorylistview.cpp


示例13: IndirectDataTablePresenter

JumpFitDataTablePresenter::JumpFitDataTablePresenter(JumpFitModel *model,
                                                     QTableWidget *dataTable)
    : IndirectDataTablePresenter(model, dataTable, jumpFitHeaders()),
      m_jumpFitModel(model) {
  auto header = dataTable->horizontalHeader();
  header->setResizeMode(1, QHeaderView::Stretch);
}
开发者ID:samueljackson92,项目名称:mantid,代码行数:7,代码来源:JumpFitDataTablePresenter.cpp


示例14: QListWidget

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()));
}
开发者ID:KDE,项目名称:smb4k,代码行数:26,代码来源:smb4ksharesview.cpp


示例15: QDeclarativeView

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&)));
}
开发者ID:astarasikov,项目名称:qt4-panel,代码行数:29,代码来源:mainwidget.cpp


示例16: QDeclarativeView

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;
    }
开发者ID:1heinz,项目名称:TauLabs,代码行数:25,代码来源:qmlviewgadgetwidget.cpp


示例17: format

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()));
}
开发者ID:jordonwu,项目名称:paysages3d,代码行数:33,代码来源:MainModelerWindow.cpp


示例18: QtTreePropertyBrowser

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);
}
开发者ID:katik,项目名称:naali,代码行数:33,代码来源:ECBrowser.cpp


示例19: QQuickView

QtQuick2ApplicationViewer::QtQuick2ApplicationViewer(QWindow *parent)
    : QQuickView(parent)
    , d(new QtQuick2ApplicationViewerPrivate())
{
    connect(engine(), SIGNAL(quit()), SLOT(close()));
    setResizeMode(QQuickView::SizeRootObjectToView);
}
开发者ID:151706061,项目名称:QtAV,代码行数:7,代码来源:qtquick2applicationviewer.cpp


示例20: switch

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;
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:26,代码来源:moc_qlayout.cpp



注:本文中的setResizeMode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setResolution函数代码示例发布时间:2022-05-30
下一篇:
C++ setResizable函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap