PDA

View Full Version : code for promote to



andreime
15th July 2009, 13:48
I was wondering if you can do the same thing as right click on an a QFrame let's say and choose promote to fpanel let's say (obviously also a QFrame type), but via code.
i am trying to change the contents of a QFrame after a button was clicked.
Any help will be greatly appreciated. Thank you

Lykurg
15th July 2009, 13:54
I was wondering if you can do the same thing as right click on an a QFrame let's say and choose promote to fpanel let's say (obviously also a QFrame type), but via code.
i am trying to change the contents of a QFrame after a button was clicked
You can't. But you could use a QStackedWidget with a QFrame on page 1 and a fpanel on page 2.

Or maybe there is a better solution if you describe more, what exactly you want to change.

andreime
15th July 2009, 15:18
So i want to do something like this:
i have a fPanel frame widget that has inside a tableWidget and some buttons + labels
and a tPanel frame widget that has inside a treeWidget and the same buttons and labels

in the mainwindow i have leftFrame and rightFrame that i promoted to fPanel.
i want to be able to change the type of anyone of the two frames to either fPanel or tPanel.

i tried several things. i even got to the point where i thought that because they are all QFrame types i can equalize them something like
m_ui->leftFrame = new tPanel
obviously it didn't work.
i want to display the contents of my drives, similar to total commander or norton commander, and to change the view type from list to tree by the push of a button.
i don't know how to do that :( . i tried but failed. i also think that there is way but it somehow eludes me. any ideas?