Hi,
i wanted to create QCombobox
but my QComboBox be in the top of the mainwindowsCode:
formcharacter->show();
how i made to get it in good position for ewample in the left of widget i can resize it and move it with mouse ?
Printable View
Hi,
i wanted to create QCombobox
but my QComboBox be in the top of the mainwindowsCode:
formcharacter->show();
how i made to get it in good position for ewample in the left of widget i can resize it and move it with mouse ?
http://doc.qt.io/qt-5/layout.html
Cheers,
_
OK, i see an example , i wanted to make as it :
Code:
layout->addWidget(liste); formcharacter->setLayout(layout); formcharacter->show();
but nothing changed
Sure something changed. Your combo box is no longer just sitting on top of the formcharacter widget, it is layed out inside the widget and will resize with it.
Perhaps you can better explain what you are expecting to happen.
Hi,
Ok i will try to explain
i wanted to see my scene in the central widget, then in the left of my main window i see 3 button "annimer,arreter and reply"
i have too an tool bar when i choose "personnag" i must see widget where there is the combox
this picture
Attachment 11517
that's what i get from my code
setCentralWidget(mQOgreWidget); is to set the widget where is my scene in the central of the main window, and we can see in the picture that workCode:
MainWindow::MainWindow() { mQOgreWidget = new QOgreWidget(this); setCentralWidget(mQOgreWidget); createMenu(); }
createMenu() is the function where is my toolbar and the other widget
the code of createMenu()
But as you can see in the picture the buttons are not in the left of the window, the QComboBox is in the top of the windows!!Code:
void MainWindow::createMenu() { /**************************/ /**************************/ /**************************/ /****************Camera**********/ /**************Tag*************************/ /**************contraintes****************/ /********************************************/ mdiArea = new QMdiArea(centralwidget); mdiArea->addSubWindow(subwindow); /*********listviex***********************/ listView->setModel( model ); connect(mQOgreWidget,SIGNAL( itemAded( QStandardItem *,int )), this, SLOT( itemAded( QStandardItem *,int ) )); /**********************************************/ scrollArea->setWidgetResizable(true); scrollArea->setWidget(scrollAreaWidgetContents); dockWidget_5->setWidget(dockWidgetContents_8); addDockWidget(static_cast<Qt::DockWidgetArea>(2), dockWidget_5); setMenuBar(menuBar); setStatusBar(statusbar); menuBar->addAction(menuLoad->menuAction()); menuBar->addAction(menuAjouter->menuAction()); menuBar->addAction(menuImport->menuAction()); menuBar->addAction(menuCam_ra->menuAction()); menuBar->addAction(menuTags->menuAction()); menuLoad->addSeparator(); menuLoad->addAction(actionOuvrir); menuLoad->addAction(actionSauvegarder); menuLoad->addAction(actionSauvegarder_2); menuLoad->addAction(actionQuitter); menuAjouter->addAction(menuObjet->menuAction()); menuAjouter->addAction(actionPersonnage); menuObjet->addAction(actionCylindre); menuObjet->addAction(actionCube); menuObjet->addAction(actionSphere); menuImport->addAction(actionFichier_C3D); menuImport->addAction(actionFichier_BVH); menuCam_ra->addAction(actionAjouter); menuCam_ra->addAction(actionModifier); menuCam_ra->addAction(actionSupprimer); menuTags->addAction(actionAjouter_2); menuTags->addAction(actionModifier_2); menuTags->addAction(actionSupprimer_2); menuContraintes->addAction(actionContraintes); anim->setCheckable(true); arret->setCheckable(true); connect( arret, SIGNAL(clicked()), this, SLOT( stop())); Replay->setCheckable(true); /*************/ layout->addWidget(liste); formcharacter->setLayout(layout); formcharacter->show(); }
can somone help me to fix those problems ?
If you want the combobox to be a child of the widget you create at line 119 then you should create it with that widget as its parent (as you do for the others at 122-124).
You should consider using a layout in the widget from line 119 rather than the absolute positioning you are doing now.
what you mean?Quote:
If you want the combobox to be a child of the widget you create at line 119 then you should create it with that widget as its parent (as you do for the others at 122-124).
You should consider using a layout in the widget from line 119 rather than the absolute positioning you are doing now.
but even the widget and the lines at 122-124 are not well positionned , they must be in the left of the minwidow, not the left of the central widget