Removed some more Qt dependencies

This commit is contained in:
Matthias Koefferlein 2022-05-07 23:56:48 +02:00
parent 1ad9dd2c11
commit c8be882785
3 changed files with 9 additions and 39 deletions

View File

@ -357,29 +357,27 @@ LayoutCanvas::~LayoutCanvas ()
void
LayoutCanvas::key_event (unsigned int key, unsigned int buttons)
{
#if defined(HAVE_QT) // @@@
if (! (buttons & lay::ShiftButton)) {
if (int (key) == lay::KeyDown) {
emit down_arrow_key_pressed ();
down_arrow_key_pressed ();
} else if (int (key) == lay::KeyUp) {
emit up_arrow_key_pressed ();
up_arrow_key_pressed ();
} else if (int (key) == lay::KeyLeft) {
emit left_arrow_key_pressed ();
left_arrow_key_pressed ();
} else if (int (key) == lay::KeyRight) {
emit right_arrow_key_pressed ();
right_arrow_key_pressed ();
}
} else {
if (int (key) == lay::KeyDown) {
emit down_arrow_key_pressed_with_shift ();
down_arrow_key_pressed_with_shift ();
} else if (int (key) == lay::KeyUp) {
emit up_arrow_key_pressed_with_shift ();
up_arrow_key_pressed_with_shift ();
} else if (int (key) == lay::KeyLeft) {
emit left_arrow_key_pressed_with_shift ();
left_arrow_key_pressed_with_shift ();
} else if (int (key) == lay::KeyRight) {
emit right_arrow_key_pressed_with_shift ();
right_arrow_key_pressed_with_shift ();
}
}
#endif
}
void

View File

@ -163,7 +163,7 @@ LineStyleInfo::is_bit_set (unsigned int n) const
return (pattern () [(n / 32) % pattern_stride ()] & (1 << (n % 32))) != 0;
}
#if defined(HAVE_QT) // @@@
#if defined(HAVE_QT)
QBitmap
LineStyleInfo::get_bitmap (int width, int height) const
{
@ -355,9 +355,6 @@ struct ReplaceLineStyleOp
};
LineStyles::LineStyles () :
#if defined(HAVE_QT)
QObject (),
#endif
db::Object (0)
{
for (unsigned int d = 0; d < sizeof (style_strings) / sizeof (style_strings [0]); d += 2) {
@ -368,9 +365,6 @@ LineStyles::LineStyles () :
}
LineStyles::LineStyles (const LineStyles &p) :
#if defined(HAVE_QT)
QObject (),
#endif
db::Object (0)
{
m_styles = p.m_styles;
@ -424,13 +418,6 @@ LineStyles::replace_style (unsigned int i, const LineStyleInfo &p)
m_styles [i] = p;
chg = true;
}
// if something has changed emit the signal
if (chg) {
#if defined(HAVE_QT) // @@@
emit changed ();
#endif
}
}
unsigned int

View File

@ -220,15 +220,8 @@ private:
* cannot be changed.
*/
class LAYBASIC_PUBLIC LineStyles :
#if defined(HAVE_QT)
public QObject,
#endif
public db::Object
{
#if defined(HAVE_QT)
Q_OBJECT
#endif
public:
typedef std::vector<LineStyleInfo> pattern_vector;
typedef pattern_vector::const_iterator iterator;
@ -361,14 +354,6 @@ public:
*/
static const LineStyles &default_style ();
#if defined(HAVE_QT)
signals:
/**
* @brief This signal is emitted if a style is changed
*/
void changed ();
#endif
private:
std::vector<LineStyleInfo> m_styles;
};