Adding QTableView into QFrame
-
hi.. i have made a separate source file containing QTableView and some other controls. My issue is when i am loading that widget in QFrame, internal QTableView is not adopting the size of parent container class(i.e., QFrame). Can any one help me what i might be doing wrong.?
-
Hi,
Are you properly using layouts in your custom widgets ?
-
-
@gaurav118 No, because your customTable does not have a layout...
-
You see that red 🚫 on the left of
customTable
in the top right?
That means you did not set a layout on it. Right click on the background and layout->layout horizontally -
Hi
The red layout you used is a floating one. its for inserting into
other layouts. As @VRonin says, you should apply a layout to custom table
to have red layout use all space available. -
@gaurav118
super :)
While the red layouts are very tempting. The most used way to apply layout is
to right click and choose one from layout menu. To further subdivide
the layout into ""sections", the red ones can be used. -
Instead of actually laying out customTable in MainWindow, i am trying to give it a sliding effect to populate the customTable object. Any help i can get?
-
@gaurav118
Hi
You can use
http://doc.qt.io/qt-5/animation-overview.html
for that. -
mrjj Lifetime Qt Championreplied to gaurav118 on 9 May 2018, 15:20 last edited by mrjj 5 Sept 2018, 15:21
@gaurav118
Hi
If you need inspiration, this does a slide out using the animation framework.
https://github.com/chrisaverage/burger-menu
Check out
void BurgerMenu::toggle(bool checked)
note that this sample animates while in a layout. -
@gaurav118
Super. :)
Yeah they are pretty much
seen all places nowadays.
I even have one in my new app ;)
1/15