mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
GCC build fix GetTextExtent inline needed to be defined in header
This commit is contained in:
parent
ff4a29cb26
commit
c56ae98139
@ -1430,26 +1430,6 @@ int gGraph::minHeight()
|
||||
return minheight;
|
||||
}
|
||||
|
||||
inline void GetTextExtent(QString text, int &width, int &height, QFont *font)
|
||||
{
|
||||
#ifdef ENABLE_THREADED_DRAWING
|
||||
static QMutex mut;
|
||||
mut.lock();
|
||||
#endif
|
||||
QFontMetrics fm(*font);
|
||||
//#ifdef Q_OS_WIN32
|
||||
QRect r = fm.boundingRect(text);
|
||||
width = r.width();
|
||||
height = r.height();
|
||||
//#else
|
||||
// width=fm.width(text);
|
||||
// height=fm.xHeight()+2; // doesn't work properly on windows..
|
||||
//#endif
|
||||
#ifdef ENABLE_THREADED_DRAWING
|
||||
mut.unlock();
|
||||
#endif
|
||||
}
|
||||
|
||||
int GetXHeight(QFont *font)
|
||||
{
|
||||
QFontMetrics fm(*font);
|
||||
|
@ -34,6 +34,14 @@ void DestroyGraphGlobals();
|
||||
|
||||
const int mouse_movement_threshold = 6;
|
||||
|
||||
inline void GetTextExtent(QString text, int &width, int &height, QFont *font)
|
||||
{
|
||||
QFontMetrics fm(*font);
|
||||
QRect r = fm.boundingRect(text);
|
||||
width = r.width();
|
||||
height = r.height();
|
||||
}
|
||||
|
||||
/*! \class gGraph
|
||||
\brief Single Graph object, containing multiple layers and Layer layout code
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user