コード例 #1
0
void
SideBySideLayout::insertWidget(int index, QWidget* widget)
{
    addChildWidget(widget);
    m_itemList.insert(index, new QWidgetItem(widget));
    doLayout(geometry(), 0);
}
コード例 #2
0
 void addButton(QAbstractButton *button, int priority)
 {
     addChildWidget(button);
     m_priorities.insert(button, priority);
     int index = 1;
     foreach(QWidgetItem *item, m_items) {
         if (m_priorities.value(static_cast<QAbstractButton*>(item->widget())) > priority)
             break;
         index++;
     }
     m_items.insert(index-1, new QWidgetItem(button));
 }
コード例 #3
0
ファイル: wz_window.cpp プロジェクト: jpcy/WidgetZero
Window::Window(const std::string &title)
{
	type_ = WidgetType::Window;
	drawPriority_ = 0;
	headerHeight_ = 0;
	borderSize_ = 4;
	drag_ = WindowDrag::None;
	title_ = title;

	content_ = new Widget;
	content_->setStretch(Stretch::All);
	addChildWidget(content_);
}
コード例 #4
0
ファイル: qboxlayout.cpp プロジェクト: FilipBE/qtextended
/*!
    Inserts \a widget at position \a index, with stretch factor \a
    stretch and alignment \a alignment. If \a index is negative, the
    widget is added at the end.

    The stretch factor applies only in the \l{direction()}{direction}
    of the QBoxLayout, and is relative to the other boxes and widgets
    in this QBoxLayout. Widgets and boxes with higher stretch factors
    grow more.

    If the stretch factor is 0 and nothing else in the QBoxLayout has
    a stretch factor greater than zero, the space is distributed
    according to the QWidget:sizePolicy() of each widget that's
    involved.

    The alignment is specified by \a alignment. The default alignment
    is 0, which means that the widget fills the entire cell.

    \sa addWidget(), insertItem()
*/
void QBoxLayout::insertWidget(int index, QWidget *widget, int stretch,
                              Qt::Alignment alignment)
{
    Q_D(QBoxLayout);
    if (!checkWidget(this, widget))
         return;
    addChildWidget(widget);
    if (index < 0)                                // append
        index = d->list.count();
    QWidgetItem *b = QLayoutPrivate::createWidgetItem(this, widget);
    b->setAlignment(alignment);
    QBoxLayoutItem *it = new QBoxLayoutItem(b, stretch);
    d->list.insert(index, it);
    invalidate();
}
コード例 #5
0
ファイル: qdockwidget.cpp プロジェクト: phen89/rtqt
void QDockWidgetLayout::setWidgetForRole(Role r, QWidget *w)
{
    QWidget *old = widgetForRole(r);
    if (old != 0) {
        old->hide();
        removeWidget(old);
    }

    if (w != 0) {
        addChildWidget(w);
        item_list[r] = new QWidgetItemV2(w);
        w->show();
    } else {
        item_list[r] = 0;
    }

    invalidate();
}
コード例 #6
0
void DeckButtonsLayout::setForwardButton( QAbstractButton* button )
{
    if ( forwardButton && button == forwardButton ) {
        return;
    }

    if ( forwardItem ) {
        delete takeAt( 2 );
    }

    if ( button ) {
        addChildWidget( button );
    }

    forwardItem = new QWidgetItem( button );
    forwardButton = button;

    update();
}
コード例 #7
0
void DeckButtonsLayout::setRoundButton( QAbstractButton* button )
{
    if ( RoundButton && button == RoundButton ) {
        return;
    }

    if ( goItem ) {
        delete takeAt( 1 );
    }

    if ( button ) {
        addChildWidget( button );
    }

    goItem = new QWidgetItem( button );
    RoundButton = button;

    update();
}
コード例 #8
0
void DeckButtonsLayout::setBackwardButton( QAbstractButton* button )
{
    if ( backwardButton && button == backwardButton ) {
        return;
    }

    if ( backwardItem ) {
        delete takeAt( 0 );
    }

    if ( button ) {
        addChildWidget( button );
    }

    backwardItem = new QWidgetItem( button );
    backwardButton = button;

    update();
}
コード例 #9
0
int StackLayout::insertWidget(int index, QWidget *widget)
{
    addChildWidget(widget);
    index = qMin(index, _list.count());
    if (index < 0)
        index = _list.count();
    QWidgetItem *wi = new QWidgetItem( widget );
    _list.insert(index, wi);
    invalidate();
    if (_index < 0) {
        setCurrentIndex(index);
    } else {
        if (index <= _index)
            ++_index;
        if (_mode == StackOne)
            widget->hide();
        widget->lower();
    }
    return index;
}
コード例 #10
0
/*!
    Inserts the given \a widget at the given \a index in this
    QStackedLayout. If \a index is out of range, the widget is
    appended (in which case it is the actual index of the \a widget
    that is returned).

    If the QStackedLayout is empty before this function is called, the
    given \a widget becomes the current widget.

    Inserting a new widget at an index less than or equal to the current index
    will increment the current index, but keep the current widget.

    \sa addWidget(), removeWidget(), setCurrentWidget()
*/
int QStackedLayout::insertWidget(int index, QWidget *widget)
{
    Q_D(QStackedLayout);
    addChildWidget(widget);
    index = qMin(index, d->list.count());
    if (index < 0)
        index = d->list.count();
    QWidgetItem *wi = QLayoutPrivate::createWidgetItem(this, widget);
    d->list.insert(index, wi);
    invalidate();
    if (d->index < 0) {
        setCurrentIndex(index);
    } else {
        if (index <= d->index)
            ++d->index;
        if (d->stackingMode == StackOne)
            widget->hide();
        widget->lower();
    }
    return index;
}
コード例 #11
0
void GameStateConfigBase::addChildWidgets() {
	addChildWidget(music_volume_sl, AUDIO_TAB);
	addChildWidget(music_volume_lb, AUDIO_TAB);
	addChildWidget(sound_volume_sl, AUDIO_TAB);
	addChildWidget(sound_volume_lb, AUDIO_TAB);

	addChildWidget(combat_text_cb, INTERFACE_TAB);
	addChildWidget(combat_text_lb, INTERFACE_TAB);
	addChildWidget(show_fps_cb, INTERFACE_TAB);
	addChildWidget(show_fps_lb, INTERFACE_TAB);
	addChildWidget(colorblind_cb, INTERFACE_TAB);
	addChildWidget(colorblind_lb, INTERFACE_TAB);
	addChildWidget(hardware_cursor_cb, INTERFACE_TAB);
	addChildWidget(hardware_cursor_lb, INTERFACE_TAB);
	addChildWidget(dev_mode_cb, INTERFACE_TAB);
	addChildWidget(dev_mode_lb, INTERFACE_TAB);
	addChildWidget(loot_tooltips_cb, INTERFACE_TAB);
	addChildWidget(loot_tooltips_lb, INTERFACE_TAB);
	addChildWidget(statbar_labels_cb, INTERFACE_TAB);
	addChildWidget(statbar_labels_lb, INTERFACE_TAB);
	addChildWidget(auto_equip_cb, INTERFACE_TAB);
	addChildWidget(auto_equip_lb, INTERFACE_TAB);
	addChildWidget(subtitles_cb, INTERFACE_TAB);
	addChildWidget(subtitles_lb, INTERFACE_TAB);
	addChildWidget(language_lstb, INTERFACE_TAB);
	addChildWidget(language_lb, INTERFACE_TAB);

	addChildWidget(activemods_lstb, MODS_TAB);
	addChildWidget(activemods_lb, MODS_TAB);
	addChildWidget(inactivemods_lstb, MODS_TAB);
	addChildWidget(inactivemods_lb, MODS_TAB);
	addChildWidget(activemods_shiftup_btn, MODS_TAB);
	addChildWidget(activemods_shiftdown_btn, MODS_TAB);
	addChildWidget(activemods_deactivate_btn, MODS_TAB);
	addChildWidget(inactivemods_activate_btn, MODS_TAB);
}
コード例 #12
0
ファイル: flowlayout.cpp プロジェクト: Andrsid/myagent-im
void FlowLayout::insertWidget(int i, QWidget* w)
{
	addChildWidget(w);
	itemList.insert(i, new QWidgetItem(w));
}
コード例 #13
0
void FixedSizeGridLayout::insertWidget(int index, QWidget *widget)
{
	addChildWidget(widget);
	insertItem(index, new QWidgetItemV2(widget));
}
コード例 #14
0
ファイル: QLayout_DhClass.cpp プロジェクト: bennofs/hsQt
void DhQLayout::DvhaddChildWidget(QWidget* x1) {
  return addChildWidget(x1);
}
コード例 #15
0
void GameStateConfigDesktop::addChildWidgetsDesktop() {
	addChildWidget(fullscreen_cb, VIDEO_TAB);
	addChildWidget(fullscreen_lb, VIDEO_TAB);
	addChildWidget(hwsurface_cb, VIDEO_TAB);
	addChildWidget(hwsurface_lb, VIDEO_TAB);
	addChildWidget(vsync_cb, VIDEO_TAB);
	addChildWidget(vsync_lb, VIDEO_TAB);
	addChildWidget(texture_filter_cb, VIDEO_TAB);
	addChildWidget(texture_filter_lb, VIDEO_TAB);
	addChildWidget(change_gamma_cb, VIDEO_TAB);
	addChildWidget(change_gamma_lb, VIDEO_TAB);
	addChildWidget(gamma_sl, VIDEO_TAB);
	addChildWidget(gamma_lb, VIDEO_TAB);
	addChildWidget(hws_note_lb, VIDEO_TAB);
	addChildWidget(dbuf_note_lb, VIDEO_TAB);
	addChildWidget(test_note_lb, VIDEO_TAB);

	addChildWidget(mouse_move_cb, INPUT_TAB);
	addChildWidget(mouse_move_lb, INPUT_TAB);
	addChildWidget(enable_joystick_cb, INPUT_TAB);
	addChildWidget(enable_joystick_lb, INPUT_TAB);
	addChildWidget(mouse_aim_cb, INPUT_TAB);
	addChildWidget(mouse_aim_lb, INPUT_TAB);
	addChildWidget(no_mouse_cb, INPUT_TAB);
	addChildWidget(no_mouse_lb, INPUT_TAB);
	addChildWidget(joystick_deadzone_sl, INPUT_TAB);
	addChildWidget(joystick_deadzone_lb, INPUT_TAB);
	addChildWidget(joystick_device_lstb, INPUT_TAB);
	addChildWidget(joystick_device_lb, INPUT_TAB);
	addChildWidget(handheld_note_lb, INPUT_TAB);

	for (unsigned int i = 0; i < keybinds_btn.size(); i++) {
		input_scrollbox->addChildWidget(keybinds_btn[i]);
	}
}