Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
2299fc12
Commit
2299fc12
authored
Jul 03, 2018
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed QT double event issue
parent
ef00f675
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
4 deletions
+32
-4
xtt/lib/cow/qt/cow_qt_helpers.cpp
xtt/lib/cow/qt/cow_qt_helpers.cpp
+8
-1
xtt/lib/cow/qt/cow_qt_helpers.h
xtt/lib/cow/qt/cow_qt_helpers.h
+4
-1
xtt/lib/flow/qt/flow_scroll_widget_qt.cqt
xtt/lib/flow/qt/flow_scroll_widget_qt.cqt
+7
-1
xtt/lib/flow/qt/flow_scroll_widget_qt.h
xtt/lib/flow/qt/flow_scroll_widget_qt.h
+3
-0
xtt/lib/glow/qt/glow_scroll_widget_qt.cqt
xtt/lib/glow/qt/glow_scroll_widget_qt.cqt
+7
-1
xtt/lib/glow/qt/glow_scroll_widget_qt.h
xtt/lib/glow/qt/glow_scroll_widget_qt.h
+3
-0
No files found.
xtt/lib/cow/qt/cow_qt_helpers.cpp
View file @
2299fc12
...
...
@@ -77,9 +77,16 @@ void dbg_print(const char *file, int line, const char *fmt, ...)
}
}
void
dbg_print
(
QString
str
)
void
dbg_print
(
const
char
*
file
,
int
line
,
QString
str
)
{
if
(
DEBUG
)
{
// 1. print timestamp
print_time
(
stderr
);
// 2. print filename only, without path
const
char
*
file2
=
strrchr
(
file
,
'/'
);
file2
=
file2
?
(
file2
+
1
)
:
file
;
fprintf
(
stderr
,
" %s:%d: "
,
file2
,
line
);
// 3. print the actual debug message
QByteArray
ba
=
str
.
toLocal8Bit
();
const
char
*
c_str
=
ba
.
data
();
fprintf
(
stderr
,
"%s
\n
"
,
c_str
);
...
...
xtt/lib/cow/qt/cow_qt_helpers.h
View file @
2299fc12
...
...
@@ -50,11 +50,14 @@ void print_time(FILE *stream, int fulldate = 0);
void
dbg_print
(
const
char
*
file
,
int
line
,
const
char
*
fmt
,
...);
void
dbg_print
(
QString
str
);
void
dbg_print
(
const
char
*
file
,
int
line
,
QString
str
);
#define debug_print(fmt, args...) \
do { if (DEBUG) { dbg_print(__FILE__, __LINE__, fmt, ##args); } } while (0)
#define debug_print2(qstr) \
do { if (DEBUG) { dbg_print(__FILE__, __LINE__, qstr); } } while (0)
/*
* Qt Helper functions
*/
...
...
xtt/lib/flow/qt/flow_scroll_widget_qt.cqt
View file @
2299fc12
...
...
@@ -93,7 +93,11 @@ QWidget *QtScrollWidgetFlow::initScroll(
bool QScrollAreaFlow::event(QEvent *event)
{
QtScrollWidgetFlow *child = ((QtScrollWidgetFlow *) widget());
child->handleEvent(event);
time_t t;
time(&t);
if (event->type() != child->lastEvent->type() || difftime(t, child->t) > 0.000001) {
child->handleEvent(event);
}
return QScrollArea::event(event);
}
...
...
@@ -263,6 +267,8 @@ bool QtScrollWidgetFlow::event(QEvent *event)
is_realized = true;
}
handleEvent(event);
lastEvent = event;
time(&t);
return QWidget::event(event);
}
...
...
xtt/lib/flow/qt/flow_scroll_widget_qt.h
View file @
2299fc12
...
...
@@ -105,6 +105,9 @@ public:
QImage
image
;
QEvent
*
lastEvent
;
time_t
t
;
virtual
void
handleEvent
(
QEvent
*
event
);
protected:
...
...
xtt/lib/glow/qt/glow_scroll_widget_qt.cqt
View file @
2299fc12
...
...
@@ -93,7 +93,11 @@ QWidget *QtScrollWidgetGlow::initScroll(
bool QScrollAreaGlow::event(QEvent *event)
{
QtScrollWidgetGlow *child = ((QtScrollWidgetGlow *) widget());
child->handleEvent(event);
time_t t;
time(&t);
if (event->type() != child->lastEvent->type() || difftime(t, child->t) > 0.000001) {
child->handleEvent(event);
}
return QScrollArea::event(event);
}
...
...
@@ -263,6 +267,8 @@ bool QtScrollWidgetGlow::event(QEvent *event)
is_realized = true;
}
handleEvent(event);
lastEvent = event;
time(&t);
return QWidget::event(event);
}
...
...
xtt/lib/glow/qt/glow_scroll_widget_qt.h
View file @
2299fc12
...
...
@@ -105,6 +105,9 @@ public:
QImage
image
;
QEvent
*
lastEvent
;
time_t
t
;
virtual
void
handleEvent
(
QEvent
*
event
);
protected:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment