Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2422

QSplitter: cannot be resized to less than the combined minimum sizes of all child widgets

    XMLWordPrintable

Details

    Description

      A QSplitter cannot be resized to less than the combined minimum sizes of all child widgets regardless of whether or not they are collapsed.

      This is most evident when the collapsed widget is a large one. The widget containing the splitter cannot be resized smaller which may be required.

      Test case main.cpp to reproduce
      ===============================
      #include <QtGui>

      class FixedSizeWidget : public QWidget
      {
      Q_OBJECT
      public:
      FixedSizeWidget(QWidget *parent = 0)
      : QWidget(parent)

      { QVBoxLayout *layout = new QVBoxLayout(this); layout->addWidget(new QLineEdit); layout->addWidget(new QPushButton); layout->addWidget(new QTextEdit); }

      protected:
      void showEvent(QShowEvent *event)

      { setFixedSize(500, 500); QWidget::showEvent(event); }

      ;
      };

      class MainWindow : public QMainWindow
      {
      Q_OBJECT
      public:
      MainWindow(QWidget *parent = 0)
      : QMainWindow(parent)

      { QWidget *w = new QWidget(this); setCentralWidget(w); QVBoxLayout *layout = new QVBoxLayout(w); QSplitter *splitter = new QSplitter(this); splitter->setOrientation(Qt::Vertical); splitter->addWidget(new QTextEdit("QTextEdit 1")); splitter->addWidget(new FixedSizeWidget); splitter->addWidget(new QTextEdit("QTextEdit 2")); layout->addWidget(splitter); }

      };

      #include "main.moc"

      int main(int argc, char **argv)
      {
      QApplication a(argc, argv);
      MainWindow mw;
      mw.show();
      return a.exec();
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            smd Jan Arve
            gpf Shane McLaughlin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes