当前位置: 首页>>代码示例>>C++>>正文


C++ setResizeMode函数代码示例

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


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


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