diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-12-09 11:40:54 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-12-09 11:40:54 -0500 |
| commit | e1d6f6380dc4f7719f369b48e327085b0e0f511b (patch) | |
| tree | bed1e67e0e3b15835f6293a3195bf3acfbe761f7 /src/mainwindow.cpp | |
| parent | 8cf3c4a3678233c37a89be38cebdaf5b8e864cb2 (diff) | |
use paintEvent() to allow interactive resize because showEvent() is too early
bumped to rc2
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f58473e9..eaecfca1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -207,6 +207,7 @@ MainWindow::MainWindow(Settings &settings : QMainWindow(parent) , ui(new Ui::MainWindow) , m_WasVisible(false) + , m_FirstPaint(true) , m_linksSeparator(nullptr) , m_Tutorial(this, "MainWindow") , m_OldProfileIndex(-1) @@ -687,15 +688,12 @@ void MainWindow::allowListResize() for (int i = 0; i < ui->modList->header()->count(); ++i) { ui->modList->header()->setSectionResizeMode(i, QHeaderView::Interactive); } - //ui->modList->header()->setSectionResizeMode(ui->modList->header()->count() - 1, QHeaderView::Stretch); ui->modList->header()->setStretchLastSection(true); - // allow resize on plugin list for (int i = 0; i < ui->espList->header()->count(); ++i) { ui->espList->header()->setSectionResizeMode(i, QHeaderView::Interactive); } - //ui->espList->header()->setSectionResizeMode(ui->espList->header()->count() - 1, QHeaderView::Stretch); ui->espList->header()->setStretchLastSection(true); } @@ -1286,14 +1284,22 @@ void MainWindow::showEvent(QShowEvent *event) m_OrganizerCore.settings().widgets().restoreIndex(ui->groupCombo); - allowListResize(); - m_OrganizerCore.settings().nexus().registerAsNXMHandler(false); m_WasVisible = true; updateProblemsButton(); } } +void MainWindow::paintEvent(QPaintEvent* event) +{ + if (m_FirstPaint) { + allowListResize(); + m_FirstPaint = false; + } + + QMainWindow::paintEvent(event); +} + void MainWindow::onBeforeClose() { storeSettings(); |
