data: Option to run only C/C++ preprocessor when indexing (issue 297)

* Added as checkbox to indexing start dialog
* Only shown for C/C++ projects
* Files will be marked incomplete
This commit is contained in:
Eberhard Graether
2017-04-18 22:11:20 +02:00
parent 2b24b88745
commit 63087913bd
31 changed files with 373 additions and 231 deletions
+23 -2
View File
@@ -1,9 +1,12 @@
#include "qt/element/QtIconButton.h"
#include "qt/utility/utilityQt.h"
QtIconButton::QtIconButton(QString iconPath, QString hoveredIconPath, QWidget* parent)
: QPushButton("", parent)
, m_iconPath(iconPath)
, m_hoveredIconPath(hoveredIconPath)
, m_color(Qt::transparent)
{
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
@@ -14,11 +17,17 @@ QtIconButton::QtIconButton(QString iconPath, QString hoveredIconPath, QWidget* p
leaveEvent(nullptr);
}
void QtIconButton::setColor(QColor color)
{
m_color = color;
leaveEvent(nullptr);
}
void QtIconButton::enterEvent(QEvent *event)
{
if (m_hoveredIconPath.size())
{
setIcon(QIcon(QPixmap(m_hoveredIconPath)));
setIconFromPath(m_hoveredIconPath);
}
}
@@ -26,6 +35,18 @@ void QtIconButton::leaveEvent(QEvent *event)
{
if (m_iconPath.size())
{
setIcon(QIcon(QPixmap(m_iconPath)));
setIconFromPath(m_iconPath);
}
}
void QtIconButton::setIconFromPath(QString path)
{
QPixmap pixmap = QPixmap(path);
if (m_color != Qt::transparent)
{
pixmap = utility::colorizePixmap(pixmap, m_color);
}
setIcon(QIcon(pixmap));
}