Skip to content

Commit

Permalink
remove qt5 dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Bramas committed Sep 25, 2015
1 parent fc1889c commit 48130c2
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 12 deletions.
8 changes: 3 additions & 5 deletions .travis.yml
Expand Up @@ -4,11 +4,9 @@ compiler:
- clang

before_install:
- sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa
- sudo apt-get update -qq
- sudo apt-get install -qq qtbase5-dev qt5-qmake qtbase5-dev-tools libpoppler-qt5-dev zlib1g-dev libqt5xml5 libqt5network5 libqt5sql5 libqt5script5
script:
- sudo apt-get update
- sudo apt-get install libqt4-dev qt4-qmake libpoppler-qt4-dev zlib1g-dev
script:
- cd source
- qmake -qt=qt5 texiteasy.pro
- qmake texiteasy.pro
- make -j 4
2 changes: 1 addition & 1 deletion source/texiteasy.pro
Expand Up @@ -17,7 +17,7 @@ VERSION = \\\"'0.21.3'\\\"
VERSION_HEX = 0x002103

CONFIG += c++11
#QMAKE_CXXFLAGS += -std=c++0x
QMAKE_CXXFLAGS += -std=c++0x


#DEFINES += PORTABLE_EXECUTABLE
Expand Down
26 changes: 20 additions & 6 deletions source/widgetstatusbar.cpp
Expand Up @@ -214,6 +214,11 @@ void WidgetStatusBar::checkStructAction()
}
}






void WidgetStatusBar::updateButtons()
{
if(!FileManager::Instance.currentWidgetFile())
Expand All @@ -238,24 +243,33 @@ void WidgetStatusBar::updateButtons()

OutputPaneToggleButton *button = new OutputPaneToggleButton(index, pane->statusbarText(),
pane->action());
/*QPushButton * button = new QPushButton(//QString("<div style='margin:0px;'><a class='link' style='text-decoration:none; color:")+
//ConfigManager::Instance.colorToString(ConfigManager::Instance.getTextCharFormats("normal").foreground().color())+
"' href='#'>"+
pane->statusbarText()//+"</a></div>"
);
*/

if(widget->isPaneOpen(pane))
{
button->setChecked(true);
}

pane->action()->disconnect();
this->insertPermanentWidget(index, button, 0);
_paneLabels << button;

#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
Qt4PaneCallback * c = new Qt4PaneCallback();
c->pane = pane;
c->widget = widget;
c->button = button;

connect(button, SIGNAL(clicked(bool)), c, SLOT(onButtonClicked(bool)));
connect(pane->action(), SIGNAL(toggled(bool)), c, SLOT(onPaneactionToggled(bool)));
connect(pane->action(), SIGNAL(triggered(bool)), c, SLOT(onPaneactionToggled(bool)));

#else
connect(button, &OutputPaneToggleButton::clicked, [=](){
widget->togglePane(pane);
});
connect(pane->action(), &QAction::toggled, [=](){ button->setChecked(pane->action()->isChecked()); });
connect(pane->action(), &QAction::triggered, [=](bool checked){ button->setChecked(checked); });
#endif
++index;
}

Expand Down
27 changes: 27 additions & 0 deletions source/widgetstatusbar.h
Expand Up @@ -7,13 +7,20 @@
#include <QTimeLine>
#include <QDebug>

#include "widgetfile.h"

namespace Ui {
class WidgetStatusBar;
}
class QToolButton;
class QSplitter;
class QPixmap;
class QAction;
class IPane;





class WidgetStatusBarButton : public QWidget
{
Expand Down Expand Up @@ -169,4 +176,24 @@ private slots:
bool _errorTableOpen, _consoleOpen;
};




#if QT_VERSION < QT_VERSION_CHECK(5,0,0)

class Qt4PaneCallback : public QObject
{
Q_OBJECT

public:
OutputPaneToggleButton *button;
IPane * pane;
WidgetFile * widget;

public slots:
void onButtonClicked(bool) { widget->togglePane(pane); }
void onPaneactionToggled(bool checked) { button->setChecked(checked); }
};
#endif

#endif // WIDGETSTATUSBAR_H

0 comments on commit 48130c2

Please sign in to comment.