Search Results

Search found 2964 results on 119 pages for 'qt stylesheet'.

Page 16/119 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Linking win32 dll in Qt

    - by kambamsu
    Hi, I want to reference a win32 dll from my Qt application. I've added the dll location in the .pro file at "LIBS+=" . Once that is done, by right, i should be able to include the .h file inside the dll from my application. But i'm unable to do so. I'm testing with the dll here: http://www.flipcode.com/archives/Creating_And_Using_DLLs.shtml Any help would be appreciated! Thanks

    Read the article

  • Qt/C++ or C#, which learn first??

    - by myax
    I already know C++ console programming. So shall i learn Qt for c++ or c# first?? I eventually plan to learn both anyways. Also, how long will each one take. The only programming language i know is c++.

    Read the article

  • Qt script get text property

    - by user350668
    Hi all, I'm trying to access the text of a QLabel using Qt script. Here is what I have: var mystring; var mylabel = objectFromPath("...someWindow::Label"); mystring = mylabel.text; // then do something with mystring This doesn't work and I don't know what I'm doing wrong. Any help would be appreciated. thanks

    Read the article

  • [Qt] Check octal number

    - by sterh
    Hello, I write simple application in C++/Qt. And i have a text and some octal number in it. My app splits this text by spaces. And i need to check octal numbers from text. How can i select octal numbers from this text with regular expressions? Thank you.

    Read the article

  • Verfiying the network connection using Qt 4.4

    - by user249490
    Hi, I have an application which runs a tool that requires network connection. Now my aim is to check whether the user has a network connection, if he don't have one, i can straight away display an error without proceeding further. If he has, he can continue working with my application. So my basic need is to check whether the user has a network connection or not. How i can achieve through Qt 4.4? I am using Windows XP.

    Read the article

  • one timer per thread using Qt

    - by Pourya
    Hi, I modified Qt's broadcast sender example so that it has ten threads and in each thread it starts a timer, but only timer of the first thread is triggered. How can I have one timer running for each thread?

    Read the article

  • [Qt/C++] Need help in optimizing a drawing code ...

    - by Ahmad
    Hello all ... I needed some help in trying to optimize this code portion ... Basically here's the thing .. I'm making this 'calligraphy pen' which gives the calligraphy effect by simply drawing a lot of adjacent slanted lines ... The problem is this: When I update the draw region using update() after every single draw of a slanted line, the output is correct, in the sense that updates are done in a timely manner, so that everything 'drawn' using the pen is immediately 'seen' the drawing.. however, because a lot (100s of them) of updates are done, the program slows down a little when run on the N900 ... When I try to do a little optimization by running update after drawing all the slanted lines (so that all lines are updated onto the drawing board through a single update() ), the output is ... odd .... That is, immediately after drawing the lines, they lines seem broken (they have vacant patches where the drawing should have happened as well) ... however, if I trigger a redrawing of the form window (say, by changing the size of the form), the broken patches are immediately fixed !! When I run this program on my N900, it gets the initial broken output and stays like that, since I don't know how to enforce a redraw in this case ... Here is the first 'optimized' code and output (partially correct/incorrect) void Canvas::drawLineTo(const QPoint &endPoint) { QPainter painter(&image); painter.setPen(QPen(Qt::black,1,Qt::SolidLine,Qt::RoundCap,Qt::RoundJoin)); int fx=0,fy=0,k=0; qPoints.clear(); connectingPointsCalculator2(qPoints,lastPoint.x(),lastPoint.y(),endPoint.x(),endPoint.y()); int i=0; int x,y; for(i=0;i<qPoints.size();i++) { x=qPoints.at(i).x(); y=qPoints.at(i).y(); painter.setPen(Qt::black); painter.drawLine(x-5,y-5,x+5,y+5); **// Drawing slanted lines** } **//Updating only once after many draws:** update (QRect(QPoint(lastPoint.x()-5,lastPoint.y()-5), QPoint(endPoint.x()+5,endPoint.y()+5)).normalized()); modified = true; lastPoint = endPoint; } Image right after scribbling on screen: http://img823.imageshack.us/img823/8755/59943912.png After re-adjusting the window size, all the broken links above are fixed like they should be .. Here is the second un-optimized code (its output is correct right after drawing, just like in the second picture above): void Canvas::drawLineTo(const QPoint &endPoint) { QPainter painter(&image); painter.setPen(QPen(Qt::black,1,Qt::SolidLine,Qt::RoundCap,Qt::RoundJoin)); int fx=0,fy=0,k=0; qPoints.clear(); connectingPointsCalculator2(qPoints,lastPoint.x(),lastPoint.y(),endPoint.x(),endPoint.y()); int i=0; int x,y; for(i=0;i<qPoints.size();i++) { x=qPoints.at(i).x(); y=qPoints.at(i).y(); painter.setPen(Qt::black); painter.drawLine(x-5,y-5,x+5,y+5); **// Drawing slanted lines** **//Updating repeatedly during the for loop:** update(QRect(QPoint(x-5,y-5), QPoint(x+5,y+5)).normalized());//.adjusted(-rad,-rad,rad,rad)); } modified = true; int rad = (myPenWidth / 2) + 2; lastPoint = endPoint; } Can anyone see what the issue might be ?

    Read the article

  • Qt - reloading widget contents

    - by bullettime
    I'm trying to modify the fridge magnets example by adding a button that will reload the widget where the draggable labels are drawn, reflecting any changes made to the text file it reads. I defined another class that would contain the button and the DragWidget object, so there would be an instance of this class instead of DragWidget in main(): class wrapWidget: public QWidget { public: wrapWidget(); }; wrapWidget::wrapWidget() { QGridLayout *gridlayout = new QGridLayout(); DragWidget *w = new DragWidget(); QPushButton *b = new QPushButton("refresh"); gridlayout ->addWidget(w,0,0); gridlayout ->addWidget(b,1,0); setLayout(gridlayout ); connect(b,SIGNAL(clicked()),w,SLOT(draw())); } The call to connect is where I'm trying to do the refresh thing. In the original fridge magnets example, all the label drawing code was inside the constructor of the DragWidget class. I moved that code to a public method that I named 'draw()', and called this method from the constructor instead. Here's DragWidget definition and implementation: #include <QWidget> QT_BEGIN_NAMESPACE class QDragEnterEvent; class QDropEvent; QT_END_NAMESPACE class DragWidget : public QWidget { public: DragWidget(QWidget *parent = 0); public slots: void draw(); protected: void dragEnterEvent(QDragEnterEvent *event); void dragMoveEvent(QDragMoveEvent *event); void dropEvent(QDropEvent *event); void mousePressEvent(QMouseEvent *event); void paintEvent(QPaintEvent *event); }; DragWidget::DragWidget(QWidget *parent) : QWidget(parent) { draw(); QPalette newPalette = palette(); newPalette.setColor(QPalette::Window, Qt::white); setPalette(newPalette); setMinimumSize(400, 100);//qMax(200, y)); setWindowTitle(tr("Fridge Magnets")); setAcceptDrops(true); } void DragWidget::draw(){ QFile dictionaryFile(":/dictionary/words.txt"); dictionaryFile.open(QFile::ReadOnly); QTextStream inputStream(&dictionaryFile); int x = 5; int y = 5; while (!inputStream.atEnd()) { QString word; inputStream >> word; if (!word.isEmpty()) { DragLabel *wordLabel = new DragLabel(word, this); wordLabel->move(x, y); wordLabel->show(); wordLabel->setAttribute(Qt::WA_DeleteOnClose); x += wordLabel->width() + 2; if (x >= 245) { x = 5; y += wordLabel->height() + 2; } } } } I thought that maybe calling draw() as a slot would be enough to reload the labels, but it didn't work. Putting the draw() call inside the widget's overriden paintEvent() instead of the constructor didn't work out as well, the program would end up in an infinite loop. What I did was obviously not the right way of doing it, so what should I be doing instead?

    Read the article

  • Qt QAbstractButton setDown interferes with grabMouse

    - by edA-qa mort-ora-y
    I have some weird behaviour in Qt that seems like a defect. I'd like to know if anybody has a good workaround. I have a popup widget that contains many buttons in it. The user activates the popup by pressing the mouse button down. The popup widget calls grabMouse when shown. It gets all the mouse events. As it rolls over a button it calls setDown(true) on the button. Now however, when the mouse button is released the popup widget does not get the mouseReleaseEvent, that goes to the button. That is, calling setDown(true) on a button causes the button to steal mouse events, bypassing the grabMouse in the popup widget. I've looked at the source code for setDown but I can't see anything there that would do it directly. I also notice however that sometimes a button gets a hover event, sometimes not. I would assume it would never get those events when the mouse is grabbed. //g++ -o grab_lost grab_lost.cpp -lQtCore -lQtGui -I /usr/include/qt4/ -I /usr/include/qt4/QtCore -I /usr/include/qt4/QtGui /** Demonstrates the defect of losing the mouse. Run the program and: 1. Press mouse anywhere 2. release in purple block (not on X) 3. Release message written (GrabLost receives the mouseReleaseEvent) For defect: 1. Pree mouse anywhere 2. Release inside the X button 3. button is clicked, no release message (GrabLost does not get the mouseReleaseEvent) */ #include <QWidget> #include <QPushButton> #include <QApplication> #include <QMouseEvent> #include <QPainter> class GrabLost : public QWidget { QPushButton * btn; public: GrabLost( QWidget * parent = 0) : QWidget( parent, Qt::Popup ) { btn = new QPushButton( "X", this ); setMouseTracking( true ); } protected: void showEvent( QShowEvent * ev ) { QWidget::showEvent( ev ); grabMouse(); } void closeEvent( QCloseEvent * ev ) { releaseMouse(); QWidget::closeEvent( ev ); } void hideEvent( QHideEvent * ev ) { releaseMouse(); QWidget::hideEvent( ev ); } void mouseReleaseEvent( QMouseEvent * ev ) { qDebug( "mouseRelease" ); close(); } void mouseMoveEvent( QMouseEvent * ev ) { QWidget * w = childAt( ev->pos() ); bool ours = dynamic_cast<QPushButton*>( w ) == btn; btn->setDown( ours ); } void paintEvent( QPaintEvent * ev ) { //just to show where the widget is QPainter pt( this ); pt.setPen( QColor( 0,0,0 ) ); pt.setBrush( QColor( 128,0,128) ); pt.drawRect( 0, 0, size().width(), size().height() ); } }; class GrabMe : public QWidget { protected: void mousePressEvent( QMouseEvent * ev ) { GrabLost * gl = new GrabLost(); gl->resize( 100, 100 ); QPoint at( mapToGlobal( ev->pos() ) ); gl->move( at.x() - 50, at.y() - 50 ); gl->show(); } }; int main( int argc, char** argv ) { QApplication app( argc, argv ); GrabMe * gm = new GrabMe(); gm->move( 100, 100 ); gm->resize( 300, 300 ); gm->show(); app.exec(); return 0; }

    Read the article

  • Should I base my Embedded Linux product on Qt?

    - by Udi
    My company is developing a medical product. One of the components is a pda-like platform that will run embedded linux. We were considering Qt as the UI framework but found out that Qt is a lot more than that (we are not familiar with Qt). In general, the device needs to do the following: 1. Receive measurements over USB HID from another device (USB HID is used for convenience). 2. Process the measurements. 3. Store them in a database. 4. Interact with the user using the device's touch screen lcd. 5. Communicate (wi-fi, tcp-ip) with a central management station that collects the data and configures the device. 6. Include a web server to allow accessing the device via a browser. We intend to program in C++. My questions are: 1. Is that a good choice for such a device? 2. Assuming we choose Qt, how do we build our product? - Do we use Qt just as a GUI framework and write the application code in a separate process (passing messages between Qt and the application process)? - Do we write the entire application inside Qt, using all of the services the tool has to offer? - Another approach?

    Read the article

  • Proper use of Q_OBJECT?

    - by Jen
    If I derive my class from QObject (or a subclass), the Qt documentation says that I have to put the Q_OBJECT macro into my class declaration. It also ways I need to "run the meta-object compiler" for my class. I have no idea how to do this. Is this something I need to add to the .pro file? Do I need to edit the makefile? This seems overly complicated for a simple derived class. I'm using Qt Creator.

    Read the article

  • Why can't I set a layout for a page in a QStackedWidget in designer?

    - by cppguy
    Steps to reproduce in designer for Qt 4.8.0 I create a new dialog form in Qt Designer I add a QStackedWidget to the dialog I set the layout of the dialog to make the stacked layout size with the dialog I add a few controls to page one in the stacked widget I select the first page in the stacked widget in the right hand tree view of controls The icon next to that page (which is a QWidget) shows the page is missing a layout When I click one of the layout buttons above, it doesn't change the layout of the page QWidget, it changes the layout of the dialog even though I had explicitly selected the page. Is this a bug in designer? Am I missing something? I really don't want to add the layouts programatically as that prevents me from being able to layout the pages in designer in the same .ui file

    Read the article

  • QT's QGraphicsview clickable icon on screen

    - by goodwince
    I'm working on a project with QT and am trying to draw icons from a database. I have auxiliary information in the table that I would like to display if the user chooses to see it (i.e. the x,y of the icon and some other options from database). I am debating on would it be better to go through and just redraw all the icons with this information added, or do some sort of looping through the icons and setting some value to true to display the information. Thanks in advance.

    Read the article

  • calling Qt's QGraphicsView::setViewport with a custom QGLWidget

    - by mos
    I've derived from QGLWidget before, like so: class MyGLWidget : public QGLWidget { public: // stuff... virtual void initializeGL() { /* my custom OpenGL initialization routine */ } // more stuff... }; However, I find that if I try to initialize a QGraphicsView with my custom QGLWidget as the viewport, initializeGL doesn't get called (setting a breakpoint within the Qt library, neither does QGLWidget::initializeGL() when created plain). // initializeGL, resizeGL, paintGL not called ui.graphicsView->setViewport(new MyGLWidget(QGLFormat(QGL::DoubleBuffer))); // initializeGL, resizeGL, paintGL *still* not called ui.graphicsView->setViewport(new QGLWidget(QGLFormat(QGL::DoubleBuffer))); Where is the correct location to place the code that currently resides in MyGLWidget::initializeGL()?

    Read the article

  • Importing .dll into Qt

    - by Bad Man
    I want to bring a .dll dependency into my Qt project. So I added this to my .pro file: win32 { LIBS += C:\lib\dependency.lib LIBS += C:\lib\dependency.dll } And then (I don't know if this is the right syntax or not) #include <windows.h> Q_DECL_IMPORT int WINAPI DoSomething(); btw the .dll looks something like this: #include <windows.h> BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { return TRUE; } extern "C" { int WINAPI DoSomething() { return -1; } }; Getting error: unresolved symbol? Note: I'm not experienced with .dll's outside of .NET's ez pz assembly architechture, definitely a n00b.

    Read the article

  • click feature in Qt

    - by Solitaire
    Hi, I just want to clarify, weather the feature is present or not in Qt. The scenario is like this, I have a list view with items, I want to place the icon to the listview when the item is selected. The selection I mean is, first time when I click item should be selected, next time if I click the same item then it should be selected. Please note It is not the double click. So is there any feature which handles this feature by default, any property or flag which I need to set to listview to behave like this or manual implementation Is required for this.

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >