From 498301a72093877a1181aa2ca0c2673df47af116 Mon Sep 17 00:00:00 2001 From: yonghye Date: Thu, 1 Nov 2018 10:34:18 +0900 Subject: [PATCH] Bug Fix: Table widget header not visible on Ubuntu --- mainwindow.cpp | 11 +++++++++-- mainwindow.h | 3 +++ mainwindow.ui | 16 +++++++++++----- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 8430718..65ab831 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -34,8 +34,6 @@ MainWindow::MainWindow(QWidget *parent) : connect(new QShortcut(QKeySequence(Qt::Key_D), this), SIGNAL(activated()), this, SLOT(next_img())); connect(new QShortcut(QKeySequence(Qt::Key_Space), this), SIGNAL(activated()), this, SLOT(next_img())); - ui->tableWidget_label->horizontalHeader()->setStyleSheet(""); - disconnect(ui->tableWidget_label->horizontalHeader(), SIGNAL(sectionPressed(int)),ui->tableWidget_label, SLOT(selectColumn(int))); } MainWindow::~MainWindow() @@ -290,6 +288,7 @@ void MainWindow::pjreddie_style_msgBox(QMessageBox::Icon icon, QString title, QS msgBox.setFont(font); msgBox.button(QMessageBox::Ok)->setFont(font); msgBox.button(QMessageBox::Ok)->setStyleSheet("border-style: outset; border-width: 2px; border-color: rgb(0, 255, 0); color : rgb(0, 255, 0);"); + msgBox.button(QMessageBox::Ok)->setFocusPolicy(Qt::ClickFocus); msgBox.setStyleSheet("background-color : rgb(34, 0, 85); color : rgb(0, 255, 0);"); msgBox.exec(); @@ -387,3 +386,11 @@ void MainWindow::on_horizontalSlider_images_sliderMoved(int position) void MainWindow::on_horizontalSlider_images_sliderPressed() { } + +void MainWindow::init_tableWidget() +{ + ui->tableWidget_label->horizontalHeader()->setVisible(true); + ui->tableWidget_label->horizontalHeader()->setStyleSheet(""); + + disconnect(ui->tableWidget_label->horizontalHeader(), SIGNAL(sectionPressed(int)),ui->tableWidget_label, SLOT(selectColumn(int))); +} diff --git a/mainwindow.h b/mainwindow.h index cf590fd..cd425ba 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -60,6 +60,9 @@ private: QStringList m_labelNameList; int m_labelIndex; + + void init_tableWidget(); + void init(); void img_open(const int); diff --git a/mainwindow.ui b/mainwindow.ui index 2ff7bbc..e18c764 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -433,10 +433,16 @@ border-color: rgb(0, 255, 255); - 90 + 100 21 + + + 100 + 16777215 + + 75 @@ -473,13 +479,13 @@ border-color: rgb(0, 255, 255); 41 - 12 + 15 16777215 - 12 + 15 @@ -507,7 +513,7 @@ border-color: rgb(0, 255, 255); - 640 + 545 70 @@ -660,7 +666,7 @@ QTableView { 2 - false + true false