ensured parenting of qwidgets
This commit is contained in:
+12
-15
@@ -172,8 +172,7 @@ void EffectControls::show_effect_menu(int type, int subtype) {
|
||||
const EffectMeta& em = effects.at(i);
|
||||
|
||||
if (em.type == type && em.subtype == subtype) {
|
||||
QAction* action = new QAction(&effects_menu);
|
||||
action->setText(em.name);
|
||||
QAction* action = effects_menu.addAction(em.name);
|
||||
action->setData(reinterpret_cast<quintptr>(&em));
|
||||
if (!em.tooltip.isEmpty()) {
|
||||
action->setToolTip(em.tooltip);
|
||||
@@ -193,9 +192,8 @@ void EffectControls::show_effect_menu(int type, int subtype) {
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
parent = new QMenu(&effects_menu);
|
||||
parent = effects_menu.addMenu(em.category);
|
||||
parent->setToolTipsVisible(true);
|
||||
parent->setTitle(em.category);
|
||||
|
||||
bool found = false;
|
||||
for (int i=0;i<effects_menu.actions().size();i++) {
|
||||
@@ -275,7 +273,7 @@ void EffectControls::open_effect(QVBoxLayout* layout, Effect* e) {
|
||||
}
|
||||
|
||||
void EffectControls::setup_ui() {
|
||||
QWidget* contents = new QWidget();
|
||||
QWidget* contents = new QWidget(this);
|
||||
|
||||
QHBoxLayout* hlayout = new QHBoxLayout(contents);
|
||||
hlayout->setSpacing(0);
|
||||
@@ -293,7 +291,7 @@ void EffectControls::setup_ui() {
|
||||
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
scrollArea->setWidgetResizable(true);
|
||||
|
||||
QWidget* scrollAreaWidgetContents = new QWidget();
|
||||
QWidget* scrollAreaWidgetContents = new QWidget(scrollArea);
|
||||
|
||||
QHBoxLayout* scrollAreaLayout = new QHBoxLayout(scrollAreaWidgetContents);
|
||||
scrollAreaLayout->setSpacing(0);
|
||||
@@ -308,7 +306,7 @@ void EffectControls::setup_ui() {
|
||||
effects_area_layout->setMargin(0);
|
||||
|
||||
vcontainer = new QWidget(effects_area);
|
||||
QVBoxLayout* vcontainerLayout = new QVBoxLayout(vcontainer);
|
||||
QVBoxLayout* vcontainerLayout = new QVBoxLayout();
|
||||
vcontainerLayout->setSpacing(0);
|
||||
vcontainerLayout->setMargin(0);
|
||||
|
||||
@@ -320,7 +318,7 @@ void EffectControls::setup_ui() {
|
||||
veHeaderLayout->setSpacing(0);
|
||||
veHeaderLayout->setMargin(0);
|
||||
|
||||
QPushButton* btnAddVideoEffect = new QPushButton(veHeader);
|
||||
QPushButton* btnAddVideoEffect = new QPushButton();
|
||||
btnAddVideoEffect->setIcon(QIcon(":/icons/add-effect.png"));
|
||||
btnAddVideoEffect->setToolTip(tr("Add Video Effect"));
|
||||
veHeaderLayout->addWidget(btnAddVideoEffect);
|
||||
@@ -328,7 +326,7 @@ void EffectControls::setup_ui() {
|
||||
|
||||
veHeaderLayout->addStretch();
|
||||
|
||||
QLabel* lblVideoEffects = new QLabel(veHeader);
|
||||
QLabel* lblVideoEffects = new QLabel();
|
||||
QFont font;
|
||||
font.setPointSize(9);
|
||||
lblVideoEffects->setFont(font);
|
||||
@@ -338,16 +336,15 @@ void EffectControls::setup_ui() {
|
||||
|
||||
veHeaderLayout->addStretch();
|
||||
|
||||
QPushButton* btnAddVideoTransition = new QPushButton(veHeader);
|
||||
QPushButton* btnAddVideoTransition = new QPushButton();
|
||||
btnAddVideoTransition->setIcon(QIcon(":/icons/add-transition.png"));
|
||||
btnAddVideoTransition->setToolTip(tr("Add Video Transition"));
|
||||
connect(btnAddVideoTransition, SIGNAL(clicked(bool)), this, SLOT(video_transition_click()));
|
||||
|
||||
veHeaderLayout->addWidget(btnAddVideoTransition);
|
||||
|
||||
vcontainerLayout->addWidget(veHeader);
|
||||
|
||||
video_effect_area = new QWidget(vcontainer);
|
||||
video_effect_area = new QWidget();
|
||||
QVBoxLayout* veAreaLayout = new QVBoxLayout(video_effect_area);
|
||||
veAreaLayout->setSpacing(0);
|
||||
veAreaLayout->setMargin(0);
|
||||
@@ -368,7 +365,7 @@ void EffectControls::setup_ui() {
|
||||
aeHeaderLayout->setSpacing(0);
|
||||
aeHeaderLayout->setMargin(0);
|
||||
|
||||
QPushButton* btnAddAudioEffect = new QPushButton(aeHeader);
|
||||
QPushButton* btnAddAudioEffect = new QPushButton();
|
||||
btnAddAudioEffect->setIcon(QIcon(":/icons/add-effect.png"));
|
||||
btnAddAudioEffect->setToolTip(tr("Add Audio Effect"));
|
||||
connect(btnAddAudioEffect, SIGNAL(clicked(bool)), this, SLOT(audio_effect_click()));
|
||||
@@ -376,7 +373,7 @@ void EffectControls::setup_ui() {
|
||||
|
||||
aeHeaderLayout->addStretch();
|
||||
|
||||
QLabel* lblAudioEffects = new QLabel(aeHeader);
|
||||
QLabel* lblAudioEffects = new QLabel();
|
||||
lblAudioEffects->setFont(font);
|
||||
lblAudioEffects->setAlignment(Qt::AlignCenter);
|
||||
lblAudioEffects->setText(tr("AUDIO EFFECTS"));
|
||||
@@ -384,7 +381,7 @@ void EffectControls::setup_ui() {
|
||||
|
||||
aeHeaderLayout->addStretch();
|
||||
|
||||
QPushButton* btnAddAudioTransition = new QPushButton(aeHeader);
|
||||
QPushButton* btnAddAudioTransition = new QPushButton();
|
||||
btnAddAudioTransition->setIcon(QIcon(":/icons/add-transition.png"));
|
||||
btnAddAudioTransition->setToolTip(tr("Add Audio Transition"));
|
||||
connect(btnAddAudioTransition, SIGNAL(clicked(bool)), this, SLOT(audio_transition_click()));
|
||||
|
||||
+26
-27
@@ -23,48 +23,47 @@ GraphEditor::GraphEditor(QWidget* parent) : QDockWidget(parent), row(nullptr) {
|
||||
setWindowTitle(tr("Graph Editor"));
|
||||
resize(720, 480);
|
||||
|
||||
QWidget* main_widget = new QWidget();
|
||||
QWidget* main_widget = new QWidget(this);
|
||||
setWidget(main_widget);
|
||||
QVBoxLayout* layout = new QVBoxLayout();
|
||||
main_widget->setLayout(layout);
|
||||
QVBoxLayout* layout = new QVBoxLayout(main_widget);
|
||||
|
||||
QWidget* tool_widget = new QWidget();
|
||||
QWidget* tool_widget = new QWidget(this);
|
||||
tool_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
|
||||
QHBoxLayout* tools = new QHBoxLayout();
|
||||
QHBoxLayout* tools = new QHBoxLayout(this);
|
||||
tool_widget->setLayout(tools);
|
||||
|
||||
QWidget* left_tool_widget = new QWidget();
|
||||
QHBoxLayout* left_tool_layout = new QHBoxLayout();
|
||||
QWidget* left_tool_widget = new QWidget(this);
|
||||
QHBoxLayout* left_tool_layout = new QHBoxLayout(this);
|
||||
left_tool_layout->setSpacing(0);
|
||||
left_tool_layout->setMargin(0);
|
||||
left_tool_widget->setLayout(left_tool_layout);
|
||||
tools->addWidget(left_tool_widget);
|
||||
QWidget* center_tool_widget = new QWidget();
|
||||
QHBoxLayout* center_tool_layout = new QHBoxLayout();
|
||||
QWidget* center_tool_widget = new QWidget(this);
|
||||
QHBoxLayout* center_tool_layout = new QHBoxLayout(this);
|
||||
center_tool_layout->setSpacing(0);
|
||||
center_tool_layout->setMargin(0);
|
||||
center_tool_widget->setLayout(center_tool_layout);
|
||||
tools->addWidget(center_tool_widget);
|
||||
QWidget* right_tool_widget = new QWidget();
|
||||
QHBoxLayout* right_tool_layout = new QHBoxLayout();
|
||||
QWidget* right_tool_widget = new QWidget(this);
|
||||
QHBoxLayout* right_tool_layout = new QHBoxLayout(this);
|
||||
right_tool_layout->setSpacing(0);
|
||||
right_tool_layout->setMargin(0);
|
||||
right_tool_widget->setLayout(right_tool_layout);
|
||||
tools->addWidget(right_tool_widget);
|
||||
|
||||
keyframe_nav = new KeyframeNavigator(0, false);
|
||||
keyframe_nav = new KeyframeNavigator(this, false);
|
||||
keyframe_nav->enable_keyframes(true);
|
||||
keyframe_nav->enable_keyframe_toggle(false);
|
||||
left_tool_layout->addWidget(keyframe_nav);
|
||||
left_tool_layout->addStretch();
|
||||
|
||||
linear_button = new QPushButton(tr("Linear"));
|
||||
linear_button = new QPushButton(tr("Linear"), this);
|
||||
linear_button->setProperty("type", EFFECT_KEYFRAME_LINEAR);
|
||||
linear_button->setCheckable(true);
|
||||
bezier_button = new QPushButton(tr("Bezier"));
|
||||
bezier_button = new QPushButton(tr("Bezier"), this);
|
||||
bezier_button->setProperty("type", EFFECT_KEYFRAME_BEZIER);
|
||||
bezier_button->setCheckable(true);
|
||||
hold_button = new QPushButton(tr("Hold"));
|
||||
hold_button = new QPushButton(tr("Hold"), this);
|
||||
hold_button->setProperty("type", EFFECT_KEYFRAME_HOLD);
|
||||
hold_button->setCheckable(true);
|
||||
|
||||
@@ -75,36 +74,36 @@ GraphEditor::GraphEditor(QWidget* parent) : QDockWidget(parent), row(nullptr) {
|
||||
|
||||
layout->addWidget(tool_widget);
|
||||
|
||||
QWidget* central_widget = new QWidget();
|
||||
QVBoxLayout* central_layout = new QVBoxLayout();
|
||||
QWidget* central_widget = new QWidget(this);
|
||||
QVBoxLayout* central_layout = new QVBoxLayout(this);
|
||||
central_widget->setLayout(central_layout);
|
||||
central_layout->setSpacing(0);
|
||||
central_layout->setMargin(0);
|
||||
header = new TimelineHeader();
|
||||
header = new TimelineHeader(this);
|
||||
header->viewer = panel_sequence_viewer;
|
||||
central_layout->addWidget(header);
|
||||
view = new GraphView();
|
||||
view = new GraphView(this);
|
||||
central_layout->addWidget(view);
|
||||
|
||||
layout->addWidget(central_widget);
|
||||
|
||||
QWidget* value_widget = new QWidget();
|
||||
QWidget* value_widget = new QWidget(this);
|
||||
value_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
|
||||
QHBoxLayout* values = new QHBoxLayout();
|
||||
QHBoxLayout* values = new QHBoxLayout(this);
|
||||
value_widget->setLayout(values);
|
||||
values->addStretch();
|
||||
|
||||
QWidget* central_value_widget = new QWidget();
|
||||
value_layout = new QHBoxLayout();
|
||||
QWidget* central_value_widget = new QWidget(this);
|
||||
value_layout = new QHBoxLayout(this);
|
||||
value_layout->setMargin(0);
|
||||
value_layout->addWidget(new QLabel("")); // a spacer so the layout doesn't jump
|
||||
value_layout->addWidget(new QLabel("", this)); // a spacer so the layout doesn't jump
|
||||
central_value_widget->setLayout(value_layout);
|
||||
values->addWidget(central_value_widget);
|
||||
|
||||
values->addStretch();
|
||||
layout->addWidget(value_widget);
|
||||
|
||||
current_row_desc = new QLabel();
|
||||
current_row_desc = new QLabel(this);
|
||||
current_row_desc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
|
||||
current_row_desc->setAlignment(Qt::AlignCenter);
|
||||
layout->addWidget(current_row_desc);
|
||||
@@ -158,7 +157,7 @@ void GraphEditor::set_row(EffectRow *r) {
|
||||
for (int i=0;i<r->fieldCount();i++) {
|
||||
EffectField* field = r->field(i);
|
||||
if (field->type == EFFECT_FIELD_DOUBLE) {
|
||||
QPushButton* slider_button = new QPushButton();
|
||||
QPushButton* slider_button = new QPushButton(this);
|
||||
slider_button->setCheckable(true);
|
||||
slider_button->setChecked(field->is_enabled());
|
||||
slider_button->setIcon(QIcon(":/icons/record.png"));
|
||||
@@ -168,7 +167,7 @@ void GraphEditor::set_row(EffectRow *r) {
|
||||
slider_proxy_buttons.append(slider_button);
|
||||
value_layout->addWidget(slider_button);
|
||||
|
||||
LabelSlider* slider = new LabelSlider();
|
||||
LabelSlider* slider = new LabelSlider(this);
|
||||
slider->set_color(get_curve_color(i, r->fieldCount()).name());
|
||||
connect(slider, SIGNAL(valueChanged()), this, SLOT(passthrough_slider_value()));
|
||||
slider_proxies.append(slider);
|
||||
|
||||
+8
-8
@@ -63,7 +63,7 @@ Project::Project(QWidget *parent) :
|
||||
{
|
||||
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
|
||||
QWidget* dockWidgetContents = new QWidget();
|
||||
QWidget* dockWidgetContents = new QWidget(this);
|
||||
QVBoxLayout* verticalLayout = new QVBoxLayout(dockWidgetContents);
|
||||
verticalLayout->setContentsMargins(0, 0, 0, 0);
|
||||
verticalLayout->setSpacing(0);
|
||||
@@ -76,10 +76,10 @@ Project::Project(QWidget *parent) :
|
||||
sorter->setSourceModel(&project_model);
|
||||
|
||||
// optional toolbar
|
||||
toolbar_widget = new QWidget();
|
||||
toolbar_widget = new QWidget(this);
|
||||
toolbar_widget->setVisible(config.show_project_toolbar);
|
||||
toolbar_widget->setObjectName("project_toolbar");
|
||||
QHBoxLayout* toolbar = new QHBoxLayout();
|
||||
QHBoxLayout* toolbar = new QHBoxLayout(toolbar_widget);
|
||||
toolbar->setMargin(0);
|
||||
toolbar->setSpacing(0);
|
||||
toolbar_widget->setLayout(toolbar);
|
||||
@@ -157,14 +157,14 @@ Project::Project(QWidget *parent) :
|
||||
verticalLayout->addWidget(tree_view);
|
||||
|
||||
// icon view
|
||||
icon_view_container = new QWidget();
|
||||
icon_view_container = new QWidget(dockWidgetContents);
|
||||
|
||||
QVBoxLayout* icon_view_container_layout = new QVBoxLayout();
|
||||
QVBoxLayout* icon_view_container_layout = new QVBoxLayout(icon_view_container);
|
||||
icon_view_container_layout->setMargin(0);
|
||||
icon_view_container_layout->setSpacing(0);
|
||||
icon_view_container->setLayout(icon_view_container_layout);
|
||||
|
||||
QHBoxLayout* icon_view_controls = new QHBoxLayout();
|
||||
QHBoxLayout* icon_view_controls = new QHBoxLayout(icon_view_container);
|
||||
icon_view_controls->setMargin(0);
|
||||
icon_view_controls->setSpacing(0);
|
||||
|
||||
@@ -172,14 +172,14 @@ Project::Project(QWidget *parent) :
|
||||
directory_up_button.addFile(":/icons/dirup.png", QSize(), QIcon::Normal);
|
||||
directory_up_button.addFile(":/icons/dirup-disabled.png", QSize(), QIcon::Disabled);
|
||||
|
||||
directory_up = new QPushButton();
|
||||
directory_up = new QPushButton(icon_view_container);
|
||||
directory_up->setIcon(directory_up_button);
|
||||
directory_up->setEnabled(false);
|
||||
icon_view_controls->addWidget(directory_up);
|
||||
|
||||
icon_view_controls->addStretch();
|
||||
|
||||
QSlider* icon_size_slider = new QSlider(Qt::Horizontal);
|
||||
QSlider* icon_size_slider = new QSlider(Qt::Horizontal, icon_view_container);
|
||||
icon_size_slider->setMinimum(16);
|
||||
icon_size_slider->setMaximum(120);
|
||||
icon_view_controls->addWidget(icon_size_slider);
|
||||
|
||||
+44
-40
@@ -540,7 +540,7 @@ void Timeline::resizeEvent(QResizeEvent *) {
|
||||
}
|
||||
int comp_height = tool_button_widget->height();
|
||||
int cols = qCeil(double(total_client_height)/double(comp_height));
|
||||
tool_button_widget->setFixedWidth((tool_button_children.at(0)->width())*cols + horizontal_spacing*(cols-1) + 1);
|
||||
tool_button_widget->setFixedWidth((tool_button_children.at(0)->sizeHint().width())*cols + horizontal_spacing*(cols-1) + 1);
|
||||
}
|
||||
|
||||
void Timeline::delete_in_out(bool ripple) {
|
||||
@@ -1097,7 +1097,7 @@ void Timeline::paste(bool insert) {
|
||||
QPushButton* replace_button = box.addButton(tr("Replace"), QMessageBox::NoRole);
|
||||
QPushButton* skip_button = box.addButton(tr("Skip"), QMessageBox::RejectRole);
|
||||
|
||||
QCheckBox* future_box = new QCheckBox(tr("Do this for all conflicts found"));
|
||||
QCheckBox* future_box = new QCheckBox(tr("Do this for all conflicts found"), &box);
|
||||
box.setCheckBox(future_box);
|
||||
|
||||
box.exec();
|
||||
@@ -1645,18 +1645,19 @@ void Timeline::setup_ui() {
|
||||
|
||||
QHBoxLayout* horizontalLayout = new QHBoxLayout(dockWidgetContents);
|
||||
horizontalLayout->setSpacing(0);
|
||||
horizontalLayout->setContentsMargins(0, 0, 0, 0);
|
||||
horizontalLayout->setMargin(0);
|
||||
|
||||
tool_button_widget = new QWidget(dockWidgetContents);
|
||||
tool_button_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
setWidget(dockWidgetContents);
|
||||
|
||||
tool_button_widget = new QWidget();
|
||||
tool_button_widget->setObjectName("timeline_toolbar");
|
||||
tool_button_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
|
||||
FlowLayout* tool_buttons_layout = new FlowLayout(tool_button_widget);
|
||||
// tool_buttons_layout->setSizeConstraint(QLayout::SetNoConstraint);
|
||||
tool_buttons_layout->setSpacing(4);
|
||||
tool_buttons_layout->setContentsMargins(0, 0, 0, 0);
|
||||
tool_buttons_layout->setMargin(0);
|
||||
|
||||
toolArrowButton = new QPushButton(tool_button_widget);
|
||||
toolArrowButton = new QPushButton();
|
||||
QIcon arrow_icon;
|
||||
arrow_icon.addFile(QStringLiteral(":/icons/arrow.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
arrow_icon.addFile(QStringLiteral(":/icons/arrow-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
@@ -1667,7 +1668,7 @@ void Timeline::setup_ui() {
|
||||
connect(toolArrowButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolArrowButton);
|
||||
|
||||
toolEditButton = new QPushButton(tool_button_widget);
|
||||
toolEditButton = new QPushButton();
|
||||
QIcon icon1;
|
||||
icon1.addFile(QStringLiteral(":/icons/beam.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
icon1.addFile(QStringLiteral(":/icons/beam-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
@@ -1678,7 +1679,7 @@ void Timeline::setup_ui() {
|
||||
connect(toolEditButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolEditButton);
|
||||
|
||||
toolRippleButton = new QPushButton(tool_button_widget);
|
||||
toolRippleButton = new QPushButton();
|
||||
QIcon icon2;
|
||||
icon2.addFile(QStringLiteral(":/icons/ripple.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
icon2.addFile(QStringLiteral(":/icons/ripple-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
@@ -1689,7 +1690,7 @@ void Timeline::setup_ui() {
|
||||
connect(toolRippleButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolRippleButton);
|
||||
|
||||
toolRazorButton = new QPushButton(tool_button_widget);
|
||||
toolRazorButton = new QPushButton();
|
||||
QIcon icon4;
|
||||
icon4.addFile(QStringLiteral(":/icons/razor.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
icon4.addFile(QStringLiteral(":/icons/razor-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
@@ -1700,7 +1701,7 @@ void Timeline::setup_ui() {
|
||||
connect(toolRazorButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolRazorButton);
|
||||
|
||||
toolSlipButton = new QPushButton(tool_button_widget);
|
||||
toolSlipButton = new QPushButton();
|
||||
QIcon icon5;
|
||||
icon5.addFile(QStringLiteral(":/icons/slip.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon5.addFile(QStringLiteral(":/icons/slip-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
@@ -1711,7 +1712,7 @@ void Timeline::setup_ui() {
|
||||
connect(toolSlipButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolSlipButton);
|
||||
|
||||
toolSlideButton = new QPushButton(tool_button_widget);
|
||||
toolSlideButton = new QPushButton();
|
||||
QIcon icon6;
|
||||
icon6.addFile(QStringLiteral(":/icons/slide.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon6.addFile(QStringLiteral(":/icons/slide-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
@@ -1722,7 +1723,7 @@ void Timeline::setup_ui() {
|
||||
connect(toolSlideButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolSlideButton);
|
||||
|
||||
toolHandButton = new QPushButton(tool_button_widget);
|
||||
toolHandButton = new QPushButton();
|
||||
QIcon icon7;
|
||||
icon7.addFile(QStringLiteral(":/icons/hand.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon7.addFile(QStringLiteral(":/icons/hand-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
@@ -1733,7 +1734,7 @@ void Timeline::setup_ui() {
|
||||
connect(toolHandButton, SIGNAL(clicked(bool)), this, SLOT(set_tool()));
|
||||
tool_buttons_layout->addWidget(toolHandButton);
|
||||
|
||||
toolTransitionButton = new QPushButton(tool_button_widget);
|
||||
toolTransitionButton = new QPushButton();
|
||||
QIcon icon8;
|
||||
icon8.addFile(QStringLiteral(":/icons/transition-tool.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon8.addFile(QStringLiteral(":/icons/transition-tool-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
@@ -1743,7 +1744,7 @@ void Timeline::setup_ui() {
|
||||
connect(toolTransitionButton, SIGNAL(clicked(bool)), this, SLOT(transition_tool_click()));
|
||||
tool_buttons_layout->addWidget(toolTransitionButton);
|
||||
|
||||
snappingButton = new QPushButton(tool_button_widget);
|
||||
snappingButton = new QPushButton();
|
||||
QIcon icon9;
|
||||
icon9.addFile(QStringLiteral(":/icons/magnet.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon9.addFile(QStringLiteral(":/icons/magnet-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
@@ -1754,7 +1755,7 @@ void Timeline::setup_ui() {
|
||||
connect(snappingButton, SIGNAL(toggled(bool)), this, SLOT(snapping_clicked(bool)));
|
||||
tool_buttons_layout->addWidget(snappingButton);
|
||||
|
||||
zoomInButton = new QPushButton(tool_button_widget);
|
||||
zoomInButton = new QPushButton();
|
||||
QIcon icon10;
|
||||
icon10.addFile(QStringLiteral(":/icons/zoomin.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon10.addFile(QStringLiteral(":/icons/zoomin-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
@@ -1763,7 +1764,7 @@ void Timeline::setup_ui() {
|
||||
connect(zoomInButton, SIGNAL(clicked(bool)), this, SLOT(zoom_in()));
|
||||
tool_buttons_layout->addWidget(zoomInButton);
|
||||
|
||||
zoomOutButton = new QPushButton(tool_button_widget);
|
||||
zoomOutButton = new QPushButton();
|
||||
QIcon icon11;
|
||||
icon11.addFile(QStringLiteral(":/icons/zoomout.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon11.addFile(QStringLiteral(":/icons/zoomout-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
@@ -1772,17 +1773,16 @@ void Timeline::setup_ui() {
|
||||
connect(zoomOutButton, SIGNAL(clicked(bool)), this, SLOT(zoom_out()));
|
||||
tool_buttons_layout->addWidget(zoomOutButton);
|
||||
|
||||
recordButton = new QPushButton(tool_button_widget);
|
||||
recordButton = new QPushButton();
|
||||
QIcon icon12;
|
||||
icon12.addFile(QStringLiteral(":/icons/record.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon12.addFile(QStringLiteral(":/icons/record-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
recordButton->setIcon(icon12);
|
||||
recordButton->setToolTip(tr("Record audio"));
|
||||
connect(recordButton, SIGNAL(clicked(bool)), this, SLOT(record_btn_click()));
|
||||
|
||||
tool_buttons_layout->addWidget(recordButton);
|
||||
|
||||
addButton = new QPushButton(tool_button_widget);
|
||||
addButton = new QPushButton();
|
||||
QIcon icon13;
|
||||
icon13.addFile(QStringLiteral(":/icons/add-button.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
icon13.addFile(QStringLiteral(":/icons/add-button-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
@@ -1793,54 +1793,58 @@ void Timeline::setup_ui() {
|
||||
|
||||
horizontalLayout->addWidget(tool_button_widget);
|
||||
|
||||
timeline_area = new QWidget(dockWidgetContents);
|
||||
QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||
sizePolicy2.setHorizontalStretch(1);
|
||||
sizePolicy2.setVerticalStretch(0);
|
||||
sizePolicy2.setHeightForWidth(timeline_area->sizePolicy().hasHeightForWidth());
|
||||
timeline_area->setSizePolicy(sizePolicy2);
|
||||
timeline_area = new QWidget();
|
||||
QSizePolicy timeline_area_policy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||
timeline_area_policy.setHorizontalStretch(1);
|
||||
timeline_area_policy.setVerticalStretch(0);
|
||||
timeline_area_policy.setHeightForWidth(timeline_area->sizePolicy().hasHeightForWidth());
|
||||
timeline_area->setSizePolicy(timeline_area_policy);
|
||||
|
||||
QVBoxLayout* timeline_area_layout = new QVBoxLayout(timeline_area);
|
||||
timeline_area_layout->setSpacing(0);
|
||||
timeline_area_layout->setContentsMargins(0, 0, 0, 0);
|
||||
headers = new TimelineHeader(timeline_area);
|
||||
|
||||
headers = new TimelineHeader();
|
||||
timeline_area_layout->addWidget(headers);
|
||||
|
||||
editAreas = new QWidget(timeline_area);
|
||||
editAreas = new QWidget();
|
||||
QHBoxLayout* editAreaLayout = new QHBoxLayout(editAreas);
|
||||
editAreaLayout->setSpacing(0);
|
||||
editAreaLayout->setContentsMargins(0, 0, 0, 0);
|
||||
QSplitter* splitter = new QSplitter(editAreas);
|
||||
|
||||
QSplitter* splitter = new QSplitter();
|
||||
splitter->setChildrenCollapsible(false);
|
||||
splitter->setOrientation(Qt::Vertical);
|
||||
QWidget* videoContainer = new QWidget(splitter);
|
||||
|
||||
QWidget* videoContainer = new QWidget();
|
||||
|
||||
QHBoxLayout* videoContainerLayout = new QHBoxLayout(videoContainer);
|
||||
videoContainerLayout->setSpacing(0);
|
||||
videoContainerLayout->setContentsMargins(0, 0, 0, 0);
|
||||
video_area = new TimelineWidget(videoContainer);
|
||||
video_area->setFocusPolicy(Qt::ClickFocus);
|
||||
|
||||
video_area = new TimelineWidget();
|
||||
video_area->setFocusPolicy(Qt::ClickFocus);
|
||||
videoContainerLayout->addWidget(video_area);
|
||||
|
||||
videoScrollbar = new QScrollBar(videoContainer);
|
||||
videoScrollbar = new QScrollBar();
|
||||
videoScrollbar->setMaximum(0);
|
||||
videoScrollbar->setSingleStep(20);
|
||||
videoScrollbar->setOrientation(Qt::Vertical);
|
||||
|
||||
videoContainerLayout->addWidget(videoScrollbar);
|
||||
|
||||
splitter->addWidget(videoContainer);
|
||||
|
||||
QWidget* audioContainer = new QWidget(splitter);
|
||||
QWidget* audioContainer = new QWidget();
|
||||
QHBoxLayout* audioContainerLayout = new QHBoxLayout(audioContainer);
|
||||
audioContainerLayout->setSpacing(0);
|
||||
audioContainerLayout->setContentsMargins(0, 0, 0, 0);
|
||||
audio_area = new TimelineWidget(audioContainer);
|
||||
|
||||
audio_area = new TimelineWidget();
|
||||
audio_area->setFocusPolicy(Qt::ClickFocus);
|
||||
|
||||
audioContainerLayout->addWidget(audio_area);
|
||||
|
||||
audioScrollbar = new QScrollBar(audioContainer);
|
||||
audioScrollbar = new QScrollBar();
|
||||
audioScrollbar->setMaximum(0);
|
||||
audioScrollbar->setOrientation(Qt::Vertical);
|
||||
|
||||
@@ -1852,7 +1856,7 @@ void Timeline::setup_ui() {
|
||||
|
||||
timeline_area_layout->addWidget(editAreas);
|
||||
|
||||
horizontalScrollBar = new ResizableScrollBar(timeline_area);
|
||||
horizontalScrollBar = new ResizableScrollBar();
|
||||
horizontalScrollBar->setMaximum(0);
|
||||
horizontalScrollBar->setSingleStep(20);
|
||||
horizontalScrollBar->setOrientation(Qt::Horizontal);
|
||||
@@ -1861,7 +1865,7 @@ void Timeline::setup_ui() {
|
||||
|
||||
horizontalLayout->addWidget(timeline_area);
|
||||
|
||||
audio_monitor = new AudioMonitor(dockWidgetContents);
|
||||
audio_monitor = new AudioMonitor();
|
||||
audio_monitor->setMinimumSize(QSize(50, 0));
|
||||
|
||||
horizontalLayout->addWidget(audio_monitor);
|
||||
|
||||
+2
-1
@@ -481,6 +481,7 @@ int Viewer::get_playback_speed() {
|
||||
void Viewer::resizeEvent(QResizeEvent *) {
|
||||
if (seq != nullptr) {
|
||||
set_sb_max();
|
||||
viewer_widget->update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,7 +587,7 @@ long Viewer::get_seq_out() {
|
||||
}
|
||||
|
||||
void Viewer::setup_ui() {
|
||||
QWidget* contents = new QWidget();
|
||||
QWidget* contents = new QWidget(this);
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout(contents);
|
||||
layout->setSpacing(0);
|
||||
|
||||
Reference in New Issue
Block a user