forked from qt-creator/qt-creator
Gerrit: Move QueryValidatingLineEdit to cpp
Change-Id: Ia0564ffb9354b31df77cb9877937c87f1247a4a6 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
1203ef5b2f
commit
98dbe9adca
@@ -33,6 +33,7 @@
|
|||||||
#include "gerritparameters.h"
|
#include "gerritparameters.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/fancylineedit.h>
|
||||||
#include <utils/itemviews.h>
|
#include <utils/itemviews.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
@@ -58,6 +59,24 @@ namespace Internal {
|
|||||||
static const int layoutSpacing = 5;
|
static const int layoutSpacing = 5;
|
||||||
static const int maxTitleWidth = 350;
|
static const int maxTitleWidth = 350;
|
||||||
|
|
||||||
|
class QueryValidatingLineEdit : public Utils::FancyLineEdit
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit QueryValidatingLineEdit(QWidget *parent = 0);
|
||||||
|
void setTextColor(const QColor &c);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void setValid();
|
||||||
|
void setInvalid();
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_valid;
|
||||||
|
const QColor m_okTextColor;
|
||||||
|
const QColor m_errorTextColor;
|
||||||
|
};
|
||||||
|
|
||||||
QueryValidatingLineEdit::QueryValidatingLineEdit(QWidget *parent)
|
QueryValidatingLineEdit::QueryValidatingLineEdit(QWidget *parent)
|
||||||
: Utils::FancyLineEdit(parent)
|
: Utils::FancyLineEdit(parent)
|
||||||
, m_valid(true)
|
, m_valid(true)
|
||||||
@@ -319,3 +338,5 @@ void GerritDialog::fetchFinished()
|
|||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Gerrit
|
} // namespace Gerrit
|
||||||
|
|
||||||
|
#include "gerritdialog.moc"
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
#ifndef GERRIT_INTERNAL_GERRITDIALOG_H
|
#ifndef GERRIT_INTERNAL_GERRITDIALOG_H
|
||||||
#define GERRIT_INTERNAL_GERRITDIALOG_H
|
#define GERRIT_INTERNAL_GERRITDIALOG_H
|
||||||
|
|
||||||
#include <utils/fancylineedit.h>
|
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
@@ -49,31 +48,17 @@ class QDialogButtonBox;
|
|||||||
class QTextBrowser;
|
class QTextBrowser;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Utils { class TreeView; }
|
namespace Utils {
|
||||||
|
class FancyLineEdit;
|
||||||
|
class TreeView;
|
||||||
|
}
|
||||||
|
|
||||||
namespace Gerrit {
|
namespace Gerrit {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class GerritParameters;
|
class GerritParameters;
|
||||||
class GerritModel;
|
class GerritModel;
|
||||||
class GerritChange;
|
class GerritChange;
|
||||||
|
class QueryValidatingLineEdit;
|
||||||
class QueryValidatingLineEdit : public Utils::FancyLineEdit
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit QueryValidatingLineEdit(QWidget *parent = 0);
|
|
||||||
void setTextColor(const QColor &c);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void setValid();
|
|
||||||
void setInvalid();
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_valid;
|
|
||||||
const QColor m_okTextColor;
|
|
||||||
const QColor m_errorTextColor;
|
|
||||||
};
|
|
||||||
|
|
||||||
class GerritDialog : public QDialog
|
class GerritDialog : public QDialog
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user