Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.5k Posts
  • How to read the .gz files

    10
    0 Votes
    10 Posts
    8k Views
    A
    This is a FAQ. There is an entry on it "here":http://developer.qt.nokia.com/faq/answer/how_to_compress_data_with_qt .
  • [SOLVED] how to get tab index when only text is known?

    4
    0 Votes
    4 Posts
    6k Views
    A
    Or just keep track of it yourself, by using a hash like this: @ QHash<QString, int> m_tabIndices; @ However, because it is unlikely you will have many tabs, I guess a linear search works just as well if not better. Still, in general, you should remember it does not scale very well.
  • [Closed] Problem with paint event in mac?

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    A
    You are discussing the same issue already in another "topic":http://developer.qt.nokia.com/forums/viewthread/12896/. I think you have been warned before not to open duplicate topics. I am closing this topic.
  • [Solved] QNetworkAccessManager/QThread/Signals & Slots

    2
    0 Votes
    2 Posts
    2k Views
    S
    I figured it out! Mia Culpa!!! I forgot to "moveToThread" dataGen before line 12 in the code above.
  • Selection of row in QItemDelegate, widget not displayed

    5
    0 Votes
    5 Posts
    3k Views
    N
    Below is my delegate implemenation. @class CountryDelegate :public QItemDelegate { Q_OBJECT public: virtual QWidget* createEditor ( QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index ) const { QComboBox* editor = new QComboBox( parent ); editor->installEventFilter( const_cast<CountryDelegate*>(this) ); return editor; } virtual void setEditorData( QWidget* editor, const QModelIndex& index ) const { QComboBox* combo = static_cast<QComboBox*>( editor ); combo->addItems( countries() ); int idx = CountryDelegate::countries().indexOf( index.data( Qt::DisplayRole ).toString() ); combo->setCurrentIndex( idx ); } virtual void setModelData( QWidget * editor, QAbstractItemModel* model, const QModelIndex& index ) const { QComboBox* combo = static_cast<QComboBox*>( editor ); model->setData( index, combo->currentText() ); } virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem& option, const QModelIndex& index ) const { // Just a silly example, don't allow the editor to get a smaller height than its sizehint. int hCell = option.rect.height(); int hEditor = editor->sizeHint().height(); int h = qMax( hCell, hEditor ); QSize size = option.rect.size(); size.setHeight( h ); editor->setGeometry( QRect( option.rect.topLeft() - QPoint(0,(h-hCell)/2), size ) ); } virtual bool eventFilter( QObject* obj, QEvent* event ) { if ( event->type() == QEvent::KeyRelease && static_cast<QKeyEvent*>(event)->key() == Qt::Key_Return ) { emit commitData( static_cast<QWidget*>(obj) ); emit closeEditor( static_cast<QWidget*>(obj), EditNextItem ); } return false; } static QStringList countries() { QStringList countries; countries << "Denmark" << "Sweeden" << "Norway" << "USA" << "Germany" << "Poland" << "Iceland" << "Holland" << "Great Britain" << "Ireland" << "Scotland"; return countries; } };@
  • Problem in setting tab focus with hyperlink?

    13
    0 Votes
    13 Posts
    5k Views
    P
    [quote author="Eddy" date="1324985364"]What style are you using? What OS are you on?[/quote] Did you tested that hyperlink?
  • Scroll bars in scroll area not coming

    9
    0 Votes
    9 Posts
    6k Views
    A
    Ya sure Eddy.....below is my ui file code.. @ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>734</width> <height>708</height> </rect> </property> <property name="windowTitle"> <string>MainWindow</string> </property> <widget class="QWidget" name="centralWidget"> <widget class="QPushButton" name="pushButton"> <property name="geometry"> <rect> <x>30</x> <y>150</y> <width>75</width> <height>23</height> </rect> </property> <property name="text"> <string>PushButton</string> </property> </widget> <widget class="QScrollArea" name="scrollArea"> <property name="geometry"> <rect> <x>50</x> <y>220</y> <width>291</width> <height>141</height> </rect> </property> <property name="verticalScrollBarPolicy"> <enum>Qt::ScrollBarAlwaysOn</enum> </property> <property name="horizontalScrollBarPolicy"> <enum>Qt::ScrollBarAlwaysOn</enum> </property> <property name="widgetResizable"> <bool>true</bool> </property> <widget class="QWidget" name="scrollAreaWidgetContents"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>272</width> <height>122</height> </rect> </property> <widget class="QWidget" name="layoutWidget"> <property name="geometry"> <rect> <x>30</x> <y>30</y> <width>24</width> <height>34</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> <property name="sizeConstraint"> <enum>QLayout::SetMinAndMaxSize</enum> </property> <item> <widget class="QLabel" name="label"> <property name="text"> <string>label</string> </property> </widget> </item> <item> <widget class="QLabel" name="label_2"> <property name="text"> <string>label</string> </property> </widget> </item> </layout> </widget> </widget> </widget> <widget class="QWidget" name="verticalLayoutWidget_2"> <property name="geometry"> <rect> <x>510</x> <y>250</y> <width>61</width> <height>41</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout_2"> <property name="sizeConstraint"> <enum>QLayout::SetFixedSize</enum> </property> </layout> </widget> </widget> <widget class="QMenuBar" name="menuBar"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>734</width> <height>21</height> </rect> </property> </widget> <widget class="QToolBar" name="mainToolBar"> <attribute name="toolBarArea"> <enum>TopToolBarArea</enum> </attribute> <attribute name="toolBarBreak"> <bool>false</bool> </attribute> </widget> <widget class="QStatusBar" name="statusBar"/> </widget> <layoutdefault spacing="6" margin="11"/> <resources/> <connections/> </ui> @
  • [SOLVED] how to get the QmodelIndex to a QString?

    8
    0 Votes
    8 Posts
    8k Views
    K
    lets say there are three items in the listwidget. when a user clicks the second item, i want to get the index from it. so the code would return number 2. the listwidget.currentindex does return it but in a modelindex. i need the number to be in a string so that i can work with it. after reading Eddy's last post, i tested the currentRow and it is just what i was looking for. i marked this topic as solved.
  • 0 Votes
    10 Posts
    17k Views
    G
    Using pure C functions, this should work. I would recommend to test it with a simple, minimal test project, just to be 100% sure.
  • QSqlModel* - get a domain or type of field

    3
    0 Votes
    3 Posts
    2k Views
    H
    I knew about QSqlRecord::field() and method type(), but information of basic type is too basic ;) I will make query to get a domain names. Thanks for reply.
  • Monitoring bandwidth usage app

    2
    0 Votes
    2 Posts
    2k Views
    G
    Qt will help you to visualize the data, probably using some additional graphing/charting library. Gathering the actual data is platform dependent and not part of the standard Qt libs. Maybe Qt Mobility has some means for that.
  • QNetworkManager and post requests

    6
    0 Votes
    6 Posts
    6k Views
    G
    You should ask google why they are sending this redirect. If you are able to use Qt 4.8, I would recommend looking into [[Doc:QHttpMultiPart]] which eases posting HTML/HTTP forms significantly.
  • 0 Votes
    4 Posts
    3k Views
    G
    Basic C++ error. toStdString is not a static method. @ myabc.name = tempstr.toStdStr(); @
  • Fit QTableWidget headers

    3
    0 Votes
    3 Posts
    2k Views
    G
    There is no simple Qt method to share the space niceley between columns. You might want to consider setting stretchLastSection of the [[Doc:QHeaderView]] to true. This will allocate the remaining space to the last column.
  • [Solved] Problems building Oracle Call Interface (OCI) Plugin on Windows

    20
    0 Votes
    20 Posts
    20k Views
    I
    To those who might have problems with -loci, try replacing -loci with the path to oci.dll (like C:\XEClient\bin\oci.dll) in the both Makefile.Release and Makefile.Debug files on LIBS section.
  • [solved]UI Set

    7
    0 Votes
    7 Posts
    3k Views
    EddyE
    Great! Well done. If you consider this post as solved, please edit your first post and add [solved] in front of it.
  • QTCPServer & QThread

    3
    0 Votes
    3 Posts
    2k Views
    D
    That does not even compile http://developer.qt.nokia.com/wiki/Threads_Events_QObjects
  • How to set QDialog not visible on exec&#40;&#41; method?

    2
    0 Votes
    2 Posts
    2k Views
    P
    Maybe you can call hide() inside showEvent()?
  • How can i use microsoft access database in Qt?

    8
    0 Votes
    8 Posts
    9k Views
    R
    startmenu -> All Programs -> Qt SDK -> Desktop -> cmd
  • Perform an automatic click on a webpage

    3
    0 Votes
    3 Posts
    3k Views
    0
    Well if you require not a very high speed... you could look into "IMacros" for firefox e.g. No programming needed, it does what you tell him to do ;) If you want to do it more seriously, well you should look into Script languages, like Volker pointed out. Qt and C++ are not really helping in that matter ;)