Search Results

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

Page 18/77 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Can Qt's QWebView display programatically generated XML?

    - by Dan Ellis
    Using Qt 4.6, I can dynamically add to an HTML page like this: ui->webView->page()->mainFrame()->documentElement().findFirst("body").appendInside("<i>some text</i>\n"); However, if I QWebView::load() an XML file, it displays it with the correct CSS styling (from an processing instruction), but doesn't show any changes when I do something like: ui->webView->page()->mainFrame()->documentElement().findFirst("lines").appendInside("<line>hello</line>\n"); Why is it treating them differently, and is there a way to modify an XML document in the same way I can an HTML one?

    Read the article

  • Qt for Symbian - Detecting touch/non-touch devices...

    - by Nikos
    I'm porting a game for Symbian which supports both a touch & non-touch UI. I need to be able to tell if the device has a touch screen on start-up so I can enable the appropriate mode. After googling for hours and going though the Qt Docs I found QSysInfo but this merely provides the version of the Symbian device. Is there a way to get the actual capabilities of the device? There must be a way to tell if the device has a touch screen...! I'm using the latest QtCreator with the NokiaSDK. Thank you in advance, Nikos.

    Read the article

  • How to create a new File in Qt

    - by GG
    Hello friends, I am a Qt beginner and just got stuck with the problem. I am looking for a file SomePath/NewDirectoryA/NewFile.kml ( NewFile.kml will be the only file in NewDirectoryA, having this directory just to maintain semantics in the project ). If SomePath/NewDirectoryA/NewFile.kml exists then I will use it in my code and If it doesn't exist then I have to create it. If this File doesn't exist then this directory also doesn't exist in SomePath. So If only I have to create a file I can use QFile and open it in ReadWrite or WriteOnly mode. But the problem is I have to create the file with the directory itself. I tried with QFile with file name SomePath/NewDirectoryA/NewFile.kml but it didn't worked. Please suggest me a way in which I can create a new file( NewFile.kml ) in a new directory( NewDirectorA ) at a given location( SomePath ).

    Read the article

  • using sqlite database with qt

    - by Lakshan Perera
    here is my code, it dont seems enything wrong, QSqlDatabase db=QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName("thedata.sqlite"); db.open(); QSqlQuery quary; quary.prepare("SELECT lastname FROM people where firstname='?' "); quary.bindValue(0,lineEdit->text()); bool x=quary.exec(); if(x){ //...... } else { QSqlError err; err=quary.lastError(); QMessageBox::about(this,"error",err.text() ); } when the program is working always it gives the error parameter count mismatch im using qt 4.8 and its own headers for using sqlite. I would be very thankful for eny advice, though I searched in google i see many posts in this issue but nothing helped me. thank you.

    Read the article

  • Qt grabWindow coordinates shifted from GetCursorPos and GetWindowRect

    - by user1391
    In Qt, when I use the QPixmap::grabWindow(hwnd,x,y,h,w) function, the coordinates are shifted slightly, when compared to the coordinates using the windows api functions GetCursorPos and GetWindowRect. i.e. (0,0) from the point of view of GetCursorPos and GetWindowRect is at the very top left of the toolbar at the top of the window. But (0,0) for QPixmap::grabWindow is more "inside" (i.e. ignoring the window frame). How can I make these 2 coordinates consistent? Especially since the user might have different thicknesses for the window frame?

    Read the article

  • QT: QPainter + GDI in the same widget?

    - by shoosh
    I'm trying to use the method described here to use a QPainter and GDI calls on the same widget. Unfortunately this tutorial seem to have been written on an earlier version of QT and now it does not work. I set the WA_PaintOnScreen flag and reimplement paintEngine() to return NULL. Then on the paintEvent() I create a QPainter, use it and then use some GDI calls to paint a bitmap. The GDI calls work fine but the QPainter does nothing. I get the following error on the console: QPainter::begin: Paint device returned engine == 0, type: 1 Is this simply not supported anymore? how can I do it? I've also tried creating an additional widget on top of the GDI-painting widget but that didn't go well as well since the top widget appears black and blocks the GDI widget.

    Read the article

  • use qt and django to create desktop apps

    - by sandra
    Hi guys, I had this idea of creating desktop apps using django. The principe being: - Write the django app, and use something like cherrypy to serve it. - Write a Qt app in C++ to access it and this by using QtWebview (webkit) I'd like to "bundle" this in a single app. The lighter, the better :) So here are my questions and if you have better ideas and suggestions, please share them :) Is it possible to serve a django app with a c++ one? (a c++ server embedding python)? anyone did this before? Do you have some articles, blog posts? Thanks a lot!

    Read the article

  • Windows Power State change event notification in Qt

    - by Surjya Narayana Padhi
    Hi Geeks, I developing a GUI in QT where I have to show the battery status icon. To get the system power status, I am using the windows API. But to show status anytime , do i need to use a thread to continuously read and display the power status? I am thinking of using event handler. But not sure how to implement. I am thinking that for just one status icon I will run a thread. Anybody has any better suggestion, please share.

    Read the article

  • Implementing implicitly shared classes outside of Qt

    - by Timothy Baldridge
    I'm familiar with the way Qt uses D-pointers for managing data. How do I do this in my code? I tried this method: 1) move all data into a struct 2) add a QAtomicInt to the struct 3) implement a = operator and change my constructor/deconstructor to check-up on the reference count. The issue is, when I go to do a shallow copy of the object, I get an error about QObject declaring = as private. How then do I accomplish this? Here's an example of my copy operator: HttpRequest & HttpRequest::operator=(const HttpRequest &other) { other.d->ref.ref(); if (!d->ref.deref()) delete d; d = other.d; return *this; } Am I going about this the wrong way?

    Read the article

  • QT Modeless dialog window dos'nt response to the move command

    - by user63898
    Hello all im using Modeless dialog in my application , and when i try to use the Modeless dialog move command from the MainWindow the Modeless dialog didint even show up,why ? (by the way if i remove the move command every thing works and i can see the dialog when called, i try to move it to the systray era. here somecode: M odelessDialog* ModelessDialog= new ModelessDialog(this); ModelessDialog->setModal(false); ModelessDialog->setAttribute(Qt::WA_DeleteOnClose); int topLeft_x = m_SystrayReq.topLeft().x(); int topLeft_y = m_SystrayReq.topLeft().y(); // the valus of x & y are just fine . ModelessDialog->move(topLeft_x,topLeft_y); ModelessDialog->show();

    Read the article

  • Getting values from pro files in Qt

    - by user249490
    Hi, I am using Qt 4.5 in Windows XP. My pro file has the variable VERSION = 1.0. Now i need to read this variable and get its value (1.0) from the source code. So that I don't have to maintain another variable for version inside my source code. I just read from the pro file and update it. So that the value remains consistent all over my project. Is it possible? Any pointers regarding this are welcome..

    Read the article

  • Qt: default value of variable in class

    - by Martin
    When creating my own class in Qt I would like my variables in the class to have a standard/default value if I haven't set them to anything. It would be perfect if this was possible to set in the h-file so I don't have to do it in each instance method of my class. You can see what I want to do in the code below. In the example myBool would have the value of false and myInt the value of 0 when the object have been created. Is this possible at all? In myclass.h: class MyClass { Q_OBJECT public: MyClass(); ~MyClass(); bool myBool = false; //I want to set myBool and myInt to a default/standard value int myInt = 0; };

    Read the article

  • Qt and finding partial matches in a QList

    - by ExpatEgghead
    I have a struct viz: struct NameKey { std::string fullName; std::string probeName; std::string format; std::string source; } which are held in a QList: QList<NameKey> keyList; what I need to do is find an occurence in keyList of a partial match where the search is for a NameKey that only has two members filled. All the keyList entries are full NameKey's. My current implementation is , well, boring in the extreme with too many if's and conditions. So, If I have a DataKey with a fullName and a format I need to find all the occurences in keyList which match. Any useful Qt/boost things available?

    Read the article

  • Qt layout problem.

    - by Lukasz Lew
    I have a following Qt code: QVBoxLayout* box = new QVBoxLayout; label = new QLabel(); // will be set later dynamically box->addWidget (label); Text in label will be set later. The problem is that when label resizes, it resizes QVBoxLayout, and it resizes other neighboring widgets. I don't want to make a label or layout fixed width. Because I want them to resize with a whole window. Is it possible to tell a widget to take all the place that it has in a layout, but not more?

    Read the article

  • Qt Creator Debugging

    - by CJ
    I'm using QT Creator on 3 platforms to create platform independent software. However, I'm getting a segmentation fault with the exact same code in Windows only. That doesn't sound so bad because I can use the debugger. Except, no matter how many breakpoints I set or where I set them, they are ignored by the debugger. I am 100% sure that my control flow is going through the breakpoint but not breaking the flow. Any thoughts? How can that happen?

    Read the article

  • Qt/C++ regular expression library with unicode property support

    - by Dave
    I'm converting an application from the .Net framework to Qt using C++. The application makes extensive use of regular expression unicode properties, i.e. \p{L}, \p{M}, etc. I've just discovered that the QRegExp class lacks support for this among other things (lookbehinds, etc.) Can anyone recommend a C++ regular expression library that: Supports unicode properties Is unicode-aware in other respects (i.e. \w matches more than ASCII word characters) As a bonus, supports lookbehinds. Please don't point me to the wikipedia article; I don't trust it. That article says that QRegExp supports unicode properties. Unless I'm really doing something wrong, it doesn't. I'm looking for someone actually using unicode properties with a regex library in a project.

    Read the article

  • Analog of Java Form Layout in Qt

    - by Narek
    Once I have programmed GUI with Java and have used Form Layouts. Form layout (if I am not mistaken that is from SWT library) made possible to give right, left, top and bottom adges of any GUI element (widget) with respect to other widgets in the same widget (parent widget) or with respect to the adges of parent widget. So it was possible to control the future of widgets that are inside of another one, when that "another widget" is being resized. In Qt I have find the QFormLayout which is similar to Java one, but seems I can't handle with widgets as flexible in terms of relative positioning, as it was with Java's Form Layout. So are there any other means to give a widget position with respect to the others (without overloading resizeEvent function) as that was in Java? Thanks.

    Read the article

  • Qt almost same main menu entries

    - by user1671710
    I'm using c++ Qt library and I want to do something which would do : connect(actionB11, SIGNAL(triggered()), this, SLOT(SetSomething(1, 1))); connect(actionB12, SIGNAL(triggered()), this, SLOT(SetSomething(1, 2))); connect(actionB21, SIGNAL(triggered()), this, SLOT(SetSomething(2, 1))); connect(actionB22, SIGNAL(triggered()), this, SLOT(SetSomething(2, 2))); The code above doesnt work because SIGNAL function has to have same number and argument types as SLOT function. Does exist a way how to do it? I dont want to have about 20 function as SetSomething11, SetSomething12 calling SetSomething(1, 1) etc.

    Read the article

  • DynamicResource and Dynamic Items in ContextMenu on XamDataGrid

    - by miguel
    I would like to dynamically create a set of context menu options based upon some properties. Currently, I am creating a context menu as a DynamicResource with the visibility of the menu options bound to the properties, however, it seems that the DynamicResource is created only once, at runtime. Is this true? What I would like to do is have the menu generated each time, which will take into account the property changes on the data object. Please see the following XAML snippet: <Border DockPanel.Dock="Right" Margin="4,4,4,4" BorderBrush="Gray" BorderThickness="1" CornerRadius="3" > <igDP:XamDataGrid Height="Auto" Width="Auto" Style="{DynamicResource DefaultInfragisticsGridStyle}" Name="axeDataGrid" ActiveRecord="{Binding Path=SelectedItem, Mode=TwoWay}" DataSource="{Binding Path=Axes}" ContextMenuOpening="ContextMenuOpeningHandler"> <igDP:XamDataGrid.Resources> <Style TargetType="{x:Type igDP:DataRecordPresenter}" BasedOn="{x:Static Themes:DataPresenterAero.DataRecordPresenter}"/> <ContextMenu x:Key="RecordContextMenu"> <ContextMenu.Resources> <BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter"/> </ContextMenu.Resources> <MenuItem Header="Cancel Axe" Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igDP:XamDataGrid}}, Path=DataContext.CancelAxe}" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igDP:XamDataGrid}}, Path=DataContext.IsCancelAxeAllowed, Converter={StaticResource booleanToVisibilityConverter}, Mode=OneWay}"/> <MenuItem Header="Create RFQ" Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igDP:XamDataGrid}}, Path=DataContext.CreateRFQ}" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igDP:XamDataGrid}}, Path=DataContext.IsCreateRfqAllowed, Converter={StaticResource booleanToVisibilityConverter}, Mode=OneWay}"/> </ContextMenu> <Style TargetType="{x:Type igDP:DataRecordCellArea}"> <Setter Property="ContextMenu" Value="{DynamicResource RecordContextMenu}" /> </Style>

    Read the article

  • QT: trouble with qobject_cast

    - by weevilo
    I have derived QGraphicsItem and QGraphicsScene classes. I want the items to be able to call scene() and get a derviedGraphicsItem * instead of a QGraphicsItem *, so I reimplemented QGraphicsScene::itemAt to return a derived pointer. DerivedItem* DerivedScene::itemAt( const QPointF &position, const QTransform &dt ) const { return qobject_cast< DerivedItem * >( QGraphicsScene::itemAt(position, dt) ); } I get the following error (Qt 4.6, GCC 4.4.3 on Ubuntut 10.4) scene.cpp: In member function ‘DerivedItem* DerivedScene::itemAt(qreal, qreal, const QTransform&) const’: scene.cpp:28: error: no matching function for call to ‘qobject_cast(QGraphicsItem*)’ I then noticed QGraphicsItem doesn't inherit QObject, so I made my derived QGraphicsItem class have multiple inheritance from QObject and QGraphicsItem, and after adding the Q_OBJECT macro and rebuilding the project I get the same error. Am I going about this the wrong way? I know it's supposed to be bad design to try to cast a parent class as a child, but in this case it seems like what I want, since my derived item class has new functionality and its objects need a way to call that new functionality on items around themselves, and asking the items scene object with itemAt() seems like the best way - but I need itemAt() to return a pointer of the right type. I can get around this by having the derived items cast the QGraphicsItem * returned by QGraphicsScene::itemAt() using dynamic_cast, but I don't really understand why that works and not qobject_cast, or the benefits or disadvantages to using dynamic_cast vs. qobject_cast.

    Read the article

  • Static linking in Qt --> link errors in VS 2008

    - by ChruS
    Today I dediced to make static linking in Qt. I used Qt4 with Visual Studio and static C runtime article. The 3rd step took quite a long time. When it was finished I opened my project in VS 2008, made Build->Clean Solution and try to Release. Unfortunately I got link errors: warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library error LNK2019: unresolved external symbol "private: static struct QString::Data QString::shared_null" (?shared_null@QString@@0UData@1@A) referenced in function "public: __thiscall QString::QString(void)" (??0QString@@QAE@XZ) error LNK2019: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A) referenced in function "public: __thiscall QByteArray::QByteArray(void)" (??0QByteArray@@QAE@XZ) error LNK2001: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A) error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDialog::staticMetaObject" (?staticMetaObject@QDialog@@2UQMetaObject@@B) error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDialog::staticMetaObject" (?staticMetaObject@QDialog@@2UQMetaObject@@B) error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDialog::staticMetaObject" (?staticMetaObject@QDialog@@2UQMetaObject@@B) error LNK2019: unresolved external symbol "public: static enum QSysInfo::WinVersion const QSysInfo::WindowsVersion" (?WindowsVersion@QSysInfo@@2W4WinVersion@1@B) referenced in function _WinMain@16 What i did wrong? Help to fix this pls.

    Read the article

  • Static linking in Qt --> link errors in VS 2008

    - by ChruS
    Today I dediced to make static linking in Qt. I used Qt4 with Visual Studio and static C runtime article. The 3rd step took quite a long time. When it was finished I opened my project in VS 2008, made Build->Clean Solution and try to Release. Unfortunately I got link errors: warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library error LNK2019: unresolved external symbol "private: static struct QString::Data QString::shared_null" (?shared_null@QString@@0UData@1@A) referenced in function "public: __thiscall QString::QString(void)" (??0QString@@QAE@XZ) error LNK2019: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A) referenced in function "public: __thiscall QByteArray::QByteArray(void)" (??0QByteArray@@QAE@XZ) error LNK2001: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A) error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDialog::staticMetaObject" (?staticMetaObject@QDialog@@2UQMetaObject@@B) error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDialog::staticMetaObject" (?staticMetaObject@QDialog@@2UQMetaObject@@B) error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDialog::staticMetaObject" (?staticMetaObject@QDialog@@2UQMetaObject@@B) error LNK2019: unresolved external symbol "public: static enum QSysInfo::WinVersion const QSysInfo::WindowsVersion" (?WindowsVersion@QSysInfo@@2W4WinVersion@1@B) referenced in function _WinMain@16 What i did wrong? Help to fix this pls.

    Read the article

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