How to set the depth of QWidget???



  • I am new to qt and now I'm using PyQt as a starting point.

    I created a ui file with Qt-designer and then converted it into py file that I can use in the project like this:

    @
    self.ui = Ui_MainWindow()
    self.ui.setupUi(self)
    @

    Now the problem is: in the ui file I created a button the size is as same big as the main window and then in my project I sub-classed a DragDropListWidget from QWidget to process drag-drop event and then I add all the ui-stuffs like this:

    @
    QWidget.init(self, parent)
    self.ui = Ui_MainWindow()
    self.ui.setupUi(self)
    self.view = DragDropListWidget(self)
    self.setCentralWidget(self.view)
    @

    Then when the app started up I can drag-drop files on to the window put the button in the ui is covered by the view content (the DragDropListWidget) I tried to change the depth and set visible of the DragDropListWidget but both won;t work...

    BTW, I am really do not understand this ui and view stuff very well :(

    Any reply will be appreciated, thanks in advance :)



  • Hi there

    I may be misunderstanding your question, but you mention that your button is the same size as the window? That makes me wonder if you haven't perhaps forgotten to set layouts on your widget:

    "Layout Management":http://developer.qt.nokia.com/doc/qt-4.7/layout.html

    It could be beneficial to you if you posted some code here as it will help to understand your question :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.