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. How to set a QWidget inside of a QDockWidget as the central widget in that QDockWidget?

How to set a QWidget inside of a QDockWidget as the central widget in that QDockWidget?

Scheduled Pinned Locked Moved General and Desktop
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.
  • M Offline
    M Offline
    MathSquare
    wrote on last edited by
    #1

    how to set a QWidget inside of a QDockWidget as the central widget in that QDockWidget?

    @
    QWidget* ui->qwidget = qwidgetdock->centralWidget();
    @

    qwidget is the Qwidget that i want as the centralWidget as qwidgetdock.
    qwidgetdock is the Qwidgetdock that I want as it centralWidget.
    But doesn't.
    Please Help Me ;).

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      For starters this looks just plain wrong:
      @QWidget* ui->qwidget = @
      What is that suppose to mean? You can't declare members outside of a class declaration in C++.

      I'm not sure if I understand you correctly but if you just want to insert a widget into the dock, there's "QDockWidget::setWidget()":http://qt-project.org/doc/qt-5.0/qtwidgets/qdockwidget.html#setWidget method.

      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