Qt: revert paintEvent changes, only keep one for ShaderParamsDialog

This commit is contained in:
Brad Parker 2018-08-19 19:27:06 -04:00
parent 8380ad61f9
commit 3ad54bc9ca
6 changed files with 13 additions and 117 deletions

View File

@ -91,6 +91,19 @@ void ShaderParamsDialog::closeEvent(QCloseEvent *event)
emit closed();
}
void ShaderParamsDialog::paintEvent(QPaintEvent *event)
{
QStyleOption o;
QPainter p;
o.initFrom(this);
p.begin(this);
style()->drawPrimitive(
QStyle::PE_Widget, &o, &p, this);
p.end();
QDialog::paintEvent(event);
}
QString ShaderParamsDialog::getFilterLabel(unsigned filter)
{
QString filterString;
@ -1153,16 +1166,3 @@ void ShaderParamsDialog::onShaderParamDoubleSpinBoxValueChanged(double value)
}
}
}
void ShaderParamsDialog::paintEvent(QPaintEvent *event)
{
QStyleOption o;
QPainter p;
o.initFrom(this);
p.begin(this);
style()->drawPrimitive(
QStyle::PE_Widget, &o, &p, this);
p.end();
QDialog::paintEvent(event);
}

View File

@ -5,7 +5,6 @@
class QCloseEvent;
class QResizeEvent;
class QPaintEvent;
class QVBoxLayout;
class QFormLayout;
class QLayout;

View File

@ -191,19 +191,6 @@ void TreeView::selectionChanged(const QItemSelection &selected, const QItemSelec
emit itemsSelected(list);
}
void TreeView::paintEvent(QPaintEvent *event)
{
QStyleOption o;
QPainter p;
o.initFrom(this);
p.begin(this);
style()->drawPrimitive(
QStyle::PE_Widget, &o, &p, this);
p.end();
QTreeView::paintEvent(event);
}
TableWidget::TableWidget(QWidget *parent) :
QTableWidget(parent)
{
@ -225,38 +212,12 @@ void TableWidget::keyPressEvent(QKeyEvent *event)
QTableWidget::keyPressEvent(event);
}
void TableWidget::paintEvent(QPaintEvent *event)
{
QStyleOption o;
QPainter p;
o.initFrom(this);
p.begin(this);
style()->drawPrimitive(
QStyle::PE_Widget, &o, &p, this);
p.end();
QTableWidget::paintEvent(event);
}
CoreInfoLabel::CoreInfoLabel(QString text, QWidget *parent) :
QLabel(text, parent)
{
setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
}
void CoreInfoLabel::paintEvent(QPaintEvent *event)
{
QStyleOption o;
QPainter p;
o.initFrom(this);
p.begin(this);
style()->drawPrimitive(
QStyle::PE_Widget, &o, &p, this);
p.end();
QLabel::paintEvent(event);
}
CoreInfoWidget::CoreInfoWidget(CoreInfoLabel *label, QWidget *parent) :
QWidget(parent)
,m_label(label)
@ -277,19 +238,6 @@ void CoreInfoWidget::resizeEvent(QResizeEvent *event)
m_scrollArea->resize(event->size());
}
void CoreInfoWidget::paintEvent(QPaintEvent *event)
{
QStyleOption o;
QPainter p;
o.initFrom(this);
p.begin(this);
style()->drawPrimitive(
QStyle::PE_Widget, &o, &p, this);
p.end();
QWidget::paintEvent(event);
}
LogTextEdit::LogTextEdit(QWidget *parent) :
QPlainTextEdit(parent)
{
@ -305,19 +253,6 @@ void LogTextEdit::appendMessage(const QString& text)
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
}
void LogTextEdit::paintEvent(QPaintEvent *event)
{
QStyleOption o;
QPainter p;
o.initFrom(this);
p.begin(this);
style()->drawPrimitive(
QStyle::PE_Widget, &o, &p, this);
p.end();
QPlainTextEdit::paintEvent(event);
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
,m_loadCoreWindow(new LoadCoreWindow(this))
@ -3012,19 +2947,6 @@ void MainWindow::onShowInfoMessage(QString msg)
showMessageBox(msg, MainWindow::MSGBOX_TYPE_INFO, Qt::ApplicationModal, false);
}
void MainWindow::paintEvent(QPaintEvent *event)
{
QStyleOption o;
QPainter p;
o.initFrom(this);
p.begin(this);
style()->drawPrimitive(
QStyle::PE_Widget, &o, &p, this);
p.end();
QMainWindow::paintEvent(event);
}
static void* ui_window_qt_init(void)
{
ui_window.qtWindow = new MainWindow();

View File

@ -10,7 +10,6 @@
#include <QFileDialog>
#include <QApplication>
#include <QColorDialog>
#include <QPainter>
#include "viewoptionsdialog.h"
#include "../ui_qt.h"
@ -217,15 +216,3 @@ void ViewOptionsDialog::hideDialog()
reject();
}
void ViewOptionsDialog::paintEvent(QPaintEvent *event)
{
QStyleOption o;
QPainter p;
o.initFrom(this);
p.begin(this);
style()->drawPrimitive(
QStyle::PE_Widget, &o, &p, this);
p.end();
QDialog::paintEvent(event);
}

View File

@ -44,8 +44,6 @@ private:
QCheckBox *m_suggestLoadedCoreFirstCheckBox;
QSpinBox *m_allPlaylistsListMaxCountSpinBox;
QSpinBox *m_allPlaylistsGridMaxCountSpinBox;
protected:
void paintEvent(QPaintEvent *event);
};
#endif

View File

@ -153,8 +153,6 @@ signals:
protected slots:
void columnCountChanged(int oldCount, int newCount);
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
protected:
void paintEvent(QPaintEvent *event);
};
class TableWidget : public QTableWidget
@ -167,8 +165,6 @@ signals:
void deletePressed();
protected:
void keyPressEvent(QKeyEvent *event);
protected:
void paintEvent(QPaintEvent *event);
};
class AppHandler : public QObject
@ -190,8 +186,6 @@ class CoreInfoLabel : public QLabel
Q_OBJECT
public:
CoreInfoLabel(QString text = QString(), QWidget *parent = 0);
protected:
void paintEvent(QPaintEvent *event);
};
class CoreInfoWidget : public QWidget
@ -202,7 +196,6 @@ public:
QSize sizeHint() const;
protected:
void resizeEvent(QResizeEvent *event);
void paintEvent(QPaintEvent *event);
private:
CoreInfoLabel *m_label;
QScrollArea *m_scrollArea;
@ -215,8 +208,6 @@ public:
LogTextEdit(QWidget *parent = 0);
public slots:
void appendMessage(const QString& text);
protected:
void paintEvent(QPaintEvent *event);
};
class MainWindow : public QMainWindow
@ -459,7 +450,6 @@ private:
protected:
void closeEvent(QCloseEvent *event);
void keyPressEvent(QKeyEvent *event);
void paintEvent(QPaintEvent *event);
};
Q_DECLARE_METATYPE(ThumbnailWidget)