Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. How to set the depth of QWidget???
Forum Updated to NodeBB v4.3 + New Features

How to set the depth of QWidget???

Scheduled Pinned Locked Moved Language Bindings
2 Posts 2 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    supersuraccoon
    wrote on last edited by
    #1

    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 :)

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goblincoding
      wrote on last edited by
      #2

      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 :)

      http://www.goblincoding.com

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved