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
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
/*!
    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
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();
}
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();
}
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();
}
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;
}
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
void FlowLayout::insertWidget(int i, QWidget* w)
{
	addChildWidget(w);
	itemList.insert(i, new QWidgetItem(w));
}
void FixedSizeGridLayout::insertWidget(int index, QWidget *widget)
{
	addChildWidget(widget);
	insertItem(index, new QWidgetItemV2(widget));
}
示例#14
0
void DhQLayout::DvhaddChildWidget(QWidget* x1) {
  return addChildWidget(x1);
}
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]);
	}
}