Search Results

Search found 1902 results on 77 pages for 'qt contextmenu'.

Page 44/77 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • QTableWidget signal cellChanged(): distinguish between user input and change by routines

    - by crabman
    i am using PyQt but my question is a general Qt one: I have a QTableWidget that is set up by the function updateTable. It writes the data from DATASET to the table when it is called. Unfortunately this causes my QTableWidget to emit the signal cellChanged() for every cell. The signal cellChanged() is connected to a function on_tableWidget_cellChanged that reads the contents of the changed cell and writes it back to DATASET. This is necessary to allow the user to change the data manually. So everytime the table is updated, its contents are written back to DATASET. Is there a way to distinguish if the cell was changed by the user or by updateTable? i thought of disconnecting on_tableWidget_cellChanged by updateTable temporarily but that seems to be a little dirty.

    Read the article

  • Load NSImage into QPixmap or QImage

    - by Thomi
    I have an NSImage pointer from a platform SDK, and I need to load it into Qt's QImage class. To make things easier, I can create a QImage from a CGImageRef by using QPixmap as an intermediate format, like this: CGImageRef myImage = // ... get a CGImageRef somehow. QImage img = QPixmap::fromMacCGImageRef(myImage).toImage(); However, I cannot find a way to convert from an NSImage to a CGImageRef. Several other people have had the same problem, but I have yet to find a solution. There is the CGImageForProposedRect method, but I can't seem to get it to work. I'm currently trying this (img is my NSImage ptr): CGImageRef ir = [img CGImageFirProposedRect:0:0:0]; Any ideas?

    Read the article

  • QPainter::drawText bounding boxes for each character

    - by satuon
    I'm using QPainter to draw multiline text on QImage. However, I also need to display a colored rectangle around each character's bounding box. So I need to know the bounding box that each character had when being drawn. For example, for painter.drawText(QRect(100, 100, 200, 200), Qt::TextWordWrap, "line\nline2", &r); I would need to get 10 rectangles, taking into account newlines, word-wrap, tabs, etc. For example, the rectangle of the second 'l' would be below the rectangle of the first 'l', instead of being to the right of 'e', because of the newline.

    Read the article

  • QGraphicsView and eventFilter

    - by erelender
    Hello everyone, This has been bugging me for more than two days now, so i thought i should ask. I am using Qt 4.5.3 (compiled with VC2008) on Win7. I have MyGraphicsView (inherits QGraphicsView) and MyFilter (inherits QObject) classes. When i install the MyFilter object as an event filter to MyGraphicsView, Mouse events are delivered to MyFilter after they are delivered to MyGraphicsView whereas Key events are delivered to MyFilter before they are delivered to MyGraphicsView. In the second case, i install the MyFilter object as an event filter to MyGraphicsView-viewport() (which is a standart QGLWidget), Mouse events are delivered to MyFilter before they are delivered to MyGraphicsView, whereas Key events are delivered to only MyGraphicsView. The events are supposed to be delivered to event filters before they are delivered to the actual object, so why is this happening? What should i do to ensure this order? Thanks in advance. Best Regards.

    Read the article

  • GDB doesnt like my typedef

    - by yan bellavance
    It seems that the following is to deep for the debugger in Qt even though the program uses it without problem typedef QMap <int, QStringList> day2FileNameType; typedef QMap <int, day2FileNameType> month2day2FileNameType; typedef QMap <int, month2day2FileNameType> year2month2day2FileNameType; year2month2day2FileNameType y2m2d2f; now the first 2 typeDefs work okay with the debugger but the third one retrieving data for watch view (over 100 pending request) Is it wrong for me to try and use such a typedef as year2month2day2FileNameType?

    Read the article

  • LIbrary issue: How do I set up QtWebKit to parse HTML?

    - by user560106
    Nick Presta showed that you can parse HTML with qt here: Library Recommendation: C++ HTML Parser However, when I attempt to build this, I get an access violation on the "QWebFrame* frame = page.mainFrame();" line. What am I doing wrong? #include <QtWebKit\QWebElement> #include <QtWebKit\QWebView> #include <QtWebKit\QWebFrame> #include <QtWebKit\QWebPage> #include <iostream> int main() { QWebPage page; QWebFrame* frame = page.mainFrame(); frame->setHtml( "<html><head></head><body></body></html>" ); QWebElement document = frame->documentElement(); return 0; }

    Read the article

  • selected Rows/Line in QTableView copy to QClipboard

    - by Berschi
    Hi. First of all, sorry for bad English. It's about C++ and Qt. I have a SQLite-Database and I did it into a QSqlTableModel. To show the Database, I put that Model into a QTableView. Now I want to create a Method where the selected Rows (or the whole Line) will be copied into the QClipboard. After that I want to insert it into my OpenOffice.Calc-Document. But I have no Idea what to do with the "Selected"-SIGNAL and the QModelIndex and how to put this into the Clipboard. So can you please help me? Berschi

    Read the article

  • QObject cloning

    - by Olorin
    I know that Qobjects are supposed to be identities not values eg you cannot copy them and by default the copy constructor and asignment are disabled as explained in qt documentation. But is it possible to create a new Qobject from an existing one using a clone method? Would this be a logic error ? If i say QObject b; QObject a; b.cloneFrom(a); or QObject a = new QBject(); QObject b = new QBject(); b->cloneFrom(a); and the clone method copyes stuff like members etc would this be wrong? And if this is ok can i write my own copy constructor and asignment operator that does just that? Note: i actually want to try this with classes that inherit qobject.

    Read the article

  • mingw spitting countless warnings about ignoring "dll import" attribute

    - by hasen j
    I'm using mingw32-make to compile a qt project that uses opengl, it compiles correctly and everything, but it spits countless warning messages of the form: c:/qt3/include/qcolor.h:67: warning: inline function `int qGray(int, int, int)' declared as dllimport: attribute ignored For this particular instance, the function declaration is: Q_EXPORT inline int qGray( int r, int g, int b )// convert R,G,B to gray 0..255 { return (r*11+g*16+b*5)/32; } My question is, why is it spitting all these warning? how can I silence them without silencing other legitimate warnings (i.e. warnings that are related directly to my code and could be potential problems)? More importantly, why is mingw ignoring the dll import attribute in the first place?

    Read the article

  • Signals and slots in PyQt

    - by Skilldrick
    In the past I've had some experience of Qt in C++. I've now started using PyQt, and finding it a bit bewildering. There doesn't seem to be any definitive source of documentation, apart from a small amount at Riverbank. I guess the first thing I'd like to know is that there's an initial hump with PyQt, and it does get easier. The Riverbank docs talk about new style signals and slots for PyQt, as well as old style. They suggest that the new style is better, but I was wondering if that is what most users of PyQt do.

    Read the article

  • on some Windows machines, skinned applications sometimes loses their skin. any ideas?

    - by Lior
    Hi we are developing a skinned application, and under vista/windows 7, on some machines, skinned applications sometimes loses their skin. here's an example for the problem, and here's how the application looks when it's good. this happens to us whether we develop with native Win32 API or in QT. It happens spontanously, with no event that might explain it. btw, we see it happens sometimes to some other applications, too we solve it by repainting everything every 2-3 seconds. but this is an ugly hack... any ideas why this could happen? thanks _very_much_ for any lead - Lior

    Read the article

  • QWidget keyPressEvent override

    - by eaigner
    Hi there, I'm trying for half an eternity now overriding QWidgets keyPressEvent function in QT but it just won't work. I've to say i am new to CPP, but I know ObjC and standard C. My problem looks like this: class QSGameBoard : public QWidget { Q_OBJECT public: QSGameBoard(QWidget *p, int w, int h, QGraphicsScene *s); signals: void keyCaught(QKeyEvent *e); protected: virtual void keyPressEvent(QKeyEvent *event); }; QSGameBoard is my QWidget subclass and i need to override the keyPressEvent and fire a SIGNAL on each event to notify some registered objects. My overridden keyPressEvent in QSGameBoard.cpp looks like this: void QSGameBoard::keyPressEvent(QKeyEvent *event) { printf("\nkey event in board: %i", event->key()); //emit keyCaught(event); } When i change QSGameBoard:: to QWidget:: it receives the events, but i cant emit the signal because the compiler complains about the scope. And if i write it like this the function doesn't get called at all. What's the problem here?

    Read the article

  • QPainter paints garbage

    - by DSblizzard
    Fragment of program code: def add_link(Item0Num, Item1Num): global Mw, View # Mw - MainWindow if Item0Num != Item1Num and not link_exists(Item0Num, Item1Num): append( links_to(Item1Num), Item0Num ) append( links_from(Item0Num), Item1Num ) LinkGi = TLinkGi() Mw.Scene.addItem(LinkGi) LinkGi.setZValue(200) LinkGi.scale(1 / View.Scale, 1 / View.Scale) LinkGi.Item0Num = Item0Num LinkGi.Item1Num = Item1Num class TLinkGi(QGraphicsItem): def paint(self, Painter, StyleOptionGraphicsItem, Widget): global Mw, View Pen = QPen(Qt.black, 1) Painter.setPen(Pen) X0, Y0 = task_center(self.Item0Num) self.setPos(X0, Y0) X1, Y1 = task_center(self.Item1Num) X, Y = int( (X1 - X0) * View.Scale ), int( (Y1 - Y0) * View.Scale ) Painter.drawLine(0, 0, X, Y) #Mw.Scene.update(0, 0, Plan.Size, Plan.Size) # (1) #Mw.gvMain.repaint() # (2) def boundingRect(self): global View Rect = QRectF(0, 0, Plan.Size, Plan.Size) return Rect This paints such garbage: http://img697.imageshack.us/content_round.php?page=done&l=img697/5395/qpaintergarbage1.jpg When lines (1) and (2) are uncommented things doesn't become much better: http://img63.imageshack.us/content_round.php?page=done&l=img63/9693/qpaintergarbage0.jpg Please help me to solve this problem.

    Read the article

  • Touch screens for kiosk applications

    - by Micah
    I'm developing a kiosk-style touchscreen application in Qt. Currently I'm using an Elo Touch surface acoustic wave touchmonitor which works well except for one thing: drag performance is way too poor to provide a good user experience. As this is the case for the cursor in X as well as in my application, it seems to be either the fault of X (probably not) or the touchmonitor. Since mobile platforms are able to achieve very high performance in this regard, it seems like it should be possible for vastly more powerful desktop systems. Does anybody have experience with getting good drag performance out of desktop touchmonitors? What hardware have you used? Is X to blame?

    Read the article

  • How to draw QGraphicsItem in a MFC view

    - by user336969
    I'm starting using Qt in my application. My application is MFC based. I want to draw some QGraphicsItems in my currect MFC view, is it possible? You may say that it could be done by hosting QGraphicsView with QWinWidget in the MFC view, that don't work, however. Because my Canvas (MFC view) supports zooming and rotating while the QGraphicsView itself don't. When I zooming the QGraphicsItem, the QGraphicsView shows scroll bar instead of enlarging itself. Any suggestion? Thanks!

    Read the article

  • ChaiScript troubles

    - by Ockonal
    Hello guys, I'm using script language ChaiScript with c++ and Qt. I've defined such function: void ChaiPainter::drawRectangle(QPainter *painter, int x, int y, int height, int width) { painter.drawRect(x, y, width, height); } And in application paint-event: void MainWindow::paintEvent(QPaintEvent *event) { QPainter painter(this); chaiPainter->mChai.add(chaiscript::var(&painter), "painter"); chaiPainter->mChai.add(chaiscript::fun(&ChaiPainter::drawRectangle), "drawRect"); chaiPainter->mChai("drawRect(painter, 5, 5, 100, 100)"); } The error is: 'chaiscript::Eval_Error' what(): Error: "No matching function to dispatch to with function 'drawRect'" during evaluation at (1, 1) What I do wrong?

    Read the article

  • Problem with signals and slots

    - by Jen
    I am creating a class with custom slots in Qt: class CustomEdit : public QTextEdit { Q_OBJECT public: CustomEdit(QWidget* parent); public slots: void onTextChanged (); }; However, I'm getting thise linker error: undefined reference to 'vtable for CustomEdit' The documentation says: if you get compiler errors along the lines of "undefined reference to vtable for LcdNumber", you have probably forgotten to run the moc or to include the moc output in the link command. ... but it is not obvious what that means. Is there something I need to add to my class, or to the .pro file?

    Read the article

  • How can I update fontconfig to a newer version in Red Hat 5.3?

    - by yan bellavance
    I want to update fontconfig to a newer version but it seems that the OS is still finding the old fontconfig and I need the newer version to build qt. How do I make Red Hat 5.3 see the newer version? I do not know if this helps but when I did a search for fontconfig I found some files in a folder called cache. When I do yum update it tells me everything is up to date but that version is too old and is missing FcFreeTypeQueryFace. Just send me a comment if this is wrong site and ill change it.

    Read the article

  • How to make a 3D UI for an application ?

    - by wacky_coder
    I'm building an application and I'd like its User Interface to be 3D, most probably a cylinder. The user would see the cylinder[Horizontally laid] and the cylinder's curved surface would have the buttons and any other controls that need to be placed. The cylinder needs to rotate and later, I'd like to add some other effects to the cylinder too. Someone told me that such a UI can be modelled using Maya or Blender and exported to openGL and then I could use C/C++ (with Qt) to carry out the actions. How can this be done?? Is there any other way to build the UI and do all the other things that I need ?? I really need some help because I have the UI in mind, but no idea on how to implement it. Thanks

    Read the article

  • How can I set the line style of a specific cell in a QTableView?

    - by Bob Nelson
    I am working with a QT GUI. I am implementing a simple hex edit control using a QTableView. My initial idea is to use a table with seventeen columns. Each row of the table will have 16 hex bytes and then an ASCII representation of that data in the seventeenth column. Ideally, I would like to edit/set the style of the seventeenth column to have no lines on the top and bottom of each cell to give the text a free flowing appearance. What is the best way to approach this using the QTableView?

    Read the article

  • macdeployqt and third party libraries

    - by user338170
    I've got an application project that depends on a couple of shared libraries that I have created myself. According to the Qt 4.6 documentation "Deploying an Application on Mac OSX": Note: If you want a 3rd party library to be included in your application bundle, then you must add an excplicit lib entry for that library to your application's .pro file. Otherwise, the macdeployqt tool will not copy the 3rd party .dylib into the bundle. I have added lib entries to my application's .pro file but the libraries that I have written do not get copied into the bundle when I execute macdeployqt. I have the following in my .pro file: LIBS += -L../Libraries -lMyLib Everything builds okay, its just when I try to run from the bundle that I run into problems i.e. "image not found" errors. Is there a bug in macdeployqt or do I have to something more to my .pro file?

    Read the article

  • How to get QWebKit to display image?

    - by George Edison
    Okay, I have a Qt executable in the same directory as a file logo.png. I call the following: QString msg("<html><body><img src='logo.png' /></body></html>"); webView->setHtml(msg); where webview is the QWebKit pointer However, when I execute the program, the image does not display. I am executing the program from the directory that the image is in... why won't it display?

    Read the article

  • Program crashes in debugger before anything happens

    - by Tim
    I'm building an application for Windows XP using the MinGW tool chain and it sometimes crashes unexpectedly. So, I'm trying to use a debugger (Gdb) but the program exits with code 03 before anything happens. In fact, all I see from GDB is: [New thread 3184.0x7b8][New thread 3184.0xef8] Program exited with code 03. My suspicion is that there is some failed dynamic linking of a dependency (which are Qt, VTK, and ITK, all built with MinGW). However, this does not happen when I just run the program normally. Or if it happens, it appears to be intermittent and well after the program is launched and running. NOTE: I'm also using Cmake for cross compiling. What should I do? What can I try?

    Read the article

  • QML 5.3 iOS compilation of pure QML app

    - by Nathaniel Johnson
    I have an application written in QML. Initially, I used the standard C++ bootstrap for the app. int main(int argc, char *argv[]) { QApplication app(argc, argv); // A bunch of components and data models written in C++ QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); return app.exec(); } The bulk of the app is in QML and the more I work with QML, the happier I am with it and the more I feel comfortable converting the C++ pieces to QML. So, it comes to one risk that I wanted to ask about. If I convert the app to a pure QML application like the kind generated by the Qt Quick UI application wizard with no C++ and designed to be run with qmlscene will I be able to compile it for iOS when the time to port it comes or will I end up just converting it back to the C++ loader form? TL;DR Can pure QML (no C++) apps be compiled and run on iOS devices?

    Read the article

  • QScrollArea widget content promoted to QWidget

    - by ocell
    Hi folks, First of all, thanks for you time reading my question. I created my own Qt Widget (parent of QWidget) and has a QImage "inside" to manipulate images. The problem I have is the following: when I promote the content of a QScrollArea to my widget, the scroll features doesn't works; I haven't any scroll bar or I can't see any result when I use the method 'ensureVisible(..)'. Please can you tell me if I need to overload or override any method in my own widget. Regards and thanks in advance, Oscar.

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >