carsonip / Penguin-Subtitle-Player

An open-source, cross-platform standalone subtitle player
GNU General Public License v3.0
304 stars 38 forks source link

Include missing header QStyle #55

Closed qianyueyou closed 6 years ago

qianyueyou commented 6 years ago

To fix build error.

carsonip commented 6 years ago

Sorry I'm quite busy these days, hopefully I can pull up the build tools and try your PR during the weekends.

carsonip commented 6 years ago

I just looked into the code. I actually used QStyle without including it in the first place. Not sure how it compiled successfully in the past (on my machine and Travis CI). Your edit should be ok, but I'm curious about what build error you got. Do you have the logs?

qianyueyou commented 6 years ago

Hey I was building on Linux, and it was a simple unknown identifier error. Searching online reveals that it might have to do with their internal header dependency cleanup in qt5.

src/mainwindow.cpp: In constructor ‘MainWindow::MainWindow(QWidget*)’:                                         
src/mainwindow.cpp:104:21: error: incomplete type ‘QStyle’ used in nested name specifier                       
             QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, this->size(),                               
                     ^~~~~~~~~~~
src/mainwindow.cpp: In member function ‘virtual void MainWindow::paintEvent(QPaintEvent*)’:                    
src/mainwindow.cpp:258:42: warning: unused parameter ‘event’ [-Wunused-parameter]                              
 void MainWindow::paintEvent(QPaintEvent *event) {
                             ~~~~~~~~~~~~~^~~~~
src/mainwindow.cpp: In member function ‘virtual void MainWindow::mouseReleaseEvent(QMouseEvent*)’:             
src/mainwindow.cpp:293:49: warning: unused parameter ‘event’ [-Wunused-parameter]                              
 void MainWindow::mouseReleaseEvent(QMouseEvent *event) {                                                      
                                    ~~~~~~~~~~~~~^~~~~
src/mainwindow.cpp: In member function ‘virtual void MainWindow::enterEvent(QEvent*)’:                         
src/mainwindow.cpp:302:37: warning: unused parameter ‘event’ [-Wunused-parameter]                              
 void MainWindow::enterEvent(QEvent *event) {
                             ~~~~~~~~^~~~~
src/mainwindow.cpp: In member function ‘virtual void MainWindow::leaveEvent(QEvent*)’:                         
src/mainwindow.cpp:308:37: warning: unused parameter ‘event’ [-Wunused-parameter]                              
 void MainWindow::leaveEvent(QEvent *event) {
                             ~~~~~~~~^~~~~
src/mainwindow.cpp: In member function ‘virtual void MainWindow::resizeEvent(QResizeEvent*)’:                  
src/mainwindow.cpp:313:44: warning: unused parameter ‘event’ [-Wunused-parameter]                              
 void MainWindow::resizeEvent(QResizeEvent *event) {
                              ~~~~~~~~~~~~~~^~~~~
carsonip commented 6 years ago

Makes sense. Thanks for the PR!