Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] A possible bug in QWidget::layout()
Forum Updated to NodeBB v4.3 + New Features

[Solved] A possible bug in QWidget::layout()

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.3k 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.
  • D Offline
    D Offline
    Davita
    wrote on last edited by
    #1

    Hi guys. I'm getting access violation exception (c0000005 in QtGuid4.dll) while I try to access widget's layout.
    http://dl.dropbox.com/u/3055964/Capture.GIF
    As you can see from image above, both tbSandboxedApps and tbHistory has vertical layout on them, but while I try to access their layout, I get the exception mentioned above.
    @QLayout* ll = ui->tbHistory->layout();@
    This code throws the exception, but from the documentation, we can read that:
    "Returns the layout manager that is installed on this widget, or 0 if no layout manager is installed."
    So in my case, ui->tbHistory->layout() should return a valid pointer to it's vertical layout, but instead, it crashes the app. Even if I break the layout, it still crashes instead of returning 0, as pointed by documentation.
    I'm using custom MSVC build of Qt 4.7.3, without any source modification.
    Any ideas what could be the problem?
    Thanks.

    UPDATE


    My bad, I was accessing layout() until I called ui->setupUi();
    :shame: :)

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

      So it's solved, I'd guess?

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Davita
        wrote on last edited by
        #3

        Yes Volker, thanks. I forgot to rename the thread. :)

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          No problem, I just wanted to be sure :)

          http://www.catb.org/~esr/faqs/smart-questions.html

          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