Qt India

RSS Feed
A group for the Indian Qt Developer community. To learn, discuss and showcase Qt apps, ask questions, troubleshoot and help each other. All other members are also welcome to join.
Founder: Deleted Member # 4a2
Members: 675
Category: Regional
Join group

This is an overview of the latest updated topics, visit the full forum here.

2
replies

How to use Hunspell in Qt.

by: Vikas A | Views: 167 | Forum: India | Last post by Vikas A, December 16, 2014

I am working on Windows 7 (Qt with MinGW ), i want to user Hunspell in my project.
It is very complicated to use it in windows environment.

Please some one can provide a like to any document (not Hunspell standard documents) or any other help.
Thanks,

10
replies

how to take input date from user in qdateedit and show database accordingly

by: vikchh00@gmail.com | Views: 695 | Forum: India | Last post by p3c0, December 6, 2014

how to take input any date from user in qdateedit or calenderwidget and show database accordingly by clicking button now my code is showing databse of only current date(todays date) i want user to selct date and show data of that particular date

  1. void MainWindow::on_pushButton_2_clicked()
  2. {
  3.     QCalendarWidget *calendar=new QCalendarWidget;
  4.     QDateEdit *dateedit=new QDateEdit;
  5.  
  6.  
  7.     QDate d=calendar->selectedDate();
  8.     ui->dateEdit->setDate(d);
  9.  
  10.  
  11.     int  q= d.year();
  12.     QString q1=QString::number(q);
  13.     int q2=d.month();
  14.     QString q3=QString::number(q2);
  15.     int q4=d.day();
  16.     QString q5=QString::number(q4);
  17.  
  18.     QSqlQueryModel *mode =new QSqlQueryModel(ui->print);
  19.     mode->setQuery(QString("select * from health10  where month(Datestamp)=\""+q3+"\" and day(Datestamp)=\""+q5+"\" and year(datestamp)=\""+q1+"\" ;"));
  20.     ui->print->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
  21.     ui->print->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
  22.     ui->print-> setModel (mode);

[edit: added missing coding tags @ SGaist]

0
replies

problem about QHistoryState

by: tcsjzdnlh | Views: 144 | Forum: India

  1.  QHistoryState *s1h = new QHistoryState(s1);
  2.  
  3.     QState *s3 = new QState();
  4.     s3->assignProperty(label, "text", "In s3");
  5.     QMessageBox *mbox = new QMessageBox(mainWindow);
  6.     mbox->addButton(QMessageBox::Ok);
  7.     mbox->setText("Interrupted!");
  8.     mbox->setIcon(QMessageBox::Information);
  9.     QObject::connect(s3, SIGNAL(entered()), mbox, SLOT(exec()));
  10.     s3->addTransition(s1h);
  11.     machine.addState(s3);
  12.  
  13.     s1->addTransition(interruptButton, SIGNAL(clicked()), s3);

//——————

this snippet from Qt document about QHistoryState

i wonder to know one of statements : s3->addTransition(s1h);

how the s3 state transition to s1h (QHistoryState) without signal or event,
it should be some thing like that: s3->addTransition( button, SIGNAL, s1h) );

1
replies

Serial comunicacion using Qt and Visual Studio

by: Falcon2050 | Views: 226 | Forum: India | Last post by tarod.net, November 12, 2014

Hello :
I would like to ask you very kindly about how to realize a serial communication using Qt and Visual Studio.
Here is the code I have up to now :

//mytimer.hpp

  1. #ifndef MYTIMER_HPP
  2. #define MYTIMER_HPP
  3.  
  4. #include <QtSerialPort/QtSerialPort>
  5. #include <QTimer>
  6. #include <QThread>
  7. #include <QObject>
  8.  
  9. class MyTimer : public QObject
  10. {
  11.  Q_OBJECT
  12.  
  13. public:
  14.  MyTimer(int,int);
  15.  QSerialPort serial;
  16.  QTimer timer;                        
  17.  int how_many_times;
  18.  int sampling;
  19.  
  20.  
  21. signals:              
  22.  void done();
  23.  
  24. public slots:
  25.  void MyTimerSlot();
  26. };
  27.  
  28. #endif // MYTIMER_H

//mytimer.cpp

  1. //#include <QtSerialPort/QtSerialPort>
  2. #include "mytimer.hpp"
  3. #include <QDebug>
  4.  
  5.  
  6.  
  7. MyTimer::MyTimer(int a, int b)
  8. {
  9.  how_many_times = a;
  10.  sampling = b;
  11.  
  12.     connect(&timer, SIGNAL(timeout()),
  13.   this, SLOT(MyTimerSlot()));
  14.  
  15.  timer.setInterval(sampling);
  16.  timer.start();                
  17.  
  18. }
  19.  
  20. void MyTimer::MyTimerSlot()
  21. {
  22.  
  23.  if (how_many_times == 1)
  24.  {
  25.   timer.stop();
  26.  }
  27.  
  28.  /*==========================================================================*/
  29.  
  30.  
  31.  serial.setPortName("COM1");
  32.  serial.setBaudRate(QSerialPort::Baud9600);
  33.  serial.setDataBits(QSerialPort::Data8);
  34.  serial.setParity(QSerialPort::NoParity);
  35.  serial.setStopBits(QSerialPort::OneStop);
  36.  serial.setFlowControl(QSerialPort::NoFlowControl);
  37.  serial.open(QIODevice::ReadWrite);
  38.  
  39.  serial.write("hello");
  40.  
  41.  serial.close();
  42.  
  43.  /*==========================================================================*/
  44.  
  45.  qDebug() << "hello" ;
  46.  
  47.  how_many_times -= 1;
  48.  
  49.  if (how_many_times == 0)
  50.  {
  51.   done();
  52.  }
  53.  
  54.  
  55. }

//main.cpp

  1. #include <QCoreApplication>
  2. #include "mytimer.hpp"
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.  QCoreApplication a(argc, argv);
  7.  
  8.  MyTimer timer(20,500);
  9.  
  10.  QObject::connect(&timer, SIGNAL(done()), &a, SLOT(quit()));
  11.  
  12.  return a.exec();
  13. }

Thank you in advance for your response,
Have a nice day!

[edit: added missing coding tags @ SGaist]

0
replies

installation of Qt creator on red hat linux

by: jatinjanshali | Views: 227 | Forum: India

I need a help to install qt creator <qt-creator-opensource-linux-x86_64-3.2.1.run > on red hat linux <2.6.32-71.el6.x86_64>. qt creator is successfully installed but when i start the qt creator following error is coming:
(<unknown>:9851): Gtk-WARNING **: Attempt to load unknown IM context type ‘gtk-im-context-none’
Failed to load core: /home/jatin/qtcreator-3.2/lib/qtcreator/plugins/libCore.so: Cannot load library /home/jatin/qtcreator-3.2/lib/qtcreator/plugins/libCore.so: (/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14’ not found (required by /home/jatin/qtcreator-3.2/lib/qtcreator/plugins/libCore.so))

help me

2
replies

I need help on taking a flash webvideo screenshot on Pyside or PyQt4

by: rasheedahmed27 | Views: 286 | Forum: India | Last post by rasheedahmed27, October 16, 2014

i have an issue on taking a screenshot of the youtube video page.

in Pyside i have enabled flash function using below command to play video on Pyside browser

  1.     s.setAttribute(QWebSettings.PluginsEnabled, True)
  2.     s.setAttribute(QWebSettings.JavascriptEnabled, True)

now my script can open video embedded website and playing videos but when i tried to capture screenshot it showing Black screen on video embedded place.

Script:

#!/usr/bin/env python
#-*- coding:utf-8 *

@from PySide.QtCore import Qt, QUrl, QTimer, Slot
from PySide.QtGui import QApplication, QImage, QPainter
from PySide.QtWebKit import QWebView, QWebPage, QWebSettings
from PySide.QtNetwork import QNetworkRequest, QNetworkReply
import time, sys

class Render(QWebView): def init(self, url, filename, image_crop, translate_page, parent=None): super(Render, self).init(parent) self.image_crop = image_crop self.fileName = time.strftime(”%Y%m%d%H%M%S”,time.localtime()) +”_test.jpg” self.finished = False

# Settings s = self.page().settings() s.setAttribute(QWebSettings.AutoLoadImages, True) s.setAttribute(QWebSettings.PluginsEnabled, True) s.setAttribute(QWebSettings.JavascriptEnabled, True) s.setAttribute(QWebSettings.JavaEnabled, False) s.setAttribute(QWebSettings.JavascriptCanOpenWindows, False) s.setAttribute(QWebSettings.DeveloperExtrasEnabled, True) #self.page().mainFrame().setScrollBarPolicy(Qt.Horizontal, Qt.ScrollBarAlwaysOff) self.page().mainFrame().setScrollBarPolicy(Qt.Vertical, Qt.ScrollBarAlwaysOff) self.timerScreen = QTimer() self.timerScreen.setInterval(10000) self.timerScreen.setSingleShot(True) self.timerScreen.timeout.connect(self.takeScreenshot) self.loadFinished.connect(self.timerScreen.start) self.load(QUrl(url)) @Slot(QNetworkReply) def takeScreenshot(self): [...]
2
replies

changing image by using keypress

by: sasireka | Views: 372 | Forum: India | Last post by SGaist, September 30, 2014

hi all,

Good day. I want to change the image using keypress. If i am pressing F2, in screen i have to show first image. Again pressing F2 second time in screen have to show next image. please give me some IDEA and SIMPLE EXAMPLE to do it.

Thanks & Regards
Sasi

5
replies

connecting the image slice change with the slider

by: rekhap | Views: 348 | Forum: India | Last post by rekhap, September 27, 2014

hello,
m really stuck with an issue and m new to qt..
plz help me out.
my task is to read the image of x number of slice.. display it,, set slider and spin box so that all three shud interact with each other.
sinbox- slider
slider-spinbox
slider-qvtkwidget these are connected bt when i move the mouse wheel for changing the image slice the slider has to be moved according to the mouse wheel.. m nt understanding how to connect it.

thanks inadvance

20
replies

[solved] how to set local fonts

by: sasireka | Views: 773 | Forum: India | Last post by sasireka, September 26, 2014

hi all,
how to set local fonts. I am trying with this code. this is working for english but not for “lohit tamil”.

  1.  ui->label1->setStyleSheet ("font: 40pt \"Lohit Tamil\";");
  2.             ui->label1->setText("சென்னை");
  3.             //ui->label1->setText("tamil");
  4.             ui->label1->show();
0
replies

Qt Quick app on WP8: Shaders not compiling

by: dsanjit | Views: 205 | Forum: India

Hi !
I am writing a 2D game and need to deploy on Windows Phone, iOS and Android. My prototype runs well on Android and Desktop/Mingw but no matter what I do I just cannot deploy on a Windows Phone – the shaders dont compile. I have VS2012 for Windows phone as well as VS2013 Desktop, Store and the Pro version along with all the other SDKs. I ran qmake -tp VC CONFIG= ….. and got the game to build fine on VS2012 for WP (also compiles in VS2013-Pro/WP8). I run QtD3dservice and it recognizes my Nokia Lumia on Device 0 and lists the apps in there. But when I hit run the shaders dont seem to compile.

I have no idea what I am doing wrong. Please help. I would also appreciate a paid consultant to assist me if possible, possibly located in Bangalore India. Please email me at dsanjit@yahoo.com.

This is rather urgent.

Cheers
Sanjit

This is an overview of the latest updated topics, visit the full forum here.