Your ROOT_URL in app.ini is http://git.osmesh.ru/ but you are visiting http://91.221.70.94:3000/KOMETA/qtSimpleGraph/commit/7a4ec0e365ed44a1c63c4e3c34cef17605b284d6
You should set ROOT_URL correctly, otherwise the web may not work correctly.
3 changed files with
31 additions and
2 deletions
main.cpp
qtsgraph.cpp
qtsgraph.h
@ -30,7 +30,14 @@ void QTSGraph::PaintBox()
SetTextStyle ( 0 , 45 , 10 ) ;
OutTextXY ( 30 , 30 , " Hello world! " ) ;
SetTextStyle ( 1 , 0 , 20 ) ;
OutTextXY ( 210 , 50 , " Hello world! " ) ;
OutTextXY ( 170 , 50 , " Кликните мышкой... " ) ;
int m = ReadMouseButton ( ) ;
SetColor ( clRed ) ;
SetTextStyle ( 1 , 0 , 20 ) ;
if ( m = = 1 ) OutTextXY ( 150 , 80 , " Нажата левая кнопка " ) ;
else if ( m = = 2 ) OutTextXY ( 150 , 80 , " Нажата правая кнопка " ) ;
else if ( m = = 3 ) OutTextXY ( 150 , 80 , " Нажата средняя кнопка " ) ;
else OutTextXY ( 150 , 80 , " Нажата неизвестная кнопка " ) ;
SetTextStyle ( 2 , 180 , 30 ) ;
OutTextXY ( 460 , 550 , " Hello world! " ) ;
SetColor ( 0x999999 ) ;
@ -103,6 +103,7 @@ void QTSGraph::Circle(int x, int y, int radius)
bool QTSGraph : : MouseClicked ( )
{
QCoreApplication : : processEvents ( QEventLoop : : AllEvents , 50 ) ;
bool m = EventMouseClicked ;
EventMouseClicked = false ;
return m ;
@ -149,6 +150,18 @@ int QTSGraph::ReadKey()
return t ;
}
int QTSGraph : : ReadMouseButton ( )
{
if ( IDMouseButton = = - 1 )
{
while ( ! MouseClicked ( ) & & this - > isVisible ( ) )
Delay ( 1 ) ;
}
int t = IDMouseButton ;
IDMouseButton = - 1 ;
return t ;
}
void QTSGraph : : Rectangle ( int x1 , int y1 , int x2 , int y2 )
{
QPainter painter ( & Canvas ) ;
@ -233,10 +246,17 @@ void QTSGraph::mousePressEvent(QMouseEvent *event)
if ( event - > buttons ( ) & Qt : : LeftButton )
{
// Левая кнопка
IDMouseButton = 1 ;
}
else if ( event - > buttons ( ) & Qt : : RightButton )
{
// Правая кнопка
IDMouseButton = 2 ;
}
else if ( event - > buttons ( ) & Qt : : MiddleButton )
{
// Средняя кнопка
IDMouseButton = 3 ;
}
ResetTimer - > start ( ResetInterval ) ;
}
@ -79,9 +79,10 @@ public:
void OutTextXY ( int x , int y , std : : string caption ) ;
void PutPixel ( int x , int y , QRgb c = 0x00000000 , int PenWidth = 1 ) ;
int ReadKey ( ) ;
int ReadMouseButton ( ) ;
void Rectangle ( int x1 , int y1 , int x2 , int y2 ) ;
void SetColor ( QRgb c ) ;
void SetFillStyle ( int Pattern , QRgb Color ) ; // Стиль и цы ет заливки
void SetFillStyle ( int Pattern , QRgb Color ) ; // Стиль и цв ет заливки
/*
0 - NoBrush
1 - SolidPattern
@ -127,6 +128,7 @@ private:
bool EventMouseClicked = false ;
bool EventKeyPressed = false ;
int IDPressedKey = - 1 ;
int IDMouseButton = - 1 ;
int ResetInterval ;
int TextDirection = 0 ;