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. Subclassed QWidget not respecting ColumnSpan
Qt 6.11 is out! See what's new in the release blog

Subclassed QWidget not respecting ColumnSpan

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 371 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.
  • R Offline
    R Offline
    RickF
    wrote on last edited by
    #1

    Hello,
    I have a Custom Widget (subclass of QWidget) that holds a GroupBox, a slider and an QSpinBox. I have a grid layout in my dock widget's main widget.

    If I add a button to the to the main layout l->addWidget(w,0,0,1,5) the button seems correctly stretched (columnspan of 5)

    If I add my custom widget, it always is taking up approx 2 columns -

    l->addWidget(1,0,1,5) // does not expand to 5 columns
    l_addWidget(1,0,1,2) // same size as above

    So my widget is not obeying the column span.

    I must be not setting a sizeHint() ?? Or a window flag?

    Not sure what the problem is. Any tips welcome?

    Thanks

    Rick

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you show your complete code ?

      What version of Qt are you using ?
      On what platform ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

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